diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/doc/代码修改日志 b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/doc/代码修改日志 index a8d4ad7..dbdbf90 100644 --- a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/doc/代码修改日志 +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/doc/代码修改日志 @@ -306,3 +306,12 @@ jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterial -- author:cursor---date:20260525--for: 【XSLMES-20260525-A52】高层级弹窗内 Message 提示层级修复 ----------- jeecgboot-vue3/src/design/public.less + +-- author:cursor---date:20260525--for: 【XSLMES-20260525-A53】种类解析移除小类名兜底/通用选料弹窗接配置/配置变更清缓存 ----------- +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixerMaterialKindCfgService.java +jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/impl/MesXslMixerMaterialKindCfgServiceImpl.java +jeecgboot-vue3/src/views/mes/material/modules/MesMixerMaterialSelectModal.vue +jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts +jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue +jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue +jeecgboot-vue3/src/views/xslmes/mesXslMixerMaterialKindCfg/MesXslMixerMaterialKindCfgList.vue diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixerMaterialKindCfgService.java b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixerMaterialKindCfgService.java index aa41b9c..f25cbb1 100644 --- a/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixerMaterialKindCfgService.java +++ b/jeecg-boot/jeecg-boot-module/jeecg-module-xslmes/src/main/java/org/jeecg/modules/xslmes/service/IMesXslMixerMaterialKindCfgService.java @@ -32,7 +32,7 @@ public interface IMesXslMixerMaterialKindCfgService extends IService(null); + //update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】通用密炼物料选料弹窗种类改读配置表----------- + const kindLookup = ref(null); + //update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】通用密炼物料选料弹窗种类改读配置表----------- const [registerTable, { reload, getSelectRowKeys, getSelectRows, setSelectedRowKeys, clearSelectedRowKeys }] = useTable({ api: mixerList, @@ -44,6 +54,9 @@ selectedRow.value = null; clearSelectedRowKeys?.(); setModalProps({ confirmLoading: false }); + //update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】通用密炼物料选料弹窗种类改读配置表----------- + kindLookup.value = await loadMixingMaterialKindLookup(); + //update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】通用密炼物料选料弹窗种类改读配置表----------- const mid = data?.mixerMaterialId as string | undefined; if (mid) { setSelectedRowKeys?.([mid]); @@ -60,12 +73,13 @@ reload(); }); - function buildKind(row: Recordable) { - const a = row.majorCategoryId_dictText || ''; - const b = row.minorCategoryId_dictText || ''; - if (a && b) return `${a} / ${b}`; - return a || b || ''; + //update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】通用密炼物料选料弹窗种类改读配置表----------- + function resolveMaterialKind(row: Recordable) { + const minorId = row?.minorCategoryId ? String(row.minorCategoryId) : ''; + const minorName = row?.minorCategoryId_dictText || ''; + return resolveMixingMaterialKindFromLookup(kindLookup.value, undefined, minorId, minorName); } + //update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】通用密炼物料选料弹窗种类改读配置表----------- async function handleOk() { const keys = (getSelectRowKeys?.() || []) as string[]; @@ -82,12 +96,19 @@ createMessage.warning('请选择一条密炼物料'); return; } + //update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】通用密炼物料选料弹窗种类改读配置表----------- + const materialKind = resolveMaterialKind(row); + if (!materialKind) { + createMessage.warning('未匹配到种类,请检查密炼物料种类配置'); + return; + } + //update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】通用密炼物料选料弹窗种类改读配置表----------- emit('select', { mixerMaterialId: row.id, materialName: row.materialName || '', materialCode: row.materialCode || '', materialDesc: row.materialDesc || '', - materialKind: buildKind(row), + materialKind, minorCategoryId: row.minorCategoryId || '', majorCategoryText: row.majorCategoryId_dictText || '', minorCategoryText: row.minorCategoryId_dictText || '', diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslMixerMaterialKindCfg/MesXslMixerMaterialKindCfgList.vue b/jeecgboot-vue3/src/views/xslmes/mesXslMixerMaterialKindCfg/MesXslMixerMaterialKindCfgList.vue index bad582c..cf7be91 100644 --- a/jeecgboot-vue3/src/views/xslmes/mesXslMixerMaterialKindCfg/MesXslMixerMaterialKindCfgList.vue +++ b/jeecgboot-vue3/src/views/xslmes/mesXslMixerMaterialKindCfg/MesXslMixerMaterialKindCfgList.vue @@ -70,6 +70,9 @@ import MesXslMixerMaterialKindCfgEditModal from './components/MesXslMixerMaterialKindCfgEditModal.vue'; import { columns, searchFormSchema, superQuerySchema } from './MesXslMixerMaterialKindCfg.data'; import { batchDelete, deleteOne, getExportUrl, getImportUrl, list } from './MesXslMixerMaterialKindCfg.api'; + //update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】种类配置变更后清除前端 lookup 缓存----------- + import { clearMixingMaterialKindLookupCache } from '../mesXslMixingSpec/MesXslMixingSpec.data'; + //update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】种类配置变更后清除前端 lookup 缓存----------- const queryParam = reactive({}); const [registerBatchModal, { openModal: openBatchModal }] = useModal(); @@ -138,6 +141,9 @@ } function handleSuccess() { + //update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】种类配置变更后清除前端 lookup 缓存----------- + clearMixingMaterialKindLookupCache(); + //update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】种类配置变更后清除前端 lookup 缓存----------- selectedRowKeys.value = []; reload(); } diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts b/jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts index 933a177..1fae248 100644 --- a/jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts +++ b/jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data.ts @@ -1040,12 +1040,12 @@ function matchKindFromLookup(lookup: MixerMaterialKindLookup | null | undefined, return ''; } -/** 解析混炼示方明细种类:称量方式优先,其次物料小类 ID,最后小类名称兜底 */ +/** 解析混炼示方明细种类:称量方式优先,其次物料小类 ID(未命中返回空,由配置表维护) */ export function resolveMixingMaterialKindFromLookup( lookup: MixerMaterialKindLookup | null | undefined, weighMode?: string, minorCategoryId?: string, - minorCategoryName?: string, + _minorCategoryName?: string, ) { const fromWeighMode = matchKindFromLookup(lookup, weighMode); if (fromWeighMode) { @@ -1055,9 +1055,6 @@ export function resolveMixingMaterialKindFromLookup( if (fromMinorId) { return fromMinorId; } - if (minorCategoryName != null && String(minorCategoryName).trim() !== '') { - return String(minorCategoryName).trim(); - } return ''; } @@ -1107,6 +1104,8 @@ export function applyMixingMaterialFromSelection(row: Recordable, material: Reco row.mixerMaterialDesc = material.materialDesc || material.materialName || material.materialCode || ''; row.materialMajor = material.majorCategoryId_dictText || ''; row.materialMinor = material.minorCategoryId_dictText || ''; - row.materialKind = materialKind || row.materialMinor || ''; + //update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】种类仅读配置表,移除小类名兜底----------- + row.materialKind = materialKind != null && String(materialKind).trim() !== '' ? String(materialKind).trim() : ''; + //update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】种类仅读配置表,移除小类名兜底----------- } //update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A50】混炼示方密炼物料选料弹窗与种类解析----------- diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue b/jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue index 01c7d20..707e42b 100644 --- a/jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue +++ b/jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterialSelectModal.vue @@ -393,6 +393,12 @@ const weighMode = getPickerWeighMode(row.id); const payload: Recordable = { ...row, pickerWeighMode: weighMode }; const materialKind = resolveKindForMaterial(row, weighMode); + //update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】选料未匹配种类时提示检查配置----------- + if (!materialKind) { + createMessage.warning('未匹配到种类,请检查密炼物料种类配置'); + return; + } + //update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】选料未匹配种类时提示检查配置----------- applyMixingMaterialFromSelection(payload, row, materialKind); emit('select', payload); closeModal(); diff --git a/jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue b/jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue index 19f82cf..9bec8b2 100644 --- a/jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue +++ b/jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingSpecModal.vue @@ -944,11 +944,9 @@ function onMixingMaterialSelect(payload: Recordable | null) { if (!payload || !materialPickerRow.value) { return; } - applyMixingMaterialFromSelection( - materialPickerRow.value, - payload, - payload.materialKind || payload.materialMinor || '', - ); + //update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】选料回填种类仅使用配置解析结果----------- + applyMixingMaterialFromSelection(materialPickerRow.value, payload, payload.materialKind || ''); + //update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】选料回填种类仅使用配置解析结果----------- recalcMaterialAccumWeight(); materialPickerRow.value = null; }