|
@@ -194,7 +194,7 @@
|
|
|
<span class="mg-r-20">选择WBS</span>
|
|
|
<el-select
|
|
|
v-model="wbsId"
|
|
|
- @change="wbsChange"
|
|
|
+ @change='wbsChange'
|
|
|
:disabled="selected"
|
|
|
placeholder="请选择WBS"
|
|
|
style="width:500px;"
|
|
@@ -607,6 +607,7 @@ export default {
|
|
|
deep: true
|
|
|
},
|
|
|
activeType: function (newValue) {
|
|
|
+ console.log(newValue, "activeType: function")
|
|
|
if (newValue == '4') {
|
|
|
this.getContractList();
|
|
|
this.getRoleList();
|
|
@@ -658,7 +659,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
beforeLeave (activeName, oldActiveName) {
|
|
|
+ console.log("---------------- beforeLeave ----------------------")
|
|
|
|
|
|
+ console.log(activeName, "---------------- beforeLeave-activeName")
|
|
|
+ console.log(oldActiveName, "---------------- beforeLeave-oldActiveName")
|
|
|
return new Promise((resolve, reject) => {
|
|
|
if (oldActiveName == '1' && !this.projectForm.id) {
|
|
|
this.$message({
|
|
@@ -679,7 +683,7 @@ export default {
|
|
|
this.saveProject().then((res) => {
|
|
|
this.projectForm.id = res.data.data.id;
|
|
|
this.typeChang[oldActiveName] = false;
|
|
|
-
|
|
|
+
|
|
|
resolve();
|
|
|
this.$message({
|
|
|
type: "success",
|
|
@@ -696,6 +700,7 @@ export default {
|
|
|
message: "保存成功!"
|
|
|
});
|
|
|
}).catch(() => {
|
|
|
+ console.log("beforeLeave catch getRightTree")
|
|
|
this.getRightTree();
|
|
|
reject();
|
|
|
})
|
|
@@ -761,6 +766,7 @@ export default {
|
|
|
this.saveBtnBackDisabled = false
|
|
|
this.saveBtnNextDisabled = false
|
|
|
if(this.activeType == '2'){
|
|
|
+ console.log("saveQuit getRightTree")
|
|
|
this.getRightTree();
|
|
|
}
|
|
|
return;
|
|
@@ -809,6 +815,7 @@ export default {
|
|
|
this.saveBtnDisabled = false
|
|
|
}
|
|
|
if(this.activeType == '2'){
|
|
|
+ console.log("saveNext getRightTree")
|
|
|
this.getRightTree();
|
|
|
}
|
|
|
return;
|
|
@@ -1009,9 +1016,10 @@ export default {
|
|
|
this.logleftloading = false;
|
|
|
})
|
|
|
},
|
|
|
- wbsChange (value) {
|
|
|
- console.log(value,'WBS节点更换测试')
|
|
|
- console.log(this.templateType);
|
|
|
+ wbsChange (value, flag) {
|
|
|
+ console.log(value, 'WBS节点更换测试 value')
|
|
|
+
|
|
|
+ console.log(flag, 'WBS节点更换测试 flag')
|
|
|
if(this.templateType==1){
|
|
|
this.selectData.referenceWbsTemplateId=value
|
|
|
|
|
@@ -1027,7 +1035,7 @@ export default {
|
|
|
}else{
|
|
|
this.projectForm.referenceWbsTemplateTypeTrial='private'
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
let ids = value.toString().split(',');
|
|
|
findProjectTree(ids[1], ids[0]).then((res) => {
|
|
|
if (Array.isArray(res.data.data)) {
|
|
@@ -1046,7 +1054,7 @@ export default {
|
|
|
this.projectForm.referenceWbsTemplateTypeTrial='public'
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
getAlltree(this.userInfo.tenant_id, '1', value).then((res) => {
|
|
|
if (Array.isArray(res.data.data)) {
|
|
@@ -1059,7 +1067,9 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- this.getRightTree();
|
|
|
+ if (flag === undefined) { /* 下拉框切换的时候调用 */
|
|
|
+ this.getRightTree();
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
getLogTreeList(){
|
|
@@ -1119,7 +1129,7 @@ export default {
|
|
|
}
|
|
|
this.treeList = arr;
|
|
|
|
|
|
- this.wbsChange(this.wbsId)
|
|
|
+ this.wbsChange(this.wbsId, true)
|
|
|
}).finally(() => {
|
|
|
resolve();
|
|
|
})
|
|
@@ -1157,9 +1167,9 @@ export default {
|
|
|
arr[1].options = data.wbsTreePrivates;
|
|
|
}
|
|
|
this.treeList = arr;
|
|
|
-
|
|
|
+
|
|
|
this.wbsId = this.templateType == 1 ? this.selectData.referenceWbsTemplateId : this.selectData.referenceWbsTemplateIdTrial
|
|
|
- this.wbsChange(this.wbsId)
|
|
|
+ this.wbsChange(this.wbsId, true)
|
|
|
|
|
|
// if(this.treeList[0].options.length > 0){
|
|
|
// this.wbsId = this.treeList[0].options[0].value;
|
|
@@ -1198,18 +1208,32 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async treeInit () {
|
|
|
- console.log('treeInit');
|
|
|
+ console.log('------------------- treeInit ------------------------');
|
|
|
|
|
|
let refId = this.selectData.referenceWbsTemplateId;
|
|
|
+
|
|
|
+ console.log(refId, '------------------- treeInit.refId ------------------------');
|
|
|
+
|
|
|
+ if (this.projectForm.referenceWbsTemplateType === 'private' && refId != null && refId.toString().length > 0) {
|
|
|
+ // 私有库右边树形数据是通过 pkeyId 查询的
|
|
|
+ let ids = refId.toString().split(",");
|
|
|
+ if (ids.length > 1) {
|
|
|
+ refId = ids[0]
|
|
|
+ let list = this.treeList[1].options;
|
|
|
+ refId = list.filter(e => e.projectId == ids[1])[0].pkeyId;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//引用被删会出现 wbsType -1
|
|
|
if (refId && refId > 0 && Number(this.projectForm.wbsType) > 0) {
|
|
|
+ console.log('------------------- treeInit if------------------------');
|
|
|
//有引用id,回显
|
|
|
//this.selected = true;
|
|
|
|
|
|
this.templateType = this.projectForm.wbsType;
|
|
|
await this.getTreeList();
|
|
|
let priv = {};
|
|
|
- console.log(this.projectForm.referenceWbsTemplateType,'类型');
|
|
|
+
|
|
|
if (this.projectForm.referenceWbsTemplateType == 'private') {
|
|
|
//私有
|
|
|
let list = this.treeList[1].options;
|
|
@@ -1227,15 +1251,12 @@ export default {
|
|
|
}
|
|
|
|
|
|
if(this.templateType == 1){
|
|
|
- this.selectData.referenceWbsTemplateId =this.wbsId
|
|
|
+ this.selectData.referenceWbsTemplateId =this.wbsId
|
|
|
}else{
|
|
|
this.selectData.referenceWbsTemplateIdTrial=this.wbsId
|
|
|
}
|
|
|
|
|
|
- console.log(this.wbsId,'this.wbsId111111111111');
|
|
|
- console.log(this.selectData,'this.selectData333');
|
|
|
-
|
|
|
- let projectTree = await findProjectTree(this.projectForm.id, refId)
|
|
|
+ let projectTree = await findProjectTree(this.projectForm.id, refId) //查询的右边的数据
|
|
|
if (Array.isArray(projectTree.data.data)) {
|
|
|
this.leftloading = true;
|
|
|
this.rightloading = true;
|
|
@@ -1264,7 +1285,9 @@ export default {
|
|
|
}else{
|
|
|
this.wbsId = '';
|
|
|
}
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ console.log('------------------- treeInit else------------------------');
|
|
|
this.getTreeList();
|
|
|
}
|
|
|
|
|
@@ -1277,7 +1300,7 @@ export default {
|
|
|
if (refId && refId > 0 && Number(this.projectForm.wbsType) > 0) {
|
|
|
//有引用id,回显
|
|
|
//this.selected = true;
|
|
|
-
|
|
|
+
|
|
|
findWbsTreeList(2).then((res) => {
|
|
|
let arr = [{
|
|
|
label: '公有库',
|
|
@@ -1329,9 +1352,17 @@ export default {
|
|
|
},
|
|
|
|
|
|
getRightTree() {
|
|
|
+ console.log("-------------------- getRightTree -------------------")
|
|
|
this.rightloading = true;
|
|
|
-
|
|
|
+
|
|
|
let WbsId = this.templateType === 1 ? this.selectData.referenceWbsTemplateId : this.selectData.referenceWbsTemplateIdTrial
|
|
|
+ console.log(WbsId, "getRightTree-WbsId")
|
|
|
+
|
|
|
+ if (this.projectForm.referenceWbsTemplateType == 'private' && WbsId != null && WbsId.toString().length > 0) {
|
|
|
+ let ids = WbsId.toString().split(",");
|
|
|
+ WbsId = ids[0]
|
|
|
+ }
|
|
|
+
|
|
|
findProjectTree(this.projectForm.id, WbsId).then((res) => {
|
|
|
if (Array.isArray(res.data.data)) {
|
|
|
this.$refs.treetotree.setRightTree(res.data.data);
|
|
@@ -1340,17 +1371,7 @@ export default {
|
|
|
}
|
|
|
this.rightloading = false;
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
- findProjectTree(this.projectForm.id, WbsId).then((res) => {
|
|
|
- console.log('findProjectTree');
|
|
|
- if (Array.isArray(res.data.data)) {
|
|
|
- this.$refs.treetotree.setRightTree(res.data.data);
|
|
|
- } else {
|
|
|
- this.$refs.treetotree.setRightTree([]);
|
|
|
- }
|
|
|
- this.rightloading = false;
|
|
|
- })
|
|
|
+
|
|
|
},
|
|
|
|
|
|
}
|