Commit 248c427c authored by shida.liu's avatar shida.liu

feat: 为 POP 商品管理添加新增商品权限并更新相关页面

parent 52a39979
......@@ -55,6 +55,9 @@ export const POP_BATCH_DELIVERY = {
// POP商品管理-(应付审计的,没有实际用处)
export const POP_GOOD_MANAGE = {
EDITABLE: '0201021', // 新增/修改
ADD_SERVICE_GOODS: '0201031', // 新增服务商品
ADD_NORMAL_GOODS: '0201041', // 新增实物商品
ADD_TAKEAWAY_GOODS: '0201051', // 新增外卖商品
};
// 订单查询
......
......@@ -27,7 +27,7 @@ import InfoAudit from './infoAudit';
import DraftModal from './DraftModal';
import Takeaway from './Takeaway';
import { GOOD_MANAGE, POP_GOOD_MANAGE } from '@/../config/permission.config';
import { POP_GOOD_MANAGE } from '@/../config/permission.config';
import LocalStroage from '@/utils/localStorage';
import configApi from '@/../config/env.config';
import { GoldCategory } from '@/config/app.config';
......@@ -422,9 +422,9 @@ class popGoodsManage extends Component {
};
const { pageNo, pageSize, selectedRowKeys } = this.state;
const canAddService = permissions[GOOD_MANAGE.ADD_SERVICE_GOODS];
const canAddNormal = permissions[GOOD_MANAGE.ADD_NORMAL_GOODS];
const canAddTakeaway = permissions[GOOD_MANAGE.ADD_TAKEAWAY_GOODS];
const canAddService = permissions[POP_GOOD_MANAGE.ADD_SERVICE_GOODS];
const canAddNormal = permissions[POP_GOOD_MANAGE.ADD_NORMAL_GOODS];
const canAddTakeaway = permissions[POP_GOOD_MANAGE.ADD_TAKEAWAY_GOODS];
this.canEditable = permissions[POP_GOOD_MANAGE.EDITABLE];
// console.log('serviceData', this.state.serviceData);
// console.log('shopList', this.shopList);
......
......@@ -2,13 +2,19 @@ import React, { useContext } from 'react';
import { TaskList } from '../config';
import { ServiceContext } from '../context';
import commonStyle from '../common.less';
import { useLocation } from 'react-router-dom';
import { POP_GOOD_MANAGE } from '@/../config/permission.config';
export const TaskTypeSelect = props => {
const location = useLocation();
const customer = useContext(ServiceContext);
const typeConfig = TaskList(
customer.canAddService,
customer.canAddNormal,
customer.canTakeawayService,
const isPopGoods = location.pathname.indexOf('popGoodsManage') > 0; // pop商品管理-商品库(应付审计用的, 驳回和修改状态下不能编辑)
const typeConfig = !isPopGoods
? TaskList(customer.canAddService, customer.canAddNormal, customer.canTakeawayService)
: TaskList(
POP_GOOD_MANAGE.ADD_SERVICE_GOODS === '0201031',
POP_GOOD_MANAGE.ADD_NORMAL_GOODS === '0201041',
POP_GOOD_MANAGE.ADD_TAKEAWAY_GOODS === '0201051',
);
const selectTabs = task => {
if (!customer.isEdit && Object.keys(props.takeAway).length === 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment