{"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\\taskToComplete.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\components\\flow\\task\\taskToComplete.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":["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\nimport OpinionText from \"@/components/common/opinionText.vue\";\nimport FileUpload from \"@/components/common/fileUpload.vue\";\nimport flow from \"@/api/flow.js\";\nimport { mapState } from \"vuex\";\nimport { Base64 } from \"js-base64\";\nexport default {\n  name: \"taskToComplete\",\n  props: [\"taskId\", \"leaderId\", \"opinion\", \"action\", \"instId\", \"signatureField\",\n  //自动签章字段\n  \"signatureCover\",\n  //自动签章是否覆盖\n  \"secretFree\" //自动签章时是否免密\n  ],\n\n  components: {\n    OpinionText: OpinionText,\n    FileUpload: FileUpload\n  },\n  data: function data() {\n    return {\n      dialogVisible: false,\n      dialogTitle: \"\",\n      text: \"\",\n      boData: {},\n      opinionField: \"\",\n      appendOpinion: false,\n      data: {},\n      appendStr: true,\n      wrap: \"\\n\",\n      initBoAttr: \"\",\n      signaturePassword: \"\",\n      isSignatureCallBack: false,\n      signatureLoading: null\n    };\n  },\n  computed: mapState({\n    signatureStatus: function signatureStatus(state) {\n      return state.storeProcess.signatureConfig.status;\n    }\n  }),\n  watch: {\n    signatureStatus: function signatureStatus(newVal, oldVal) {\n      if (newVal != 'start') {\n        this.isSignatureCallBack = true;\n      }\n      if (newVal === 'success' && oldVal === 'ing') {\n        this.doConfirm();\n      } else if (newVal === 'success' && oldVal === 'fail') {}\n      if (this.signatureLoading != null) {\n        this.signatureLoading.close();\n      }\n    }\n  },\n  methods: {\n    showDialog: function showDialog(opinionField, boData, appendOpinion, completeData) {\n      this.dialogVisible = true;\n      if (this.action == \"agree\" || this.action == \"agreeTrans\") {\n        this.dialogTitle = \"审批同意\";\n      } else if (this.action == \"oppose\" || this.action == \"opposeTrans\") {\n        this.dialogTitle = \"审批反对\";\n      }\n      this.data = completeData;\n      this.opinionField = opinionField;\n      this.boData = boData;\n      this.appendOpinion = appendOpinion;\n    },\n    afterOpen: function afterOpen() {\n      var _this2 = this;\n      if (this.opinionField) {\n        var con = document.querySelector(\"[model-name='data.\" + this.opinionField + \"']\");\n        if (con && con.__vue__ && con.__vue__.isEditor) {\n          this.wrap = \"<br>\";\n        }\n      }\n      var param = {\n        instId: this.instId,\n        taskId: this.taskId\n      };\n      flow.getBpmSaveOpinionByTeam(param).then(function (resp) {\n        if (resp.state && resp.value) {\n          _this2.getOpinion(resp.value);\n        } else {\n          if (_this2.action == \"agree\" || _this2.action == \"agreeTrans\") {\n            _this2.getOpinion(\"同意\");\n          } else if (_this2.action == \"oppose\" || _this2.action == \"opposeTrans\") {\n            _this2.getOpinion(\"反对\");\n          }\n        }\n      });\n    },\n    //获取意见\n    getOpinion: function getOpinion(opinion) {\n      this.text = opinion;\n      var opinioValue = this.$refs.opinionText.getOpinion();\n      if (this.opinionField) {\n        var currentUser = this.$store.state.user.currentUserDetail.user;\n        var moment = require(\"moment\");\n        var boData = this.boData;\n        var filed = this.opinionField.split(\".\");\n        if (boData[filed[0]][filed[1]] == '<p><br/></p>') {\n          boData[filed[0]][filed[1]] = \"\";\n        }\n        //是否覆盖审批意见\n        if (this.appendOpinion) {\n          if (opinioValue) {\n            boData[filed[0]][filed[1]] = opinioValue + this.wrap + currentUser.fullname + \" \" + moment().format(\"YYYY-MM-DD HH:mm:ss\");\n          }\n        } else {\n          if (opinioValue) {\n            opinioValue += this.wrap + currentUser.fullname + \" \" + moment().format(\"YYYY-MM-DD HH:mm:ss\");\n          }\n          if (this.appendStr) {\n            this.initBoAttr = boData[filed[0]][filed[1]];\n          }\n          if (filed.length == 2) {\n            if (this.initBoAttr) {\n              if (opinion) {\n                boData[filed[0]][filed[1]] = this.initBoAttr + this.wrap + this.wrap + opinioValue;\n              } else {\n                boData[filed[0]][filed[1]] = this.initBoAttr;\n              }\n            } else {\n              boData[filed[0]][filed[1]] = opinioValue;\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    cancel: function cancel() {\n      this.dialogVisible = false;\n      this.getOpinion(\"\");\n    },\n    confirm: function confirm() {\n      var _this3 = this;\n      if (this.action == \"agree\" && this.signatureField) {\n        var _this = this;\n        this.isSignatureCallBack = false;\n        this.$store.dispatch(\"storeProcess/initSignature\", {}).then(function (rep) {}); //点同意按钮先初始化状态\n        this.$store.dispatch(\"storeProcess/doSignature\", {\n          status: 'start',\n          field: this.signatureField,\n          isCover: this.signatureCover,\n          secretFree: this.secretFree,\n          password: this.signaturePassword\n        }).then(function (rep) {\n          _this.signatureLoading = _this3.$loading({\n            lock: true,\n            text: '正在进行签章处理...',\n            spinner: 'el-icon-loading',\n            background: 'rgba(0, 0, 0, 0.7)'\n          });\n          // 设置5秒超时机制，如果超时则弹出提示\n          setTimeout(function () {\n            _this.signatureLoading.close();\n            if (_this.isSignatureCallBack == false) {\n              _this.$message({\n                type: \"warning\",\n                message: \"签章处理超时，请联系管理员确定是否配置签章控件。\"\n              });\n              return;\n            }\n          }, 5000);\n        });\n      } else {\n        this.doConfirm();\n      }\n    },\n    doConfirm: function doConfirm() {\n      var _this4 = this;\n      if (this.$refs.fileUpload.getFiles() != \"\") {\n        this.data.files = JSON.stringify(this.$refs.fileUpload.getFiles());\n      }\n      if (this.$refs.opinionText.getOpinion()) {\n        this.data.opinion = this.$refs.opinionText.getOpinion();\n      } else {\n        this.$message({\n          type: \"warning\",\n          message: \"请输入审批意见\"\n        });\n        return;\n      }\n      this.data.data = Base64.encode(JSON.stringify(this.boData));\n      this.$store.dispatch(\"storeProcess/complete\", this.data).then(function () {\n        //this.$parent.nextTask();\n        // this.$emit(\"nextTask\");\n        _this4.$router.go(-1);\n      });\n    }\n  },\n  mounted: function mounted() {}\n};",null]}