duy %!s(int64=2) %!d(string=hai) anos
pai
achega
b17e559959
Modificáronse 2 ficheiros con 56 adicións e 12 borrados
  1. 12 0
      src/api/manager/projectinfo.js
  2. 44 12
      src/views/manager/projectinfo/tree.vue

+ 12 - 0
src/api/manager/projectinfo.js

@@ -82,6 +82,18 @@ export const findProjectTree = (projectId, wbsId) => {
         }
     })
 }
+//获取试验配合比树接口
+export const findProjectTreeTrial = (projectId, wbsId,pKeyId ) => {
+    return request({
+        url: '/api/blade-manager/projectInfo/tree-record-trial',
+        method: 'get',
+        params: {
+            projectId,
+            wbsId,
+            pKeyId
+        }
+    })
+}
 
 export const getContractRelation = (contractId) => {
   return request({

+ 44 - 12
src/views/manager/projectinfo/tree.vue

@@ -640,7 +640,7 @@
         <el-button @click="(sortTag = false), (sortTag2 = false)"
           >取 消</el-button
         >
-        <el-button type="primary" @click="editSort()">确 定</el-button>
+        <el-button type="primary" @click="editSort()" v-loading="sureSortload">确 定</el-button>
       </span>
     </el-dialog>
 
@@ -658,7 +658,7 @@
       />
       <span slot="footer" class="dialog-footer">
         <el-button @click="excelSortTag = false">取 消</el-button>
-        <el-button type="primary" @click="editPrivateSort()">确 定</el-button>
+        <el-button type="primary" @click="editPrivateSort()"  v-loading="surePrivateSortload">确 定</el-button>
       </span>
     </el-dialog>
 
@@ -1583,6 +1583,7 @@ import {
   tabTypeLazyTree,
 } from "@/api/manager/wbsprivate";
 import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
+import { findProjectTreeTrial as getAlltreeTrial } from "@/api/manager/projectinfo";
 import {refrehPram} from "@/api/manager/wbstree"
 import {getTableElments} from "@/api/manager/wbstree";
 import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
@@ -1619,6 +1620,8 @@ export default {
       //#region
       sortTag: false,
       sortTag2: false,
+      sureSortload:false,
+      surePrivateSortload:false,
  
       sort:[],
       //#endregion
@@ -1908,6 +1911,7 @@ export default {
         this.nodeDetail = Object.assign({}, res.data.data);
       });
       this.updateNodeTable();
+      this.nodeTypeChange(53)
 
       //获取节点展开路径
       this.getExpandedKeys(node);
@@ -1994,7 +1998,6 @@ export default {
         res.data.data.parentName = parentName;
         this.tableData = [res.data.data];
         if (type == 1) {
-          console.log(1111111111);
           this.nodeDetail = {
             parentId: res.data.data.id,
             parentName: parentName,
@@ -2002,7 +2005,8 @@ export default {
           };
         } else {
           this.nodeDetail = Object.assign({}, res.data.data);
-          this.mixRatioTestIds = this.toSplit(res.data.data.mixRatioTestIds);
+        
+          // this.mixRatioTestIds = this.toSplit(res.data.data.mixRatioTestIds);
         }
         this.nodeDetail.type = 1; //	'1'节点 '2'表单
         this.nodeDetail.wbsId = this.id;
@@ -2265,14 +2269,32 @@ export default {
       }
     },
     nodeTypeChange(val) {
+      console.log(333333333);
       if (val === 53) {
-        if (this.testTreeData.length > 0) {
-          return;
-        }
+        // if (this.testTreeData.length > 0) {
+        //   return;
+        // }
+       
         this.testTreeLoad = true;
-        getAlltree(this.projectid, this.id).then((res) => {
+        // getAlltreeTrial(this.projectid, this.id, this.curTreeData.primaryKeyId).then((res) => {
+        //   this.testTreeLoad = false;
+        //   console.log(res.data.data,'data');
+        //   let trialdata=res.data.data
+        //   if(trialdata&&trialdata.allTree){
+        //     this.testTreeData = trialdata.allTree[0];
+        //     if(trialdata.allStatusIds.length>0){
+        //       //设置勾选相关联试验全选
+        //       this.mixRatioTestIds =trialdata.allStatusIds[0];
+        //     }
+               
+        //   }
+          
+        // });
+        getAlltree(this.projectid, this.id, this.curTreeData.primaryKeyId).then((res) => {
           this.testTreeLoad = false;
-          this.testTreeData = res.data.data;
+          console.log(res.data.data,'data');
+            this.testTreeData=res.data.data
+          
         });
       }
     },
@@ -2284,7 +2306,7 @@ export default {
       const newarr = [...checkedKeys, ...halfCheckedKeys];
       //  const newarr = [...checkedKeys]
       this.nodeDetail.mixRatioTestIds = this.toJoin(newarr);
-      console.log(this.toJoin(newarr),'this.toJoin(newarr)');
+     
     },
     filterChange() {
       if (this.treeData.length > 0) {
@@ -2295,6 +2317,7 @@ export default {
       getAlltree(this.projectid, this.id).then((res) => {
         this.treeLoad = false;
         this.treeData = res.data.data;
+        console.log(res.data.data,'res.data.data');
         this.$nextTick(() => {
           this.$refs.treeall.filter(this.filterText);
         });
@@ -2462,12 +2485,15 @@ export default {
       this.excelSortTag2 = true;
     },
     editPrivateSort() {
+      this.surePrivateSortload=true
       wbsTreePrivateTableSort(this.tableSortList).then(() => {
-        this.updateNodeTable();
-        this.$message({
+          this.$message({
           type: "success",
           message: "排序成功!",
         });
+
+        this.updateNodeTable();
+         this.surePrivateSortload=false
         this.excelSortTag = false;
         this.excelSortTag2 = false;
       });
@@ -2681,12 +2707,18 @@ export default {
       });
     },
     async wbsTreePrivateSort() {
+      this.sureSortload=true
       //wbs私有树节点手动排序
       const { data: res } = await wbsTreePrivateSort(this.sort);
       console.log(res);
       if (res.code == 200) {
         this.sortTag = false;
         this.sortTag2 = false;
+        this.$message({
+          type: "success",
+          message: "排序成功!",
+        });
+        this.sureSortload=false
         this.getLazytreessss();
       }
     },