{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!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\\taskToTrans.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\flow\\task\\taskToTrans.vue","mtime":1667327529466},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\babel.config.js","mtime":1667327525434},{"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\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"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":["import \"core-js/modules/es6.regexp.split\";\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 OpinionText from \"@/components/common/opinionText.vue\";\nimport FileUpload from \"@/components/common/fileUpload.vue\";\nimport HtUserSelector from \"@/components/control/HtUserSelector.vue\";\nimport utils from \"@/utils.js\";\nimport req from \"@/request.js\";\nexport default {\n  name: \"taskToTrans\",\n  props: [\"taskId\", \"files\"],\n  components: {\n    OpinionText: OpinionText,\n    FileUpload: FileUpload,\n    HtUserSelector: HtUserSelector\n  },\n  data: function data() {\n    return {\n      transDialog: false,\n      users: \"\",\n      radioVote: \"1\",\n      //任务通过规则\n      decideType: \"agree\",\n      //计票策略\n      voteType: \"percent\",\n      //投票类型\n      voteAmount: \"100\",\n      //票数\n      signType: \"parallel\",\n      //流转类型\n      action: \"submit\",\n      //流转结束后的动作\n      isHight: false,\n      isVoteAmount: false,\n      token: utils.getUrlKey(\"token\"),\n      flowThis: \"\",\n      //flowAction的this\n      text: \"\",\n      //意见内容\n      boData: \"\",\n      //boData数据\n      opinionField: \"\",\n      //要回填的字段\n      appendStr: true,\n      initBoAttr: '',\n      appendOpinion: false //是否覆盖审批意见\n\n    };\n  },\n  methods: {\n    //获取意见\n    getOpinion: function getOpinion(opinion) {\n      this.text = opinion;\n      var opinioValue = this.$refs.opinionText.getOpinion();\n\n      if (this.opinionField) {\n        var currentUser = this.$store.state.user.currentUserDetail.user;\n\n        var moment = require(\"moment\");\n\n        var boData = this.boData;\n        var filed = this.opinionField.split(\".\");\n\n        if (boData[filed[0]][filed[1]] == '<p><br/></p>') {\n          boData[filed[0]][filed[1]] = \"\";\n        } //是否覆盖审批意见\n\n\n        if (this.appendOpinion) {\n          if (opinioValue) {\n            boData[filed[0]][filed[1]] = opinioValue + \"\\n\" + currentUser.fullname + \" \" + moment().format(\"YYYY-MM-DD HH:mm:ss\");\n          }\n        } else {\n          if (opinioValue) {\n            opinioValue += \"\\n\" + currentUser.fullname + \" \" + moment().format(\"YYYY-MM-DD HH:mm:ss\");\n          }\n\n          if (this.appendStr) {\n            this.initBoAttr = boData[filed[0]][filed[1]];\n          }\n\n          if (filed.length == 2) {\n            if (this.initBoAttr) {\n              if (opinion) {\n                boData[filed[0]][filed[1]] = this.initBoAttr + \"\\n\\n\" + opinioValue;\n              } else {\n                boData[filed[0]][filed[1]] = this.initBoAttr;\n              }\n            } else {\n              boData[filed[0]][filed[1]] = opinioValue;\n            }\n          }\n\n          this.appendStr = false;\n        }\n        /*else if (filed.length==3 &&boData[filed[0]][filed[1]].length>0){//处理子表\r\n          for (let i = 0; i <boData[filed[0]][filed[1]].length ; i++) {\r\n            boData[filed[0]][filed[1]][i][filed[2]]=opinioValue;\r\n          }\r\n        }*/\n\n      }\n    },\n    //选择投票类型\n    voteTypeChange: function voteTypeChange(value) {\n      if (value == \"percent\") {\n        this.isVoteAmount = true;\n      } else {\n        this.isVoteAmount = false;\n      }\n    },\n    //选择任务通过规则\n    setVote: function setVote(value) {\n      this.voteType = \"amount\";\n      this.voteAmount = \"1\";\n\n      if (value == \"1\") {\n        this.isHight = false;\n      } else if (value == \"2\") {\n        this.isHight = false;\n        this.decideType = \"refuse\";\n      } else if (value == \"3\") {\n        this.isHight = false;\n        this.decideType = \"agree\";\n      } else if (value == \"4\") {\n        this.isHight = true;\n      }\n    },\n    //鼠标点击页面其他其他位置不关闭弹框\n    handleClose: function handleClose(_this, opinionField, boData, appendOpinion) {\n      this.opinionField = opinionField;\n      this.boData = boData;\n      this.appendOpinion = appendOpinion;\n      this.flowThis = _this;\n      this.transDialog = true;\n    },\n    //执行前置脚本\n    runBeforeScript: function runBeforeScript() {\n      var _this = this;\n\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\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\n      if (result && result.then && typeof result.then == \"function\") {\n        return result;\n      }\n\n      if (result === false) return false;\n      return true;\n    },\n    //取消\n    cancel: function cancel() {\n      this.transDialog = false;\n      this.getOpinion(\"\");\n    },\n    //确认\n    confirm: function confirm() {\n      var _this2 = this;\n\n      if (this.users == \"\" || this.users == null) {\n        Message.warning(\"请选择流转人员\");\n        return;\n      } else if (this.$refs.opinionText.getOpinion() == \"\") {\n        Message.warning(\"请填写流转意见\");\n        return;\n      }\n\n      utils.getOnlineFormData(true).then(function (formDataStr) {\n        return _this2.submitConfirm(formDataStr);\n      }).catch(function (reason) {\n        return utils.handleGetFormDataReject(reason).then(function () {\n          return _this2.submitConfirm();\n        });\n      });\n    },\n    submitConfirm: function submitConfirm(formDataStr) {\n      var _this = this;\n\n      var scriptResult = this.runBeforeScript(); //执行前置脚本返回false时终止按钮操作\n\n      if (scriptResult === false) return; //执行前置脚本返回的接口时先执行前置事件接口\n\n      if (scriptResult.then && typeof scriptResult.then == \"function\") {\n        scriptResult.then(function () {\n          //接口返回成功则正常执行按钮操作\n          _this.funcDoNext(formDataStr);\n        }, function (fail) {\n          //接口返回失败则终止按钮操作，并给与提示\n          _this.$message.warning(fail);\n\n          return;\n        });\n      } else {\n        //执行前置脚本返回true时正常执行按钮操作\n        _this.funcDoNext(formDataStr);\n      }\n    },\n    funcDoNext: function funcDoNext(formDataStr) {\n      var _this3 = this;\n\n      utils.closeAllNotification();\n      var userId = \"\";\n\n      for (var i = 0; i < this.users.length; i++) {\n        userId = userId + this.users[i].id + \",\";\n      }\n\n      userId = userId.substring(0, userId.length - 1);\n      var data = {\n        taskId: this.taskId,\n        opinion: this.$refs.opinionText.getOpinion(),\n        userIds: userId\n      };\n\n      if (this.$refs.fileUpload.getFiles() != \"\") {\n        data.files = JSON.stringify(this.$refs.fileUpload.getFiles());\n      }\n\n      data.action = this.action;\n      data.decideType = this.decideType;\n      data.signType = this.signType;\n      data.voteAmount = this.voteAmount;\n      data.voteType = this.voteType;\n\n      if (formDataStr) {\n        data.data = Base64.encode(formDataStr);\n      }\n\n      data.formKey = this.flowThis.$refs.formContent.formKey;\n      this.$store.dispatch(\"storeProcess/taskToTrans\", data).then(function () {\n        _this3.transDialog = false;\n\n        if (_this3.token != null) {\n          window.close();\n        } else {\n          _this3.$router.go(-1);\n        }\n      });\n    }\n  }\n};",null]}