yangbifan 2 anni fa
parent
commit
1fc19c16e5

+ 2 - 2
config/dev.env.js

@@ -6,8 +6,8 @@ module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
   ENV_CONFIG: '"dev"',
   ctx:'"http://127.0.0.1:8080"',
-  // ctxForm: '"http://10.149.85.91:8880"',//dev
-  ctxForm: '"http://43.138.50.94:8880"',//test
+  ctxForm: '"http://10.149.85.91:8880"',//dev
+  // ctxForm: '"http://43.138.50.94:8880"',//test
   // ctxForm: '"http://192.168.2.124:8880"',//test
   // ctxForm: '"http://10.230.15.228:8880"',//生产
   excludeMeWhenSelectNextHandler:false,

+ 36 - 13
src/components/workflow.vue

@@ -70,7 +70,9 @@
             </div>
             <div class="flex-header-text-tree">
               已选人员
-              <div class="">{{ selectUser }}</div>
+              <div class="" v-for="(item, index) in backThree" :key="index">
+                {{ item.loginNameStr }}
+              </div>
             </div>
           </div>
         </div>
@@ -169,7 +171,7 @@ export default {
     },
   },
   created() {
-    console.log(this.list);
+
     this.getNextPath(this.list.resourceId, 1);
     this.getMetirialType();
   },
@@ -184,7 +186,7 @@ export default {
         },
         data: {},
       }).then((res) => {
-        console.log(res);
+
         this.demand = res.data;
       });
     },
@@ -201,7 +203,7 @@ export default {
 
       let res = await this.common.httpPost(obj, success);
       function success(data) {
-        console.log(data);
+
       }
     },
     async nextWorks(lists, list) {
@@ -213,7 +215,7 @@ export default {
       };
       await this.common.httpPost(obj, success);
       function success(data) {
-        console.log(_this.nodes);
+    
         let updateList = {
           taskId: data.taskid,
           id: _this.list.id,
@@ -483,14 +485,17 @@ export default {
         if (status === 3) {
           this.nodes = res.data.body;
           this.getTreeLists(res.data.body, 1);
+          
           if (res.data.body.nextShapes[0].multi !== null) {
             if (res.data.body.nextShapes[0].multi.multi === "true") {
               this.manyPeopleStatus = true; //转派按钮生效
             } else {
               this.manyPeopleStatus = false;
             }
+          }else{
+             this.manyPeopleStatus = false;
           }
-          console.log(res.data.body);
+
         }
       });
     },
@@ -515,21 +520,23 @@ export default {
         },
         data: "",
       }).then((res) => {
-        console.log(status);
         if (status === 2) {
           this.treeCopyList = res.data; //抄送
-          console.log(this.treeCopyList);
           //  this.$refs.defTrees.treeList = res.data;
         } else {
           this.treeList = res.data; //抄送
           // this.$refs.defTree.treeList = res.data;
-          console.log(this.treeList);
+
         }
       });
     },
     //转派按钮方法
     clickTransfer(e) {
+      this.$refs.defTree.userList = [];
+      this.backThree = []
+      this.treeList = []
       if (e == 1) {
+        this.manyPeopleStatus = false;
         this.TransferStatus = true;
       } else if (e == 2) {
         this.CopyStatus = true;
@@ -538,6 +545,8 @@ export default {
     },
     //点击节点获取下一步的处理人字段
     clickGetTree(e, index) {
+      this.$refs.defTree.userList = [];
+      this.backThree = []
       // this.CopyStatus = false;
       this.TransferStatus = false;
       //   this.clickTaskName = e.properties.name;
@@ -551,25 +560,26 @@ export default {
     },
     //点击修改
     clickEdit() {
-      console.log(123);
       this.editStatus = true;
     },
     //选择树的回调
     changeTree(e) {
       if (this.manyPeopleStatus == true) {
+
         this.backThree = e;
+ 
         let arr = [];
         this.backThree.map((item) => {
           arr.push(item.loginNoStr);
         });
         this.nextDealManList = arr.toString();
-        console.log(arr.toString());
+
       } else {
+    
         if (e.length > 1) {
           this.$message.error("只能选择一个人");
           return;
         } else {
-          console.log(e);
           this.backThree = e;
           if (this.CopyStatus === true) {
             this.getTreeLists(e[0].loginNoStr, 2);
@@ -595,7 +605,7 @@ export default {
           dictCodePks: "approval",
         },
       }).then((res) => {
-        console.log(res);
+
         this.commonlyList = res.data;
       });
     },
@@ -682,6 +692,19 @@ export default {
       this.editStatus = false;
     },
   },
+  //  watch: {
+  //   "backThree": {
+  //     handler(newVal) {
+  //       if (newVal) {
+  //         console.log('[ newVal ] >', newVal)
+  //       //  console.log(newVal);
+  //        if(newVal.length === 0){
+  //         this.backThree.push({loginNameStr:'暂无选择'})
+  //        }
+  //       }
+  //     },
+  //   },
+  //  }
 };
 </script>
 

+ 23 - 8
src/components/workflowEntrance.vue

@@ -9,7 +9,7 @@
               选择路径
 
               <div class="flex-path-list">
-                <div @click="getTreeLists()">转派</div>
+                <div @click="getTreeLists(9)">转派</div>
                 <div @click="getclose()">结束</div>
                 <!-- <div
                   v-for="(item, index) in node.nextShapes"
@@ -70,7 +70,9 @@
             </div>
             <div class="flex-header-text-tree">
               已选人员
-              <div class="">{{ selectUser }}</div>
+              <div class="" v-for="(item, index) in backThree" :key="index">
+                {{ item.loginNameStr }}
+              </div>
             </div>
           </div>
         </div>
@@ -136,6 +138,7 @@ export default {
   name: "workflow",
   data() {
     return {
+      MultipersonTransfer: false,
       transferStatus: false, //转派按钮控制
       TransferStatus: false, //是否点击转派状态
       copyStatus: false, //抄送按钮控制
@@ -177,6 +180,8 @@ export default {
   },
   methods: {
     getclose() {
+      this.backThree = [];
+      this.treeList = [];
       this.close = "1";
     },
     // async getqueryMultiTaskId() {
@@ -222,13 +227,12 @@ export default {
         let listss = {
           userId: _this.backThree[0].loginNoStr, //人员id
           taskId: this.list.taskId, //表单标识
-          loginstr:JSON.parse(window.sessionStorage.userInfo).loginNoStr,
+          loginstr: JSON.parse(window.sessionStorage.userInfo).loginNoStr,
           // taskName: this.clicknextName, //流程节点
           content: this.textarea, //意见内容
         };
-       
-          (obj.url = _this.$url.formList.getNewTransferTask + _this.list.taskId)
-        , //下一步工作流接口
+
+        (obj.url = _this.$url.formList.getNewTransferTask + _this.list.taskId), //下一步工作流接口
           (obj.status = "form"),
           (obj.data = listss);
       }
@@ -491,6 +495,11 @@ export default {
     },
     //查询候选人接口
     getTreeLists(e, status) {
+      if (e === 9) {
+        this.MultipersonTransfer = true;
+      } else {
+        this.MultipersonTransfer = false;
+      }
       let id = this.initialList.nextShapes[0].properties.documentation;
       // if (status === 2) {
       //   id = "copy." + e;
@@ -554,8 +563,14 @@ export default {
     },
     //选择树的回调
     changeTree(e) {
-      console.log(e);
-      this.backThree = e;
+      if (this.MultipersonTransfer) {
+        if (e.length > 1) {
+          this.$message.error("只能选择一个人");
+          return;
+        } else {
+          this.backThree = e;
+        }
+      }
     },
     //获取字典表常用意见
     getMetirialType(e) {

+ 33 - 33
src/pages/main/leader/components/formTable.vue

@@ -463,9 +463,9 @@ export default {
         needName: [
           { required: true, message: "请输入需求名称", trigger: "blur" },
         ],
-        // mkFileShareAttachList: [
-        //   { required: true, validator: this.validateFiles },
-        // ],
+        mkFileShareAttachList: [
+          { required: true, validator: this.validateFiles },
+        ],
         applyDept: [
           { required: true, message: "请输入申请部门", trigger: "blur" },
         ],
@@ -808,14 +808,14 @@ export default {
         "敏感信息范围说明.xlsx",
       ];
       let files = this.$refs.upload.attList;
-      if (
-        (this.form.isMarketMeeting !== "是" &&
-          this.form.applyDept === "市场经营部") ||
-        (this.form.applyDept !== "信息技术中心" &&
-          this.form.applyDept !== "市场经营部")
-      ) {
-        num++;
-      }
+      // if (
+      //   (this.form.isMarketMeeting !== "是" &&
+      //     this.form.applyDept === "市场经营部") ||
+      //   (this.form.applyDept !== "信息技术中心" &&
+      //     this.form.applyDept !== "市场经营部")
+      // ) {
+      //   num++;
+      // }
       if (!files.length || files.length < num) {
         callback(new Error("请上传正确的模板数量!"));
       } else {
@@ -827,28 +827,28 @@ export default {
           });
           arrList.push(newList);
         }
-        files.map((item) => {
-          let fileIndex = item.name.lastIndexOf(".");
-          let substrName = item.name.substr(fileIndex);
-          if (substrName == ".pptx") {
-            arrList.push(item);
-          }
-        });
-        if (
-          (this.form.isMarketMeeting !== "是" &&
-            this.form.applyDept === "市场经营部") ||
-          (this.form.applyDept !== "信息技术中心" &&
-            this.form.applyDept !== "市场经营部")
-        ) {
-          let pptList = arrList.filter((item) => {
-            let fileIndex = item.name.lastIndexOf(".");
-            let substrName = item.name.substr(fileIndex);
-            return substrName == ".pptx";
-          });
-          if (!pptList.length) {
-            callback(new Error("请上传ppt!"));
-          }
-        }
+        // files.map((item) => {
+        //   let fileIndex = item.name.lastIndexOf(".");
+        //   let substrName = item.name.substr(fileIndex);
+        //   if (substrName == ".pptx") {
+        //     arrList.push(item);
+        //   }
+        // });
+        // if (
+        //   (this.form.isMarketMeeting !== "是" &&
+        //     this.form.applyDept === "市场经营部") ||
+        //   (this.form.applyDept !== "信息技术中心" &&
+        //     this.form.applyDept !== "市场经营部")
+        // ) {
+        //   let pptList = arrList.filter((item) => {
+        //     let fileIndex = item.name.lastIndexOf(".");
+        //     let substrName = item.name.substr(fileIndex);
+        //     return substrName == ".pptx";
+        //   });
+        //   if (!pptList.length) {
+        //     callback(new Error("请上传ppt!"));
+        //   }
+        // }
         arrList.map((item) => {
           //excel命名错误
           if (item === undefined) {

+ 64 - 8
src/pages/main/leader/demand/demandHomes.vue

@@ -191,8 +191,8 @@ export default {
         processDefinitionKey: "request_form_process",
       },
       requestForm: {
-        fresourceId: "0d94de8a-0281-11ed-a302-4ae7da54db39", // 本地环境
-        // fresourceId: "bf79721c-33f3-11ed-ba0b-00505687dcd3", //测试环境
+        // fresourceId: "0d94de8a-0281-11ed-a302-4ae7da54db39", // 本地环境
+        fresourceId: "bf79721c-33f3-11ed-ba0b-00505687dcd3", //测试环境
         processDefinitionKey: "request_form_process",
       },
       treeList: [], //候选人列表
@@ -757,10 +757,66 @@ export default {
     };
   },
   created() {
-    // const func = (name) => {
-    //   name = name || "fatfish";
-    //   console.log(name);
-    // };
+    // let A = [
+    //   {
+    //     id: 1,
+    //     b: "456",
+    //   },
+    //   {
+    //     id: 2,
+    //     b: "456",
+    //   },
+    // ];
+    // let B = [
+    //   {
+    //     a: 1,
+    //     b: "4567",
+    //   },
+    //   {
+    //     a: 1,
+    //     b: "4568",
+    //   },
+    //   {
+    //     a: 2,
+    //     b: "4567",
+    //   },
+    // ];
+    // A.map((item) => {
+    //   item.c = [];
+    //   let index = B.findIndex((items) => {
+    //     if (items.a == item.id) {
+    //       item.c.push(items);
+    //     }
+    //   });
+    //   console.log(index);
+    //  B.map((items,index) =>{
+    //   if(item.id == items.a){
+    //     item.c.push(items)
+    //   }
+
+    //  })
+    // });
+    // console.log(A);
+    function getUserDescribe(name) {
+      const describeForNameMap = [
+        [
+          (name) => name.length > 3, // 判断条件
+          () => console.log("名字太长"), // 执行函数
+        ],
+        [(name) => name.length < 2, () => console.log("名字太短")],
+        [(name) => name[0] === "陈", () => console.log("小陈")],
+        [(name) => name === "大鹏", () => console.log("管理员")],
+        [
+          (name) => name[0] === "李" && name !== "李鹏",
+          () => console.log("小李"),
+        ],
+      ];
+      // 获取符合条件的子数组
+      const getDescribe = describeForNameMap.find((item) => item[0](name));
+      // 子数组存在则运行子数组中的第二个元素(执行函数)
+      getDescribe ? getDescribe[1]() : console.log("此人比较神秘!");
+    }
+    getUserDescribe('张元芳微软')
     const func = (name, age = "fatfish") => {
       console.log(name);
     };
@@ -1333,7 +1389,7 @@ export default {
       function success(data) {
         let list = [];
         list = data.data.data;
-        if (data.data.lastmandata.length!=0) {
+        if (data.data.lastmandata.length != 0) {
           data.data.lastmandata.map((item, index) => {
             item.id = index + 22;
           });
@@ -1342,7 +1398,7 @@ export default {
           item.startTime = _this.$util.datetimeFormat(item.startTime);
           item.endTime = _this.$util.datetimeFormat(item.endTime);
           item.id = index + 1;
-          if (data.data.lastmandata.length!=0) {
+          if (data.data.lastmandata.length != 0) {
             if (item.taskId == data.data.lastmandata[0].taskId) {
               item.children = data.data.lastmandata;
             }