工艺模板样式修改

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

Loading…
Cancel
Save