优化种类生成逻辑
This commit is contained in:
@@ -306,3 +306,12 @@ jeecgboot-vue3/src/views/xslmes/mesXslMixingSpec/components/MesXslMixingMaterial
|
|||||||
|
|
||||||
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A52】高层级弹窗内 Message 提示层级修复 -----------
|
-- author:cursor---date:20260525--for: 【XSLMES-20260525-A52】高层级弹窗内 Message 提示层级修复 -----------
|
||||||
jeecgboot-vue3/src/design/public.less
|
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
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public interface IMesXslMixerMaterialKindCfgService extends IService<MesXslMixer
|
|||||||
MesXslMixerMaterialKindLookupVO loadKindLookup(Integer tenantId);
|
MesXslMixerMaterialKindLookupVO loadKindLookup(Integer tenantId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解析混炼示方明细种类:称量方式优先,其次物料小类,最后小类名称兜底
|
* 解析混炼示方明细种类:称量方式优先,其次物料小类 ID;未命中配置返回 null
|
||||||
*/
|
*/
|
||||||
String resolveMixingMaterialKind(
|
String resolveMixingMaterialKind(
|
||||||
MesXslMixerMaterialKindLookupVO lookup,
|
MesXslMixerMaterialKindLookupVO lookup,
|
||||||
|
|||||||
@@ -369,10 +369,9 @@ public class MesXslMixerMaterialKindCfgServiceImpl
|
|||||||
return fromMinor;
|
return fromMinor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (oConvertUtils.isNotEmpty(minorCategoryName)) {
|
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】种类未命中配置时不回退小类名-----------
|
||||||
return minorCategoryName.trim();
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
|
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】种类未命中配置时不回退小类名-----------
|
||||||
}
|
}
|
||||||
|
|
||||||
private String matchKindFromLookup(MesXslMixerMaterialKindLookupVO lookup, String key) {
|
private String matchKindFromLookup(MesXslMixerMaterialKindLookupVO lookup, String key) {
|
||||||
|
|||||||
@@ -11,11 +11,21 @@
|
|||||||
import { list as mixerList, queryById as queryMixerById } from '../MesMixerMaterial.api';
|
import { list as mixerList, queryById as queryMixerById } from '../MesMixerMaterial.api';
|
||||||
import { columns as mixerColumns, searchFormSchema as mixerSearch } from '../MesMixerMaterial.data';
|
import { columns as mixerColumns, searchFormSchema as mixerSearch } from '../MesMixerMaterial.data';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】通用密炼物料选料弹窗种类改读配置表-----------
|
||||||
|
import {
|
||||||
|
loadMixingMaterialKindLookup,
|
||||||
|
resolveMixingMaterialKindFromLookup,
|
||||||
|
type MixerMaterialKindLookup,
|
||||||
|
} from '/@/views/xslmes/mesXslMixingSpec/MesXslMixingSpec.data';
|
||||||
|
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】通用密炼物料选料弹窗种类改读配置表-----------
|
||||||
|
|
||||||
const emit = defineEmits(['register', 'select']);
|
const emit = defineEmits(['register', 'select']);
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
|
|
||||||
const selectedRow = ref<Recordable | null>(null);
|
const selectedRow = ref<Recordable | null>(null);
|
||||||
|
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】通用密炼物料选料弹窗种类改读配置表-----------
|
||||||
|
const kindLookup = ref<MixerMaterialKindLookup | null>(null);
|
||||||
|
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】通用密炼物料选料弹窗种类改读配置表-----------
|
||||||
|
|
||||||
const [registerTable, { reload, getSelectRowKeys, getSelectRows, setSelectedRowKeys, clearSelectedRowKeys }] = useTable({
|
const [registerTable, { reload, getSelectRowKeys, getSelectRows, setSelectedRowKeys, clearSelectedRowKeys }] = useTable({
|
||||||
api: mixerList,
|
api: mixerList,
|
||||||
@@ -44,6 +54,9 @@
|
|||||||
selectedRow.value = null;
|
selectedRow.value = null;
|
||||||
clearSelectedRowKeys?.();
|
clearSelectedRowKeys?.();
|
||||||
setModalProps({ confirmLoading: false });
|
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;
|
const mid = data?.mixerMaterialId as string | undefined;
|
||||||
if (mid) {
|
if (mid) {
|
||||||
setSelectedRowKeys?.([mid]);
|
setSelectedRowKeys?.([mid]);
|
||||||
@@ -60,12 +73,13 @@
|
|||||||
reload();
|
reload();
|
||||||
});
|
});
|
||||||
|
|
||||||
function buildKind(row: Recordable) {
|
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】通用密炼物料选料弹窗种类改读配置表-----------
|
||||||
const a = row.majorCategoryId_dictText || '';
|
function resolveMaterialKind(row: Recordable) {
|
||||||
const b = row.minorCategoryId_dictText || '';
|
const minorId = row?.minorCategoryId ? String(row.minorCategoryId) : '';
|
||||||
if (a && b) return `${a} / ${b}`;
|
const minorName = row?.minorCategoryId_dictText || '';
|
||||||
return a || b || '';
|
return resolveMixingMaterialKindFromLookup(kindLookup.value, undefined, minorId, minorName);
|
||||||
}
|
}
|
||||||
|
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】通用密炼物料选料弹窗种类改读配置表-----------
|
||||||
|
|
||||||
async function handleOk() {
|
async function handleOk() {
|
||||||
const keys = (getSelectRowKeys?.() || []) as string[];
|
const keys = (getSelectRowKeys?.() || []) as string[];
|
||||||
@@ -82,12 +96,19 @@
|
|||||||
createMessage.warning('请选择一条密炼物料');
|
createMessage.warning('请选择一条密炼物料');
|
||||||
return;
|
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', {
|
emit('select', {
|
||||||
mixerMaterialId: row.id,
|
mixerMaterialId: row.id,
|
||||||
materialName: row.materialName || '',
|
materialName: row.materialName || '',
|
||||||
materialCode: row.materialCode || '',
|
materialCode: row.materialCode || '',
|
||||||
materialDesc: row.materialDesc || '',
|
materialDesc: row.materialDesc || '',
|
||||||
materialKind: buildKind(row),
|
materialKind,
|
||||||
minorCategoryId: row.minorCategoryId || '',
|
minorCategoryId: row.minorCategoryId || '',
|
||||||
majorCategoryText: row.majorCategoryId_dictText || '',
|
majorCategoryText: row.majorCategoryId_dictText || '',
|
||||||
minorCategoryText: row.minorCategoryId_dictText || '',
|
minorCategoryText: row.minorCategoryId_dictText || '',
|
||||||
|
|||||||
@@ -70,6 +70,9 @@
|
|||||||
import MesXslMixerMaterialKindCfgEditModal from './components/MesXslMixerMaterialKindCfgEditModal.vue';
|
import MesXslMixerMaterialKindCfgEditModal from './components/MesXslMixerMaterialKindCfgEditModal.vue';
|
||||||
import { columns, searchFormSchema, superQuerySchema } from './MesXslMixerMaterialKindCfg.data';
|
import { columns, searchFormSchema, superQuerySchema } from './MesXslMixerMaterialKindCfg.data';
|
||||||
import { batchDelete, deleteOne, getExportUrl, getImportUrl, list } from './MesXslMixerMaterialKindCfg.api';
|
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<any>({});
|
const queryParam = reactive<any>({});
|
||||||
const [registerBatchModal, { openModal: openBatchModal }] = useModal();
|
const [registerBatchModal, { openModal: openBatchModal }] = useModal();
|
||||||
@@ -138,6 +141,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleSuccess() {
|
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 = [];
|
selectedRowKeys.value = [];
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1040,12 +1040,12 @@ function matchKindFromLookup(lookup: MixerMaterialKindLookup | null | undefined,
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 解析混炼示方明细种类:称量方式优先,其次物料小类 ID,最后小类名称兜底 */
|
/** 解析混炼示方明细种类:称量方式优先,其次物料小类 ID(未命中返回空,由配置表维护) */
|
||||||
export function resolveMixingMaterialKindFromLookup(
|
export function resolveMixingMaterialKindFromLookup(
|
||||||
lookup: MixerMaterialKindLookup | null | undefined,
|
lookup: MixerMaterialKindLookup | null | undefined,
|
||||||
weighMode?: string,
|
weighMode?: string,
|
||||||
minorCategoryId?: string,
|
minorCategoryId?: string,
|
||||||
minorCategoryName?: string,
|
_minorCategoryName?: string,
|
||||||
) {
|
) {
|
||||||
const fromWeighMode = matchKindFromLookup(lookup, weighMode);
|
const fromWeighMode = matchKindFromLookup(lookup, weighMode);
|
||||||
if (fromWeighMode) {
|
if (fromWeighMode) {
|
||||||
@@ -1055,9 +1055,6 @@ export function resolveMixingMaterialKindFromLookup(
|
|||||||
if (fromMinorId) {
|
if (fromMinorId) {
|
||||||
return fromMinorId;
|
return fromMinorId;
|
||||||
}
|
}
|
||||||
if (minorCategoryName != null && String(minorCategoryName).trim() !== '') {
|
|
||||||
return String(minorCategoryName).trim();
|
|
||||||
}
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1107,6 +1104,8 @@ export function applyMixingMaterialFromSelection(row: Recordable, material: Reco
|
|||||||
row.mixerMaterialDesc = material.materialDesc || material.materialName || material.materialCode || '';
|
row.mixerMaterialDesc = material.materialDesc || material.materialName || material.materialCode || '';
|
||||||
row.materialMajor = material.majorCategoryId_dictText || '';
|
row.materialMajor = material.majorCategoryId_dictText || '';
|
||||||
row.materialMinor = material.minorCategoryId_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】混炼示方密炼物料选料弹窗与种类解析-----------
|
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A50】混炼示方密炼物料选料弹窗与种类解析-----------
|
||||||
|
|||||||
@@ -393,6 +393,12 @@
|
|||||||
const weighMode = getPickerWeighMode(row.id);
|
const weighMode = getPickerWeighMode(row.id);
|
||||||
const payload: Recordable = { ...row, pickerWeighMode: weighMode };
|
const payload: Recordable = { ...row, pickerWeighMode: weighMode };
|
||||||
const materialKind = resolveKindForMaterial(row, 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);
|
applyMixingMaterialFromSelection(payload, row, materialKind);
|
||||||
emit('select', payload);
|
emit('select', payload);
|
||||||
closeModal();
|
closeModal();
|
||||||
|
|||||||
@@ -944,11 +944,9 @@ function onMixingMaterialSelect(payload: Recordable | null) {
|
|||||||
if (!payload || !materialPickerRow.value) {
|
if (!payload || !materialPickerRow.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
applyMixingMaterialFromSelection(
|
//update-begin---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】选料回填种类仅使用配置解析结果-----------
|
||||||
materialPickerRow.value,
|
applyMixingMaterialFromSelection(materialPickerRow.value, payload, payload.materialKind || '');
|
||||||
payload,
|
//update-end---author:cursor ---date:20260525 for:【XSLMES-20260525-A53】选料回填种类仅使用配置解析结果-----------
|
||||||
payload.materialKind || payload.materialMinor || '',
|
|
||||||
);
|
|
||||||
recalcMaterialAccumWeight();
|
recalcMaterialAccumWeight();
|
||||||
materialPickerRow.value = null;
|
materialPickerRow.value = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user