优化混炼示方,新增种类配置

This commit is contained in:
geht
2026-05-25 19:44:14 +08:00
parent c85657d199
commit dc3f305303
34 changed files with 3892 additions and 104 deletions

View File

@@ -13,7 +13,8 @@ import { loadTreeData } from '/@/views/system/category/category.api';
import {
MATERIAL_RAW_AUX_CODE,
materialRawAuxCategoryId,
isMaterialRawAuxSubCategory,
ensureMaterialCategoryContext,
isMaterialMinorCategory,
toIsRubberFlag,
fromIsRubberFlag,
} from '/@/views/system/category/category.constants';
@@ -48,7 +49,7 @@ const schemas: FormSchema[] = [
defaultValue: false,
renderComponentContent: '胶料',
colProps: { span: 24 },
ifShow: ({ values }) => isMaterialRawAuxSubCategory(values.pid),
ifShow: ({ values }) => isMaterialMinorCategory(values.pid),
},
];
@@ -95,7 +96,7 @@ async function ensureMaterialRawAuxCategoryId() {
function normalizeSubmitValues(values: Recordable) {
const payload = { ...values };
payload.isRubber = isMaterialRawAuxSubCategory(payload.pid) ? toIsRubberFlag(payload.isRubber) : '0';
payload.isRubber = isMaterialMinorCategory(payload.pid) ? toIsRubberFlag(payload.isRubber) : '0';
return payload;
}
@@ -104,6 +105,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
await ensureMaterialRawAuxCategoryId();
await ensureMaterialCategoryContext();
const tree = await buildPidTree();
if (!tree.length) {
createMessage.warning('未加载到物料分类树,请确认分类字典根编码 XSLMES_MATERIAL 已存在');