{"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/components/report_list.vue?vue&type=script&lang=js","dependencies":[{"path":"/Users/admin/projects/dms/src/dealer_admin/src/views/report/components/report_list.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 _utils = require(\"@/utils\");\nvar _Pagination = _interopRequireDefault(require(\"@/components/Pagination\"));\nvar _review_log = _interopRequireDefault(require(\"./review_log.vue\"));\nvar _review = _interopRequireDefault(require(\"./review.vue\"));\nvar _reviewManagerModal = _interopRequireDefault(require(\"./reviewManagerModal.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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n// waves directive\n// import Handle from \"./handle.vue\";\nvar _default = exports.default = {\n  name: \"ReportList\",\n  components: {\n    //Handle,\n    Pagination: _Pagination.default,\n    ReviewLog: _review_log.default,\n    Review: _review.default,\n    ReviewManager: _reviewManagerModal.default\n  },\n  directives: {\n    waves: _waves.default\n  },\n  data: function data() {\n    return {\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      userid: '',\n      exportLoading: false\n    };\n  },\n  props: {\n    reportStatusMap: {\n      type: Object,\n      default: {}\n    },\n    reportTypeMap: {\n      type: Object,\n      default: {}\n    },\n    reportTypeList: {\n      type: Array,\n      default: []\n    }\n  },\n  created: function created() {\n    this.$forceUpdate();\n  },\n  methods: {\n    init: function () {\n      var _init = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(status) {\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {\n          while (1) switch (_context.prev = _context.next) {\n            case 0:\n              this.listQuery = {\n                page: 1,\n                limit: 10,\n                search: '',\n                type: '',\n                status: status\n              };\n              _context.next = 3;\n              return this.getList();\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    getList: function () {\n      var _getList = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {\n        var res, _res$result, total, list, userid;\n        return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {\n          while (1) switch (_context2.prev = _context2.next) {\n            case 0:\n              this.listLoading = true;\n              _context2.next = 3;\n              return API.list(this.listQuery);\n            case 3:\n              res = _context2.sent;\n              _res$result = res.result, total = _res$result.total, list = _res$result.list, userid = _res$result.userid;\n              this.total = total;\n              this.userid = userid;\n              this.list = [];\n              this.list = this.dataHandle(list);\n              this.listLoading = false;\n            case 10:\n            case \"end\":\n              return _context2.stop();\n          }\n        }, _callee2, 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    lookReviewLog: function lookReviewLog(id) {\n      var _this3 = this;\n      this.$nextTick(function () {\n        _this3.$refs.reviewLog.init(id);\n      });\n    },\n    exportExcel: function exportExcel() {\n      var _this4 = 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        var filterVal = [\"sales_opportunity_no\", \"type\", \"name\", \"main_product\", \"money\", \"content\", \"status\", \"dealer\", \"create_at\", \"handle_user\", \"handle_date\", \"handle_result\"];\n        var newList = _this4.list.map(function (e) {\n          //console.log(e);\n          return (0, _objectSpread2.default)({}, e);\n        });\n        console.log(\"newList:\", newList);\n        var data = _this4.formatJson(filterVal, newList);\n        console.log(\"data:\", data);\n        excel.export_json_to_excel({\n          header: tHeader,\n          data: data,\n          filename: \"报备中心\"\n        });\n        _this4.exportLoading = false;\n      });\n    },\n    formatJson: function formatJson(filterVal, jsonData) {\n      var _this5 = this;\n      return jsonData.map(function (v) {\n        return filterVal.map(function (j) {\n          if (j === \"type\") {\n            return _this5.reportTypeMap[v[j]] && _this5.reportTypeMap[v[j]] != undefined ? _this5.reportTypeMap[v[j]] : '';\n          } else if (j === \"status\") {\n            return _this5.reportStatusMap[v[j]] && _this5.reportStatusMap[v[j]] != undefined ? _this5.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 == \"handle_user\") {\n            return v.handle_user && v.handle_user != undefined ? v.handle_user.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    showReview: function showReview(id) {\n      var _this6 = this;\n      this.$nextTick(function () {\n        _this6.$refs.review.init(id);\n      });\n    },\n    showReviewManager: function showReviewManager(id) {\n      var _this7 = this;\n      this.$nextTick(function () {\n        _this7.$refs.reviewManager.init(id);\n      });\n    }\n  }\n};",null]}