{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web\\src\\components\\flow\\task\\taskToEndProcess.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\components\\flow\\task\\taskToEndProcess.vue","mtime":1675214577151},{"path":"D:\\jenkins\\workspace\\xypm-web\\babel.config.js","mtime":1675214572901},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\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\nimport { mapState, mapActions } from \"vuex\";\nimport OpinionText from \"@/components/common/opinionText.vue\";\nimport FileUpload from \"@/components/common/fileUpload.vue\";\nimport { Message } from \"element-ui\";\nimport utils from \"@/utils.js\";\nimport req from \"@/request.js\";\nexport default {\n  name: \"taskToEndProcess\",\n  props: [\"taskId\"],\n  components: {\n    OpinionText: OpinionText,\n    FileUpload: FileUpload\n  },\n  data: function data() {\n    return {\n      endProcessDialog: false,\n      token: utils.getUrlKey(\"token\"),\n      flowThis: \"\" //flowAction的this\n    };\n  },\n\n  computed: mapState({\n    currentUser: function currentUser(state) {\n      return state.login.currentUser;\n    }\n  }),\n  methods: {\n    //鼠标点击页面其他其他位置不关闭弹框\n    handleClose: function handleClose(_this) {\n      this.flowThis = _this;\n      this.endProcessDialog = true;\n    },\n    //执行前置脚本\n    runBeforeScript: function runBeforeScript() {\n      var _this = this;\n      var item = utils.indexOfList(_this.flowThis.rowsBtn, \"alias\", _this.flowThis.btnAlias);\n      return _this.tempScript(item.beforeScript);\n    },\n    //执行前置脚本\n    tempScript: function tempScript(script) {\n      var _this = this;\n      var _req = req;\n      var boData = _this.flowThis.$refs.formContent.data;\n      var tempScript = \"var tempFunction = function(_req,data,_this){ \" + script + \"};\";\n      var result = eval(tempScript + \"tempFunction(_req,boData,_this);\");\n      if (result && result.then && typeof result.then == \"function\") {\n        return result;\n      }\n      if (result === false) return false;\n      return true;\n    },\n    //取消\n    cancel: function cancel() {\n      this.endProcessDialog = false;\n    },\n    //确认\n    confirm: function confirm() {\n      if (this.$refs.opinionText.getOpinion() == \"\") {\n        Message.warning(\"请填写终止原因\");\n        return;\n      }\n      var _this = this;\n      var scriptResult = this.runBeforeScript();\n      //执行前置脚本返回false时终止按钮操作\n      if (scriptResult === false) return;\n      //执行前置脚本返回的接口时先执行前置事件接口\n      if (scriptResult.then && typeof scriptResult.then == \"function\") {\n        scriptResult.then(function () {\n          //接口返回成功则正常执行按钮操作\n          _this.funcDoNext();\n        }, function (fail) {\n          //接口返回失败则终止按钮操作，并给与提示\n          _this.$message.warning(fail);\n          return;\n        });\n      } else {\n        //执行前置脚本返回true时正常执行按钮操作\n        _this.funcDoNext();\n      }\n    },\n    funcDoNext: function funcDoNext() {\n      var _this2 = this;\n      var files = \"\";\n      if (this.$refs.fileUpload.getFiles() != \"\") {\n        files = JSON.stringify(this.$refs.fileUpload.getFiles());\n      }\n      this.$store.dispatch(\"login/validAndCompletedCurrent\").then(function () {\n        var data = {\n          taskId: _this2.taskId,\n          endReason: _this2.$refs.opinionText.getOpinion(),\n          messageType: \"inner\",\n          account: _this2.currentUser.account,\n          files: files,\n          busDataObjectNode: {\n            test: \"我是测试数据,请在这里封装您需要的数据\"\n          }\n        };\n        _this2.$store.dispatch(\"storeProcess/doEndProcess\", data).then(function () {\n          _this2.endProcessDialog = false;\n          if (_this2.token != null) {\n            window.close();\n          } else {\n            //终止流程后返回到待办页面\n            _this2.$router.push(\"/v-flow/v-todo\");\n            //this.$router.go(-1);\n          }\n        });\n      });\n    }\n  }\n};",null]}