You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
48 KiB
1 lines
48 KiB
{"remainingRequest":"D:\\codeeeeee\\酒水代码\\后台管理\\admin_dHBzn\\node_modules\\babel-loader\\lib\\index.js!D:\\codeeeeee\\酒水代码\\后台管理\\admin_dHBzn\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\codeeeeee\\酒水代码\\后台管理\\admin_dHBzn\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\codeeeeee\\酒水代码\\后台管理\\admin_dHBzn\\node_modules\\iview-loader\\index.js??ref--0-2!D:\\codeeeeee\\酒水代码\\后台管理\\admin_dHBzn\\src\\pages\\product\\productList\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\codeeeeee\\酒水代码\\后台管理\\admin_dHBzn\\src\\pages\\product\\productList\\index.vue","mtime":1730271528587},{"path":"D:\\codeeeeee\\酒水代码\\后台管理\\admin_dHBzn\\babel.config.js","mtime":1729046415503},{"path":"D:\\codeeeeee\\酒水代码\\后台管理\\admin_dHBzn\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1729046421803},{"path":"D:\\codeeeeee\\酒水代码\\后台管理\\admin_dHBzn\\node_modules\\babel-loader\\lib\\index.js","mtime":1729046421506},{"path":"D:\\codeeeeee\\酒水代码\\后台管理\\admin_dHBzn\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1729046421803},{"path":"D:\\codeeeeee\\酒水代码\\后台管理\\admin_dHBzn\\node_modules\\vue-loader\\lib\\index.js","mtime":1729046430178},{"path":"D:\\codeeeeee\\酒水代码\\后台管理\\admin_dHBzn\\node_modules\\iview-loader\\index.js","mtime":1729046425643}],"contextDependencies":[],"result":["var _methods;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator.return && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport goodsDetail from \"@/pages/kefu/pc/components/goods_detail\";\nimport stockEdit from \"../components/stockEdit.vue\";\nimport expandRow from \"./tableExpand.vue\";\nimport productDetails from '../components/productDetails.vue';\nimport storeLabelList from \"@/components/storeLabelList\";\nimport userLabel from \"@/components/labelList\";\nimport couponList from \"@/components/couponList\";\nimport attribute from \"./attribute\";\nimport toExcel from \"../../../utils/Excel.js\";\nimport { mapState } from \"vuex\";\nimport taoBao from \"./taoBao\";\nimport dayjs from \"dayjs\";\nimport Setting from \"@/setting\";\nimport util from \"@/libs/util\";\nimport { staffListInfo } from \"@/api/store\";\nimport { getGoodHeade, getGoods, PostgoodsIsShow, treeListApi, productShowApi, productUnshowApi, storeProductApi, cascaderListApi, productCache, cacheDelete, setDeliveryType, productReviewApi, forcedRemovalApi, batchProcess, productGetTemplateApi, brandList, allSystemForm } from '@/api/product';\nimport { systemFormInfo } from '@/api/setting';\nimport { getSupplierList as _getSupplierList } from \"@/api/supplier\";\nimport { erpConfig, erpProduct } from \"@/api/erp\";\nimport exportExcel from \"@/utils/newToExcel.js\";\nexport default {\n name: \"product_productList\",\n components: {\n expandRow: expandRow,\n attribute: attribute,\n taoBao: taoBao,\n goodsDetail: goodsDetail,\n stockEdit: stockEdit,\n productDetails: productDetails,\n storeLabelList: storeLabelList,\n userLabel: userLabel,\n couponList: couponList\n },\n filters: {\n timeFormat: function timeFormat(value) {\n return dayjs(value * 1000).format(\"YYYY-MM-DD HH:mm\");\n }\n },\n computed: _objectSpread(_objectSpread(_objectSpread({}, mapState(\"admin/layout\", [\"isMobile\"])), mapState(\"admin/userLevel\", [\"categoryId\"])), {}, {\n labelWidth: function labelWidth() {\n return this.isMobile ? undefined : 75;\n },\n labelPosition: function labelPosition() {\n return this.isMobile ? \"top\" : \"right\";\n }\n }),\n data: function data() {\n return {\n formTypeList: [],\n formColumns: [{\n title: '表单标题',\n key: 'title',\n // align:'center',\n minWidth: 100\n }, {\n title: '表单类型',\n key: 'name',\n // align:'center',\n minWidth: 100\n }, {\n title: '是否必填',\n slot: 'require',\n // align:'center',\n minWidth: 100\n }],\n roterPre: Setting.roterPre,\n supplierList: [],\n header: {},\n //请求头部信息\n erpUrl: Setting.apiBaseURL + \"/file/upload/1\",\n template: false,\n modals: false,\n modalsType: false,\n delivery_type: [],\n grid: {\n xl: 7,\n lg: 8,\n md: 12,\n sm: 24,\n xs: 24\n },\n // 订单列表\n orderData: {\n page: 1,\n limit: 10,\n type: 6,\n status: \"\",\n time: \"\",\n real_name: \"\",\n store_id: \"\"\n },\n artFrom: {\n page: 1,\n limit: 15,\n cate_id: \"\",\n type: \"1\",\n store_name: \"\",\n excel: 0,\n supplier_id: \"\",\n store_id: \"\",\n brand_id: [],\n store_label_id: []\n },\n list: [],\n tableList: [],\n headeNum: [],\n treeSelect: [],\n isProductBox: false,\n loading: false,\n data: [],\n total: 0,\n props: {\n emitPath: false,\n multiple: true,\n checkStrictly: true\n },\n attrTemplate: false,\n ids: [],\n display: \"none\",\n formSelection: [],\n selectionCopy: [],\n checkBox: false,\n isAll: 0,\n data1: [],\n value1: [],\n alertShow: false,\n goodsId: \"\",\n columns3: [],\n openErp: false,\n // activeKey:1\n productId: 0,\n detailsVisible: false,\n batchModal: false,\n menuActive: 1,\n storeLabelShow: false,\n storeDataLabel: [],\n labelShow: false,\n dataLabel: [],\n coupon_ids: [],\n updateIds: [],\n updateName: [],\n couponName: [],\n //自定义留言下拉选择\n customList: [{\n value: \"text\",\n label: \"文本框\"\n }, {\n value: \"number\",\n label: \"数字\"\n }, {\n value: \"email\",\n label: \"邮件\"\n }, {\n value: \"data\",\n label: \"日期\"\n }, {\n value: \"time\",\n label: \"时间\"\n }, {\n value: \"id\",\n label: \"身份证\"\n }, {\n value: \"phone\",\n label: \"手机号\"\n }, {\n value: \"img\",\n label: \"图片\"\n }],\n customBtn: false,\n batchData: {\n system_form_id: 0,\n //自定义表单id\n cate_id: [],\n store_label_id: [],\n delivery_type: [],\n freight: 1,\n postage: 0,\n temp_id: 0,\n give_integral: 0,\n coupon_ids: [],\n label_id: [],\n recommend: [],\n custom_form: []\n },\n templateList: [],\n brandData: [],\n goodsDataLabel: [],\n isLabel: 0,\n checkUidList: [],\n isCheckBox: false,\n staffData: [],\n formList: []\n };\n },\n watch: {\n $route: function $route() {\n if (this.$route.fullPath === \"/product/product_list?type=5\") {\n this.getPath();\n }\n },\n formSelection: function formSelection(value) {\n // this.checkBox = value.length === this.tableList.length;\n },\n tableList: {\n deep: true,\n handler: function handler(value) {\n var _this = this;\n value.forEach(function (item) {\n _this.formSelection.forEach(function (itm) {\n if (itm.id === item.id) {\n item.checkBox = true;\n }\n });\n });\n var arr = this.tableList.filter(function (item) {\n return item.checkBox;\n });\n if (this.tableList.length) {\n this.checkBox = this.tableList.length === arr.length;\n } else {\n this.checkBox = false;\n }\n }\n },\n storeDataLabel: function storeDataLabel(value) {\n this.batchData.store_label_id = value.map(function (item) {\n return item.id;\n });\n // this.artFrom.store_label_id = value.map(item => item.id);\n },\n couponName: function couponName(value) {\n this.batchData.coupon_ids = value.map(function (item) {\n return item.id;\n });\n },\n dataLabel: function dataLabel(value) {\n this.batchData.label_id = value.map(function (item) {\n return item.id;\n });\n },\n 'batchData.system_form_id': function batchDataSystem_form_id(value) {\n this.customBtn = !!value;\n },\n 'batchData.freight': function batchDataFreight(value) {\n switch (value) {\n case 1:\n this.batchData.postage = 0;\n this.batchData.temp_id = 0;\n break;\n case 2:\n this.batchData.temp_id = 0;\n break;\n case 3:\n this.batchData.postage = 0;\n break;\n }\n }\n },\n created: function created() {\n var _this2 = this;\n this.getToken();\n this.staffList();\n productCache().then(function (res) {\n var info = res.data.info;\n if (!Array.isArray(info)) {\n _this2.alertShow = true;\n }\n }).catch(function (err) {\n _this2.$Message.error(err.msg);\n });\n this.getErpConfig();\n this.getBrandList();\n this.allFormList();\n },\n mounted: function mounted() {\n this.goodsCategory();\n this.getSupplierList();\n if (this.$route.fullPath === \"/product/product_list?type=5\") {\n this.getPath();\n } else {\n this.getDataList();\n }\n // this.getDataList();\n this.productGetTemplate();\n this.goodHeade();\n },\n activated: function activated(e) {\n this.getDataList();\n this.goodHeade();\n },\n beforeRouteEnter: function beforeRouteEnter(to, from, next) {\n next(function (vm) {\n if (from.path.indexOf(\"/admin/product/add_product\") != -1) {\n document.documentElement.scrollTop = to.meta.scollTopPosition;\n } else {\n if (vm.artFrom.page != 1 || vm.artFrom.cate_id != \"\" || vm.artFrom.type != \"1\" || vm.artFrom.store_name != \"\" || vm.artFrom.supplier_id != \"\" || vm.artFrom.brand_id.length != 0 || vm.goodsDataLabel.length != 0) {\n vm.artFrom = {\n page: 1,\n limit: 15,\n cate_id: \"\",\n type: \"1\",\n store_name: \"\",\n excel: 0,\n supplier_id: \"\",\n store_id: \"\",\n brand_id: [],\n store_label_id: []\n };\n vm.goodsDataLabel = [];\n var that = vm;\n setTimeout(function () {\n that.userSearchs();\n }, 500);\n } else {\n vm.userSearchs();\n }\n }\n });\n },\n beforeRouteLeave: function beforeRouteLeave(to, from, next) {\n if (from.meta.keepAlive) {\n from.meta.scollTopPosition = document.documentElement.scrollTop;\n }\n next();\n },\n methods: (_methods = {\n allReset: function allReset() {\n this.isAll = 0;\n this.isCheckBox = false;\n this.$refs.xTable.setAllCheckboxRow(false);\n this.checkUidList = [];\n },\n changeForm: function changeForm(e) {\n this.getSystemFormInfo(e, {\n type: 1\n });\n },\n getSystemFormInfo: function getSystemFormInfo(e, data) {\n var _this3 = this;\n systemFormInfo(e, data).then(function (res) {\n _this3.formTypeList = res.data.info;\n }).catch(function (err) {\n _this3.$Message.error(err.msg);\n });\n },\n allFormList: function allFormList() {\n var _this4 = this;\n allSystemForm().then(function (res) {\n _this4.formList = res.data;\n }).catch(function (err) {\n _this4.$Message.error(err.msg);\n });\n },\n checkboxItem: function checkboxItem(e) {\n console.log(3);\n var id = parseInt(e.rowid);\n var index = this.checkUidList.indexOf(id);\n if (index !== -1) {\n this.checkUidList = this.checkUidList.filter(function (item) {\n return item !== id;\n });\n } else {\n this.checkUidList.push(id);\n }\n },\n checkboxAll: function checkboxAll() {\n // 获取选中当前值\n var obj2 = this.$refs.xTable.getCheckboxRecords(true);\n console.log(13123);\n // 获取之前选中值\n var obj = this.$refs.xTable.getCheckboxReserveRecords(true);\n if (this.isAll == 0 && this.checkUidList.length <= obj.length && !this.isCheckBox) {\n obj = [];\n }\n obj = obj.concat(obj2);\n var ids = [];\n obj.forEach(function (item) {\n ids.push(parseInt(item.id));\n });\n this.checkUidList = ids;\n if (!obj2.length) {\n this.isCheckBox = false;\n }\n },\n allPages: function allPages(e) {\n this.isAll = e;\n if (e == 0) {\n this.$refs.xTable.toggleAllCheckboxRow();\n // this.checkboxAll();\n } else {\n if (!this.isCheckBox) {\n this.$refs.xTable.setAllCheckboxRow(true);\n this.isCheckBox = true;\n this.isAll = 1;\n } else {\n this.$refs.xTable.setAllCheckboxRow(false);\n this.isCheckBox = false;\n this.isAll = 0;\n }\n this.checkUidList = [];\n }\n },\n closeStoreLabel: function closeStoreLabel(label) {\n var index = this.goodsDataLabel.indexOf(this.goodsDataLabel.filter(function (d) {\n return d.id == label.id;\n })[0]);\n this.goodsDataLabel.splice(index, 1);\n // 商品标签id\n var storeActiveIds = [];\n this.goodsDataLabel.forEach(function (item) {\n storeActiveIds.push(item.id);\n });\n this.artFrom.store_label_id = storeActiveIds;\n this.userSearchs();\n },\n // 品牌列表\n getBrandList: function getBrandList() {\n var _this5 = this;\n brandList().then(function (res) {\n _this5.brandData = res.data;\n }).catch(function (err) {\n _this5.$Message.error(err.msg);\n });\n },\n //获取供应商列表;\n getSupplierList: function getSupplierList() {\n var _this6 = this;\n _getSupplierList().then( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _this6.supplierList = res.data;\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }()).catch(function (res) {\n _this6.$Message.error(res.msg);\n });\n },\n // 审核\n auditGoods: function auditGoods(row) {\n var _this7 = this;\n this.$modalForm(productReviewApi(row.id)).then(function () {\n _this7.getDataList();\n _this7.goodHeade();\n });\n },\n // 强制下架\n forcedRemoval: function forcedRemoval(row) {\n var _this8 = this;\n this.$modalForm(forcedRemovalApi(row.id)).then(function () {\n return _this8.getDataList();\n });\n },\n frontDownload: function frontDownload() {\n var a = document.createElement(\"a\"); //创建一个<a></a>标签\n a.href = \"/statics/ERP商品导入模板.xlsx\"; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.\n a.download = \"ERP商品导入模板.xlsx\"; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可\n a.style.display = \"none\"; // 障眼法藏起来a标签\n document.body.appendChild(a); // 将a标签追加到文档对象中\n a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了\n a.remove(); // 一次性的,用完就删除a标签\n },\n handleFormatError: function handleFormatError(file) {\n return this.$Message.error(\"必须上传xlsx格式文件\");\n },\n // 上传头部token\n getToken: function getToken() {\n this.header[\"Authori-zation\"] = \"Bearer \" + util.cookies.get(\"token\");\n },\n upFile: function upFile(res) {\n var _this9 = this;\n erpProduct({\n path: res.data.src\n }).then(function (res) {\n _this9.$Message.success(res.msg);\n _this9.getDataList();\n }).catch(function (err) {\n return _this9.$Message.error(err.msg);\n });\n },\n beforeUpload: function beforeUpload() {\n var _this10 = this;\n var promise = new Promise(function (resolve) {\n _this10.$nextTick(function () {\n resolve(true);\n });\n });\n return promise;\n },\n //erp配置\n getErpConfig: function getErpConfig() {\n var _this11 = this;\n erpConfig().then(function (res) {\n _this11.openErp = res.data.open_erp;\n }).catch(function (err) {\n _this11.$Message.error(err.msg);\n });\n },\n stockChange: function stockChange(stock) {\n var _this12 = this;\n this.tableList.forEach(function (item) {\n if (_this12.goodsId == item.id) {\n item.stock = stock;\n }\n });\n },\n // 库存管理\n stockControl: function stockControl(row) {\n this.goodsId = row.id;\n this.$refs.stock.modals = true;\n this.$refs.stock.productAttrs(row);\n },\n cancelDelivery: function cancelDelivery() {\n this.modalsType = false;\n this.delivery_type = [];\n },\n deliveryType: function deliveryType() {\n this.modalsType = true;\n },\n putDelivery: function putDelivery() {\n var _this13 = this;\n if (this.delivery_type.length === 0) {\n this.$Message.error(\"请选择要配送的商品\");\n } else {\n var data = {\n all: this.isAll,\n delivery_type: this.delivery_type,\n ids: this.checkUidList\n };\n // if (this.isAll == 0) {\n // data.ids = this.checkUidList;\n // }\n setDeliveryType(data).then(function (res) {\n _this13.$Message.success(res.msg);\n _this13.modalsType = false;\n _this13.delivery_type = [];\n _this13.isAll = 0;\n _this13.getDataList();\n }).catch(function (res) {\n _this13.$Message.error(res.msg);\n });\n }\n },\n // 商品详情\n lookGoods: function lookGoods(id) {\n this.goodsId = id;\n this.isProductBox = true;\n },\n closeAlert: function closeAlert() {\n var _this14 = this;\n cacheDelete().then(function (res) {\n _this14.$Message.success(res.msg);\n }).catch(function (err) {\n _this14.$Message.error(err.msg);\n });\n },\n getPath: function getPath() {\n this.columns2 = _toConsumableArray(this.columns);\n if (name !== \"1\" && name !== \"2\") {\n this.columns2.shift();\n }\n this.artFrom.page = 1;\n this.artFrom.type = this.$route.query.type.toString();\n this.getDataList();\n },\n changeMenu: function changeMenu(row, name, index) {\n var _this15 = this;\n switch (name) {\n case \"1\":\n this.$router.push({\n path: this.roterPre + \"/product/product_reply/\" + row.id\n });\n break;\n case \"2\":\n this.del(row, \"恢复商品\", index, name);\n break;\n case \"3\":\n this.del(row, \"移入回收站\", index, name);\n break;\n case \"4\":\n this.stockControl(row);\n break;\n case \"5\":\n this.$modalForm(forcedRemovalApi(row.id)).then(function () {\n _this15.getDataList();\n _this15.goodHeade();\n });\n break;\n case \"6\":\n this.$router.push({\n path: this.roterPre + \"/product/add_product/\",\n query: {\n copy: row.id\n }\n });\n break;\n }\n },\n // 数据导出;\n exports: function () {\n var _exports = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var th, filekey, data, fileName, formValidate, excelData, i, lebData;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n th = [], filekey = [], data = [], fileName = \"\";\n formValidate = this.artFrom;\n excelData = {};\n excelData.ids = this.checkUidList.join();\n if (this.isAll == 1) {\n excelData.all = 1;\n excelData.cate_id = formValidate.cate_id;\n excelData.type = formValidate.type;\n excelData.store_name = formValidate.store_name;\n excelData.supplier_id = formValidate.supplier_id;\n excelData.brand_id = formValidate.brand_id;\n excelData.store_label_id = formValidate.store_label_id;\n excelData.excel = formValidate.excel;\n }\n excelData.page = 1;\n i = 0;\n case 7:\n if (!(i < excelData.page + 1)) {\n _context2.next = 24;\n break;\n }\n _context2.next = 10;\n return this.getExcelData(excelData);\n case 10:\n lebData = _context2.sent;\n if (!fileName) fileName = lebData.filename;\n if (!filekey.length) {\n filekey = lebData.filekey;\n }\n if (!th.length) th = lebData.header;\n if (!lebData.export.length) {\n _context2.next = 19;\n break;\n }\n data = data.concat(lebData.export);\n excelData.page++;\n _context2.next = 21;\n break;\n case 19:\n exportExcel(th, filekey, fileName, data);\n return _context2.abrupt(\"return\");\n case 21:\n i++;\n _context2.next = 7;\n break;\n case 24:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function exports() {\n return _exports.apply(this, arguments);\n }\n return exports;\n }(),\n getExcelData: function getExcelData(excelData) {\n return new Promise(function (resolve, reject) {\n storeProductApi(excelData).then(function (res) {\n return resolve(res.data);\n });\n });\n },\n changeTemplate: function changeTemplate(e) {\n // this.template = e;\n },\n freight: function freight() {\n this.$refs.template.isTemplate = true;\n },\n // 批量上架\n onShelves: function onShelves() {\n var _this16 = this;\n if (this.isAll != 1 && this.checkUidList.length === 0) {\n this.$Message.warning(\"请选择要上架的商品\");\n } else {\n var data = {\n all: this.isAll,\n ids: this.checkUidList\n };\n if (this.isAll == 1) {\n data.where = {\n cate_id: this.artFrom.cate_id,\n excel: this.artFrom.excel,\n store_name: this.artFrom.store_name,\n type: this.artFrom.type\n };\n }\n productShowApi(data).then(function (res) {\n _this16.$Message.success(res.msg);\n _this16.goodHeade();\n _this16.getDataList();\n _this16.allReset();\n }).catch(function (res) {\n _this16.$Message.error(res.msg);\n });\n }\n },\n // 批量下架\n onDismount: function onDismount() {\n var _this17 = this;\n if (this.isAll != 1 && this.checkUidList.length === 0) {\n this.$Message.warning(\"请选择要下架的商品\");\n } else {\n var data = {\n all: this.isAll,\n ids: this.checkUidList\n };\n if (this.isAll == 1) {\n data.where = {\n cate_id: this.artFrom.cate_id,\n excel: this.artFrom.excel,\n store_name: this.artFrom.store_name,\n type: this.artFrom.type\n };\n }\n productUnshowApi(data).then(function (res) {\n _this17.$Message.success(res.msg);\n _this17.goodHeade();\n _this17.getDataList();\n _this17.allReset();\n }).catch(function (res) {\n _this17.$Message.error(res.msg);\n });\n }\n },\n // 添加淘宝商品成功\n onClose: function onClose() {\n this.modals = false;\n },\n // 复制淘宝\n onCopy: function onCopy() {\n this.$router.push({\n path: this.roterPre + \"/product/add_product\",\n query: {\n type: -1\n }\n });\n // this.modals = true;\n },\n // tab选择\n onClickTab: function onClickTab(name) {\n this.allReset();\n this.artFrom.type = name;\n // this.columns2 = [...this.columns];\n // if (name !== \"1\" && name !== \"2\") {\n // this.columns2.shift();\n // }\n // let obj = [...this.columns];\n // obj.shift();\n // obj.splice(8, 1);\n // this.columns3 = obj;\n // this.checkBox = false;\n this.artFrom.page = 1;\n this.getDataList();\n this.goodHeade();\n },\n // 下拉树\n handleCheckChange: function handleCheckChange(data) {\n var value = \"\";\n var title = \"\";\n this.list = [];\n this.artFrom.cate_id = 0;\n data.forEach(function (item, index) {\n value += \"\".concat(item.id, \",\");\n title += \"\".concat(item.title, \",\");\n });\n value = value.substring(0, value.length - 1);\n title = title.substring(0, title.length - 1);\n this.list.push({\n value: value,\n title: title\n });\n this.artFrom.cate_id = value;\n this.getDataList();\n },\n // 获取商品表单头数量\n goodHeade: function goodHeade() {\n var _this18 = this;\n // let data = {\n // store_name: this.artFrom.store_name,\n // cate_id: this.artFrom.cate_id || \"\",\n // supplier_id: this.artFrom.supplier_id || \"\",\n // store_id: this.artFrom.store_id || \"\",\n // brand_id: this.artFrom.brand_id || [],\n // store_label_id: this.artFrom.store_label_id || []\n // };\n getGoodHeade(this.artFrom).then(function (res) {\n _this18.headeNum = res.data.list;\n }).catch(function (res) {\n _this18.$Message.error(res.msg);\n });\n },\n // 商品分类;\n goodsCategory: function goodsCategory() {\n var _this19 = this;\n // treeListApi(1).then(res => {\n // this.treeSelect = res.data;\n // }).catch(res => {\n // this.$Message.error(res.msg);\n // })\n cascaderListApi(1).then(function (res) {\n _this19.data1 = res.data;\n }).catch(function (res) {\n _this19.$Message.error(res.msg);\n });\n },\n // 商品列表;\n getDataList: function getDataList() {\n var _this20 = this;\n this.loading = true;\n this.artFrom.cate_id = this.artFrom.cate_id || \"\";\n getGoods(this.artFrom).then(function (res) {\n var data = res.data;\n _this20.tableList = data.list;\n _this20.total = data.count;\n _this20.loading = false;\n _this20.$nextTick(function () {\n if (this.isAll == 1) {\n if (this.isCheckBox) {\n this.$refs.xTable.setAllCheckboxRow(true);\n } else {\n this.$refs.xTable.setAllCheckboxRow(false);\n }\n } else {\n var obj = this.$refs.xTable.getCheckboxReserveRecords(true);\n if (!this.checkUidList.length || this.checkUidList.length <= obj.length) {\n this.$refs.xTable.setAllCheckboxRow(false);\n }\n }\n });\n }).catch(function (res) {\n _this20.loading = false;\n _this20.$Message.error(res.msg);\n });\n },\n pageChange: function pageChange(currentPage) {\n this.artFrom.page = currentPage.currentPage;\n this.getDataList();\n // this.$refs.table.clearCurrentRow();\n },\n // cascaderSearchs(value, selectedData) {\n // this.artFrom.cate_id = value[value.length - 1];\n // this.userSearchs();\n // },\n // 表格搜索\n userSearchs: function userSearchs(e) {\n this.allReset();\n this.artFrom.page = 1;\n this.formSelection = [];\n this.goodHeade();\n this.getDataList();\n },\n // 上下架\n changeSwitch: function changeSwitch(row) {\n var _this21 = this;\n PostgoodsIsShow(row.id, row.is_show).then(function (res) {\n _this21.$Message.success(res.msg);\n _this21.goodHeade();\n _this21.getDataList();\n _this21.allReset();\n }).catch(function (res) {\n _this21.$Message.error(res.msg);\n _this21.goodHeade();\n _this21.getDataList();\n });\n },\n // 数据导出;\n exportData: function exportData() {\n var th = [\"商品名称\", \"商品简介\", \"商品分类\", \"价格\", \"库存\", \"销量\", \"收藏人数\"];\n var filterVal = [\"store_name\", \"store_info\", \"cate_name\", \"price\", \"stock\", \"sales\", \"collect\"];\n this.where.page = \"nopage\";\n getGoods(this.where).then(function (res) {\n var data = res.data.map(function (v) {\n return filterVal.map(function (k) {\n return v[k];\n });\n });\n var fileTime = Date.parse(new Date());\n var fileName = \"商户数据_\" + fileTime,\n fileType = \"xlsx\",\n sheetName = \"商户数据\";\n toExcel({\n th: th,\n data: data,\n fileName: fileName,\n fileType: fileType,\n sheetName: sheetName\n });\n });\n },\n // 属性弹出;\n attrTap: function attrTap() {\n this.attrTemplate = true;\n }\n }, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_methods, \"changeTemplate\", function changeTemplate(msg) {\n this.attrTemplate = msg;\n }), \"edit\", function edit(row) {\n this.$router.push({\n path: this.roterPre + \"/product/add_product/\" + row.id\n });\n }), \"del\", function del(row, tit, num, name) {\n var _this22 = this;\n var delfromData = {\n title: tit,\n num: num,\n url: \"product/product/\".concat(row.id),\n method: \"DELETE\",\n ids: \"\",\n tips: \"\\u786E\\u5B9A\\u8981\\u79FB\".concat(name == 2 ? '出' : '入', \"\\u56DE\\u6536\\u7AD9\\u5417\\uFF1F\")\n };\n this.$modalSure(delfromData).then(function (res) {\n _this22.$Message.success(res.msg);\n _this22.tableList.splice(num, 1);\n _this22.goodHeade();\n _this22.allReset();\n }).catch(function (res) {\n _this22.$Message.error(res.msg);\n });\n }), \"staffList\", function staffList() {\n var _this23 = this;\n staffListInfo().then(function (res) {\n _this23.staffData = res.data;\n }).catch(function (err) {\n _this23.$Message.error(err.msg);\n });\n }), \"details\", function details(id) {\n this.productId = id;\n this.detailsVisible = true;\n }), \"openBatch\", function openBatch() {\n this.isLabel = 0;\n this.batchModal = true;\n }), \"menuSelect\", function menuSelect(name) {\n this.menuActive = name;\n }), \"activeStoreData\", function activeStoreData(storeDataLabel) {\n this.storeLabelShow = false;\n if (this.isLabel) {\n this.goodsDataLabel = storeDataLabel;\n // 商品标签id\n var storeActiveIds = [];\n storeDataLabel.forEach(function (item) {\n storeActiveIds.push(item.id);\n });\n this.artFrom.store_label_id = storeActiveIds;\n this.userSearchs();\n } else {\n this.storeDataLabel = storeDataLabel;\n }\n }), \"storeLabelClose\", function storeLabelClose() {\n this.storeLabelShow = false;\n }), \"openStoreLabel\", function openStoreLabel(row) {\n this.storeLabelShow = true;\n this.$refs.storeLabel.storeLabel(JSON.parse(JSON.stringify(this.storeDataLabel)));\n }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_methods, \"openGoodsLabel\", function openGoodsLabel(row) {\n this.storeLabelShow = true;\n this.$refs.storeLabel.storeLabel(JSON.parse(JSON.stringify(this.goodsDataLabel)));\n this.isLabel = 1;\n }), \"tagClose\", function tagClose(id) {\n if (this.menuActive == 2) {\n var index = this.storeDataLabel.findIndex(function (item) {\n return item.id === id;\n });\n this.storeDataLabel.splice(index, 1);\n } else {\n var _index = this.dataLabel.findIndex(function (item) {\n return item.id === id;\n });\n this.dataLabel.splice(_index, 1);\n }\n }), \"activeData\", function activeData(dataLabel) {\n this.labelShow = false;\n this.dataLabel = dataLabel;\n }), \"labelClose\", function labelClose() {\n this.labelShow = false;\n }), \"openLabel\", function openLabel() {\n this.labelShow = true;\n this.$refs.userLabel.userLabel(JSON.parse(JSON.stringify(this.dataLabel)));\n }), \"addCoupon\", function addCoupon() {\n this.$refs.couponTemplates.isTemplate = true;\n this.$refs.couponTemplates.tableList();\n }), \"nameId\", function nameId(id, names) {\n this.coupon_ids = id;\n this.couponName = this.unique(names);\n }), \"handleClose\", function handleClose(name) {\n var index = this.couponName.indexOf(name);\n this.couponName.splice(index, 1);\n var couponIds = this.coupon_ids;\n couponIds.splice(index, 1);\n this.updateIds = couponIds;\n this.updateName = this.couponName;\n }), \"unique\", function unique(arr) {\n var res = new Map();\n return arr.filter(function (arr) {\n return !res.has(arr.id) && res.set(arr.id, 1);\n });\n }), \"addForm\", function addForm() {\n this.batchData.custom_form.push({\n key: Date.now(),\n title: '',\n label: '',\n status: 0\n });\n }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_methods, \"delForm\", function delForm(item) {\n var index = this.batchData.custom_form.findIndex(function (val) {\n return val === item;\n });\n if (index !== -1) {\n this.batchData.custom_form.splice(index, 1);\n }\n }), \"cancelBatch\", function cancelBatch() {\n this.batchModal = false;\n }), \"saveBatch\", function saveBatch() {\n var _this24 = this;\n if (this.customBtn && this.batchData.system_form_id == 0) {\n return this.$Message.warning('请选择自定义表单模板');\n }\n var data = {\n type: this.menuActive,\n ids: this.checkUidList,\n all: this.isAll,\n where: this.artFrom,\n data: this.batchData\n };\n batchProcess(data).then(function (res) {\n _this24.$Message.success(res.msg);\n _this24.batchModal = false;\n }).catch(function (res) {\n _this24.$Message.error(res.msg);\n });\n }), \"productGetTemplate\", function productGetTemplate() {\n var _this25 = this;\n productGetTemplateApi().then(function (res) {\n _this25.templateList = res.data;\n });\n }), \"customMessBtn\", function customMessBtn(e) {\n if (!e) {\n this.batchData.system_form_id = 0;\n }\n }), \"batchVisibleChange\", function batchVisibleChange() {\n this.batchData = {\n cate_id: [],\n store_label_id: [],\n delivery_type: [],\n freight: 1,\n postage: 0,\n temp_id: 0,\n give_integral: 0,\n coupon_ids: [],\n label_id: [],\n recommend: [],\n custom_form: [],\n system_form_id: 0\n };\n this.storeDataLabel = [];\n this.couponName = [];\n this.dataLabel = [];\n this.menuActive = 1;\n }))\n};",null]} |