|
@@ -225,7 +225,7 @@
|
|
|
<el-radio :label="2">试验</el-radio>
|
|
|
<el-radio :label="1">质检</el-radio>
|
|
|
<el-radio :label="5">征拆</el-radio>
|
|
|
- <el-radio :label="6">计量</el-radio>
|
|
|
+ <el-radio :label="3">计量</el-radio>
|
|
|
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
@@ -638,7 +638,7 @@ export default {
|
|
|
rightTreeData:[],//存储右边的试验树数据
|
|
|
rightTreeData1:[],//存储右边的质检树数据
|
|
|
rightTreeData2:[],//存储征拆数据
|
|
|
-
|
|
|
+ rightTreeData3:[],//存储计量数据
|
|
|
rightObj:[
|
|
|
|
|
|
],
|
|
@@ -647,6 +647,9 @@ export default {
|
|
|
],
|
|
|
rightObj2:[
|
|
|
|
|
|
+ ],
|
|
|
+ rightObj3:[
|
|
|
+
|
|
|
],
|
|
|
nowref:{},
|
|
|
finalWbsid:'',
|
|
@@ -789,6 +792,7 @@ export default {
|
|
|
this.selectData={
|
|
|
referenceWbsTemplateId:data.referenceWbsTemplateId,//质检
|
|
|
referenceWbsTemplateIdLar:data.referenceWbsTemplateIdLar,//征拆
|
|
|
+ referenceWbsTemplateIdMeter:data.referenceWbsTemplateIdMeter,//计量
|
|
|
referenceWbsTemplateIdTrial:data.referenceWbsTemplateIdTrial===-1?'':data.referenceWbsTemplateIdTrial//试验
|
|
|
|
|
|
}
|
|
@@ -1111,9 +1115,11 @@ export default {
|
|
|
|
|
|
|
|
|
}else if(this.templateType==5){
|
|
|
- // this.selectData.referenceWbsTemplateId=value
|
|
|
this.selectData.referenceWbsTemplateIdLar=value
|
|
|
}
|
|
|
+ else if(this.templateType==3){
|
|
|
+ this.selectData.referenceWbsTemplateIdMeter=value
|
|
|
+ }
|
|
|
else{
|
|
|
this.selectData.referenceWbsTemplateIdTrial=value
|
|
|
}
|
|
@@ -1127,6 +1133,9 @@ export default {
|
|
|
}else if(this.templateType==5){
|
|
|
this.projectForm.referenceWbsTemplateTypeLar='private'
|
|
|
}
|
|
|
+ else if(this.templateType==2){
|
|
|
+ this.projectForm.referenceWbsTemplateTypeMeter='private'
|
|
|
+ }
|
|
|
else{
|
|
|
this.projectForm.referenceWbsTemplateTypeTrial='private'
|
|
|
}
|
|
@@ -1151,7 +1160,11 @@ export default {
|
|
|
}
|
|
|
else if(this.templateType==5){
|
|
|
this.projectForm.referenceWbsTemplateTypeLar='public'
|
|
|
- }else{
|
|
|
+ }
|
|
|
+ else if(this.templateType==2){
|
|
|
+ this.projectForm.referenceWbsTemplateTypeMeter='public'
|
|
|
+ }
|
|
|
+ else{
|
|
|
this.projectForm.referenceWbsTemplateTypeTrial='public'
|
|
|
}
|
|
|
}
|
|
@@ -1244,6 +1257,7 @@ export default {
|
|
|
if ((this.templateType == 1 && this.projectForm.referenceWbsTemplateType === 'private')
|
|
|
|| (this.templateType == 2 && this.projectForm.referenceWbsTemplateTypeTrial === 'private')
|
|
|
|| (this.templateType == 5 && this.projectForm.referenceWbsTemplateTypeLar === 'private')
|
|
|
+ || (this.templateType == 3 && this.projectForm.referenceWbsTemplateTypeMeter === 'private')
|
|
|
|
|
|
&& refId != null && refId.toString().length > 0) {
|
|
|
console.log(refId,'refId');
|
|
@@ -1282,6 +1296,11 @@ export default {
|
|
|
this.rightObj2.wbsId=recordid
|
|
|
this.rightObj2.objdata=this.rightTreeData2
|
|
|
}
|
|
|
+ else if(this.templateType===3){//计量
|
|
|
+ this.rightTreeData3=this.$refs.treetotree.rightTreeData
|
|
|
+ this.rightObj3.wbsId=recordid
|
|
|
+ this.rightObj3.objdata=this.rightTreeData3
|
|
|
+ }
|
|
|
else{
|
|
|
this.rightTreeData1=this.$refs.treetotree.rightTreeData
|
|
|
// this.rightObj1.push({
|
|
@@ -1327,6 +1346,11 @@ export default {
|
|
|
console.log('征拆选择');
|
|
|
this.wbsId =this.selectData.referenceWbsTemplateIdLar
|
|
|
|
|
|
+ }
|
|
|
+ if(this.templateType===3){
|
|
|
+ console.log('计量选择');
|
|
|
+ this.wbsId =this.selectData.referenceWbsTemplateIdMeter
|
|
|
+
|
|
|
}
|
|
|
console.log(this.wbsId===-1);
|
|
|
if(this.wbsId===-1){
|
|
@@ -1423,6 +1447,10 @@ export default {
|
|
|
}else if(this.templateType==5){
|
|
|
this.selectData.referenceWbsTemplateIdLar =this.wbsId
|
|
|
|
|
|
+ }
|
|
|
+ else if(this.templateType==3){
|
|
|
+ this.selectData.referenceWbsTemplateIdMeter =this.wbsId
|
|
|
+
|
|
|
}
|
|
|
else{
|
|
|
this.selectData.referenceWbsTemplateIdTrial=this.wbsId
|
|
@@ -1476,6 +1504,7 @@ export default {
|
|
|
console.log(this.wbsId,'this.wbsId33333');
|
|
|
this.treeInitTrial()
|
|
|
this.treeInitLar()
|
|
|
+ this.treeMeasure()
|
|
|
},
|
|
|
//初始化征拆
|
|
|
async treeInitLar () {
|
|
@@ -1537,6 +1566,66 @@ export default {
|
|
|
this.getTreeList();
|
|
|
}
|
|
|
},
|
|
|
+ //初始化计量
|
|
|
+ async treeMeasure () {
|
|
|
+ let refId = this.selectData.referenceWbsTemplateIdMeter;
|
|
|
+ console.log(refId,'refId');
|
|
|
+ //引用被删会出现 wbsType -1
|
|
|
+ if (refId && refId > 0 && Number(this.projectForm.wbsType) > 0) {
|
|
|
+ //有引用id,回显
|
|
|
+ //this.selected = true;
|
|
|
+
|
|
|
+ findWbsTreeList(2).then((res) => {
|
|
|
+ let arr = [{
|
|
|
+ label: '公有库',
|
|
|
+ options: [],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '私有库',
|
|
|
+ options: [],
|
|
|
+ }];
|
|
|
+ let data = res.data.data;
|
|
|
+ if (data.wbsInfos && data.wbsInfos.length) {
|
|
|
+ data.wbsInfos.forEach((element) => {
|
|
|
+ element.label = element.wbsName;
|
|
|
+ element.value = element.id;
|
|
|
+ })
|
|
|
+ arr[0].options = data.wbsInfos;
|
|
|
+ }
|
|
|
+ if (data.wbsTreePrivates && data.wbsTreePrivates.length) {
|
|
|
+ data.wbsTreePrivates.forEach((element) => {
|
|
|
+ element.label = element.projectName;
|
|
|
+ element.value = element.wbsId + ',' + element.projectId;
|
|
|
+ })
|
|
|
+ arr[1].options = data.wbsTreePrivates;
|
|
|
+ }
|
|
|
+
|
|
|
+ let WbsId = 0;
|
|
|
+ if (this.projectForm.referenceWbsTemplateTypeMeter == 'private') {
|
|
|
+ //私有
|
|
|
+ let list = arr[1].options;
|
|
|
+ console.log(list,'list');
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ if (list[i].pkeyId == refId) {
|
|
|
+ WbsId = list[i].wbsId + ',' + list[i].projectId;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log('共有',refId);
|
|
|
+ //公有
|
|
|
+ WbsId = refId;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.selectData.referenceWbsTemplateIdMeter = WbsId
|
|
|
+
|
|
|
+ console.log("征拆", this.selectData)
|
|
|
+ })
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.getTreeList();
|
|
|
+ }
|
|
|
+ },
|
|
|
//初始化试验
|
|
|
async treeInitTrial () {
|
|
|
console.log(this.wbsId,'wbsidshiyan');
|
|
@@ -1608,6 +1697,11 @@ export default {
|
|
|
refId=this.selectData.referenceWbsTemplateIdLar;
|
|
|
// this.$refs.treetotree.setRightTree([]);
|
|
|
}
|
|
|
+ if(this.templateType===3){
|
|
|
+ console.log(this.selectData.referenceWbsTemplateIdMeter,1111111111);
|
|
|
+ refId=this.selectData.referenceWbsTemplateIdMeter;
|
|
|
+ // this.$refs.treetotree.setRightTree([]);
|
|
|
+ }
|
|
|
|
|
|
console.log(refId,'refId');
|
|
|
if(!refId){
|
|
@@ -1656,11 +1750,26 @@ export default {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ if (
|
|
|
+ this.projectForm.referenceWbsTemplateTypeMeter === 'private' && refId != null && refId.toString().length > 0 &&this.templateType===3) {
|
|
|
+ // 私有库右边树形数据是通过 pkeyId 查询的
|
|
|
+ let ids = refId.toString().split(",");
|
|
|
+ console.log(ids,'征拆');
|
|
|
+ this.finalIds=ids
|
|
|
+ if (ids.length > 1) {
|
|
|
+ refId = ids[0]
|
|
|
+ let list = this.treeList[1].options;
|
|
|
+ refId = list.filter(e => e.projectId == ids[1])[0].pkeyId;
|
|
|
+ console.log(refId,'refId');
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
//引用被删会出现 wbsType -1
|
|
|
if (refId && refId > 0) {
|
|
|
let priv = {};
|
|
|
if (this.projectForm.referenceWbsTemplateType == 'private'&&this.templateType===1
|
|
|
||this.projectForm.referenceWbsTemplateTypeLar === 'private' &&this.templateType===5
|
|
|
+ ||this.projectForm.referenceWbsTemplateTypeMeter === 'private' &&this.templateType===3
|
|
|
||this.projectForm.referenceWbsTemplateTypeTrial === 'private'&&this.templateType===2) {
|
|
|
//私有
|
|
|
let list = this.treeList[1].options;
|
|
@@ -1694,20 +1803,25 @@ export default {
|
|
|
else if (this.projectForm.referenceWbsTemplateTypeLar === 'private'&& refId != null && refId.toString().length > 0&&this.templateType==5) {
|
|
|
WbsId = priv.pkeyId
|
|
|
}
|
|
|
+ else if (this.projectForm.referenceWbsTemplateTypeMeter === 'private'&& refId != null && refId.toString().length > 0&&this.templateType==2) {
|
|
|
+ WbsId = priv.pkeyId
|
|
|
+ }
|
|
|
else {//公有
|
|
|
WbsId=this.templateType === 1 ?this.selectData.referenceWbsTemplateId: this.selectData.referenceWbsTemplateIdTrial
|
|
|
if(this.templateType===5){
|
|
|
WbsId=this.selectData.referenceWbsTemplateIdLar
|
|
|
}
|
|
|
+ if(this.templateType===3){
|
|
|
+ WbsId=this.selectData.referenceWbsTemplateIdMeter
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
this.finalWbsid=WbsId
|
|
|
console.log(WbsId,'WbsId');
|
|
|
console.log( this.finalWbsid,' this.finalWbsid=');
|
|
|
- // this.selectData.referenceWbsTemplateIdLar=WbsId
|
|
|
+
|
|
|
|
|
|
- console.log(this.selectData.referenceWbsTemplateIdLar,'this.selectData.referenceWbsTemplateIdLar');
|
|
|
// findProjectTree(this.projectForm.id, this.templateType === 1 ? WbsId : this.selectData.referenceWbsTemplateIdTrial).then((res) => {
|
|
|
findProjectTree(this.projectForm.id, WbsId).then((res) => {
|
|
|
if (this.rightTreeData.length>0&&this.templateType===2&&this.rightObj.wbsId==WbsId) {
|
|
@@ -1717,6 +1831,9 @@ export default {
|
|
|
}else if(this.rightTreeData2.length>0&&this.templateType===5&&this.rightObj2.wbsId==WbsId){
|
|
|
this.$refs.treetotree.setRightTree(this.rightTreeData2);
|
|
|
}
|
|
|
+ else if(this.rightTreeData3.length>0&&this.templateType===3&&this.rightObj3.wbsId==WbsId){
|
|
|
+ this.$refs.treetotree.setRightTree(this.rightTreeData3);
|
|
|
+ }
|
|
|
else{
|
|
|
if (Array.isArray(res.data.data)) {
|
|
|
if(res.data.data.length>0){
|