{"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/report_list/index.vue?vue&type=script&lang=js","dependencies":[{"path":"/Users/admin/projects/dms/src/dealer_admin/src/views/report_list/index.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 _interopRequireWildcard3 = 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/es6.function.name\");\nvar _objectSpread2 = _interopRequireDefault(require(\"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/objectSpread2.js\"));\nvar _interopRequireWildcard2 = _interopRequireDefault(require(\"/Users/admin/projects/dms/src/dealer_admin/node_modules/@babel/runtime-corejs2/helpers/interopRequireWildcard.js\"));\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 = _interopRequireWildcard3(require(\"@/api/report.js\"));\nvar _waves = _interopRequireDefault(require(\"@/directive/waves\"));\nvar _Pagination = _interopRequireDefault(require(\"@/components/Pagination\"));\nvar _utils = require(\"@/utils\");\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//\n//\nvar _default = exports.default = {\n  name: \"ReportList\",\n  components: {\n    Pagination: _Pagination.default\n  },\n  directives: {\n    waves: _waves.default\n  },\n  data: function data() {\n    return {\n      reportStatusMap: {},\n      reportTypeList: [],\n      reportTypeMap: {},\n      list: [],\n      total: 0,\n      listLoading: false,\n      listQuery: {\n        page: 1,\n        limit: 10,\n        search: '',\n        status: -1,\n        type: ''\n      },\n      exportLoading: false\n    };\n  },\n  created: function created() {\n    this.init();\n  },\n  methods: {\n    init: function () {\n      var _init = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {\n          while (1) switch (_context.prev = _context.next) {\n            case 0:\n              this.getReportStatusMap();\n              this.getReportTypeList();\n              this.getReportTypeMap();\n              this.listQuery = {\n                page: 1,\n                limit: 10,\n                search: '',\n                type: '',\n                status: status\n              };\n              _context.next = 6;\n              return this.getList();\n            case 6:\n            case \"end\":\n              return _context.stop();\n          }\n        }, _callee, this);\n      }));\n      function init() {\n        return _init.apply(this, arguments);\n      }\n      return init;\n    }(),\n    getReportStatusMap: function () {\n      var _getReportStatusMap = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {\n        var res, map;\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.getReportStatusMap();\n            case 2:\n              res = _context2.sent;\n              map = res.result.map;\n              this.reportStatusMap = map;\n            case 5:\n            case \"end\":\n              return _context2.stop();\n          }\n        }, _callee2, this);\n      }));\n      function getReportStatusMap() {\n        return _getReportStatusMap.apply(this, arguments);\n      }\n      return getReportStatusMap;\n    }(),\n    getReportTypeList: function () {\n      var _getReportTypeList = (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 API.getReportTypeList();\n            case 2:\n              res = _context3.sent;\n              list = res.result.list;\n              this.reportTypeList = list;\n            case 5:\n            case \"end\":\n              return _context3.stop();\n          }\n        }, _callee3, this);\n      }));\n      function getReportTypeList() {\n        return _getReportTypeList.apply(this, arguments);\n      }\n      return getReportTypeList;\n    }(),\n    getReportTypeMap: function () {\n      var _getReportTypeMap = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4() {\n        var res, map;\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 API.getReportTypeMap();\n            case 2:\n              res = _context4.sent;\n              map = res.result.map;\n              this.reportTypeMap = map;\n            case 5:\n            case \"end\":\n              return _context4.stop();\n          }\n        }, _callee4, this);\n      }));\n      function getReportTypeMap() {\n        return _getReportTypeMap.apply(this, arguments);\n      }\n      return getReportTypeMap;\n    }(),\n    getList: function () {\n      var _getList = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee5() {\n        var res, _res$result, total, list;\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {\n          while (1) switch (_context5.prev = _context5.next) {\n            case 0:\n              this.listLoading = true;\n              _context5.next = 3;\n              return API.getAvailableList(this.listQuery);\n            case 3:\n              res = _context5.sent;\n              _res$result = res.result, total = _res$result.total, list = _res$result.list;\n              this.total = total;\n              this.list = [];\n              this.list = this.dataHandle(list);\n              this.listLoading = false;\n            case 9:\n            case \"end\":\n              return _context5.stop();\n          }\n        }, _callee5, this);\n      }));\n      function getList() {\n        return _getList.apply(this, arguments);\n      }\n      return getList;\n    }(),\n    dataHandle: function dataHandle(data) {\n      var list = [];\n      data.map(function (v) {\n        if (v.main_product) {\n          v.main_product = JSON.parse(v.main_product);\n        }\n        list.push(v);\n      });\n      return list;\n    },\n    handle: function handle(id) {\n      var _this = this;\n      this.$nextTick(function () {\n        _this.$refs.handle.init(id);\n      });\n    },\n    lookDetail: function lookDetail(id) {\n      var _this2 = this;\n      this.$nextTick(function () {\n        _this2.$refs.dealer.init(id);\n      });\n    },\n    handleFilter: function handleFilter() {\n      this.listQuery.page = 1;\n      this.getList();\n    },\n    exportExcel: function exportExcel() {\n      var _this3 = this;\n      this.exportLoading = true;\n      Promise.resolve().then(function () {\n        return (0, _interopRequireWildcard2.default)(require(\"@/vendor/Export2Excel\"));\n      }).then(function (excel) {\n        var tHeader = [\"销售机会编号\", \"类型\", \"名称\", \"主要产品\", \"金额（元）\", \"申请理由简介\", \"状态\", \"申请经销商\", \"申请日期\",\n        // \"处理人员\",\n        \"处理时间\", \"处理结果\"];\n        var filterVal = [\"sales_opportunity_no\", \"type\", \"name\", \"main_product\", \"money\", \"content\", \"status\", \"dealer\", \"create_at\",\n        // \"handle_user\",\n        \"handle_date\", \"handle_result\"];\n        var newList = _this3.list.map(function (e) {\n          //console.log(e);\n          return (0, _objectSpread2.default)({}, e);\n        });\n        console.log(\"newList:\", newList);\n        var data = _this3.formatJson(filterVal, newList);\n        console.log(\"data:\", data);\n        excel.export_json_to_excel({\n          header: tHeader,\n          data: data,\n          filename: \"报备列表\"\n        });\n        _this3.exportLoading = false;\n      });\n    },\n    formatJson: function formatJson(filterVal, jsonData) {\n      var _this4 = this;\n      return jsonData.map(function (v) {\n        return filterVal.map(function (j) {\n          if (j === \"type\") {\n            return _this4.reportTypeMap[v[j]] && _this4.reportTypeMap[v[j]] != undefined ? _this4.reportTypeMap[v[j]] : '';\n          } else if (j === \"status\") {\n            return _this4.reportStatusMap[v[j]] && _this4.reportStatusMap[v[j]] != undefined ? _this4.reportStatusMap[v[j]] : '';\n          } else if (j === \"handle_date\" || j == 'create_at') {\n            if (v[j] && v[j] != undefined) {\n              return (0, _utils.parseTime)(v[j], \"{y}-{m}-{d} {h}:{i}\");\n            }\n            return \"\";\n          } else if (j == \"dealer\") {\n            return v.dealer ? v.dealer.china_name : \"\";\n          } else if (j === \"main_product\") {\n            var str = \"\";\n            if (v[j]) {\n              for (var k = 0, ll = v[j].length; k < ll; k++) {\n                str += \"\\u4EA7\\u54C1\\u540D\\u79F0:\".concat(v[j][k].name, \"  \\u6570\\u91CF:\").concat(v[j][k].num, \"  \");\n              }\n            }\n            return str;\n          } else {\n            return v[j];\n          }\n        });\n      });\n    }\n  }\n};",null]}