|
|
|
@ -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; |
|
|
|
|