xyvcard-goods 0.0.1 → 0.0.2

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 (31) hide show
  1. package/dist/{approveFailIndex-gl8MBbK6.mjs → approveFailIndex-BS-H7i3Y.mjs} +1 -1
  2. package/dist/{approvedIndex.vue_vue_type_script_setup_true_lang-Wyt6TM2h.mjs → approveFailIndex.vue_vue_type_script_setup_true_lang-CebPGseh.mjs} +111 -94
  3. package/dist/{auditIndex-jOIDtl_l.mjs → auditIndex-DHQPvPdG.mjs} +1 -1
  4. package/dist/{auditIndex.vue_vue_type_script_setup_true_lang-sZD3eYJR.mjs → auditIndex.vue_vue_type_script_setup_true_lang-B-ghb-zu.mjs} +142 -125
  5. package/dist/{edit-DpIovEhA.mjs → edit-DOqDV4qb.mjs} +3792 -3789
  6. package/dist/{index-C9KO9AZw.mjs → el-message-D15RmjW3.mjs} +368 -367
  7. package/dist/{index-BupW0ufK.mjs → index-CIN1Wvug.mjs} +102 -75
  8. package/dist/{index-C9f6Lybt.mjs → index-CZD7OAWo.mjs} +49 -30
  9. package/dist/index.mjs +519 -593
  10. package/dist/info-MqipS9Ok.mjs +311 -0
  11. package/dist/{saleIndex-DOcefF_x.mjs → saleIndex-D2vlM6ww.mjs} +1 -1
  12. package/dist/saleIndex.vue_vue_type_script_setup_true_lang-B1iRvFF9.mjs +428 -0
  13. package/dist/{shelfIndex-CTAReFV-.mjs → shelfIndex-CEgDzOX1.mjs} +1 -1
  14. package/dist/{shelfIndex.vue_vue_type_script_setup_true_lang-BG3OCeN_.mjs → shelfIndex.vue_vue_type_script_setup_true_lang-DS__493K.mjs} +174 -160
  15. package/dist/skuForm-BMRF5whq.mjs +419 -0
  16. package/dist/skuTable-Ddo1obnO.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/lang/goods/en.d.ts +1 -68
  21. package/dts/lang/goods/zh-cn.d.ts +0 -44
  22. package/dts/utils/sku.d.ts +19 -0
  23. package/dts/views/goods/goods-spu/skuForm.vue.d.ts +29 -0
  24. package/dts/views/goods/goods-spu/skuTable.vue.d.ts +40 -0
  25. package/package.json +2 -2
  26. package/dist/approveFailIndex.vue_vue_type_script_setup_true_lang-WJ40OU9K.mjs +0 -544
  27. package/dist/approvedIndex-Cn6g11xv.mjs +0 -4
  28. package/dist/info-C6VRixBH.mjs +0 -301
  29. package/dist/saleIndex.vue_vue_type_script_setup_true_lang-Cfv3a-DK.mjs +0 -415
  30. package/dist/sku-form-BAi4HkUM.mjs +0 -463
  31. package/dist/sku-table-CRrisvJ1.mjs +0 -410
@@ -0,0 +1,419 @@
1
+ import { defineComponent as te, ref as k, computed as se, watch as C, resolveComponent as i, openBlock as m, createElementBlock as _, Fragment as h, unref as M, createVNode as o, withCtx as a, createCommentVNode as D, renderList as y, createElementVNode as S, toDisplayString as O, createTextVNode as w, createBlock as P } from "vue";
2
+ import "jmash-core";
3
+ import { C as L, D as ue, S as H, a as ne } from "./index-CZD7OAWo.mjs";
4
+ import { s as pe, _ as re } from "./skuTable-Ddo1obnO.mjs";
5
+ const de = { key: 0 }, ce = {
6
+ key: 1,
7
+ class: "w-full"
8
+ }, ie = { class: "goods-title" }, me = ["onClick"], fe = { class: "goods-content" }, ve = { class: "goods-tag" }, ge = /* @__PURE__ */ te({
9
+ __name: "skuForm",
10
+ props: {
11
+ // 规格类型
12
+ specType: {
13
+ type: String,
14
+ default: () => ""
15
+ },
16
+ form: {
17
+ type: Object,
18
+ default: () => {
19
+ }
20
+ }
21
+ },
22
+ emits: ["getGoodsSku", "getFormData"],
23
+ setup(J, { emit: K }) {
24
+ var F, T, q;
25
+ const r = k({
26
+ picUrl: "",
27
+ salePrice: 0,
28
+ marketPrice: 0,
29
+ costPrice: 0,
30
+ weight: 0,
31
+ volume: 0,
32
+ stock: 0,
33
+ skuCode: ""
34
+ }), t = k([]), I = k(), V = k([]), b = k([]), $ = k([]), v = J, E = K, U = se(() => t.value.filter(
35
+ (e) => e.name && e.specValueList != null && e.specValueList.length
36
+ ));
37
+ C(
38
+ v.form,
39
+ (e) => e,
40
+ {
41
+ deep: !0,
42
+ immediate: !0
43
+ }
44
+ ), C(
45
+ r,
46
+ (e) => {
47
+ E("getGoodsSku", e);
48
+ },
49
+ {
50
+ deep: !0,
51
+ immediate: !0
52
+ }
53
+ ), C(
54
+ U,
55
+ (e) => e,
56
+ {
57
+ deep: !0,
58
+ immediate: !0
59
+ }
60
+ ), v.form.spuId && (v.form.specType === L.specType.UNIFIED_SPEC ? r.value = (F = v.form.skuList) == null ? void 0 : F.results[0] : ($.value = (T = v.form.skuList) == null ? void 0 : T.results, (q = v.form.skuList) == null || q.results.forEach((e) => {
61
+ var l;
62
+ (l = e.specValues) == null || l.map((s) => {
63
+ ue.specInfoDict.useValues().then((n) => {
64
+ const p = n.find((f) => s.specId === f.key);
65
+ if (console.log(p), p) {
66
+ let f = {
67
+ id: s.specId,
68
+ name: p.value,
69
+ specValueList: []
70
+ };
71
+ t.value.push(f);
72
+ }
73
+ const d = /* @__PURE__ */ new Map();
74
+ t.value = t.value.filter(
75
+ (f) => !d.has(f.id) && d.set(f.id, f)
76
+ ), Q(s.specValueId);
77
+ });
78
+ });
79
+ })));
80
+ function Q(e) {
81
+ t.value.forEach((l) => {
82
+ V.value = new H({ specId: l.id }), V.value.useValues().then((s) => {
83
+ s.forEach((n) => {
84
+ if (n.key === e) {
85
+ let d = {
86
+ id: e,
87
+ name: n.value
88
+ };
89
+ l.specValueList.push(d);
90
+ }
91
+ const p = /* @__PURE__ */ new Map();
92
+ l.specValueList = l.specValueList.filter(
93
+ (d) => !p.has(d.id) && p.set(d.id, d)
94
+ ), console.log(t.value);
95
+ });
96
+ });
97
+ });
98
+ }
99
+ function W(e) {
100
+ t.value.splice(e, 1);
101
+ }
102
+ function X(e, l) {
103
+ t.value[e].specValueList.splice(l, 1);
104
+ }
105
+ function Y() {
106
+ b.value = new ne({ shopId: v.form.shopId }), b.value.useValues().then((e) => {
107
+ e.forEach((l) => {
108
+ Array.isArray(t.value) && t.value.length > 0 && (console.log(t.value), t.value.forEach((s) => {
109
+ l.key === s.id && (l.disabled = !0);
110
+ }));
111
+ });
112
+ });
113
+ }
114
+ function Z(e) {
115
+ let l = b.value.values.filter((n) => n.key === e), s = {
116
+ id: l[0].key,
117
+ name: l[0].value,
118
+ specValueList: []
119
+ };
120
+ t.value.push(s), I.value = "";
121
+ }
122
+ function z(e) {
123
+ V.value = new H({
124
+ specId: t.value[e].id
125
+ }), V.value.useValues().then((l) => {
126
+ l.map((s) => {
127
+ Array.isArray(t.value[e].specValueList) && t.value[e].specValueList.length > 0 && t.value[e].specValueList.forEach((n) => {
128
+ s.key === n.id && (s.disabled = !0);
129
+ });
130
+ });
131
+ });
132
+ }
133
+ function x(e, l) {
134
+ var p, d;
135
+ let s = V.value.values.filter((f) => f.key === e), n = {
136
+ id: s[0].key,
137
+ name: s[0].value
138
+ };
139
+ (d = (p = t.value[l]) == null ? void 0 : p.specValueList) == null || d.push(n), t.value[l].specValueId = "";
140
+ }
141
+ function ee(e) {
142
+ E("getFormData", e);
143
+ }
144
+ return (e, l) => {
145
+ const s = i("el-input-number"), n = i("el-form-item"), p = i("el-col"), d = i("el-row"), f = i("Delete"), le = i("el-icon"), oe = i("el-tag"), R = i("el-button"), N = i("el-option"), j = i("el-select"), A = i("el-popover"), B = i("el-tab-pane"), G = i("el-tabs");
146
+ return m(), _(h, null, [
147
+ v.specType == M(L).specType.UNIFIED_SPEC ? (m(), _("div", de, [
148
+ o(d, null, {
149
+ default: a(() => [
150
+ o(p, { span: 8 }, {
151
+ default: a(() => [
152
+ o(n, {
153
+ label: e.$t("goodsSpu.salePrice"),
154
+ prop: "salePrice"
155
+ }, {
156
+ default: a(() => [
157
+ o(s, {
158
+ modelValue: r.value.salePrice,
159
+ "onUpdate:modelValue": l[0] || (l[0] = (u) => r.value.salePrice = u),
160
+ precision: 2,
161
+ step: 0,
162
+ placeholder: e.$t("goodsSpu.salePriceRequired"),
163
+ class: "w-full",
164
+ controls: !1
165
+ }, null, 8, ["modelValue", "placeholder"])
166
+ ]),
167
+ _: 1
168
+ }, 8, ["label"])
169
+ ]),
170
+ _: 1
171
+ }),
172
+ o(p, { span: 8 }, {
173
+ default: a(() => [
174
+ o(n, {
175
+ label: e.$t("goodsSpu.marketPrice"),
176
+ prop: "marketPrice"
177
+ }, {
178
+ default: a(() => [
179
+ o(s, {
180
+ modelValue: r.value.marketPrice,
181
+ "onUpdate:modelValue": l[1] || (l[1] = (u) => r.value.marketPrice = u),
182
+ precision: 2,
183
+ step: 0,
184
+ placeholder: e.$t("goodsSpu.marketPriceRequired"),
185
+ class: "w-full",
186
+ controls: !1
187
+ }, null, 8, ["modelValue", "placeholder"])
188
+ ]),
189
+ _: 1
190
+ }, 8, ["label"])
191
+ ]),
192
+ _: 1
193
+ }),
194
+ o(p, { span: 8 }, {
195
+ default: a(() => [
196
+ o(n, {
197
+ label: e.$t("goodsSpu.costPrice"),
198
+ prop: "costPrice"
199
+ }, {
200
+ default: a(() => [
201
+ o(s, {
202
+ modelValue: r.value.costPrice,
203
+ "onUpdate:modelValue": l[2] || (l[2] = (u) => r.value.costPrice = u),
204
+ precision: 2,
205
+ step: 0,
206
+ placeholder: e.$t("goodsSpu.costPriceRequired"),
207
+ class: "w-full",
208
+ controls: !1
209
+ }, null, 8, ["modelValue", "placeholder"])
210
+ ]),
211
+ _: 1
212
+ }, 8, ["label"])
213
+ ]),
214
+ _: 1
215
+ }),
216
+ o(p, { span: 8 }, {
217
+ default: a(() => [
218
+ o(n, {
219
+ label: e.$t("goodsSpu.stock"),
220
+ prop: "stock"
221
+ }, {
222
+ default: a(() => [
223
+ o(s, {
224
+ modelValue: r.value.stock,
225
+ "onUpdate:modelValue": l[3] || (l[3] = (u) => r.value.stock = u),
226
+ placeholder: e.$t("goodsSpu.stockRequired"),
227
+ class: "w-full",
228
+ controls: !1,
229
+ precision: 0
230
+ }, null, 8, ["modelValue", "placeholder"])
231
+ ]),
232
+ _: 1
233
+ }, 8, ["label"])
234
+ ]),
235
+ _: 1
236
+ }),
237
+ o(p, { span: 8 }, {
238
+ default: a(() => [
239
+ o(n, {
240
+ label: e.$t("goodsSpu.weight"),
241
+ prop: "weight"
242
+ }, {
243
+ default: a(() => [
244
+ o(s, {
245
+ modelValue: r.value.weight,
246
+ "onUpdate:modelValue": l[4] || (l[4] = (u) => r.value.weight = u),
247
+ placeholder: e.$t("goodsSpu.weightRequired"),
248
+ class: "w-full",
249
+ controls: !1
250
+ }, null, 8, ["modelValue", "placeholder"])
251
+ ]),
252
+ _: 1
253
+ }, 8, ["label"])
254
+ ]),
255
+ _: 1
256
+ }),
257
+ o(p, { span: 8 }, {
258
+ default: a(() => [
259
+ o(n, {
260
+ label: e.$t("goodsSpu.volume"),
261
+ prop: "volume"
262
+ }, {
263
+ default: a(() => [
264
+ o(s, {
265
+ modelValue: r.value.volume,
266
+ "onUpdate:modelValue": l[5] || (l[5] = (u) => r.value.volume = u),
267
+ controls: !1,
268
+ placeholder: e.$t("goodsSpu.volumeRequired"),
269
+ class: "w-full"
270
+ }, null, 8, ["modelValue", "placeholder"])
271
+ ]),
272
+ _: 1
273
+ }, 8, ["label"])
274
+ ]),
275
+ _: 1
276
+ })
277
+ ]),
278
+ _: 1
279
+ })
280
+ ])) : D("", !0),
281
+ v.specType == M(L).specType.MULTI_SPEC ? (m(), _("div", ce, [
282
+ o(G, { type: "border-card" }, {
283
+ default: a(() => [
284
+ o(B, { label: "商品规格" }, {
285
+ default: a(() => [
286
+ (m(!0), _(h, null, y(t.value, (u, g) => (m(), _("div", {
287
+ class: "goods-spec",
288
+ key: g
289
+ }, [
290
+ S("div", ie, [
291
+ S("span", null, O(u.name), 1),
292
+ S("span", {
293
+ class: "goods-delete",
294
+ onClick: (c) => W(g)
295
+ }, [
296
+ o(le, null, {
297
+ default: a(() => [
298
+ o(f)
299
+ ]),
300
+ _: 1
301
+ }),
302
+ l[7] || (l[7] = w("移除"))
303
+ ], 8, me)
304
+ ]),
305
+ S("div", fe, [
306
+ S("div", ve, [
307
+ (m(!0), _(h, null, y(t.value[g].specValueList, (c, ae) => (m(), P(oe, {
308
+ key: c,
309
+ closable: "",
310
+ type: "info",
311
+ class: "right-dis",
312
+ onClose: (_e) => X(g, ae)
313
+ }, {
314
+ default: a(() => [
315
+ w(O(c.name), 1)
316
+ ]),
317
+ _: 2
318
+ }, 1032, ["onClose"]))), 128))
319
+ ]),
320
+ o(A, {
321
+ placement: "bottom",
322
+ width: 200,
323
+ trigger: "click",
324
+ onShow: (c) => z(g)
325
+ }, {
326
+ reference: a(() => [
327
+ o(R, { class: "m-2" }, {
328
+ default: a(() => l[8] || (l[8] = [
329
+ w("添加规格值")
330
+ ])),
331
+ _: 1
332
+ })
333
+ ]),
334
+ default: a(() => [
335
+ o(j, {
336
+ modelValue: t.value[g].specValueId,
337
+ "onUpdate:modelValue": (c) => t.value[g].specValueId = c,
338
+ placeholder: e.$t("goodsSpu.specValueRequired"),
339
+ onChange: (c) => x(c, g)
340
+ }, {
341
+ default: a(() => [
342
+ (m(!0), _(h, null, y(V.value.values, (c) => (m(), P(N, {
343
+ key: c.key,
344
+ label: c.value,
345
+ value: c.key,
346
+ disabled: c.disabled
347
+ }, null, 8, ["label", "value", "disabled"]))), 128))
348
+ ]),
349
+ _: 2
350
+ }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"])
351
+ ]),
352
+ _: 2
353
+ }, 1032, ["onShow"])
354
+ ])
355
+ ]))), 128)),
356
+ o(A, {
357
+ placement: "bottom",
358
+ width: 200,
359
+ trigger: "click",
360
+ onShow: Y
361
+ }, {
362
+ reference: a(() => [
363
+ o(R, { class: "m-2" }, {
364
+ default: a(() => l[9] || (l[9] = [
365
+ w("添加规格")
366
+ ])),
367
+ _: 1
368
+ })
369
+ ]),
370
+ default: a(() => [
371
+ o(j, {
372
+ modelValue: I.value,
373
+ "onUpdate:modelValue": l[6] || (l[6] = (u) => I.value = u),
374
+ placeholder: e.$t("goodsSpu.specRequired"),
375
+ onChange: Z
376
+ }, {
377
+ default: a(() => [
378
+ (m(!0), _(h, null, y(b.value.values, (u) => (m(), P(N, {
379
+ key: u.key,
380
+ label: u.value,
381
+ value: u.key,
382
+ disabled: u.disabled
383
+ }, null, 8, ["label", "value", "disabled"]))), 128))
384
+ ]),
385
+ _: 1
386
+ }, 8, ["modelValue", "placeholder"])
387
+ ]),
388
+ _: 1
389
+ })
390
+ ]),
391
+ _: 1
392
+ })
393
+ ]),
394
+ _: 1
395
+ }),
396
+ o(G, { type: "border-card" }, {
397
+ default: a(() => [
398
+ o(B, { label: "规格售价与库存" }, {
399
+ default: a(() => [
400
+ t.value.length > 0 ? (m(), P(pe, {
401
+ key: 0,
402
+ specData: U.value,
403
+ goodsSku: $.value,
404
+ onGetFormData: ee
405
+ }, null, 8, ["specData", "goodsSku"])) : D("", !0)
406
+ ]),
407
+ _: 1
408
+ })
409
+ ]),
410
+ _: 1
411
+ })
412
+ ])) : D("", !0)
413
+ ], 64);
414
+ };
415
+ }
416
+ }), be = /* @__PURE__ */ re(ge, [["__scopeId", "data-v-8e881ab3"]]);
417
+ export {
418
+ be as default
419
+ };