{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\flow\\InstanceUrgent.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\flow\\InstanceUrgent.vue","mtime":1675071992835},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport { mapState, mapActions } from \"vuex\";\nimport { Message } from \"element-ui\";\nimport req from \"@/request.js\";\nexport default {\n  name: \"instanceUrgent\",\n  components: {},\n  data: function data() {\n    return {\n      disabled: false,\n      isTaskUser: true,\n      //是否有任务审批人\n      taskUrgentDialog: false,\n      excutor: [],\n      //节点审批人集合\n      appointee: [],\n      //被催办人\n      type: \"mail\",\n      //催办方式\n      contentMail: \"\",\n      //邮件催办内容\n      contentSms: \"\",\n      //短信催办内容\n      selectNodeId: '',\n      checkedNodes: [],\n      //选择了要催办的任务\n      appointeeSecretary: \"0\",\n      nodeList: [],\n      nodeDefMap: {},\n      instId: \"\",\n      defId: \"\",\n      subject: \"\"\n    };\n  },\n  methods: {\n    //鼠标点击页面其他其他位置不关闭弹框\n    handleOpen: function handleOpen(instId, defId, subject, nodeId) {\n      var _this = this;\n\n      this.instId = instId;\n      this.defId = defId;\n      this.subject = subject;\n      this.appointee = [];\n      this.taskUrgentDialog = true;\n      this.checkedNodes = [];\n      this.isTaskUser = true; //根据流程实例ID获取当前任务节点审批人\n\n      var this_ = this;\n      req.get(window.context.bpmRunTime + '/runtime/instance/v1/getExcutorNameByInstId?instId=' + instId).then(function (res) {\n        res = res.data;\n\n        if (res) {\n          //任务管理催办\n          if (nodeId) {\n            res.forEach(function (nodeDef) {\n              if (nodeId == nodeDef.nodeId) {\n                this_.nodeList = nodeDef;\n                this_.checkedNodes.push(nodeDef.nodeId); //给每个用户添加对应的任务节点\n\n                for (var i = 0; i < nodeDef.assigneeUsers.length; i++) {\n                  nodeDef.assigneeUsers[i].nodeId = nodeDef.nodeId;\n                  nodeDef.assigneeUsers[i].nodeName = nodeDef.name;\n                }\n\n                this_.nodeDefMap[nodeDef.nodeId] = nodeDef;\n              }\n            });\n          } else if (!nodeId) {\n            //实例管理催办\n            this_.nodeList = res;\n\n            if (res.length == 1) {\n              this_.checkedNodes.push(res[0].nodeId);\n            }\n\n            res.forEach(function (nodeDef) {\n              //给每个用户添加对应的任务节点\n              for (var i = 0; i < nodeDef.assigneeUsers.length; i++) {\n                nodeDef.assigneeUsers[i].nodeId = nodeDef.nodeId;\n                nodeDef.assigneeUsers[i].nodeName = nodeDef.name;\n              }\n\n              this_.nodeDefMap[nodeDef.nodeId] = nodeDef;\n            });\n          }\n        } //要催办的任务无审批人\n\n\n        if (res.length == 0) {\n          _this.isTaskUser = false;\n        }\n      }); //根据流程定义id获取流程信息\n\n      req.get(window.context.bpmModel + '/flow/def/v1/defGet?defId=' + defId).then(function (res) {\n        res = res.data;\n\n        if (res.urgentMailTel) {\n          _this.contentMail = res.urgentMailTel;\n        }\n\n        if (res.urgentSmsTel) {\n          _this.contentSms = res.urgentSmsTel;\n        }\n      });\n    },\n    //可选变量\n    handleCommand: function handleCommand(command) {\n      if (this.type == \"mail\") {\n        this.contentMail = this.contentMail + command;\n      } else if (this.type == \"sms\" || this.type == \"smsApproval\") {\n        this.contentSms = this.contentSms + command;\n      }\n    },\n    //取消\n    cancel: function cancel() {\n      this.taskUrgentDialog = false;\n    },\n    //确认\n    confirm: function confirm() {\n      var content = \"\"; //催办内容\n\n      if (this.type == \"mail\") {\n        content = this.contentMail;\n      } else if (this.type == \"sms\") {\n        content = this.contentSms;\n      }\n\n      if (this.checkedNodes.length == 0) {\n        Message.warning(\"被催办人不能为空\");\n        return;\n      }\n\n      if (this.appointee.length == 0) {\n        Message.warning(\"请选择被催办人\");\n        return;\n      }\n\n      if (content == \"\") {\n        Message.warning(\"请输入催办内容\");\n        return;\n      }\n\n      var isAppointeeSecretary = false;\n\n      if (this.appointeeSecretary == \"1\") {\n        isAppointeeSecretary = true;\n      }\n\n      var appointeeObj = {}; //给每个任务匹配对应的被催办人信息\n\n      for (var j = 0; j < this.checkedNodes.length; j++) {\n        appointeeObj[this.checkedNodes[j]] = [];\n\n        for (var i = 0; i < this.appointee.length; i++) {\n          if (this.appointee[i].nodeId == this.checkedNodes[j]) {\n            appointeeObj[this.checkedNodes[j]].push(this.appointee[i]);\n          }\n        }\n      }\n\n      var data = {\n        \"subject\": this.subject,\n        \"type\": this.type,\n        \"instId\": this.instId,\n        \"content\": content,\n        \"promoterId\": JSON.parse(sessionStorage.getItem(\"currentUser\")).userId,\n        \"appointeeObj\": appointeeObj,\n        \"promoter\": JSON.parse(sessionStorage.getItem(\"currentUser\")).username,\n        \"appointeeSecretary\": isAppointeeSecretary\n      };\n      var this_ = this;\n      this_.disabled = true;\n      req.post(window.context.bpmRunTime + '/runtime/instance/v1/sendUrgentByInstId', data).then(function (response) {\n        if (response.data.state) {\n          Message.success({\n            duration: 1500,\n            message: response.data.message,\n            onClose: function onClose() {\n              this_.taskUrgentDialog = false;\n              this_.disabled = false;\n            }\n          });\n        }\n      }).catch(function () {\n        this_.disabled = false;\n      });\n    }\n  }\n};",null]}