fix(machineparam): 修复机台参数页面数据展示和编辑功能

This commit is contained in:
zxy 2026-04-22 09:46:34 +08:00
parent a6bb78590c
commit 3e7a17ace0
3 changed files with 12 additions and 2 deletions

View File

@ -55,7 +55,7 @@ public class MachineParamServiceImpl extends ServiceImpl<MachineParamMapper, Mac
} }
wrapper.eq(MachineParamEntity::getDeleteMark, 0); wrapper.eq(MachineParamEntity::getDeleteMark, 0);
wrapper.orderByDesc(MachineParamEntity::getCreatorTime); wrapper.orderByDesc(MachineParamEntity::getId);
if ("0".equals(machineParamPagination.getDataType())) { if ("0".equals(machineParamPagination.getDataType())) {
Page<MachineParamEntity> page = new Page<>(machineParamPagination.getCurrentPage(), machineParamPagination.getPageSize()); Page<MachineParamEntity> page = new Page<>(machineParamPagination.getCurrentPage(), machineParamPagination.getPageSize());

View File

@ -177,6 +177,8 @@ export default {
this.materialOptions = res.data.map(item => ({ this.materialOptions = res.data.map(item => ({
label: item.matName, label: item.matName,
value: String(item.id), value: String(item.id),
matCode: item.matCode || '',
matName: item.matName || '',
})) }))
}) })
}, },
@ -214,7 +216,7 @@ export default {
}, },
getMaterialName(matCode) { getMaterialName(matCode) {
const item = this.materialOptions.find(opt => opt.value === matCode) const item = this.materialOptions.find(opt => opt.value === matCode)
return item ? item.label : '' return item ? `${item.matCode}-${item.matName}` : ''
}, },
getEnabledStatusName(status) { getEnabledStatusName(status) {
const item = this.enabledStatusOptions.find(opt => opt.id === status) const item = this.enabledStatusOptions.find(opt => opt.id === status)

View File

@ -209,6 +209,7 @@ export default {
this.dataForm.id = id || ''; this.dataForm.id = id || '';
this.dialogVisible = true; this.dialogVisible = true;
this.loading = true; this.loading = true;
this.machineOptions = []; //
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.formRef) { if (this.$refs.formRef) {
this.$refs.formRef.resetFields(); this.$refs.formRef.resetFields();
@ -228,6 +229,13 @@ export default {
matCode: String(data.matCode || ''), matCode: String(data.matCode || ''),
enabledStatus: String(data.enabledStatus || '1'), enabledStatus: String(data.enabledStatus || '1'),
}; };
// ID
if (data.procId) {
this.dataForm.procId = data.procId;
this.loadMachineList(data.procId);
}
// //
if (data.detailList && Array.isArray(data.detailList)) { if (data.detailList && Array.isArray(data.detailList)) {
this.paramList = data.detailList.map(item => { this.paramList = data.detailList.map(item => {