project.ts
865 Bytes
export const getDisable = (code, id, value) => {
return code === 'LOCKED' && !!id && (value || value === 0);
};
// 利润分析的权限校验
export const getProfitDisable = (field, code, id, value) => {
// 包装费用,汇率不允许修改
if (['packetPrice', 'exchangeRate', 'profitRate'].includes(field)) {
return true;
}
// code是lock,编辑并且value存在,才需要审核
return code === 'LOCKED' && !!id && (value || value === 0);
};
// 基本信息的权限校验 客户编码、项目号、生产科、内部编号、业务员 才需要审核
export const getBaseDisable = (field, code, id) => {
if (
[
'customerCode',
'projectNo',
'productionDepartment',
'innerNo',
'orderCount',
'businessPerson',
].includes(field)
) {
return code === 'LOCKED' && !!id;
}
return false;
};