Commit 87caf0b5 authored by shida.liu's avatar shida.liu

feat: 权限

parent 248c427c
......@@ -6,15 +6,16 @@ import { useLocation } from 'react-router-dom';
import { POP_GOOD_MANAGE } from '@/../config/permission.config';
export const TaskTypeSelect = props => {
const { permissions } = props;
const location = useLocation();
const customer = useContext(ServiceContext);
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',
permissions[POP_GOOD_MANAGE.ADD_SERVICE_GOODS],
permissions[POP_GOOD_MANAGE.ADD_NORMAL_GOODS],
permissions[POP_GOOD_MANAGE.ADD_TAKEAWAY_GOODS],
);
const selectTabs = task => {
if (!customer.isEdit && Object.keys(props.takeAway).length === 0) {
......
......@@ -564,6 +564,7 @@ const ServiceGoods = options => {
<ServiceContext.Provider value={providerValue}>
<Title title="商品类型" />
<TaskTypeSelect
permissions={permissions}
productType={productType}
takeAway={takeAway}
onChange={productChange}
......
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