|
@@ -342,6 +342,8 @@ export default {
|
|
|
this.addElement = false
|
|
|
this.addElementForm.deptName = data.name
|
|
|
this.from.id = data.id
|
|
|
+
|
|
|
+ this.tableData = [];
|
|
|
}
|
|
|
},
|
|
|
async loadNode (node, resolve) {//懒加载获取节点
|
|
@@ -359,7 +361,7 @@ export default {
|
|
|
if (this.from.id) {
|
|
|
this.tableData.push({
|
|
|
eName: '',
|
|
|
- eType: '',
|
|
|
+ eType: 1,
|
|
|
eAllowDeviation: ''
|
|
|
})
|
|
|
}
|
|
@@ -371,6 +373,10 @@ export default {
|
|
|
const { data: res } = await getColByTabId({ tabId: this.from.id })
|
|
|
console.log(res);
|
|
|
if (res.code === 200) {
|
|
|
+ res.data.forEach((element)=>{
|
|
|
+ element.eName = element.textInfo;
|
|
|
+ element.eType = 1;
|
|
|
+ })
|
|
|
this.tableData = res.data
|
|
|
}
|
|
|
},
|
|
@@ -400,6 +406,26 @@ export default {
|
|
|
|
|
|
//#region 关联公共WBS模板弹框
|
|
|
establish () {//关联WBS并创建元素
|
|
|
+ if(this.tableData.length == 0){
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '至少有一条元素才能创建元素表'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let arr = [];
|
|
|
+ this.tableData.forEach((element,index)=>{
|
|
|
+ if(element.eName == ''){
|
|
|
+ arr.push(index+1);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(arr.length > 0){
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: arr.join(',')+'条的元素名称未填写'
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
this.getWbsTypeList()
|
|
|
this.AssociatedPublicTap = true
|
|
|
},
|
|
@@ -407,7 +433,7 @@ export default {
|
|
|
this.addElementForm = {
|
|
|
id: "",
|
|
|
initTableName: "",
|
|
|
- deptName: '',
|
|
|
+ deptName: this.addElementForm.deptName,
|
|
|
tableType: '',
|
|
|
tableOwner: '',
|
|
|
wbsId: '',
|
|
@@ -469,12 +495,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
handleNodeClickExcel (data) {//点击节点事件
|
|
|
- console.log(data);
|
|
|
- if (data.hasChildren) {
|
|
|
- this.addElementForm.wbsId = data.id
|
|
|
- this.addElementForm.parentId = data.parentId
|
|
|
- this.selectByNodeTable(data.id)
|
|
|
- }
|
|
|
+ this.addElementForm.wbsId = data.id
|
|
|
+ this.addElementForm.parentId = data.parentId
|
|
|
+ this.selectByNodeTable(data.id)
|
|
|
},
|
|
|
async selectByNodeTable (id) {//获取清表信息
|
|
|
const { data: res } = await selectByNodeTable(id)
|
|
@@ -549,17 +572,22 @@ export default {
|
|
|
parentId: this.addElementForm.parentId,
|
|
|
elementList: this.tableData
|
|
|
})
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请填写和选择新增的表名,表类型,表所属方'
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
|
this.$message({
|
|
|
- type: 'error',
|
|
|
+ type: 'warning',
|
|
|
message: '至少有一个元素才可以保存'
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
this.$message({
|
|
|
- type: 'error',
|
|
|
+ type: 'warning',
|
|
|
message: '请先选择WBS树节点表单'
|
|
|
})
|
|
|
}
|
|
@@ -594,6 +622,9 @@ export default {
|
|
|
const { data: res } = await dictionarydataType()
|
|
|
console.log(res);
|
|
|
if (res.code == 200) {
|
|
|
+ res.data.forEach(element => {
|
|
|
+ element.dictKey = Number(element.dictKey)
|
|
|
+ });
|
|
|
this.dataType = res.data
|
|
|
}
|
|
|
},
|