{"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/system/organization/components/UserTransfer.vue?vue&type=script&lang=js","dependencies":[{"path":"/Users/admin/projects/dms/src/dealer_admin/src/views/system/organization/components/UserTransfer.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;\nrequire(\"core-js/modules/web.dom.iterable\");\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/admin\"));\nvar AdminAPI = API;\nvar DealerInviteAPI = _interopRequireWildcard(require(\"@/api/dealer_invite\"));\nvar OrganizationAPI = _interopRequireWildcard(require(\"@/api/organization\"));\nvar _lodash = _interopRequireDefault(require(\"lodash\"));\nvar Utils = _interopRequireWildcard(require(\"@/utils/validate\"));\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  components: {},\n  data: function data() {\n    return {\n      dateVal: \"\",\n      dialogFormVisible: false,\n      adminUserId: null,\n      dealerList: [],\n      userList: [],\n      transferDepts: [],\n      organizationList: [],\n      operationStatus: false,\n      organization: \"\"\n    };\n  },\n  computed: {},\n  created: function created() {\n    this.$forceUpdate();\n  },\n  methods: {\n    change: function change(index, user) {\n      this.$forceUpdate();\n      var dealerList = _lodash.default.cloneDeep(this.dealerList);\n      ;\n      var dealer = dealerList[index];\n      dealer.invite_user = user;\n      dealerList[index] = dealer;\n      this.dealerList = [];\n      this.dealerList = dealerList;\n    },\n    getAdminInviteDealerList: function () {\n      var _getAdminInviteDealerList = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {\n        var res, __error, msg, result;\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {\n          while (1) switch (_context.prev = _context.next) {\n            case 0:\n              this.dealerList = [];\n              _context.next = 3;\n              return DealerInviteAPI.getAdminInviteDealerList({\n                adminUserId: this.adminUserId\n              });\n            case 3:\n              res = _context.sent;\n              __error = res.__error, msg = res.msg, result = res.result;\n              if (__error == 0) {\n                this.dealerList = [];\n                this.dealerList = result.dealerList;\n                this.getAllAdminList();\n              }\n            case 6:\n            case \"end\":\n              return _context.stop();\n          }\n        }, _callee, this);\n      }));\n      function getAdminInviteDealerList() {\n        return _getAdminInviteDealerList.apply(this, arguments);\n      }\n      return getAdminInviteDealerList;\n    }(),\n    getAllAdminList: function () {\n      var _getAllAdminList = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {\n        var params, res;\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {\n          while (1) switch (_context2.prev = _context2.next) {\n            case 0:\n              params = {\n                organization: this.organization\n              };\n              _context2.next = 3;\n              return AdminAPI.getAllAdminList(params);\n            case 3:\n              res = _context2.sent;\n              this.userList = [];\n              this.userList = res.result.list;\n            case 6:\n            case \"end\":\n              return _context2.stop();\n          }\n        }, _callee2, this);\n      }));\n      function getAllAdminList() {\n        return _getAllAdminList.apply(this, arguments);\n      }\n      return getAllAdminList;\n    }(),\n    getOrganizationList: function () {\n      var _getOrganizationList = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {\n        var res, list;\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {\n          while (1) switch (_context3.prev = _context3.next) {\n            case 0:\n              _context3.next = 2;\n              return OrganizationAPI.getList({});\n            case 2:\n              res = _context3.sent;\n              list = res.result.list;\n              list = this.orgainization_merge(list, null);\n              this.organizationList = [];\n              this.organizationList = list;\n              console.log(\"list:\", list);\n            case 8:\n            case \"end\":\n              return _context3.stop();\n          }\n        }, _callee3, this);\n      }));\n      function getOrganizationList() {\n        return _getOrganizationList.apply(this, arguments);\n      }\n      return getOrganizationList;\n    }(),\n    orgainization_merge: function orgainization_merge(node) {\n      var _this = this;\n      var pid = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n      var arr = [];\n      node.forEach(function (v, index) {\n        if (v['parent'] == pid) {\n          v['children'] = _this.orgainization_merge(node, v['_id']);\n          arr.push(v);\n        }\n      });\n      if (arr.length <= 0) return null;else return arr;\n    },\n    init: function () {\n      var _init = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4(id, organization) {\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee4$(_context4) {\n          while (1) switch (_context4.prev = _context4.next) {\n            case 0:\n              this.dialogFormVisible = true;\n              this.adminUserId = id;\n              this.transferDept = [];\n              this.organization = organization;\n              this.getAdminInviteDealerList();\n              this.getOrganizationList();\n            case 6:\n            case \"end\":\n              return _context4.stop();\n          }\n        }, _callee4, this);\n      }));\n      function init(_x, _x2) {\n        return _init.apply(this, arguments);\n      }\n      return init;\n    }(),\n    submitConfirm: function submitConfirm() {\n      var _this2 = this;\n      this.$confirm(\"确认调任\", \"提示\").then(/*#__PURE__*/function () {\n        var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee5(_) {\n          return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {\n            while (1) switch (_context5.prev = _context5.next) {\n              case 0:\n                console.log(\"确认\");\n                _this2.dataFormSubmit();\n              case 2:\n              case \"end\":\n                return _context5.stop();\n            }\n          }, _callee5);\n        }));\n        return function (_x3) {\n          return _ref.apply(this, arguments);\n        };\n      }()).catch(function (_) {\n        //console.log(\"取消\");\n      });\n    },\n    dataFormSubmit: function () {\n      var _dataFormSubmit = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee6() {\n        var postData, resData, __error, msg;\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee6$(_context6) {\n          while (1) switch (_context6.prev = _context6.next) {\n            case 0:\n              if (!this.operationStatus) {\n                _context6.next = 2;\n                break;\n              }\n              return _context6.abrupt(\"return\", false);\n            case 2:\n              if (!(this.transferDepts.length <= 0)) {\n                _context6.next = 5;\n                break;\n              }\n              this.$message({\n                message: msg,\n                type: \"error\"\n              });\n              return _context6.abrupt(\"return\", false);\n            case 5:\n              postData = {\n                id: this.adminUserId,\n                dealerList: JSON.stringify(this.dealerList),\n                transferDept: this.transferDepts[this.transferDepts.length - 1] //指定最后一个\n              };\n              this.operationStatus = true;\n              _context6.next = 9;\n              return API.transfer(postData);\n            case 9:\n              resData = _context6.sent;\n              __error = resData.__error, msg = resData.msg;\n              if (__error == 0) {\n                this.$message({\n                  message: msg,\n                  type: \"success\"\n                });\n                this.$emit(\"refreshDataList\");\n                this.dialogFormVisible = false;\n              }\n              this.operationStatus = false;\n            case 13:\n            case \"end\":\n              return _context6.stop();\n          }\n        }, _callee6, this);\n      }));\n      function dataFormSubmit() {\n        return _dataFormSubmit.apply(this, arguments);\n      }\n      return dataFormSubmit;\n    }()\n  }\n};",null]}