{"remainingRequest":"/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/dealer/apply/components/review.vue?vue&type=script&lang=js","dependencies":[{"path":"/Users/admin/projects/dms/src/dealer_admin/src/views/dealer/apply/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/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":["\"use strict\";\n\nvar _interopRequireWildcard = require(\"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime/helpers/interopRequireWildcard.js\");\nvar _interopRequireDefault = require(\"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime/helpers/interopRequireDefault.js\");\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _regeneratorRuntime2 = _interopRequireDefault(require(\"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/regeneratorRuntime.js\"));\nrequire(\"regenerator-runtime/runtime\");\nvar _asyncToGenerator2 = _interopRequireDefault(require(\"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/asyncToGenerator.js\"));\nvar API = _interopRequireWildcard(require(\"@/api/dealer\"));\nvar ApprovalFlowStepAPI = _interopRequireWildcard(require(\"@/api/approval_flow_step\"));\nvar AdminAPI = _interopRequireWildcard(require(\"@/api/admin\"));\nvar _lodash = _interopRequireDefault(require(\"lodash\"));\nvar _IndustrySelect = _interopRequireDefault(require(\"@/views/components/IndustrySelect.vue\"));\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//\n//\n//\n//\n//\nvar _default = exports.default = {\n  name: 'Review',\n  components: {\n    IndustrySelect: _IndustrySelect.default\n  },\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      dealer_id: '',\n      dealerApplyLogInfo: null,\n      approvalFlowStepInfo: null,\n      approvalFlowUserTypeKey: {},\n      userList: []\n    };\n  },\n  computed: {},\n  created: function created() {},\n  methods: {\n    init: function () {\n      var _init = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(id) {\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {\n          while (1) switch (_context.prev = _context.next) {\n            case 0:\n              this.dealer_id = id;\n              this.initData();\n              this.getDealerApplyInfo();\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    getDealerApplyInfo: function () {\n      var _getDealerApplyInfo = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {\n        var resData, dealerApplyLogInfo;\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {\n          while (1) switch (_context2.prev = _context2.next) {\n            case 0:\n              _context2.next = 2;\n              return API.getDealerApplyInfo(this.dealer_id);\n            case 2:\n              resData = _context2.sent;\n              if (!(resData.__error == 0)) {\n                _context2.next = 14;\n                break;\n              }\n              dealerApplyLogInfo = resData.result.detail;\n              console.log(\"dealerApplyLogInfo:\", dealerApplyLogInfo);\n              if (!(dealerApplyLogInfo.review_status != 2)) {\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.dealerApplyLogInfo = dealerApplyLogInfo;\n              this.dialogFormVisible = true;\n              _context2.next = 13;\n              return this.getApprovalFlowStepList();\n            case 13:\n              if (this.dealerApplyLogInfo.review_step == 1) {\n                this.detail();\n              }\n            case 14:\n            case \"end\":\n              return _context2.stop();\n          }\n        }, _callee2, this);\n      }));\n      function getDealerApplyInfo() {\n        return _getDealerApplyInfo.apply(this, arguments);\n      }\n      return getDealerApplyInfo;\n    }(),\n    getApprovalFlowStepList: function () {\n      var _getApprovalFlowStepList = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {\n        var query, resData, flowStepList;\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {\n          while (1) switch (_context3.prev = _context3.next) {\n            case 0:\n              query = {\n                approval_flow: this.dealerApplyLogInfo.approval_flow\n              };\n              _context3.next = 3;\n              return ApprovalFlowStepAPI.list(query);\n            case 3:\n              resData = _context3.sent;\n              if (!(resData.__error == 0)) {\n                _context3.next = 14;\n                break;\n              }\n              flowStepList = resData.result.list;\n              if (!(this.dealerApplyLogInfo.review_step < flowStepList.length)) {\n                _context3.next = 14;\n                break;\n              }\n              //表示有下一步的步骤\n              this.approvalFlowStepInfo = flowStepList[this.dealerApplyLogInfo.review_step];\n              _context3.next = 10;\n              return this.getApprovalFlowUserTypeKey();\n            case 10:\n              console.log(\"approvalFlowStepInfo:\", this.approvalFlowStepInfo);\n              //表示上步骤指定\n              if (!(this.approvalFlowStepInfo && this.approvalFlowStepInfo.approval_user_type == this.approvalFlowUserTypeKey.specified_previous_step)) {\n                _context3.next = 14;\n                break;\n              }\n              _context3.next = 14;\n              return this.getAdminSuperiorList();\n            case 14:\n            case \"end\":\n              return _context3.stop();\n          }\n        }, _callee3, this);\n      }));\n      function getApprovalFlowStepList() {\n        return _getApprovalFlowStepList.apply(this, arguments);\n      }\n      return getApprovalFlowStepList;\n    }(),\n    getApprovalFlowUserTypeKey: function () {\n      var _getApprovalFlowUserTypeKey = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4() {\n        var resData;\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee4$(_context4) {\n          while (1) switch (_context4.prev = _context4.next) {\n            case 0:\n              _context4.next = 2;\n              return ApprovalFlowStepAPI.getApprovalFlowUserTypeKey();\n            case 2:\n              resData = _context4.sent;\n              this.approvalFlowUserTypeKey = resData.result.key;\n              console.log(\"approvalFlowUserTypeKey:\", this.approvalFlowUserTypeKey);\n            case 5:\n            case \"end\":\n              return _context4.stop();\n          }\n        }, _callee4, this);\n      }));\n      function getApprovalFlowUserTypeKey() {\n        return _getApprovalFlowUserTypeKey.apply(this, arguments);\n      }\n      return getApprovalFlowUserTypeKey;\n    }(),\n    detail: function () {\n      var _detail = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee5() {\n        var resData, dealer, form;\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {\n          while (1) switch (_context5.prev = _context5.next) {\n            case 0:\n              _context5.next = 2;\n              return API.getSimpleDetail(this.dealer_id);\n            case 2:\n              resData = _context5.sent;\n              if (resData.__error == 0) {\n                dealer = resData.result.detail;\n                form = JSON.parse(JSON.stringify(this.form));\n                form.industry = dealer.industry; //申请行业\n                form.business_main_products = dealer.business_main_products; //主要产品 \n                form.business_apply_area = dealer.business_apply_area; //申请区域\n                form.business_annual_sales_target = dealer.business_annual_sales_target; //年销售目标\n                form.business_minimum_inventory = dealer.business_minimum_inventory; //最小库存量\n                this.form = {};\n                this.form = form;\n                this.dialogFormVisible = true;\n              }\n            case 4:\n            case \"end\":\n              return _context5.stop();\n          }\n        }, _callee5, this);\n      }));\n      function detail() {\n        return _detail.apply(this, arguments);\n      }\n      return detail;\n    }(),\n    getAdminSuperiorList: function () {\n      var _getAdminSuperiorList = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee6() {\n        var resData;\n        return (0, _regeneratorRuntime2.default)().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 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee7() {\n        var _this = this;\n        var postData, resData, __error, msg;\n        return (0, _regeneratorRuntime2.default)().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.dealer_id;\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              _context7.next = 9;\n              return API.review(postData);\n            case 9:\n              resData = _context7.sent;\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 12:\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]}