工艺模板样式修改

dev-scheduling
zhangdi 2 weeks ago
parent d39f2ce724
commit 97382f1512
  1. 74
      src/views/processManagement/components/addTemplateDialog.vue

@ -96,8 +96,10 @@
@node-click="handleNodeClick"
:default-expand-all="true"
:expand-on-click-node="false"
highlight-current-row
:current-row-key="currentRowId"
highlight-current
:current-node-key="currentRowId"
ref="treeRef"
node-key="id"
/>
</div>
<div class="process-right">
@ -367,8 +369,8 @@ export default {
},
data() {
return {
currentRowId: '',
currentRowId: 'root',
treeNodes: {},
treeData: [],
defaultProps: {
label: data => {
@ -378,13 +380,13 @@ export default {
}
// processName
if (data.processName) {
return data.processName;
return data.processNo + '-' + data.processName;
}
// projectCode
if (data.projectCode !== undefined) {
return `${data.projectName}`;
return `${data.trialNo}-${data.projectName}`;
}
return '未知节点';
return '工序';
},
children: data => {
//
@ -507,12 +509,18 @@ export default {
{
label: '工序列表',
processList: this.ruleForm.tableData,
id: 'root',
},
];
//
//
this.$nextTick(() => {
if (this.ruleForm.tableData.length > 0) {
this.ruleForm.tableData = this.treeData[0].processList;
this.currentRowId = 'root';
this.activeName = '1';
this.treeLeave = 1;
// 使 setCurrentKey
if (this.$refs.treeRef) {
this.$refs.treeRef.setCurrentKey('root', false);
}
});
});
@ -554,16 +562,31 @@ export default {
//
handleNodeClick(data) {
if (data.label && data.processList) {
console.log(89898989, data);
this.treeNodes = data;
// if (data.label && data.processList) {
// // ""
// this.activeName = '1';
// this.treeLeave = 1; //
// // this.ruleForm.tableData = [];
// } else if (data.processName && data.modelProjectList) {
// //
// this.activeName = '2'; // Tab
// this.treeLeave = 2; //
// this.ruleForm.tableData2 = data.modelProjectList;
// }
if (data.id === 'root' || (data.label && data.processList)) {
// ""
this.activeName = '1';
this.treeLeave = 1; //
// this.ruleForm.tableData = [];
this.treeLeave = 1;
this.currentRowId = data.id || 'root';
} else if (data.processName && data.modelProjectList) {
//
this.activeName = '2'; // Tab
this.treeLeave = 2; //
this.activeName = '2';
this.treeLeave = 2;
this.ruleForm.tableData2 = data.modelProjectList;
this.currentRowId = data.id;
}
},
// tab
@ -615,7 +638,17 @@ export default {
item.ppsId = item.ppsId + '';
item.caId = item.caId + '';
});
this.treeData = [{ label: '工序列表', processList: res.data.data.proDetailVOList }];
this.treeData = [{ label: '工序列表', processList: this.ruleForm.tableData, id: 'root' }];
//
this.$nextTick(() => {
this.currentRowId = 'root';
this.activeName = '1';
this.treeLeave = 1;
// 使 setCurrentKey
if (this.$refs.treeRef) {
this.$refs.treeRef.setCurrentKey('root', false);
}
});
});
},
getDictionary() {
@ -648,10 +681,11 @@ export default {
});
}
if (this.activeName == '2') {
console.log(98989898);
this.ruleForm.tableData2.push({
_tempId: this.tempId, //
id: null,
trialNo: this.getProcessNo(this.ruleForm.tableData2),
trialNo: this.treeNodes.processNo + '-' + this.getProcessNo(this.ruleForm.tableData2),
});
}
},
@ -771,7 +805,7 @@ export default {
message: '操作成功!',
});
this.$emit('closeDialog');
this.getDetail();
// this.getDetail();
})
.catch(err => {
this.formLoading = false;
@ -785,7 +819,7 @@ export default {
type: 'success',
message: '操作成功!',
});
this.$emit('closeDialog');
// this.$emit('closeDialog');
this.getDetail();
})
.catch(err => {
@ -845,6 +879,10 @@ export default {
padding: 0 !important;
line-height: 50px !important;
}
:deep(.el-table__header th.el-table__cell) {
height: 36px !important; /* 设置你想要的高度 */
line-height: 36px !important;
}
.process-box {
display: flex;
flex-direction: row;

Loading…
Cancel
Save