fix(machineparam): 修复机台参数页面数据展示和编辑功能
、
This commit is contained in:
parent
a6bb78590c
commit
3e7a17ace0
@ -55,7 +55,7 @@ public class MachineParamServiceImpl extends ServiceImpl<MachineParamMapper, Mac
|
||||
}
|
||||
|
||||
wrapper.eq(MachineParamEntity::getDeleteMark, 0);
|
||||
wrapper.orderByDesc(MachineParamEntity::getCreatorTime);
|
||||
wrapper.orderByDesc(MachineParamEntity::getId);
|
||||
|
||||
if ("0".equals(machineParamPagination.getDataType())) {
|
||||
Page<MachineParamEntity> page = new Page<>(machineParamPagination.getCurrentPage(), machineParamPagination.getPageSize());
|
||||
|
||||
@ -177,6 +177,8 @@ export default {
|
||||
this.materialOptions = res.data.map(item => ({
|
||||
label: item.matName,
|
||||
value: String(item.id),
|
||||
matCode: item.matCode || '',
|
||||
matName: item.matName || '',
|
||||
}))
|
||||
})
|
||||
},
|
||||
@ -214,7 +216,7 @@ export default {
|
||||
},
|
||||
getMaterialName(matCode) {
|
||||
const item = this.materialOptions.find(opt => opt.value === matCode)
|
||||
return item ? item.label : ''
|
||||
return item ? `${item.matCode}-${item.matName}` : ''
|
||||
},
|
||||
getEnabledStatusName(status) {
|
||||
const item = this.enabledStatusOptions.find(opt => opt.id === status)
|
||||
|
||||
@ -209,6 +209,7 @@ export default {
|
||||
this.dataForm.id = id || '';
|
||||
this.dialogVisible = true;
|
||||
this.loading = true;
|
||||
this.machineOptions = []; // 每次编辑前清空机台列表
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.formRef) {
|
||||
this.$refs.formRef.resetFields();
|
||||
@ -228,6 +229,13 @@ export default {
|
||||
matCode: String(data.matCode || ''),
|
||||
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)) {
|
||||
this.paramList = data.detailList.map(item => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user