xyvcard-goods 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{approveFailIndex-gl8MBbK6.mjs → approveFailIndex-C2BhoVKC.mjs} +1 -1
  2. package/dist/{approvedIndex.vue_vue_type_script_setup_true_lang-Wyt6TM2h.mjs → approveFailIndex.vue_vue_type_script_setup_true_lang-CSBlBFQo.mjs} +111 -94
  3. package/dist/{auditIndex-jOIDtl_l.mjs → auditIndex-BjjiwYrm.mjs} +1 -1
  4. package/dist/{auditIndex.vue_vue_type_script_setup_true_lang-sZD3eYJR.mjs → auditIndex.vue_vue_type_script_setup_true_lang-UrMEjXo-.mjs} +139 -122
  5. package/dist/{edit-DpIovEhA.mjs → edit-B1_IbaHc.mjs} +5007 -5008
  6. package/dist/{index-C9KO9AZw.mjs → el-message-BBB-S2MS.mjs} +614 -595
  7. package/dist/{index-C9f6Lybt.mjs → index-CZD7OAWo.mjs} +49 -30
  8. package/dist/{index-BupW0ufK.mjs → index-vE-TE0cx.mjs} +108 -81
  9. package/dist/index.mjs +1099 -1046
  10. package/dist/info-Bm6Ifv7W.mjs +311 -0
  11. package/dist/{saleIndex-DOcefF_x.mjs → saleIndex-C9AD4DIj.mjs} +1 -1
  12. package/dist/saleIndex.vue_vue_type_script_setup_true_lang-qDsRE8JX.mjs +428 -0
  13. package/dist/{shelfIndex-CTAReFV-.mjs → shelfIndex-CyAp6rf5.mjs} +1 -1
  14. package/dist/{shelfIndex.vue_vue_type_script_setup_true_lang-BG3OCeN_.mjs → shelfIndex.vue_vue_type_script_setup_true_lang-D3xUiFR2.mjs} +173 -159
  15. package/dist/skuForm-Ctu0Vbym.mjs +419 -0
  16. package/dist/skuTable-BbTTCq2m.mjs +585 -0
  17. package/dist/style.css +1 -1
  18. package/dts/api/goods-spu/types.d.ts +13 -6
  19. package/dts/constant.d.ts +4 -0
  20. package/dts/index.d.ts +2 -0
  21. package/dts/lang/goods/en.d.ts +1 -68
  22. package/dts/lang/goods/zh-cn.d.ts +0 -44
  23. package/dts/utils/sku.d.ts +19 -0
  24. package/dts/views/goods/goods-spu/{sku-form.vue.d.ts → skuForm.vue.d.ts} +7 -9
  25. package/dts/views/goods/goods-spu/skuTable.vue.d.ts +40 -0
  26. package/package.json +2 -2
  27. package/dist/approveFailIndex.vue_vue_type_script_setup_true_lang-WJ40OU9K.mjs +0 -544
  28. package/dist/approvedIndex-Cn6g11xv.mjs +0 -4
  29. package/dist/index-fu3gxdt_.mjs +0 -130
  30. package/dist/info-C6VRixBH.mjs +0 -301
  31. package/dist/saleIndex.vue_vue_type_script_setup_true_lang-Cfv3a-DK.mjs +0 -415
  32. package/dist/sku-form-BAi4HkUM.mjs +0 -463
  33. package/dist/sku-table-CRrisvJ1.mjs +0 -410
  34. package/dts/views/goods/goods-spu/approvedIndex.vue.d.ts +0 -2
  35. package/dts/views/goods/goods-spu/sku-table.vue.d.ts +0 -14
@@ -1,463 +0,0 @@
1
- import { defineComponent as z, ref as S, watch as x, resolveComponent as v, openBlock as V, createElementBlock as k, Fragment as I, createVNode as o, withCtx as u, createCommentVNode as E, renderList as N, createElementVNode as w, toDisplayString as F, createTextVNode as C, createBlock as $, unref as ee } from "vue";
2
- import "jmash-core";
3
- import { D as U, S as T } from "./index-C9f6Lybt.mjs";
4
- import { s as le, _ as ae } from "./sku-table-CRrisvJ1.mjs";
5
- const se = { key: 0 }, oe = {
6
- key: 1,
7
- class: "w-full"
8
- }, te = { class: "goods-title" }, ue = ["onClick"], ce = { class: "goods-content" }, pe = { class: "goods-tag" }, re = /* @__PURE__ */ z({
9
- __name: "sku-form",
10
- props: {
11
- // 规格类型
12
- specType: {
13
- type: String,
14
- default: () => ""
15
- },
16
- // 编辑时返回的数据
17
- skuListUpdate: {
18
- type: Array,
19
- default: () => []
20
- }
21
- },
22
- emits: ["getGoodsSku", "getFormData"],
23
- setup(O, { emit: G }) {
24
- const f = S({
25
- picUrl: "",
26
- salePrice: 0,
27
- marketPrice: 0,
28
- costPrice: 0,
29
- weight: 0,
30
- volume: 0,
31
- stock: 0,
32
- skuCode: ""
33
- }), c = S([]), D = S(), h = S([]), b = S({
34
- tableBodyList: [],
35
- tableHeaderList: []
36
- }), n = O, j = G;
37
- U.specInfoDict.useValues(), x(f, (a) => {
38
- j("getGoodsSku", a);
39
- }, {
40
- deep: !0,
41
- immediate: !0
42
- }), console.log(n.skuListUpdate), n.skuListUpdate.length > 0 && n.skuListUpdate.forEach((a) => {
43
- var e;
44
- (e = a.specValues) == null || e.forEach((t) => {
45
- U.specInfoDict.useValues().then((p) => {
46
- const l = p.find((i) => t.specId === i.key);
47
- if (console.log(l), l) {
48
- let i = {
49
- specId: t.specId,
50
- specName: l.value,
51
- specValueList: []
52
- };
53
- c.value.push(i);
54
- }
55
- console.log(c.value);
56
- const s = /* @__PURE__ */ new Map();
57
- c.value = c.value.filter((i) => !s.has(i.specId) && s.set(i.specId, i)), M(t.specValueId);
58
- });
59
- });
60
- });
61
- function M(a) {
62
- c.value.forEach((e) => {
63
- h.value = new T({ specId: e.specId }), h.value.useValues().then((t) => {
64
- t.forEach((p) => {
65
- if (p.key === a) {
66
- let s = {
67
- specId: e.specId,
68
- specValueId: a,
69
- specValueName: p.value
70
- };
71
- e.specValueList.push(s);
72
- }
73
- const l = /* @__PURE__ */ new Map();
74
- e.specValueList = e.specValueList.filter((s) => !l.has(s.specValueId) && l.set(s.specValueId, s));
75
- }), P();
76
- });
77
- });
78
- }
79
- function H(a) {
80
- c.value.splice(a, 1), P();
81
- }
82
- function J(a, e) {
83
- console.log(a, e), c.value[a].specValueList.splice(e, 1), P();
84
- }
85
- function K() {
86
- U.specInfoDict.values.map((a) => {
87
- Array.isArray(c.value) && c.value.length > 0 && c.value.forEach((e) => {
88
- a.key === e.specId ? a.disabled = !0 : a.disabled = !1;
89
- });
90
- });
91
- }
92
- function Q(a) {
93
- let e = U.specInfoDict.values.filter((p) => p.key === a), t = {
94
- specId: e[0].key,
95
- specName: e[0].value,
96
- specValueList: []
97
- };
98
- c.value.push(t), D.value = "";
99
- }
100
- function W(a) {
101
- h.value = new T({ specId: c.value[a].specId }), h.value.useValues().then((e) => {
102
- e.map((t) => {
103
- Array.isArray(c.value[a].specValueList) && c.value[a].specValueList.length > 0 && c.value[a].specValueList.forEach((p) => {
104
- t.key === p.specValueId && (t.disabled = !0);
105
- });
106
- });
107
- });
108
- }
109
- function X(a, e) {
110
- var l, s;
111
- let t = h.value.values.filter((i) => i.key === a), p = {
112
- specValueId: t[0].key,
113
- specValueName: t[0].value
114
- };
115
- (s = (l = c.value[e]) == null ? void 0 : l.specValueList) == null || s.push(p), c.value[e].specValueId = "", P();
116
- }
117
- function P() {
118
- let a = {};
119
- c.value.filter((l) => l.specValueList.length > 0).forEach((l) => {
120
- l.specName && (a[l.specName] = l.specValueList.map((s) => s.specValueName));
121
- });
122
- let e = [], t = [];
123
- for (let l in a)
124
- e.push(l), t.push(a[l]);
125
- console.log(e, t);
126
- let p = Y(...t);
127
- b.value.tableHeaderList = c.value.filter((l) => l.specValueList.length > 0).map((l) => ({
128
- label: String(l.specName),
129
- prop: String(l.specName)
130
- })), b.value.tableBodyList = p.map((l) => {
131
- let s = {
132
- picUrl: "",
133
- // 销售价格
134
- salePrice: 0,
135
- // 市场价
136
- marketPrice: 0,
137
- // 成本价
138
- costPrice: 0,
139
- // 重量
140
- weight: 0,
141
- // 体积(m³)
142
- volume: 0,
143
- // 库存
144
- stock: 0,
145
- // 编码
146
- skuCode: "",
147
- status: !1,
148
- specValues: []
149
- };
150
- const i = {};
151
- c.value.filter((d) => d.specValueList.length > 0).forEach((d) => {
152
- d.specName && (i[d.specName] = {
153
- specId: d.specId,
154
- specValueList: d.specValueList
155
- });
156
- });
157
- for (let d = 0; d < l.length; d++) {
158
- console.log(e[d], l[d]), s[e[d]] = l[d];
159
- const _ = i[e[d]];
160
- if (_) {
161
- const L = {
162
- specId: _.specId,
163
- specValueId: ""
164
- };
165
- for (const y of _.specValueList)
166
- if (y.specValueName === l[d]) {
167
- L.specValueId = y.specValueId;
168
- break;
169
- }
170
- s.specValues.push(L);
171
- }
172
- }
173
- return s;
174
- }), console.log(n.skuListUpdate), n.skuListUpdate.length > 0 && (b.value.tableBodyList = b.value.tableBodyList.map((l, s) => (s < n.skuListUpdate.length && (l.picUrl = n.skuListUpdate[s].picUrl, l.salePrice = n.skuListUpdate[s].salePrice, l.marketPrice = n.skuListUpdate[s].marketPrice, l.costPrice = n.skuListUpdate[s].costPrice, l.weight = n.skuListUpdate[s].weight, l.volume = n.skuListUpdate[s].volume, l.stock = n.skuListUpdate[s].stock, l.skuCode = n.skuListUpdate[s].skuCode, l.status = n.skuListUpdate[s].status), l))), console.log(b.value.tableBodyList), j("getFormData", c.value.map((l) => l.specId), b.value.tableBodyList);
175
- }
176
- function Y(...a) {
177
- return a = a.filter((e) => e.length > 0), a.length === 0 ? [[]] : a.reduce(
178
- (e, t) => {
179
- console.log(e, t);
180
- let p = [];
181
- return e.forEach((l) => {
182
- console.log(l), t.forEach((s) => {
183
- console.log(s), p.push(l.concat([s]));
184
- });
185
- }), p;
186
- },
187
- [[]]
188
- );
189
- }
190
- return (a, e) => {
191
- const t = v("el-input-number"), p = v("el-form-item"), l = v("el-col"), s = v("el-row"), i = v("Delete"), d = v("el-icon"), _ = v("el-tag"), L = v("el-button"), y = v("el-option"), B = v("el-select"), q = v("el-popover"), A = v("el-tab-pane"), R = v("el-tabs");
192
- return V(), k(I, null, [
193
- n.specType == "UNIFIED_SPEC" ? (V(), k("div", se, [
194
- o(s, null, {
195
- default: u(() => [
196
- o(l, { span: 8 }, {
197
- default: u(() => [
198
- o(p, {
199
- label: a.$t("goodsSpu.salePrice"),
200
- prop: "salePrice"
201
- }, {
202
- default: u(() => [
203
- o(t, {
204
- modelValue: f.value.salePrice,
205
- "onUpdate:modelValue": e[0] || (e[0] = (r) => f.value.salePrice = r),
206
- precision: 2,
207
- step: 0,
208
- placeholder: a.$t("goodsSpu.salePriceRequired"),
209
- class: "w-full",
210
- controls: !1
211
- }, null, 8, ["modelValue", "placeholder"])
212
- ]),
213
- _: 1
214
- }, 8, ["label"])
215
- ]),
216
- _: 1
217
- }),
218
- o(l, { span: 8 }, {
219
- default: u(() => [
220
- o(p, {
221
- label: a.$t("goodsSpu.marketPrice"),
222
- prop: "marketPrice"
223
- }, {
224
- default: u(() => [
225
- o(t, {
226
- modelValue: f.value.marketPrice,
227
- "onUpdate:modelValue": e[1] || (e[1] = (r) => f.value.marketPrice = r),
228
- precision: 2,
229
- step: 0,
230
- placeholder: a.$t("goodsSpu.marketPriceRequired"),
231
- class: "w-full",
232
- controls: !1
233
- }, null, 8, ["modelValue", "placeholder"])
234
- ]),
235
- _: 1
236
- }, 8, ["label"])
237
- ]),
238
- _: 1
239
- }),
240
- o(l, { span: 8 }, {
241
- default: u(() => [
242
- o(p, {
243
- label: a.$t("goodsSpu.costPrice"),
244
- prop: "costPrice"
245
- }, {
246
- default: u(() => [
247
- o(t, {
248
- modelValue: f.value.costPrice,
249
- "onUpdate:modelValue": e[2] || (e[2] = (r) => f.value.costPrice = r),
250
- precision: 2,
251
- step: 0,
252
- placeholder: a.$t("goodsSpu.costPriceRequired"),
253
- class: "w-full",
254
- controls: !1
255
- }, null, 8, ["modelValue", "placeholder"])
256
- ]),
257
- _: 1
258
- }, 8, ["label"])
259
- ]),
260
- _: 1
261
- }),
262
- o(l, { span: 8 }, {
263
- default: u(() => [
264
- o(p, {
265
- label: a.$t("goodsSpu.stock"),
266
- prop: "stock"
267
- }, {
268
- default: u(() => [
269
- o(t, {
270
- modelValue: f.value.stock,
271
- "onUpdate:modelValue": e[3] || (e[3] = (r) => f.value.stock = r),
272
- placeholder: a.$t("goodsSpu.stockRequired"),
273
- class: "w-full",
274
- controls: !1,
275
- precision: 0
276
- }, null, 8, ["modelValue", "placeholder"])
277
- ]),
278
- _: 1
279
- }, 8, ["label"])
280
- ]),
281
- _: 1
282
- }),
283
- o(l, { span: 8 }, {
284
- default: u(() => [
285
- o(p, {
286
- label: a.$t("goodsSpu.weight"),
287
- prop: "weight"
288
- }, {
289
- default: u(() => [
290
- o(t, {
291
- modelValue: f.value.weight,
292
- "onUpdate:modelValue": e[4] || (e[4] = (r) => f.value.weight = r),
293
- placeholder: a.$t("goodsSpu.weightRequired"),
294
- class: "w-full",
295
- controls: !1
296
- }, null, 8, ["modelValue", "placeholder"])
297
- ]),
298
- _: 1
299
- }, 8, ["label"])
300
- ]),
301
- _: 1
302
- }),
303
- o(l, { span: 8 }, {
304
- default: u(() => [
305
- o(p, {
306
- label: a.$t("goodsSpu.volume"),
307
- prop: "volume"
308
- }, {
309
- default: u(() => [
310
- o(t, {
311
- modelValue: f.value.volume,
312
- "onUpdate:modelValue": e[5] || (e[5] = (r) => f.value.volume = r),
313
- controls: !1,
314
- placeholder: a.$t("goodsSpu.volumeRequired"),
315
- class: "w-full"
316
- }, null, 8, ["modelValue", "placeholder"])
317
- ]),
318
- _: 1
319
- }, 8, ["label"])
320
- ]),
321
- _: 1
322
- })
323
- ]),
324
- _: 1
325
- })
326
- ])) : E("", !0),
327
- n.specType == "MULTI_SPEC" ? (V(), k("div", oe, [
328
- o(R, { type: "border-card" }, {
329
- default: u(() => [
330
- o(A, { label: "商品规格" }, {
331
- default: u(() => [
332
- (V(!0), k(I, null, N(c.value, (r, g) => (V(), k("div", {
333
- class: "goods-spec",
334
- key: g
335
- }, [
336
- w("div", te, [
337
- w("span", null, F(r.specName), 1),
338
- w("span", {
339
- class: "goods-delete",
340
- onClick: (m) => H(g)
341
- }, [
342
- o(d, null, {
343
- default: u(() => [
344
- o(i)
345
- ]),
346
- _: 1
347
- }),
348
- e[7] || (e[7] = C("移除"))
349
- ], 8, ue)
350
- ]),
351
- w("div", ce, [
352
- w("div", pe, [
353
- (V(!0), k(I, null, N(c.value[g].specValueList, (m, Z) => (V(), $(_, {
354
- key: m,
355
- closable: "",
356
- type: "info",
357
- class: "right-dis",
358
- onClose: (ne) => J(g, Z)
359
- }, {
360
- default: u(() => [
361
- C(F(m.specValueName), 1)
362
- ]),
363
- _: 2
364
- }, 1032, ["onClose"]))), 128))
365
- ]),
366
- o(q, {
367
- placement: "bottom",
368
- width: 200,
369
- trigger: "click",
370
- onShow: (m) => W(g)
371
- }, {
372
- reference: u(() => [
373
- o(L, { class: "m-2" }, {
374
- default: u(() => e[8] || (e[8] = [
375
- C("添加规格值")
376
- ])),
377
- _: 1
378
- })
379
- ]),
380
- default: u(() => [
381
- o(B, {
382
- modelValue: c.value[g].specValueId,
383
- "onUpdate:modelValue": (m) => c.value[g].specValueId = m,
384
- placeholder: a.$t("goodsSpu.specValueRequired"),
385
- onChange: (m) => X(m, g)
386
- }, {
387
- default: u(() => [
388
- (V(!0), k(I, null, N(h.value.values, (m) => (V(), $(y, {
389
- key: m.key,
390
- label: m.value,
391
- value: m.key,
392
- disabled: m.disabled
393
- }, null, 8, ["label", "value", "disabled"]))), 128))
394
- ]),
395
- _: 2
396
- }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"])
397
- ]),
398
- _: 2
399
- }, 1032, ["onShow"])
400
- ])
401
- ]))), 128)),
402
- o(q, {
403
- placement: "bottom",
404
- width: 200,
405
- trigger: "click",
406
- onShow: K
407
- }, {
408
- reference: u(() => [
409
- o(L, { class: "m-2" }, {
410
- default: u(() => e[9] || (e[9] = [
411
- C("添加规格")
412
- ])),
413
- _: 1
414
- })
415
- ]),
416
- default: u(() => [
417
- o(B, {
418
- modelValue: D.value,
419
- "onUpdate:modelValue": e[6] || (e[6] = (r) => D.value = r),
420
- placeholder: a.$t("goodsSpu.specRequired"),
421
- onChange: Q
422
- }, {
423
- default: u(() => [
424
- (V(!0), k(I, null, N(ee(U).specInfoDict.values, (r) => (V(), $(y, {
425
- key: r.key,
426
- label: r.value,
427
- value: r.key,
428
- disabled: r.disabled
429
- }, null, 8, ["label", "value", "disabled"]))), 128))
430
- ]),
431
- _: 1
432
- }, 8, ["modelValue", "placeholder"])
433
- ]),
434
- _: 1
435
- })
436
- ]),
437
- _: 1
438
- })
439
- ]),
440
- _: 1
441
- }),
442
- o(R, { type: "border-card" }, {
443
- default: u(() => [
444
- o(A, { label: "规格售价与库存" }, {
445
- default: u(() => [
446
- c.value.length ? (V(), $(le, {
447
- key: 0,
448
- "table-obj": b.value
449
- }, null, 8, ["table-obj"])) : E("", !0)
450
- ]),
451
- _: 1
452
- })
453
- ]),
454
- _: 1
455
- })
456
- ])) : E("", !0)
457
- ], 64);
458
- };
459
- }
460
- }), ve = /* @__PURE__ */ ae(re, [["__scopeId", "data-v-04b82be8"]]);
461
- export {
462
- ve as default
463
- };