{"remainingRequest":"/Users/admin/projects/dms/src/dealer_admin/node_modules/thread-loader/dist/cjs.js!/Users/admin/projects/dms/src/dealer_admin/node_modules/babel-loader/lib/index.js!/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js??ref--0-0!/Users/admin/projects/dms/src/dealer_admin/node_modules/vue-loader/lib/index.js??vue-loader-options!/Users/admin/projects/dms/src/dealer_admin/src/views/report/components/review.vue?vue&type=script&lang=js","dependencies":[{"path":"/Users/admin/projects/dms/src/dealer_admin/src/views/report/components/review.vue","mtime":1713161556000},{"path":"/Users/admin/projects/dms/src/dealer_admin/babel.config.js","mtime":1713161556000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.string.repeat\";\nimport \"core-js/modules/es6.function.name\";\nimport _regeneratorRuntime from \"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/esm/regeneratorRuntime.js\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/esm/asyncToGenerator.js\";\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 * as API from \"@/api/report\";\nimport * as ApprovalFlowStepAPI from \"@/api/approval_flow_step\";\nimport * as AdminAPI from \"@/api/admin\";\nimport _ from \"lodash\";\nimport { randomNumberString } from '@/utils/index.js';\nexport default {\n  name: 'Review',\n  components: {},\n  data: function data() {\n    return {\n      editorOption: {},\n      dialogFormVisible: false,\n      textMap: {\n        add: \"新增\",\n        update: \"编辑\"\n      },\n      value: '',\n      // 新增更新相关\n      dialogStatus: \"add\",\n      disabled: false,\n      form: {},\n      reviewResult: null,\n      reviewOptions: [{\n        value: 1,\n        label: '通过'\n      }, {\n        value: 2,\n        label: '拒绝'\n      }],\n      reportId: '',\n      reportInfo: null,\n      approvalFlowStepInfo: null,\n      approvalFlowUserTypeKey: {},\n      userList: [],\n      optionStatus: false\n    };\n  },\n  computed: {},\n  created: function created() {},\n  methods: {\n    init: function () {\n      var _init = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(id) {\n        return _regeneratorRuntime().wrap(function _callee$(_context) {\n          while (1) switch (_context.prev = _context.next) {\n            case 0:\n              this.reportId = id;\n              this.initData();\n              this.getDetail();\n            case 3:\n            case \"end\":\n              return _context.stop();\n          }\n        }, _callee, this);\n      }));\n      function init(_x) {\n        return _init.apply(this, arguments);\n      }\n      return init;\n    }(),\n    initData: function initData() {\n      this.form = {};\n      this.approvalFlowStepInfo = null;\n    },\n    getDetail: function () {\n      var _getDetail = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n        var resData, reportInfo;\n        return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n          while (1) switch (_context2.prev = _context2.next) {\n            case 0:\n              _context2.next = 2;\n              return API.detail(this.reportId);\n            case 2:\n              resData = _context2.sent;\n              if (!(resData.__error == 0)) {\n                _context2.next = 13;\n                break;\n              }\n              console.log(\"resData:\", resData);\n              reportInfo = resData.result.detail;\n              if (!(reportInfo.status != 1)) {\n                _context2.next = 9;\n                break;\n              }\n              this.$message({\n                message: \"审核已结束\",\n                type: \"error\"\n              });\n              return _context2.abrupt(\"return\", false);\n            case 9:\n              this.dialogFormVisible = true;\n              this.reportInfo = reportInfo;\n              this.getApprovalFlowStepList();\n              this.checkRepeat();\n            case 13:\n            case \"end\":\n              return _context2.stop();\n          }\n        }, _callee2, this);\n      }));\n      function getDetail() {\n        return _getDetail.apply(this, arguments);\n      }\n      return getDetail;\n    }(),\n    checkRepeat: function () {\n      var _checkRepeat = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n        var params, resData, repeat;\n        return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n          while (1) switch (_context3.prev = _context3.next) {\n            case 0:\n              params = {\n                searchKey: this.reportInfo.name\n              };\n              _context3.next = 3;\n              return API.checkRepeat(params);\n            case 3:\n              resData = _context3.sent;\n              if (resData.__error == 0) {\n                repeat = resData.result.repeat;\n                if (repeat) {\n                  this.$message({\n                    message: \"该销售机会可能重复，请注意！！！\",\n                    type: \"error\"\n                  });\n                }\n              }\n            case 5:\n            case \"end\":\n              return _context3.stop();\n          }\n        }, _callee3, this);\n      }));\n      function checkRepeat() {\n        return _checkRepeat.apply(this, arguments);\n      }\n      return checkRepeat;\n    }(),\n    getApprovalFlowStepList: function () {\n      var _getApprovalFlowStepList = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n        var query, resData, flowStepList;\n        return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n          while (1) switch (_context4.prev = _context4.next) {\n            case 0:\n              query = {\n                approval_flow: this.reportInfo.approval_flow\n              };\n              _context4.next = 3;\n              return ApprovalFlowStepAPI.list(query);\n            case 3:\n              resData = _context4.sent;\n              if (!(resData.__error == 0)) {\n                _context4.next = 15;\n                break;\n              }\n              flowStepList = resData.result.list;\n              if (!(this.reportInfo.review_step < flowStepList.length)) {\n                _context4.next = 15;\n                break;\n              }\n              //表示有下一步的步骤\n              this.approvalFlowStepInfo = flowStepList[this.reportInfo.review_step];\n              console.log(\"flowStepList:\", flowStepList);\n              _context4.next = 11;\n              return this.getApprovalFlowUserTypeKey();\n            case 11:\n              console.log(\"approvalFlowStepInfo:\", this.approvalFlowStepInfo);\n              //表示上步骤指定\n              if (!(this.approvalFlowStepInfo && this.approvalFlowStepInfo.approval_user_type == this.approvalFlowUserTypeKey.specified_previous_step)) {\n                _context4.next = 15;\n                break;\n              }\n              _context4.next = 15;\n              return this.getAdminSuperiorList();\n            case 15:\n            case \"end\":\n              return _context4.stop();\n          }\n        }, _callee4, this);\n      }));\n      function getApprovalFlowStepList() {\n        return _getApprovalFlowStepList.apply(this, arguments);\n      }\n      return getApprovalFlowStepList;\n    }(),\n    getApprovalFlowUserTypeKey: function () {\n      var _getApprovalFlowUserTypeKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {\n        var resData;\n        return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n          while (1) switch (_context5.prev = _context5.next) {\n            case 0:\n              _context5.next = 2;\n              return ApprovalFlowStepAPI.getApprovalFlowUserTypeKey();\n            case 2:\n              resData = _context5.sent;\n              this.approvalFlowUserTypeKey = resData.result.key;\n              console.log(\"approvalFlowUserTypeKey:\", this.approvalFlowUserTypeKey);\n            case 5:\n            case \"end\":\n              return _context5.stop();\n          }\n        }, _callee5, this);\n      }));\n      function getApprovalFlowUserTypeKey() {\n        return _getApprovalFlowUserTypeKey.apply(this, arguments);\n      }\n      return getApprovalFlowUserTypeKey;\n    }(),\n    getAdminSuperiorList: function () {\n      var _getAdminSuperiorList = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {\n        var resData;\n        return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n          while (1) switch (_context6.prev = _context6.next) {\n            case 0:\n              _context6.next = 2;\n              return AdminAPI.getAdminSuperiorList();\n            case 2:\n              resData = _context6.sent;\n              this.userList = [];\n              this.userList = resData.result;\n            case 5:\n            case \"end\":\n              return _context6.stop();\n          }\n        }, _callee6, this);\n      }));\n      function getAdminSuperiorList() {\n        return _getAdminSuperiorList.apply(this, arguments);\n      }\n      return getAdminSuperiorList;\n    }(),\n    change: function change(e) {\n      this.$forceUpdate();\n    },\n    review: function () {\n      var _review = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {\n        var _this = this;\n        var postData, resData, __error, msg;\n        return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n          while (1) switch (_context7.prev = _context7.next) {\n            case 0:\n              postData = JSON.parse(JSON.stringify(this.form));\n              postData.id = this.reportId;\n              postData.reviewResult = this.reviewResult;\n              console.log(\"postData:\", postData);\n              if (!(postData.reviewResult != 1 && postData.reviewResult != 2)) {\n                _context7.next = 7;\n                break;\n              }\n              this.$message({\n                message: \"请选择审核结果\",\n                type: \"error\"\n              });\n              return _context7.abrupt(\"return\", false);\n            case 7:\n              if (!this.optionStatus) {\n                _context7.next = 9;\n                break;\n              }\n              return _context7.abrupt(\"return\", false);\n            case 9:\n              this.optionStatus = true;\n              _context7.next = 12;\n              return API.review(postData);\n            case 12:\n              resData = _context7.sent;\n              this.optionStatus = false;\n              __error = resData.__error, msg = resData.msg;\n              if (__error == 0) {\n                this.$message({\n                  message: msg,\n                  type: \"success\",\n                  duration: 1501,\n                  onClose: function onClose() {}\n                });\n                this.dialogFormVisible = false;\n                setTimeout(function () {\n                  _this.$emit(\"refreshDataList\");\n                }, 500);\n              }\n            case 16:\n            case \"end\":\n              return _context7.stop();\n          }\n        }, _callee7, this);\n      }));\n      function review() {\n        return _review.apply(this, arguments);\n      }\n      return review;\n    }()\n  }\n};",null]}