index.js 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804
  1. exports.ids = [63,16,19];
  2. exports.modules = {
  3. /***/ 159:
  4. /***/ (function(module, exports) {
  5. // Exports
  6. module.exports = {
  7. };
  8. /***/ }),
  9. /***/ 182:
  10. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11. "use strict";
  12. __webpack_require__.r(__webpack_exports__);
  13. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Pagination_vue_vue_type_style_index_0_id_044ef958_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(159);
  14. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Pagination_vue_vue_type_style_index_0_id_044ef958_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Pagination_vue_vue_type_style_index_0_id_044ef958_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  15. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Pagination_vue_vue_type_style_index_0_id_044ef958_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Pagination_vue_vue_type_style_index_0_id_044ef958_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  16. /***/ }),
  17. /***/ 183:
  18. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19. "use strict";
  20. /* unused harmony export formatPrice */
  21. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return round; });
  22. /* unused harmony export transformNumber */
  23. /* unused harmony export getUnit */
  24. /* unused harmony export getSetup */
  25. /* unused harmony export getPrint */
  26. /* unused harmony export getAddon */
  27. /* unused harmony export getPackaging */
  28. /* unused harmony export getFright */
  29. /* harmony import */ var number_precision__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(121);
  30. /* harmony import */ var number_precision__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(number_precision__WEBPACK_IMPORTED_MODULE_0__);
  31. // 商品价格计算相关
  32. // 价格格式化
  33. function formatPrice(value, needSymbol = true) {
  34. // 不能在最后一步显示之前格式化999 111, 否则可能出现单价1买999个得到999价格被格式化成poa的情况
  35. if (value === 0) {
  36. return needSymbol ? '£0.00' : '0.00';
  37. } else {
  38. return needSymbol ? `£${value}` : `${value}`;
  39. }
  40. }
  41. // 简单的乘法换算
  42. function multiply(value, ratio = 100) {
  43. return parseFloat((value * ratio).toPrecision(12));
  44. }
  45. // 小数处理, 四舍五入, 为toFixed做准备
  46. function round(number, ratio = 100) {
  47. return Math.round(multiply(number, ratio)) / ratio;
  48. }
  49. /**
  50. * 将字符串简单转换成数字, 并可数倍转换. 注意, 这个适用于整数倍(商品件数), 非整数的不能用这个处理小数.
  51. * @param {*} value 目标值
  52. * @param {*} ratio 倍数, 默认1
  53. * @returns number | origin, 转换后的数字, 无法转成数字的返回原值
  54. */
  55. function transformNumber(value, ratio = 1) {
  56. const v = Number(value);
  57. if (Number.isNaN(v)) {
  58. return value;
  59. } else {
  60. // 保留两位小数
  61. return Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["divide"])(Math.trunc(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(v, ratio), 100)), 100);
  62. }
  63. }
  64. // unit 单个商品的, 没有乘数量. 因为含有111 999 这些极端值, 没有格式化输出之前直接乘回出问题的.
  65. const getUnit = function (buyNum, index, attributeList, basePriceList) {
  66. // 算出购买数量位于 价格阶梯的 哪个区间
  67. const candidate = Object.entries(attributeList).filter(item => buyNum >= item[1]);
  68. let key = 'website_qty1';
  69. if (candidate.length) {
  70. key = candidate.pop()[0];
  71. }
  72. return transformNumber(basePriceList[index][key], buyNum);
  73. };
  74. // 打印和附加价格 的steup之和. 商品基础价格现在没有setup了.
  75. const getSetup = function (buyNum, form, additionList) {
  76. const sum = Object.entries(form).reduce((total, current) => {
  77. let s = 0;
  78. // 打印服务表单的数据跟附加服务表单的数据结构不一致, 以数字id字符串键名的是打印服务的数据
  79. if (/\d+/.test(current[0]) && current[1].enable) {
  80. const temp = current[1].colorForm.filter(i => i.id === current[1].printService);
  81. let colorNumber = 1;
  82. if (temp.length) {
  83. colorNumber = temp[0].colorNumber;
  84. }
  85. const decoration = current[1].decorationList.filter(i => i.id === current[1].printService);
  86. let setup = 0;
  87. if (decoration.length) {
  88. setup = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(Number(decoration[0].website_setup), Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(Number(decoration[0].supplier_setup), colorNumber - 1));
  89. }
  90. s = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(s, setup);
  91. } else if (current[1].length) {
  92. // 附加服务的表单数据, 有值说明该项有选中了附加服务
  93. const addition = additionList[current[0]].filter(addition => current[1].includes(addition.id));
  94. if (addition.length) {
  95. const temp = addition.reduce((t, c) => {
  96. let value = Number(c.website_setup);
  97. if ([5, 6].includes(c.website_setup_id)) {
  98. // 5是poa, 6是waived. 这种情况一般setup是留空的, 不留空大概是异常数据, 重置0保险一点.
  99. value = 0;
  100. }
  101. return Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(t, Number.isNaN(value) ? 0 : value);
  102. }, 0);
  103. s = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(s, temp);
  104. }
  105. }
  106. total = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(total, s);
  107. return total;
  108. }, 0);
  109. return transformNumber(sum);
  110. };
  111. // 打印价格的 阶梯基础价*购买数量.
  112. const getPrint = function (buyNum, form, attributeList) {
  113. // 算出购买数量位于 价格阶梯的 哪个区间
  114. const candidate = Object.entries(attributeList).filter(item => buyNum >= item[1]);
  115. const key = `website_qty${candidate.length}`;
  116. const key2 = `supplier_qty${candidate.length}`;
  117. // 如果其中一项为POA, 则‘和’都是POA
  118. const result = Object.entries(form).reduce((total, current) => {
  119. if (total === 'POA') {
  120. return total;
  121. }
  122. let sum = 0;
  123. if (/\d+/.test(current[0]) && current[1].enable) {
  124. const temp = current[1].colorForm.filter(i => i.id === current[1].printService);
  125. let colorNumber = 1;
  126. if (temp.length) {
  127. colorNumber = temp[0].colorNumber;
  128. }
  129. const decoration = current[1].decorationList.filter(i => i.id === current[1].printService);
  130. // 打印价格的基础价. 其中数字111(代表'-') 和999(代表'POA')
  131. const p1 = transformNumber(decoration[0][key]);
  132. if (p1 === 999 || p1 === 111 || typeof p1 !== 'number') {
  133. return 'POA';
  134. }
  135. // 打印价格的附加价
  136. const p2 = transformNumber(decoration[0][key2]);
  137. if (p2 === 999 || p2 === 111 || typeof p2 !== 'number') {
  138. return 'POA';
  139. }
  140. let price = 0;
  141. if (decoration.length) {
  142. price = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(p1, Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(p2, colorNumber - 1));
  143. }
  144. sum = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(sum, price);
  145. }
  146. total = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(total, sum);
  147. return total;
  148. }, 0);
  149. return transformNumber(result, buyNum);
  150. };
  151. // 附加服务除了packing之外的总价
  152. const getAddon = function (buyNum, form, attributeList, additionList) {
  153. // 算出购买数量位于 价格阶梯的 哪个区间
  154. const candidate = Object.entries(attributeList).filter(item => buyNum >= item[1]);
  155. const key = `website_qty${candidate.length}`;
  156. const result = Object.entries(form).reduce((total, current) => {
  157. if (total === 'POA') {
  158. return total;
  159. }
  160. let sum = 0;
  161. if (!/\d+/.test(current[0]) && current[0] !== 'packaging') {
  162. sum = additionList[current[0]].filter(item => current[1].includes(item.id)).reduce((t, c) => {
  163. if (t === 'POA') {
  164. return t;
  165. }
  166. let temp = transformNumber(c[key]);
  167. if (temp === 999 || temp === 111 || typeof temp !== 'number') {
  168. temp = 0;
  169. return 'POA';
  170. }
  171. t = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(t, temp);
  172. return t;
  173. }, 0);
  174. }
  175. return Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(total, sum);
  176. }, 0);
  177. return transformNumber(result, buyNum);
  178. };
  179. // 附加服务中 packing 的价格
  180. const getPackaging = function (buyNum, form, attributeList, additionList) {
  181. // 算出购买数量位于 价格阶梯的 哪个区间
  182. const candidate = Object.entries(attributeList).filter(item => buyNum >= item[1]);
  183. const key = `website_qty${candidate.length}`;
  184. const result = Object.entries(form).reduce((total, current) => {
  185. if (total === 'POA') {
  186. return total;
  187. }
  188. let sum = 0;
  189. if (!/\d+/.test(current[0]) && current[0] === 'packaging') {
  190. sum = additionList[current[0]].filter(item => current[1].includes(item.id)).reduce((t, c) => {
  191. if (t === 'POA') {
  192. return t;
  193. }
  194. let temp = transformNumber(c[key]);
  195. if (temp === 999 || temp === 111 || typeof temp !== 'number') {
  196. temp = 0;
  197. return 'POA';
  198. }
  199. t = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(t, temp);
  200. return t;
  201. }, 0);
  202. }
  203. return Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(total, sum);
  204. }, 0);
  205. return transformNumber(result, buyNum);
  206. };
  207. // 运费计算. 从product页面抄过来的逻辑. +号是隐式类型转换
  208. const getFright = function (buyNum, config, freight, weight, ratio = 1) {
  209. // 单独批次数量的总重
  210. const totalWeight = Math.ceil(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(+weight.unit_w_local, buyNum));
  211. const expressFactor = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(1, Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["divide"])(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(+config.express_freight, +config.fuel), 100));
  212. const AAEFactor = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(1, Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["divide"])(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(+config.bag_freight, +config.fuel), 100));
  213. let frightCost = 0;
  214. if (freight.type === 1) {
  215. if (totalWeight > 20) {
  216. const a1 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["minus"])(totalWeight, 20);
  217. const a2 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(a1, +freight.basic);
  218. const a3 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(+freight.pickup, a2);
  219. frightCost = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(a3, expressFactor);
  220. } else {
  221. frightCost = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(+freight.pickup, expressFactor);
  222. }
  223. } else if (freight.type === 2) {
  224. const a1 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(totalWeight, +freight.basic);
  225. const a2 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(+freight.pickup, a1);
  226. frightCost = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(a2, AAEFactor);
  227. } else {
  228. frightCost = 0;
  229. }
  230. return transformNumber(frightCost, ratio);
  231. };
  232. /***/ }),
  233. /***/ 192:
  234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  235. "use strict";
  236. // ESM COMPAT FLAG
  237. __webpack_require__.r(__webpack_exports__);
  238. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Pagination.vue?vue&type=template&id=044ef958&scoped=true
  239. var render = function render() {
  240. var _vm = this,
  241. _c = _vm._self._c;
  242. return _c('div', {
  243. staticClass: "pagination-container",
  244. class: {
  245. 'hidden': _vm.hidden
  246. }
  247. }, [_vm._t("slot"), _vm._ssrNode(" "), _c('el-pagination', _vm._b({
  248. attrs: {
  249. "background": _vm.background,
  250. "current-page": _vm.currentPage,
  251. "page-size": _vm.pageSize,
  252. "layout": _vm.layout,
  253. "total": _vm.total
  254. },
  255. on: {
  256. "update:currentPage": function ($event) {
  257. _vm.currentPage = $event;
  258. },
  259. "update:current-page": function ($event) {
  260. _vm.currentPage = $event;
  261. },
  262. "update:pageSize": function ($event) {
  263. _vm.pageSize = $event;
  264. },
  265. "update:page-size": function ($event) {
  266. _vm.pageSize = $event;
  267. },
  268. "size-change": _vm.handleSizeChange,
  269. "current-change": _vm.handleCurrentChange
  270. }
  271. }, 'el-pagination', _vm.$attrs, false))], 2);
  272. };
  273. var staticRenderFns = [];
  274. // CONCATENATED MODULE: ./components/Pagination.vue?vue&type=template&id=044ef958&scoped=true
  275. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Pagination.vue?vue&type=script&lang=js
  276. /* harmony default export */ var Paginationvue_type_script_lang_js = ({
  277. name: 'Pagination',
  278. props: {
  279. total: {
  280. required: true,
  281. type: Number
  282. },
  283. page: {
  284. type: Number,
  285. default: 0
  286. },
  287. limit: {
  288. type: Number,
  289. default: 10
  290. },
  291. // pageSizes: {
  292. // type: Array,
  293. // default() {
  294. // return [10, 20, 50, 100]
  295. // }
  296. // },
  297. layout: {
  298. type: String,
  299. default: 'prev, pager, next'
  300. },
  301. background: {
  302. type: Boolean,
  303. default: true
  304. },
  305. autoScroll: {
  306. type: Boolean,
  307. default: true
  308. },
  309. hidden: {
  310. type: Boolean,
  311. default: false
  312. }
  313. },
  314. computed: {
  315. currentPage: {
  316. get() {
  317. return this.page;
  318. },
  319. set(val) {
  320. this.$emit('update:page', val);
  321. }
  322. },
  323. pageSize: {
  324. get() {
  325. return this.limit;
  326. },
  327. set(val) {
  328. this.$emit('update:limit', val);
  329. }
  330. }
  331. },
  332. methods: {
  333. handleSizeChange(val) {
  334. this.$emit('pagination', {
  335. page: this.currentPage,
  336. limit: val
  337. });
  338. if (this.autoScroll) {
  339. scrollTo(0, 800);
  340. }
  341. },
  342. handleCurrentChange(val) {
  343. this.$emit('pagination', {
  344. page: val,
  345. limit: this.pageSize
  346. });
  347. if (this.autoScroll) {
  348. scrollTo(0, 800);
  349. }
  350. }
  351. }
  352. });
  353. // CONCATENATED MODULE: ./components/Pagination.vue?vue&type=script&lang=js
  354. /* harmony default export */ var components_Paginationvue_type_script_lang_js = (Paginationvue_type_script_lang_js);
  355. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  356. var componentNormalizer = __webpack_require__(2);
  357. // CONCATENATED MODULE: ./components/Pagination.vue
  358. function injectStyles (context) {
  359. var style0 = __webpack_require__(182)
  360. if (style0.__inject__) style0.__inject__(context)
  361. }
  362. /* normalize component */
  363. var component = Object(componentNormalizer["a" /* default */])(
  364. components_Paginationvue_type_script_lang_js,
  365. render,
  366. staticRenderFns,
  367. false,
  368. injectStyles,
  369. "044ef958",
  370. "230c7770"
  371. )
  372. /* harmony default export */ var Pagination = __webpack_exports__["default"] = (component.exports);
  373. /***/ }),
  374. /***/ 215:
  375. /***/ (function(module, exports) {
  376. // Exports
  377. module.exports = {
  378. };
  379. /***/ }),
  380. /***/ 246:
  381. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  382. "use strict";
  383. __webpack_require__.r(__webpack_exports__);
  384. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUpload_vue_vue_type_style_index_0_id_596f82bc_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(215);
  385. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUpload_vue_vue_type_style_index_0_id_596f82bc_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUpload_vue_vue_type_style_index_0_id_596f82bc_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  386. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUpload_vue_vue_type_style_index_0_id_596f82bc_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUpload_vue_vue_type_style_index_0_id_596f82bc_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  387. /***/ }),
  388. /***/ 263:
  389. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  390. "use strict";
  391. // ESM COMPAT FLAG
  392. __webpack_require__.r(__webpack_exports__);
  393. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/ImageUpload.vue?vue&type=template&id=596f82bc&scoped=true
  394. var render = function render() {
  395. var _vm = this,
  396. _c = _vm._self._c;
  397. return _c('div', {
  398. staticClass: "com-image-upload"
  399. }, [_c('draggable', {
  400. staticClass: "flex start wrap",
  401. attrs: {
  402. "draggable": ".image-item"
  403. },
  404. on: {
  405. "end": _vm.end
  406. },
  407. model: {
  408. value: _vm.imageList,
  409. callback: function ($$v) {
  410. _vm.imageList = $$v;
  411. },
  412. expression: "imageList"
  413. }
  414. }, [_vm._l(_vm.imageList, function (item, index) {
  415. return _c('div', {
  416. key: item.uid || index,
  417. staticClass: "image-item flex",
  418. style: {
  419. width: _vm.width,
  420. height: _vm.height
  421. }
  422. }, [_c('img', {
  423. attrs: {
  424. "src": item.url,
  425. "alt": ""
  426. }
  427. }), _vm._v(" "), _c('div', {
  428. staticClass: "action-area flex center"
  429. }, [!_vm.disablePreview ? _c('span', {
  430. staticClass: "action-icon",
  431. on: {
  432. "click": function ($event) {
  433. return _vm.handlePictureCardPreview(item);
  434. }
  435. }
  436. }, [_c('i', {
  437. staticClass: "el-icon-zoom-in"
  438. })]) : _vm._e(), _vm._v(" "), _c('span', {
  439. staticClass: "action-icon",
  440. on: {
  441. "click": function ($event) {
  442. return _vm.handleRemove(index);
  443. }
  444. }
  445. }, [_c('i', {
  446. staticClass: "el-icon-delete"
  447. })])])]);
  448. }), _vm._v(" "), _c('el-progress', {
  449. directives: [{
  450. name: "show",
  451. rawName: "v-show",
  452. value: _vm.loading,
  453. expression: "loading"
  454. }],
  455. staticStyle: {
  456. "margin": "8px"
  457. },
  458. attrs: {
  459. "type": "circle",
  460. "percentage": _vm.uploadPercent,
  461. "width": Number(_vm.width.slice(0, _vm.width.length - 2))
  462. }
  463. }), _vm._v(" "), _c('div', {
  464. staticClass: "upload-wrap",
  465. class: {
  466. hide: _vm.loading || _vm.imageList.length >= _vm.max
  467. },
  468. style: {
  469. width: _vm.width,
  470. height: _vm.height
  471. }
  472. }, [_c('el-upload', {
  473. ref: "pictureUpload",
  474. staticClass: "custom-upload-item",
  475. attrs: {
  476. "multiple": true,
  477. "limit": _vm.max,
  478. "action": "",
  479. "drag": "",
  480. "accept": ".jpg,.png,.jpeg",
  481. "list-type": "picture-card",
  482. "file-list": _vm.imageList,
  483. "show-file-list": false,
  484. "auto-upload": false,
  485. "on-remove": _vm.handleRemove,
  486. "on-preview": _vm.handlePictureCardPreview,
  487. "on-change": (file, fileList) => {
  488. _vm.handleUpload(file, fileList);
  489. }
  490. }
  491. }, [_c('i', {
  492. staticClass: "el-icon-plus avatar-uploader-icon"
  493. })])], 1)], 2), _vm._ssrNode(" "), _c('el-dialog', {
  494. attrs: {
  495. "visible": _vm.imageDialogVisible
  496. },
  497. on: {
  498. "update:visible": function ($event) {
  499. _vm.imageDialogVisible = $event;
  500. }
  501. }
  502. }, [_c('img', {
  503. attrs: {
  504. "width": "100%",
  505. "src": _vm.imageUrl,
  506. "alt": ""
  507. }
  508. })])], 2);
  509. };
  510. var staticRenderFns = [];
  511. // CONCATENATED MODULE: ./components/ImageUpload.vue?vue&type=template&id=596f82bc&scoped=true
  512. // EXTERNAL MODULE: external "vuedraggable"
  513. var external_vuedraggable_ = __webpack_require__(142);
  514. var external_vuedraggable_default = /*#__PURE__*/__webpack_require__.n(external_vuedraggable_);
  515. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/ImageUpload.vue?vue&type=script&lang=js
  516. // import { common } from '@/api'
  517. /* harmony default export */ var ImageUploadvue_type_script_lang_js = ({
  518. name: 'ImageUpload',
  519. components: {
  520. draggable: external_vuedraggable_default.a
  521. },
  522. props: {
  523. list: {
  524. type: Array,
  525. default: () => []
  526. },
  527. max: {
  528. type: Number,
  529. default: 16
  530. },
  531. disablePreview: {
  532. type: Boolean,
  533. default: false
  534. },
  535. width: {
  536. type: String,
  537. default: '150px'
  538. },
  539. height: {
  540. type: String,
  541. default: '150px'
  542. }
  543. },
  544. data() {
  545. return {
  546. // 组件内部数据.
  547. imageList: [],
  548. loading: false,
  549. uploadPercent: 0,
  550. imageDialogVisible: false,
  551. // 预览大图的url, 每次点击都会更新
  552. imageUrl: ''
  553. };
  554. },
  555. computed: {
  556. fulled() {
  557. return 0;
  558. }
  559. },
  560. watch: {
  561. list() {
  562. this.imageList = JSON.parse(JSON.stringify(this.list));
  563. }
  564. },
  565. mounted() {
  566. this.updateList();
  567. },
  568. methods: {
  569. handleUpload(file, fileList) {
  570. this.fileList = [];
  571. if (file.status === 'ready') {
  572. this.loading = true;
  573. const interval = setInterval(() => {
  574. if (this.uploadPercent >= 99) {
  575. clearInterval(interval);
  576. return;
  577. }
  578. this.uploadPercent += 1; // 进度条进度
  579. }, 100);
  580. }
  581. const formData = new FormData();
  582. fileList.forEach(file => {
  583. formData.append('file', file.raw);
  584. });
  585. formData.append('type', 1);
  586. this.$axios.post(`/uk-api/user_base/imagesUpload`, formData).then(response => {
  587. if (response.result.code === 200) {
  588. this.imageList.push({
  589. url: response.result.data,
  590. uid: file.uid
  591. });
  592. this.updateList();
  593. return;
  594. }
  595. this.$message({
  596. message: response.result.message,
  597. type: 'warning'
  598. });
  599. }).catch(error => {
  600. console.log(error, 'component upload image error');
  601. this.$message.error(error.response.data.msg);
  602. }).finally(() => {
  603. this.loading = false;
  604. // 进度条恢复到初始状态
  605. this.uploadPercent = 0;
  606. });
  607. },
  608. handleRemove(index) {
  609. this.imageList.splice(index, 1);
  610. this.updateList();
  611. },
  612. handlePictureCardPreview(file) {
  613. this.imageUrl = file.url;
  614. this.imageDialogVisible = true;
  615. },
  616. // 每次更新imageList后手动更新父组件的数据, 不能用watch自动更新, 因为同时要watch prop值更新iamgeList, 同时watch会死循环.
  617. // 直接把prop数据绑定到dragable 和 el-upload的话vue和eslint会报错, 也可能造成调试困难
  618. updateList() {
  619. this.$emit('update:list', JSON.parse(JSON.stringify(this.imageList)));
  620. },
  621. end() {
  622. this.updateList();
  623. }
  624. }
  625. });
  626. // CONCATENATED MODULE: ./components/ImageUpload.vue?vue&type=script&lang=js
  627. /* harmony default export */ var components_ImageUploadvue_type_script_lang_js = (ImageUploadvue_type_script_lang_js);
  628. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  629. var componentNormalizer = __webpack_require__(2);
  630. // CONCATENATED MODULE: ./components/ImageUpload.vue
  631. function injectStyles (context) {
  632. var style0 = __webpack_require__(246)
  633. if (style0.__inject__) style0.__inject__(context)
  634. }
  635. /* normalize component */
  636. var component = Object(componentNormalizer["a" /* default */])(
  637. components_ImageUploadvue_type_script_lang_js,
  638. render,
  639. staticRenderFns,
  640. false,
  641. injectStyles,
  642. "596f82bc",
  643. "7f6e537e"
  644. )
  645. /* harmony default export */ var ImageUpload = __webpack_exports__["default"] = (component.exports);
  646. /***/ }),
  647. /***/ 278:
  648. /***/ (function(module, exports) {
  649. // Exports
  650. module.exports = {
  651. };
  652. /***/ }),
  653. /***/ 279:
  654. /***/ (function(module, exports) {
  655. // Exports
  656. module.exports = {
  657. };
  658. /***/ }),
  659. /***/ 333:
  660. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  661. "use strict";
  662. __webpack_require__.r(__webpack_exports__);
  663. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_325cc999_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(278);
  664. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_325cc999_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_325cc999_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
  665. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_325cc999_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_325cc999_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  666. /***/ }),
  667. /***/ 334:
  668. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  669. "use strict";
  670. __webpack_require__.r(__webpack_exports__);
  671. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_325cc999_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(279);
  672. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_325cc999_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_325cc999_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  673. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_325cc999_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_325cc999_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  674. /***/ }),
  675. /***/ 374:
  676. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  677. "use strict";
  678. // ESM COMPAT FLAG
  679. __webpack_require__.r(__webpack_exports__);
  680. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/home/myDetail/index.vue?vue&type=template&id=325cc999&scoped=true
  681. var render = function render() {
  682. var _vm$$store$state$user, _vm$$store$state$user2, _vm$$store$state$user3;
  683. var _vm = this,
  684. _c = _vm._self._c;
  685. return _c('div', {
  686. staticClass: "com-main com-margin-auto com-fixationwidth-1400"
  687. }, [_c('el-breadcrumb', {
  688. attrs: {
  689. "separator-class": "el-icon-arrow-right"
  690. }
  691. }, [_c('el-breadcrumb-item', {
  692. attrs: {
  693. "to": {
  694. path: '/'
  695. }
  696. }
  697. }, [_vm._v("Home")]), _vm._v(" "), _c('el-breadcrumb-item', [_vm._v(_vm._s(_vm.tabName))])], 1), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"content\" data-v-325cc999>", "</div>", [_c('el-menu', {
  698. ref: "menu",
  699. staticClass: "el-menu-vertical",
  700. attrs: {
  701. "background-color": "#e8eaee",
  702. "text-color": "#4a596c",
  703. "active-text-color": "#fff",
  704. "default-active": _vm.activeMenu
  705. },
  706. on: {
  707. "select": _vm.handleClick
  708. }
  709. }, [_c('el-menu-item', {
  710. attrs: {
  711. "index": "profile"
  712. }
  713. }, [_c('i', {
  714. staticClass: "iconfont"
  715. }, [_vm._v("")]), _vm._v(" "), _c('span', {
  716. attrs: {
  717. "slot": "title"
  718. },
  719. slot: "title"
  720. }, [_vm._v("My Profile")])]), _vm._v(" "), _c('el-submenu', {
  721. attrs: {
  722. "index": "order"
  723. }
  724. }, [_c('template', {
  725. slot: "title"
  726. }, [_c('i', {
  727. staticClass: "iconfont"
  728. }, [_vm._v("")]), _vm._v(" "), _c('span', {
  729. attrs: {
  730. "slot": "title"
  731. },
  732. slot: "title"
  733. }, [_vm._v("My Orders")])]), _vm._v(" "), _c('el-menu-item', {
  734. attrs: {
  735. "index": "all-orders"
  736. }
  737. }, [_vm._v("All Orders")]), _vm._v(" "), _c('el-menu-item', {
  738. attrs: {
  739. "index": "open-orders"
  740. }
  741. }, [_vm._v("Open Orders")]), _vm._v(" "), _c('el-menu-item', {
  742. attrs: {
  743. "index": "closed-orders"
  744. }
  745. }, [_vm._v("Closed Orders")])], 2)], 1), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"content-right\" data-v-325cc999>", "</div>", [_vm._ssrNode("<div" + _vm._ssrStyle(null, null, {
  746. display: _vm.activeMenu === 'profile' ? '' : 'none'
  747. }) + " data-v-325cc999>", "</div>", [_vm._ssrNode("<div class=\"content-form\" data-v-325cc999>", "</div>", [_vm._ssrNode("<p class=\"content-title\" data-v-325cc999>" + _vm._ssrEscape(_vm._s(_vm.tabName)) + "</p> "), _c('el-form', {
  748. ref: "form",
  749. attrs: {
  750. "model": _vm.profileform,
  751. "rules": _vm.rules,
  752. "label-width": "220px"
  753. }
  754. }, [_c('el-row', [_c('el-col', {
  755. attrs: {
  756. "span": 15
  757. }
  758. }, [_c('el-form-item', {
  759. attrs: {
  760. "label": "Email Address",
  761. "prop": "email"
  762. }
  763. }, [_c('el-input', {
  764. attrs: {
  765. "disabled": true
  766. },
  767. model: {
  768. value: _vm.profileform.email,
  769. callback: function ($$v) {
  770. _vm.$set(_vm.profileform, "email", $$v);
  771. },
  772. expression: "profileform.email"
  773. }
  774. })], 1)], 1), _vm._v(" "), _c('el-col', {
  775. attrs: {
  776. "span": 9
  777. }
  778. }, [_c('el-form-item', {
  779. staticClass: "upload-item",
  780. attrs: {
  781. "label": "Your Logo"
  782. }
  783. }, [_c('image-upload', {
  784. attrs: {
  785. "list": _vm.profileform.logo,
  786. "disablePreview": true,
  787. "max": 1
  788. },
  789. on: {
  790. "update:list": function ($event) {
  791. return _vm.$set(_vm.profileform, "logo", $event);
  792. }
  793. }
  794. })], 1)], 1)], 1), _vm._v(" "), _c('el-form-item', {
  795. attrs: {
  796. "label": "Company Name",
  797. "prop": "company"
  798. }
  799. }, [_c('el-input', {
  800. model: {
  801. value: _vm.profileform.company,
  802. callback: function ($$v) {
  803. _vm.$set(_vm.profileform, "company", $$v);
  804. },
  805. expression: "profileform.company"
  806. }
  807. })], 1), _vm._v(" "), _c('el-form-item', {
  808. attrs: {
  809. "label": "First Name",
  810. "prop": "contacts"
  811. }
  812. }, [_c('el-input', {
  813. model: {
  814. value: _vm.profileform.contacts,
  815. callback: function ($$v) {
  816. _vm.$set(_vm.profileform, "contacts", $$v);
  817. },
  818. expression: "profileform.contacts"
  819. }
  820. })], 1), _vm._v(" "), _c('el-form-item', {
  821. attrs: {
  822. "label": "Last Name",
  823. "prop": "last_name"
  824. }
  825. }, [_c('el-input', {
  826. model: {
  827. value: _vm.profileform.last_name,
  828. callback: function ($$v) {
  829. _vm.$set(_vm.profileform, "last_name", $$v);
  830. },
  831. expression: "profileform.last_name"
  832. }
  833. })], 1), _vm._v(" "), _c('el-form-item', {
  834. attrs: {
  835. "label": "Contact Phone Number",
  836. "prop": "phone"
  837. }
  838. }, [_c('el-input', {
  839. model: {
  840. value: _vm.profileform.phone,
  841. callback: function ($$v) {
  842. _vm.$set(_vm.profileform, "phone", $$v);
  843. },
  844. expression: "profileform.phone"
  845. }
  846. })], 1)], 1)], 2), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"content-form\" style=\"margin-top: 20px\" data-v-325cc999>", "</div>", [_vm._ssrNode("<p class=\"content-title\" data-v-325cc999>Account And Password</p> "), _c('el-form', {
  847. ref: "ruleForm",
  848. staticClass: "accountPasswordForm",
  849. attrs: {
  850. "model": _vm.accountPasswordForm,
  851. "label-width": "220px"
  852. }
  853. }, [_c('el-form-item', {
  854. attrs: {
  855. "label": "Enter the new password",
  856. "prop": "password"
  857. }
  858. }, [_c('el-input', {
  859. model: {
  860. value: _vm.accountPasswordForm.password,
  861. callback: function ($$v) {
  862. _vm.$set(_vm.accountPasswordForm, "password", $$v);
  863. },
  864. expression: "accountPasswordForm.password"
  865. }
  866. })], 1), _vm._v(" "), _c('el-form-item', {
  867. attrs: {
  868. "label": "Retype the password",
  869. "prop": "confirm_password"
  870. }
  871. }, [_c('el-input', {
  872. model: {
  873. value: _vm.accountPasswordForm.confirm_password,
  874. callback: function ($$v) {
  875. _vm.$set(_vm.accountPasswordForm, "confirm_password", $$v);
  876. },
  877. expression: "accountPasswordForm.confirm_password"
  878. }
  879. })], 1), _vm._v(" "), _c('el-form-item', [_c('el-button', {
  880. staticClass: "saveBtn",
  881. on: {
  882. "click": function ($event) {
  883. return _vm.onSave('form');
  884. }
  885. }
  886. }, [_vm._v("\n Save\n ")])], 1)], 1)], 2)], 2), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"content-form\"" + _vm._ssrStyle(null, null, {
  887. display: _vm.activeMenu === 'enquiry' ? '' : 'none'
  888. }) + " data-v-325cc999>", "</div>", [_vm._ssrNode("<p class=\"content-title\" data-v-325cc999>" + _vm._ssrEscape(_vm._s(_vm.tabName)) + "</p> "), _vm._ssrNode("<div class=\"searchInput\" data-v-325cc999>", "</div>", [_c('el-input', {
  889. attrs: {
  890. "placeholder": "Search your job name",
  891. "clearable": ""
  892. },
  893. on: {
  894. "clear": _vm.getEnquiryList
  895. },
  896. nativeOn: {
  897. "keyup": function ($event) {
  898. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) return null;
  899. return _vm.getEnquiryList.apply(null, arguments);
  900. }
  901. },
  902. model: {
  903. value: _vm.enquiryKeyword,
  904. callback: function ($$v) {
  905. _vm.enquiryKeyword = $$v;
  906. },
  907. expression: "enquiryKeyword"
  908. }
  909. }, [_c('i', {
  910. staticClass: "el-input__icon el-icon-search",
  911. attrs: {
  912. "slot": "suffix"
  913. },
  914. on: {
  915. "click": _vm.getEnquiryList
  916. },
  917. slot: "suffix"
  918. })])], 1), _vm._ssrNode(" "), _c('el-table', {
  919. directives: [{
  920. name: "loading",
  921. rawName: "v-loading",
  922. value: _vm.tableLoading,
  923. expression: "tableLoading"
  924. }],
  925. staticClass: "table-order-list",
  926. staticStyle: {
  927. "width": "100%"
  928. },
  929. attrs: {
  930. "data": _vm.enquiryList,
  931. "stripe": "",
  932. "header-cell-style": {
  933. background: '#00213b',
  934. color: '#ffffff'
  935. }
  936. },
  937. on: {
  938. "row-click": _vm.goEnquiryDetail
  939. }
  940. }, [_c('el-table-column', {
  941. attrs: {
  942. "prop": "Auto_Number",
  943. "label": "Enquiry No"
  944. }
  945. }), _vm._v(" "), _c('el-table-column', {
  946. attrs: {
  947. "prop": "Enquiry_Title",
  948. "label": "Job Name",
  949. "width": "300"
  950. }
  951. }), _vm._v(" "), _c('el-table-column', {
  952. attrs: {
  953. "prop": "Customize_Pipeline_Stage",
  954. "label": "Status"
  955. }
  956. }), _vm._v(" "), _c('el-table-column', {
  957. attrs: {
  958. "prop": "Enquiry_Created",
  959. "label": "Date"
  960. },
  961. scopedSlots: _vm._u([{
  962. key: "default",
  963. fn: function (scope) {
  964. return [_c('div', [_vm._v("\n " + _vm._s(_vm.$utils.formatTime(scope.row.Sales_Order_Created, 'DD/MM/YYYY', true)) + "\n ")])];
  965. }
  966. }])
  967. }), _vm._v(" "), _c('el-table-column', {
  968. attrs: {
  969. "label": "Action",
  970. "width": "90",
  971. "align": "center"
  972. }
  973. }, [[_c('el-button', {
  974. staticStyle: {
  975. "background-color": "rgb(0, 33, 59)",
  976. "color": "#fff"
  977. },
  978. attrs: {
  979. "size": "small",
  980. "plain": ""
  981. }
  982. }, [_vm._v("View")])]], 2)], 1), _vm._ssrNode(" "), _c('pagination', {
  983. directives: [{
  984. name: "show",
  985. rawName: "v-show",
  986. value: _vm.enquiryTotal > 0,
  987. expression: "enquiryTotal > 0"
  988. }],
  989. attrs: {
  990. "total": _vm.enquiryTotal,
  991. "page": _vm.enquiryListQuery.page,
  992. "limit": _vm.enquiryListQuery.limit
  993. },
  994. on: {
  995. "update:page": function ($event) {
  996. return _vm.$set(_vm.enquiryListQuery, "page", $event);
  997. },
  998. "update:limit": function ($event) {
  999. return _vm.$set(_vm.enquiryListQuery, "limit", $event);
  1000. },
  1001. "pagination": _vm.getEnquiryList
  1002. }
  1003. })], 2), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"content-form\"" + _vm._ssrStyle(null, null, {
  1004. display: _vm.activeMenu.includes('orders') ? '' : 'none'
  1005. }) + " data-v-325cc999>", "</div>", [_vm._ssrNode("<p class=\"content-title\" data-v-325cc999>" + _vm._ssrEscape(_vm._s(_vm.tabName)) + "</p> "), _vm._ssrNode("<div class=\"searchInput\" data-v-325cc999>", "</div>", [_c('el-input', {
  1006. attrs: {
  1007. "placeholder": "Search your job name",
  1008. "clearable": ""
  1009. },
  1010. on: {
  1011. "clear": _vm.getOrdersList
  1012. },
  1013. nativeOn: {
  1014. "keyup": function ($event) {
  1015. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) return null;
  1016. return _vm.getOrdersList.apply(null, arguments);
  1017. }
  1018. },
  1019. model: {
  1020. value: _vm.orderKeyword,
  1021. callback: function ($$v) {
  1022. _vm.orderKeyword = $$v;
  1023. },
  1024. expression: "orderKeyword"
  1025. }
  1026. }, [_c('i', {
  1027. staticClass: "el-input__icon el-icon-search",
  1028. attrs: {
  1029. "slot": "suffix"
  1030. },
  1031. on: {
  1032. "click": _vm.getOrdersList
  1033. },
  1034. slot: "suffix"
  1035. })]), _vm._ssrNode(" "), _vm.selShow ? _c('el-select', {
  1036. attrs: {
  1037. "filterable": "",
  1038. "clearable": "",
  1039. "default-first-option": "",
  1040. "placeholder": "Select the status"
  1041. },
  1042. model: {
  1043. value: _vm.selword,
  1044. callback: function ($$v) {
  1045. _vm.selword = $$v;
  1046. },
  1047. expression: "selword"
  1048. }
  1049. }, _vm._l(_vm.orderSelList, function (option) {
  1050. return _c('el-option', {
  1051. key: option,
  1052. attrs: {
  1053. "label": option,
  1054. "value": option
  1055. }
  1056. });
  1057. }), 1) : _vm._e(), _vm._ssrNode(" "), ((_vm$$store$state$user = _vm.$store.state.userInfo) === null || _vm$$store$state$user === void 0 ? void 0 : (_vm$$store$state$user2 = _vm$$store$state$user.memberCrmcomList) === null || _vm$$store$state$user2 === void 0 ? void 0 : _vm$$store$state$user2.length) > 1 ? _c('el-select', {
  1058. attrs: {
  1059. "filterable": "",
  1060. "clearable": "",
  1061. "default-first-option": "",
  1062. "placeholder": "Select the CRM"
  1063. },
  1064. model: {
  1065. value: _vm.accounts_id,
  1066. callback: function ($$v) {
  1067. _vm.accounts_id = $$v;
  1068. },
  1069. expression: "accounts_id"
  1070. }
  1071. }, _vm._l((_vm$$store$state$user3 = _vm.$store.state.userInfo) === null || _vm$$store$state$user3 === void 0 ? void 0 : _vm$$store$state$user3.memberCrmcomList, function (option) {
  1072. return _c('el-option', {
  1073. key: option.id,
  1074. attrs: {
  1075. "label": option.name,
  1076. "value": option.id
  1077. }
  1078. });
  1079. }), 1) : _vm._e(), _vm._ssrNode(" "), _c('el-button', {
  1080. staticStyle: {
  1081. "background-color": "rgb(0, 33, 59)",
  1082. "border-color": "rgb(0, 33, 59)"
  1083. },
  1084. attrs: {
  1085. "type": "primary"
  1086. },
  1087. on: {
  1088. "click": _vm.getOrdersList
  1089. }
  1090. }, [_vm._v("Submit")])], 2), _vm._ssrNode(" "), _c('el-table', {
  1091. directives: [{
  1092. name: "loading",
  1093. rawName: "v-loading",
  1094. value: _vm.tableLoading,
  1095. expression: "tableLoading"
  1096. }],
  1097. staticClass: "table-order-list",
  1098. staticStyle: {
  1099. "width": "100%"
  1100. },
  1101. attrs: {
  1102. "data": _vm.tableData,
  1103. "stripe": "",
  1104. "header-cell-style": {
  1105. background: '#00213b',
  1106. color: '#ffffff'
  1107. }
  1108. }
  1109. }, [_c('el-table-column', {
  1110. attrs: {
  1111. "prop": "Sales_Order_Title_Job_Name",
  1112. "label": "Job Name"
  1113. },
  1114. scopedSlots: _vm._u([{
  1115. key: "default",
  1116. fn: function (scope) {
  1117. return [_c('p', {
  1118. staticClass: "table-list-p1"
  1119. }, [_vm._v("\n " + _vm._s(scope.row.Sales_Order_Title_Job_Name) + "\n ")])];
  1120. }
  1121. }])
  1122. }), _vm._v(" "), _c('el-table-column', {
  1123. attrs: {
  1124. "width": "100",
  1125. "prop": "Reference",
  1126. "label": "Order No"
  1127. }
  1128. }), _vm._v(" "), _c('el-table-column', {
  1129. attrs: {
  1130. "width": "120",
  1131. "prop": "Sales_Order_Created",
  1132. "label": "Order Date"
  1133. },
  1134. scopedSlots: _vm._u([{
  1135. key: "default",
  1136. fn: function (scope) {
  1137. return [_c('div', [_vm._v("\n " + _vm._s(_vm.$utils.formatTime(scope.row.Sales_Order_Created, 'DD/MM/YYYY')) + "\n ")])];
  1138. }
  1139. }])
  1140. }), _vm._v(" "), _c('el-table-column', {
  1141. attrs: {
  1142. "width": "140",
  1143. "prop": "Order_Stage_new",
  1144. "label": "Order Status"
  1145. }
  1146. }), _vm._v(" "), _c('el-table-column', {
  1147. attrs: {
  1148. "width": "160",
  1149. "prop": "Tracking_No_arr",
  1150. "label": "Tracking No#"
  1151. },
  1152. scopedSlots: _vm._u([{
  1153. key: "default",
  1154. fn: function (scope) {
  1155. return [_c('ul', {
  1156. staticClass: "location"
  1157. }, _vm._l(scope.row.Tracking_No_arr, function (item) {
  1158. return _c('li', {
  1159. key: item.Tracking_No,
  1160. on: {
  1161. "click": function ($event) {
  1162. return _vm.openTracking_URL(item.Tracking_URL);
  1163. }
  1164. }
  1165. }, [_c('i', {
  1166. staticClass: "el-icon-location"
  1167. }), _vm._v(_vm._s(item.Tracking_No) + "\n ")]);
  1168. }), 0)];
  1169. }
  1170. }])
  1171. }), _vm._v(" "), _c('el-table-column', {
  1172. attrs: {
  1173. "width": "110",
  1174. "prop": "Grand_Total",
  1175. "label": "Amount"
  1176. },
  1177. scopedSlots: _vm._u([{
  1178. key: "default",
  1179. fn: function (scope) {
  1180. return [_vm._v("\n $" + _vm._s(_vm.transformNumber(scope.row.Grand_Total)) + "\n ")];
  1181. }
  1182. }])
  1183. }), _vm._v(" "), _c('el-table-column', {
  1184. attrs: {
  1185. "label": "Action",
  1186. "width": "100",
  1187. "align": "center"
  1188. },
  1189. scopedSlots: _vm._u([{
  1190. key: "default",
  1191. fn: function (scope) {
  1192. return [_c('el-button', {
  1193. staticStyle: {
  1194. "background-color": "rgb(0, 33, 59)",
  1195. "color": "#fff",
  1196. "width": "85px",
  1197. "margin": "0"
  1198. },
  1199. attrs: {
  1200. "size": "small",
  1201. "plain": ""
  1202. },
  1203. on: {
  1204. "click": function ($event) {
  1205. return _vm.goOrderDetail(scope.row);
  1206. }
  1207. }
  1208. }, [_vm._v("View")])];
  1209. }
  1210. }])
  1211. })], 1), _vm._ssrNode(" "), _c('pagination', {
  1212. directives: [{
  1213. name: "show",
  1214. rawName: "v-show",
  1215. value: _vm.orderTotal > 0,
  1216. expression: "orderTotal > 0"
  1217. }],
  1218. attrs: {
  1219. "total": _vm.orderTotal,
  1220. "page": _vm.orderListQuery.page,
  1221. "limit": _vm.orderListQuery.limit
  1222. },
  1223. on: {
  1224. "update:page": function ($event) {
  1225. return _vm.$set(_vm.orderListQuery, "page", $event);
  1226. },
  1227. "update:limit": function ($event) {
  1228. return _vm.$set(_vm.orderListQuery, "limit", $event);
  1229. },
  1230. "pagination": _vm.getOrdersList
  1231. }
  1232. })], 2)], 2)], 2), _vm._ssrNode(" "), _c('dialog-XX-success', {
  1233. attrs: {
  1234. "visible": _vm.xxContentVisible,
  1235. "content": _vm.xxContent
  1236. },
  1237. on: {
  1238. "update:visible": function ($event) {
  1239. _vm.xxContentVisible = $event;
  1240. },
  1241. "notify-parent": _vm.handleNotification
  1242. }
  1243. }), _vm._ssrNode(" "), _c('el-dialog', {
  1244. attrs: {
  1245. "lock-scroll": false,
  1246. "visible": _vm.urlDialogShow,
  1247. "center": "",
  1248. "width": "850px",
  1249. "top": "20vh"
  1250. },
  1251. on: {
  1252. "update:visible": function ($event) {
  1253. _vm.urlDialogShow = $event;
  1254. }
  1255. }
  1256. }, [_c('iframe', {
  1257. staticStyle: {
  1258. "width": "100%",
  1259. "height": "500px"
  1260. },
  1261. attrs: {
  1262. "src": _vm.Tracking_URL,
  1263. "frameborder": "0"
  1264. }
  1265. })])], 2);
  1266. };
  1267. var staticRenderFns = [];
  1268. // CONCATENATED MODULE: ./pages/home/myDetail/index.vue?vue&type=template&id=325cc999&scoped=true
  1269. // EXTERNAL MODULE: external "vuex"
  1270. var external_vuex_ = __webpack_require__(6);
  1271. // EXTERNAL MODULE: ./components/DIalogXXSuccess.vue + 4 modules
  1272. var DIalogXXSuccess = __webpack_require__(30);
  1273. // EXTERNAL MODULE: ./components/ImageUpload.vue + 4 modules
  1274. var ImageUpload = __webpack_require__(263);
  1275. // EXTERNAL MODULE: ./utils/price.js
  1276. var price = __webpack_require__(183);
  1277. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/home/myDetail/index.vue?vue&type=script&lang=js
  1278. // import addAddressDialog from '../../../components/addAddressDialog.vue'
  1279. /* harmony default export */ var myDetailvue_type_script_lang_js = ({
  1280. components: {
  1281. // addAddressDialog,
  1282. 'dialog-XX-success': DIalogXXSuccess["default"],
  1283. imageUpload: ImageUpload["default"]
  1284. },
  1285. data() {
  1286. return {
  1287. xxContentVisible: false,
  1288. xxContent: 'success',
  1289. componentVisible: 1,
  1290. // 2:add 3:edit 4:audit
  1291. tabName: '',
  1292. tableLoading: true,
  1293. // 表单配置项
  1294. profileform: {},
  1295. rules: {
  1296. email: [{
  1297. required: true,
  1298. message: 'Please enter the email',
  1299. trigger: 'blur'
  1300. }],
  1301. company: [{
  1302. required: true,
  1303. message: 'Please enter the company',
  1304. trigger: 'blur'
  1305. }],
  1306. contacts: [{
  1307. required: true,
  1308. message: 'Please enter first name',
  1309. trigger: 'blur'
  1310. }],
  1311. last_name: [{
  1312. required: true,
  1313. message: 'Please enter last name',
  1314. trigger: 'blur'
  1315. }],
  1316. phone: [{
  1317. required: true,
  1318. message: 'Please enter the phone',
  1319. trigger: 'blur'
  1320. }],
  1321. password: [{
  1322. required: true,
  1323. message: 'Please enter the password',
  1324. trigger: 'blur'
  1325. }],
  1326. confirm_password: [{
  1327. required: true,
  1328. message: 'Please enter the confirm_password',
  1329. trigger: 'blur'
  1330. }]
  1331. },
  1332. accountPasswordForm: {
  1333. password: '',
  1334. confirm_password: ''
  1335. },
  1336. orderKeyword: '',
  1337. selword: '',
  1338. accounts_id: '',
  1339. orderTotal: 0,
  1340. orderListQuery: {
  1341. page: 1,
  1342. limit: 20
  1343. },
  1344. tableData: [],
  1345. dialogVisible: false,
  1346. addressTotal: 0,
  1347. addressListQuery: {
  1348. page: 1,
  1349. limit: 8
  1350. },
  1351. addressList: [],
  1352. addressDetail: {},
  1353. enquiryKeyword: '',
  1354. enquiryList: [],
  1355. enquiryListQuery: {
  1356. page: 1,
  1357. limit: 20
  1358. },
  1359. enquiryTotal: 0,
  1360. orderSelList: [],
  1361. Tracking_URL: '',
  1362. urlDialogShow: false
  1363. };
  1364. },
  1365. computed: {
  1366. activeMenu() {
  1367. var _this$$route$query$ty;
  1368. return (_this$$route$query$ty = this.$route.query.type) !== null && _this$$route$query$ty !== void 0 ? _this$$route$query$ty : 'profile';
  1369. },
  1370. selShow() {
  1371. return this.activeMenu === 'all-orders' || this.activeMenu === 'open-orders';
  1372. }
  1373. },
  1374. watch: {
  1375. $route: {
  1376. handler(to) {
  1377. if (false) {}
  1378. }
  1379. },
  1380. orderKeyword() {
  1381. this.orderListQuery.page = 1;
  1382. },
  1383. enquiryKeyword() {
  1384. this.enquiryListQuery.page = 1;
  1385. }
  1386. },
  1387. mounted() {
  1388. if (this.$utils.checkLogin()) {
  1389. this.updateType();
  1390. } else {
  1391. this.$router.replace('/');
  1392. }
  1393. },
  1394. methods: {
  1395. transformNumber(value) {
  1396. return Object(price["a" /* round */])(Number(value)).toFixed(2);
  1397. },
  1398. handleClick(key, keyPath) {
  1399. if (key) {
  1400. this.$router.push({
  1401. path: '/home/myDetail',
  1402. query: {
  1403. type: key
  1404. }
  1405. });
  1406. }
  1407. },
  1408. updateType() {
  1409. if (this.activeMenu === 'profile') {
  1410. this.tabName = 'My Profile';
  1411. this.getMemberDetail();
  1412. } else if (this.activeMenu === 'enquiry') {
  1413. this.tabName = 'My Enquiry';
  1414. this.getEnquiryList();
  1415. } else if (this.activeMenu === 'address') {
  1416. // this.tabName = 'My Address'
  1417. // this.getAddressList()
  1418. } else {
  1419. this.selword = '';
  1420. if (this.activeMenu === 'all-orders') {
  1421. this.orderSelList = ['Order Confirmed', 'In Production', 'In Transit', 'Order Completed'];
  1422. }
  1423. if (this.activeMenu === 'open-orders') {
  1424. this.orderSelList = ['Order Confirmed', 'In Production', 'In Transit'];
  1425. }
  1426. this.tabName = 'My Orders';
  1427. this.getOrdersList();
  1428. }
  1429. },
  1430. closeAddressDialog() {
  1431. this.dialogVisible = false;
  1432. },
  1433. // 获取用户信息
  1434. getMemberDetail() {
  1435. this.$axios.get('/uk-api/uk/member/detail').then(res => {
  1436. if (res.code === 1) {
  1437. this.profileform = res.result;
  1438. this.profileform.logo = this.profileform.logo ? this.formatLogo(this.profileform.logo) : [];
  1439. }
  1440. }).catch(() => {});
  1441. },
  1442. formatLogo(params) {
  1443. return [{
  1444. url: params
  1445. }];
  1446. },
  1447. onSave(form) {
  1448. if (this.accountPasswordForm.confirm_password !== this.accountPasswordForm.password) {
  1449. this.$message.error('The second password is inconsistent!');
  1450. return;
  1451. }
  1452. this.$refs[form].validate(valid => {
  1453. if (valid) {
  1454. var _this$profileform$log, _this$profileform$log2;
  1455. const requestBody = {
  1456. email: this.profileform.email,
  1457. company: this.profileform.company,
  1458. contacts: this.profileform.contacts,
  1459. last_name: this.profileform.last_name,
  1460. phone: this.profileform.phone,
  1461. logo: (_this$profileform$log = (_this$profileform$log2 = this.profileform.logo[0]) === null || _this$profileform$log2 === void 0 ? void 0 : _this$profileform$log2.url) !== null && _this$profileform$log !== void 0 ? _this$profileform$log : ''
  1462. };
  1463. let needLogout = false;
  1464. if (this.accountPasswordForm.password.trim() !== '') {
  1465. requestBody.password = this.accountPasswordForm.password;
  1466. requestBody.confirm_password = this.accountPasswordForm.confirm_password;
  1467. needLogout = true;
  1468. }
  1469. this.$axios.post('/uk-api/uk/member/edit', requestBody).then(res => {
  1470. if (res.code === 1) {
  1471. this.$notify({
  1472. customClass: 'custom-notify-class',
  1473. title: 'success',
  1474. message: 'The profile information is modified successfully',
  1475. type: 'success'
  1476. });
  1477. if (needLogout) {
  1478. setTimeout(() => {
  1479. this.$store.dispatch('logout').then(() => {
  1480. this.$router.push('/');
  1481. });
  1482. }, 500);
  1483. }
  1484. }
  1485. }).catch(() => {});
  1486. } else {
  1487. console.log('error submit!!');
  1488. return false;
  1489. }
  1490. });
  1491. },
  1492. // 获取订单列表
  1493. getOrdersList() {
  1494. var _this$$store$state$us;
  1495. const accounts_id = this.accounts_id ? this.accounts_id : (_this$$store$state$us = this.$store.state.userInfo) === null || _this$$store$state$us === void 0 ? void 0 : _this$$store$state$us.memberCrmcomList.map(i => i.id).join();
  1496. const type = this.activeMenu === 'all-orders' ? '' : this.activeMenu === 'open-orders' ? 'Open Orders' : 'Closed Orders';
  1497. this.tableLoading = true;
  1498. this.$axios.post('/uk-api/crmdata/order_lists', {
  1499. keyword: this.orderKeyword,
  1500. page: this.orderListQuery.page,
  1501. limit: this.orderListQuery.limit,
  1502. accounts_id,
  1503. Order_Stage: this.selword,
  1504. type
  1505. }).then(res => {
  1506. if (res.code === 1) {
  1507. this.tableData = res.result.data;
  1508. this.orderTotal = res.result.total;
  1509. this.tableLoading = false;
  1510. }
  1511. if (false) {}
  1512. }).catch(() => {});
  1513. },
  1514. goOrderDetail(row) {
  1515. const routeUrl = this.$router.resolve({
  1516. path: '/home/myDetail/orderDetail',
  1517. query: {
  1518. id: row.sales_orders_id,
  1519. crm: row.Account_Name_id
  1520. }
  1521. });
  1522. window.open(routeUrl.href, '_blank');
  1523. },
  1524. openApproved(row) {
  1525. this.$confirm(`
  1526. <div style="text-align:center;">
  1527. <h3 style="margin:0 0 10px;color:#333;">Ready to order?</h3>
  1528. <p style="margin:0;font-size:16px;color:#333;">Your total is <b>${this.transformNumber(row.Grand_Total)}</b>. Confirm to place your order.</p>
  1529. </div>
  1530. `, '', {
  1531. dangerouslyUseHTMLString: true,
  1532. confirmButtonText: 'Confirm',
  1533. cancelButtonText: 'Cancel',
  1534. confirmButtonClass: 'el-button',
  1535. cancelButtonClass: 'el-button--info',
  1536. center: true,
  1537. showClose: false,
  1538. confirmButtonClass: 'com-btnblack'
  1539. }).then(() => {
  1540. this.$router.push({
  1541. path: '/so-confirm',
  1542. query: {
  1543. id: row.sales_orders_id,
  1544. pc_psw: row.HASH
  1545. }
  1546. });
  1547. });
  1548. },
  1549. getEnquiryList() {
  1550. var _this$$store$state$us2;
  1551. this.tableLoading = true;
  1552. this.$axios.post('/uk-api/crmdata/enquiries_lists', {
  1553. keyword: this.enquiryKeyword,
  1554. page: this.enquiryListQuery.page,
  1555. limit: this.enquiryListQuery.limit,
  1556. accounts_id: ((_this$$store$state$us2 = this.$store.state.userInfo) === null || _this$$store$state$us2 === void 0 ? void 0 : _this$$store$state$us2.crm_accounts_id) || ''
  1557. }).then(res => {
  1558. if (res.code === 1) {
  1559. this.enquiryList = res.result.data;
  1560. this.enquiryTotal = res.result.total;
  1561. this.tableLoading = false;
  1562. }
  1563. if (false) {}
  1564. });
  1565. },
  1566. goEnquiryDetail(row) {
  1567. const routeUrl = this.$router.resolve({
  1568. path: '/home/myDetail/enquiryDetail',
  1569. query: {
  1570. id: row.enquiries_id
  1571. }
  1572. });
  1573. window.open(routeUrl.href, '_blank');
  1574. },
  1575. // 获取地址列表
  1576. // getAddressList() {
  1577. // this.$axios
  1578. // .get('/api/address/list', {
  1579. // params: {
  1580. // page: this.addressListQuery.page,
  1581. // limit: this.addressListQuery.limit,
  1582. // },
  1583. // })
  1584. // .then(res => {
  1585. // if (res.code === 1) {
  1586. // this.addressList = res.result.data
  1587. // this.addressTotal = res.result.total
  1588. // }
  1589. // if (process.client) {
  1590. // this.$nextTick(() => {
  1591. // window.scroll(0, 0)
  1592. // })
  1593. // }
  1594. // })
  1595. // .catch(() => {})
  1596. // },
  1597. // addAddress(num) {
  1598. // this.addressDetail = {}
  1599. // this.componentVisible = num
  1600. // this.dialogVisible = true
  1601. // },
  1602. // editAddress(num, id) {
  1603. // this.$axios
  1604. // .get('/api/address/detail/' + id)
  1605. // .then(res => {
  1606. // this.addressDetail = res.result
  1607. // this.addressDetail.is_default = res.result.is_default === 1
  1608. // this.componentVisible = num
  1609. // this.dialogVisible = true
  1610. // })
  1611. // .catch(() => {})
  1612. // },
  1613. // delAddress(id) {
  1614. // this.$axios.get('/api/address/delete/' + id).then(res => {
  1615. // this.$notify({
  1616. // title: 'success',
  1617. // message: 'Deleted successfully',
  1618. // type: 'success',
  1619. // duration: 3000,
  1620. // })
  1621. // this.getAddressList()
  1622. // })
  1623. // },
  1624. // setDefault(id) {
  1625. // this.$axios.get('/api/address/set_default/' + id).then(res => {
  1626. // this.$notify({
  1627. // title: 'success',
  1628. // message: 'Default address is set successfully',
  1629. // type: 'success',
  1630. // duration: 3000,
  1631. // })
  1632. // this.getAddressList()
  1633. // })
  1634. // },
  1635. // update() {
  1636. // this.getAddressList()
  1637. // },
  1638. resetPassword() {
  1639. if (this.accountPasswordForm.confirm_password !== this.accountPasswordForm.password) {
  1640. this.$message.error('The second password is inconsistent!');
  1641. } else {
  1642. this.$axios({
  1643. url: '/uk-api/uk/member/reset',
  1644. method: 'POST',
  1645. data: this.accountPasswordForm
  1646. }).then(res => {
  1647. if (res.code === 1) {
  1648. this.xxContentVisible = true;
  1649. this.xxContent = 'Password Reset Successful';
  1650. }
  1651. }).catch(() => {
  1652. // this.$message.error(error.response.data.msg);
  1653. });
  1654. }
  1655. },
  1656. openTracking_URL(url) {
  1657. this.Tracking_URL = url;
  1658. this.urlDialogShow = true;
  1659. },
  1660. handleNotification() {
  1661. this.$router.push('/');
  1662. this.$store.dispatch('logout');
  1663. this.openDialog();
  1664. },
  1665. ...Object(external_vuex_["mapMutations"])(['openDialog'])
  1666. }
  1667. });
  1668. // CONCATENATED MODULE: ./pages/home/myDetail/index.vue?vue&type=script&lang=js
  1669. /* harmony default export */ var home_myDetailvue_type_script_lang_js = (myDetailvue_type_script_lang_js);
  1670. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  1671. var componentNormalizer = __webpack_require__(2);
  1672. // CONCATENATED MODULE: ./pages/home/myDetail/index.vue
  1673. function injectStyles (context) {
  1674. var style0 = __webpack_require__(333)
  1675. if (style0.__inject__) style0.__inject__(context)
  1676. var style1 = __webpack_require__(334)
  1677. if (style1.__inject__) style1.__inject__(context)
  1678. }
  1679. /* normalize component */
  1680. var component = Object(componentNormalizer["a" /* default */])(
  1681. home_myDetailvue_type_script_lang_js,
  1682. render,
  1683. staticRenderFns,
  1684. false,
  1685. injectStyles,
  1686. "325cc999",
  1687. "4153663a"
  1688. )
  1689. /* harmony default export */ var myDetail = __webpack_exports__["default"] = (component.exports);
  1690. /* nuxt-component-imports */
  1691. installComponents(component, {ImageUpload: __webpack_require__(263).default,Pagination: __webpack_require__(192).default})
  1692. /***/ })
  1693. };;
  1694. //# sourceMappingURL=index.js.map