{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\flow\\task\\taskSelectDestination.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\flow\\task\\taskSelectDestination.vue","mtime":1667327529419},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport { mapState, mapActions } from \"vuex\";\r\nimport HtUserSelector from \"@/components/control/HtUserSelector.vue\";\r\nimport utils from \"@/utils.js\";\r\nimport { debuglog } from \"util\";\r\n\r\nexport default {\r\n  name: \"taskSelectDestination\",\r\n  props: [\"taskId\", \"defId\", \"instId\", \"leaderId\"],\r\n  components: { HtUserSelector },\r\n  data() {\r\n    return {\r\n      relatedInformationDialog: false,\r\n      helpDialog: false,\r\n      disabled: false,\r\n      selectNodeId: \"\",\r\n      files: \"\",\r\n      zfiles: \"\",\r\n      formData: \"\",\r\n      opinion: \"\",\r\n      selectDesObj: {},\r\n      token: utils.getUrlKey(\"token\"),\r\n      valHelp: \"\",\r\n      proInstId: \"\" //处理人时传过来的流程实例ID\r\n    };\r\n  },\r\n  computed: mapState({\r\n    curOrgPost: state => state.user.postCharge\r\n  }),\r\n  methods: {\r\n    //帮助\r\n    help() {\r\n      this.helpDialog = true;\r\n    },\r\n    //鼠标点击页面其他其他位置不关闭弹框\r\n    showDialog(formData, files, zfiles, opinion, instId, jumpType) {\r\n      if (this.$route.query.type === \"free\"){\r\n          jumpType = \"free\";\r\n      }\r\n      this.proInstId = instId;\r\n      this.files = files;\r\n      this.zfiles = zfiles;\r\n      this.opinion = opinion;\r\n      this.formData = formData;\r\n      this.selectNodeId = \"\";\r\n      this.selectDesObj = {};\r\n      this.jumpType = jumpType;\r\n      this.relatedInformationDialog = true;\r\n      this.$store\r\n        .dispatch(\"storeProcess/getAfterJumpNodes\", {\r\n          taskId: this.taskId || \"\",\r\n          data: formData.data || formData,\r\n          defId: this.defId || \"\",\r\n          instId: this.instId || \"\",\r\n          type: this.jumpType || \"\"\r\n        })\r\n        .then(data => {\r\n          let Base64 = require(\"js-base64\").Base64;\r\n          this.selectDesObj = data;\r\n          //此操作为改节点为设置自由跳转，通过manage端的任务跳转按钮跳过来时可提供自由跳转功能\r\n          if (this.$route.query.type === \"free\"){\r\n            this.selectDesObj.jumpType = this.jumpType;\r\n            this.selectDesObj.choiceExcutor = this.jumpType;\r\n          }\r\n          if (this.selectDesObj.afterNodes.length == 1) {\r\n            this.selectNodeId = this.selectDesObj.afterNodes[0].nodeId;\r\n          }\r\n          if (this.selectDesObj.helpGlobal == \"null\") {\r\n            this.selectDesObj.helpGlobal = \"\";\r\n          }\r\n          if (this.selectDesObj.help == \"null\") {\r\n            this.selectDesObj.help = \"\";\r\n          }\r\n          if (\r\n            this.selectDesObj.helpGlobal != \"\" &&\r\n            this.selectDesObj.help != \"\"\r\n          ) {\r\n            this.valHelp = Base64.decode(this.selectDesObj.help, \"utf-8\");\r\n          } else if (\r\n            this.selectDesObj.helpGlobal == \"\" &&\r\n            this.selectDesObj.help != \"\"\r\n          ) {\r\n            this.valHelp = Base64.decode(this.selectDesObj.help, \"utf-8\");\r\n          } else if (this.selectDesObj.helpGlobal != \"\") {\r\n            this.valHelp = Base64.decode(this.selectDesObj.helpGlobal, \"utf-8\");\r\n          }\r\n        });\r\n    },\r\n    closeDailog() {\r\n      this.relatedInformationDialog = false;\r\n    },\r\n    confirm() {\r\n      let data = {\r\n        data: this.formData.data || this.formData,\r\n        taskId: this.taskId || \"\",\r\n        defId: this.defId || \"\",\r\n        proInstId: this.instId || \"\",\r\n        actionName: \"agree\",\r\n        files: this.files,\r\n        zfiles: this.zfiles,\r\n        formType: \"inner\",\r\n        opinion: this.opinion,\r\n        agentLeaderId: this.leaderId,\r\n        isSendNodeUsers: \"1\"\r\n      };\r\n      if (this.formData.businessKey) {\r\n        data.formType = \"frame\";\r\n        data.businessKey = this.formData.businessKey;\r\n        data.sysCode = this.formData.sysCode;\r\n        if (this.formData.vars) {\r\n          data.vars = this.formData.vars;\r\n        }\r\n      }\r\n      //如果用户选择看目标节点，则将节点的跳转类也传到后台\r\n\r\n      data.destination = this.selectNodeId;\r\n      if (\r\n        !data.destination &&\r\n        this.selectDesObj.afterNodes &&\r\n        this.selectDesObj.afterNodes.length == 1\r\n      ) {\r\n        data.destination = this.selectDesObj.afterNodes[0].nodeId;\r\n      }\r\n      if (this.selectDesObj.jumpType) {\r\n        data.jumpType =\r\n          this.selectDesObj.jumpType == \"select\" ? \"select\" : \"free\";\r\n      }\r\n\r\n      let nodeUsers = [];\r\n      //遍历所有的节点将其所选择的节点。\r\n      if (this.selectDesObj && this.selectDesObj.choiceExcutor == \"candidate\") {\r\n        for (\r\n          let index = 0;\r\n          index < this.selectDesObj.afterNodes.length;\r\n          index++\r\n        ) {\r\n          const node = this.selectDesObj.afterNodes[index];\r\n          if (node.selectUserIds && node.selectUserIds.length > 0) {\r\n            const excutorList = node.excutorList;\r\n            const selectusers = [];\r\n            for (let index = 0; index < excutorList.length; index++) {\r\n              const user = excutorList[index];\r\n              if (user && node.selectUserIds.indexOf(user.id) > -1) {\r\n                selectusers.push(user);\r\n              }\r\n            }\r\n            nodeUsers.push({ nodeId: node.nodeId, executors: selectusers });\r\n          }\r\n        }\r\n      } else if (this.selectDesObj) {\r\n        for (\r\n          let index = 0;\r\n          index < this.selectDesObj.afterNodes.length;\r\n          index++\r\n        ) {\r\n          const node = this.selectDesObj.afterNodes[index];\r\n          if (node.selectUsers && node.selectUsers.length > 0) {\r\n            const excutorList = node.selectUsers;\r\n            const selectusers = [];\r\n            for (let index = 0; index < excutorList.length; index++) {\r\n              const user = excutorList[index];\r\n              selectusers.push({\r\n                id: user.id,\r\n                name: user.fullname,\r\n                type: \"user\"\r\n              });\r\n            }\r\n            nodeUsers.push({ nodeId: node.nodeId, executors: selectusers });\r\n          }\r\n        }\r\n      }\r\n\r\n      if (nodeUsers.length > 0) {\r\n        data.nodeUsers = JSON.stringify(nodeUsers);\r\n      }\r\n      if (window.urgentStateValue) {\r\n        data.urgentStateValue = window.urgentStateValue;\r\n      }\r\n      if (this.taskId) {\r\n        this.$confirm(\"确认办理此任务?\", \"提示\", {\r\n          cancelButtonText: \"取消\",\r\n          confirmButtonText: \"确定\",\r\n          type: \"warning\",\r\n          closeOnClickModal: false\r\n        }).then(() => {\r\n          this.disabled = true;\r\n          this.$store\r\n            .dispatch(\"storeProcess/complete\", data)\r\n            .then(() => {\r\n              this.$router.push(\"/inst/\" + this.proInstId + \"/doneList\");\r\n              // if(this.token!=null){\r\n              //   window.close();\r\n              // }else{\r\n              //   this.$router.go(-1);\r\n              // }\r\n            })\r\n            .catch(() => {\r\n              this.disabled = false;\r\n            });\r\n        });\r\n      } else {\r\n        if (this.curOrgPost && this.curOrgPost.org) {\r\n          data.startOrgId = this.curOrgPost.org.id;\r\n        }\r\n        this.disabled = true;\r\n        data.supportMobile = 1;\r\n        this.$store\r\n          .dispatch(\"storeProcess/start\", data)\r\n          .then(() => {\r\n            if (this.token != null) {\r\n              window.close();\r\n            } else {\r\n              this.$router.go(-1);\r\n            }\r\n          })\r\n          .catch(() => {\r\n            this.disabled = false;\r\n          });\r\n      }\r\n    }\r\n  }\r\n};\r\n",null]}