xyvcard-goods 0.0.20 → 0.0.22

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 (40) hide show
  1. package/dist/ImageUpload-Dk6GY6PA.mjs +93 -0
  2. package/dist/{edit-Cj13W2TC.mjs → edit-Byv9oYAC.mjs} +1 -1
  3. package/dist/{edit-Bb2XgE0h.mjs → edit-Nuaz9WSB.mjs} +160 -244
  4. package/dist/edit-exVf8d8b.mjs +367 -0
  5. package/dist/edit.vue_vue_type_script_setup_true_lang-DuSBj1Mm.mjs +24172 -0
  6. package/dist/{goodsList-DOXK1EwK.mjs → goodsList-CZUqc4nm.mjs} +1 -1
  7. package/dist/goodsList-IWDAvKOx.mjs +4 -0
  8. package/dist/goodsList.vue_vue_type_script_setup_true_lang-BhJn02Ym.mjs +576 -0
  9. package/dist/{goodsList.vue_vue_type_script_setup_true_lang-COJVlEjX.mjs → goodsList.vue_vue_type_script_setup_true_lang-CuzIDtTN.mjs} +51 -50
  10. package/dist/{index-CGAoZY87.mjs → index-4i7TnWvV.mjs} +2 -3
  11. package/dist/index-BVGn6Q_T.mjs +53 -0
  12. package/dist/{index-DAJiqOCh.mjs → index-B_U2s9fI.mjs} +2 -2
  13. package/dist/{index-C3FT_Oe7.mjs → index-CQIttgns.mjs} +1 -1
  14. package/dist/{index-D3w33Nba.mjs → index-Dvaotk7B.mjs} +92 -68
  15. package/dist/{index-BmOxm1P2.mjs → index-_xxSoBUe.mjs} +1 -1
  16. package/dist/index.mjs +561 -538
  17. package/dist/{info-DImlMNq0.mjs → info-BH4MW3Sw.mjs} +2 -2
  18. package/dist/info-BQaaTFry.mjs +365 -0
  19. package/dist/sku-B-IzfYLq.mjs +52 -0
  20. package/dist/skuForm-AMIoZkH-.mjs +287 -0
  21. package/dist/{skuForm-Bt3arW0s.mjs → skuForm-CgjMd46J.mjs} +16 -16
  22. package/dist/{skuTable-Ahc3WlPp.mjs → skuTable-CyGQuTvR.mjs} +208 -255
  23. package/dist/skuTable-DDWSmvoz.mjs +592 -0
  24. package/dist/style.css +1 -1
  25. package/dts/api/dict.d.ts +3 -0
  26. package/dts/api/goods-sku/types.d.ts +2 -2
  27. package/dts/api/goods-spu/index.d.ts +1 -0
  28. package/dts/api/goods-spu/types.d.ts +18 -1
  29. package/dts/api/index.d.ts +2 -1
  30. package/dts/constant.d.ts +4 -0
  31. package/dts/lang/goods/zh-cn.d.ts +6 -1
  32. package/dts/router/index.d.ts +1 -0
  33. package/dts/views/goods/goods-combination/edit.vue.d.ts +2 -0
  34. package/dts/views/goods/goods-combination/goodsList.vue.d.ts +14 -0
  35. package/dts/views/goods/goods-combination/index.vue.d.ts +2 -0
  36. package/dts/views/goods/goods-combination/info.vue.d.ts +2 -0
  37. package/dts/views/goods/goods-combination/skuForm.vue.d.ts +20 -0
  38. package/dts/views/goods/goods-combination/skuTable.vue.d.ts +40 -0
  39. package/package.json +62 -61
  40. package/dist/edit.vue_vue_type_script_setup_true_lang-D2w1583D.mjs +0 -234
@@ -0,0 +1,367 @@
1
+ import { _ as j } from "./ImageUpload-Dk6GY6PA.mjs";
2
+ import { defineComponent as M, ref as I, reactive as k, resolveComponent as n, openBlock as c, createElementBlock as v, createElementVNode as g, createVNode as e, unref as t, withCtx as s, Fragment as H, renderList as P, createBlock as R, createTextVNode as w, toDisplayString as O, createCommentVNode as J } from "vue";
3
+ import { ElMessage as N } from "element-plus";
4
+ import { useRouter as K, useRoute as Q } from "vue-router";
5
+ import { routerUtil as U } from "jmash-core";
6
+ import { useI18n as W } from "vue-i18n";
7
+ import { D as m } from "./index-Dvaotk7B.mjs";
8
+ import { goodsSpuApi as h } from "./index.mjs";
9
+ import X from "./skuForm-AMIoZkH-.mjs";
10
+ const Y = { class: "app-container" }, Z = { class: "search-container" }, x = { class: "image-card" }, pe = /* @__PURE__ */ M({
11
+ __name: "edit",
12
+ setup(ee) {
13
+ const { t: p } = W(), y = K(), f = Q(), b = I();
14
+ m.goodsCategoryListBizLayDict.useValues(), m.labelListBizDict.useValues();
15
+ let l = k({
16
+ requestId: Math.random() * 10 + "",
17
+ updateMask: "labelIds,spuName,categoryIds,spuCode,freightType,freightAmount,picUrls,shelf,saleNum",
18
+ skuSpecValues: [],
19
+ freightType: m.freightTypeEnum.values[0].key,
20
+ freightAmount: 0,
21
+ shelf: m.shelfDict.values[0].key
22
+ });
23
+ const C = (u, o, i) => {
24
+ var d;
25
+ const r = (d = l.picUrls) == null ? void 0 : d.split(",").filter(Boolean);
26
+ if (r != null && r.length) {
27
+ if ((r == null ? void 0 : r.length) < 1)
28
+ return i(new Error(p("goodsSpu.imageListsErrors")));
29
+ i();
30
+ } else return i(new Error(p("goodsSpu.picUrlsRequired")));
31
+ }, T = k({
32
+ spuName: [
33
+ {
34
+ required: !0,
35
+ message: p("goodsSpu.spuNameRequired"),
36
+ trigger: "blur"
37
+ }
38
+ ],
39
+ categoryIds: [
40
+ {
41
+ required: !0,
42
+ message: p("goodsSpu.categoryIdRequired"),
43
+ trigger: "change"
44
+ }
45
+ ],
46
+ spuCode: [
47
+ {
48
+ required: !0,
49
+ message: p("goodsSpu.spuCodeRequired"),
50
+ trigger: "change"
51
+ }
52
+ ],
53
+ freightType: [
54
+ {
55
+ required: !0,
56
+ message: p("goodsSpu.freightTypeRequired"),
57
+ trigger: "change"
58
+ }
59
+ ],
60
+ freightAmount: [
61
+ {
62
+ required: !0,
63
+ message: p("goodsSpu.freightAmountRequired"),
64
+ trigger: "blur"
65
+ }
66
+ ],
67
+ picUrls: [
68
+ {
69
+ validator: C,
70
+ trigger: "change"
71
+ }
72
+ ],
73
+ shelf: [
74
+ {
75
+ required: !0,
76
+ message: p("goodsSpu.shelfRequired"),
77
+ trigger: "change"
78
+ }
79
+ ]
80
+ }), V = I(!1);
81
+ function E(u) {
82
+ l.skuSpecValues.push(u), l.skuSpecValues = l.skuSpecValues.slice(-1);
83
+ }
84
+ f.query.spuId && h.findById({ spuId: f.query.spuId }).then(({ data: u }) => {
85
+ Object.assign(l, u), V.value = !0;
86
+ });
87
+ const $ = async () => {
88
+ var u;
89
+ await ((u = b.value) == null ? void 0 : u.validate((o) => {
90
+ o && (f.query.spuId ? h.update(l).then((i) => {
91
+ i.status === 200 && (N({
92
+ message: p("common.submitSuccess"),
93
+ type: "success"
94
+ }), U.closeTagView(f.fullPath, y, !1));
95
+ }) : h.createList(l).then((i) => {
96
+ i.status === 200 && (N({
97
+ message: p("common.submitSuccess"),
98
+ type: "success"
99
+ }), U.closeTagView(f.fullPath, y, !1));
100
+ }));
101
+ }));
102
+ };
103
+ function A(u) {
104
+ u === "FREIGHT_FREE" && (l.freightAmount = 0);
105
+ }
106
+ return (u, o) => {
107
+ const i = n("el-input"), r = n("el-form-item"), d = n("el-col"), F = n("el-tree-select"), S = n("jmash-enum-radio"), q = n("el-input-number"), B = j, D = n("el-checkbox"), L = n("el-checkbox-group"), _ = n("el-row"), G = n("el-button"), z = n("el-form");
108
+ return c(), v("div", Y, [
109
+ g("div", Z, [
110
+ e(z, {
111
+ ref_key: "goodsSpuFormRef",
112
+ ref: b,
113
+ model: t(l),
114
+ "label-width": "120px",
115
+ rules: T
116
+ }, {
117
+ default: s(() => [
118
+ o[11] || (o[11] = g("div", { class: "title-content" }, "基本信息", -1)),
119
+ e(_, null, {
120
+ default: s(() => [
121
+ e(d, { span: 12 }, {
122
+ default: s(() => [
123
+ e(r, {
124
+ label: u.$t("goodsSpu.spuName"),
125
+ prop: "spuName"
126
+ }, {
127
+ default: s(() => [
128
+ e(i, {
129
+ modelValue: t(l).spuName,
130
+ "onUpdate:modelValue": o[0] || (o[0] = (a) => t(l).spuName = a),
131
+ placeholder: u.$t("goodsSpu.spuNameRequired"),
132
+ maxlength: "60",
133
+ "show-word-limit": "",
134
+ clearable: ""
135
+ }, null, 8, ["modelValue", "placeholder"])
136
+ ]),
137
+ _: 1
138
+ }, 8, ["label"])
139
+ ]),
140
+ _: 1
141
+ }),
142
+ e(d, { span: 12 }, {
143
+ default: s(() => [
144
+ e(r, {
145
+ label: u.$t("goodsSpu.spuCode"),
146
+ prop: "spuCode"
147
+ }, {
148
+ default: s(() => [
149
+ e(i, {
150
+ modelValue: t(l).spuCode,
151
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => t(l).spuCode = a),
152
+ placeholder: u.$t("goodsSpu.spuCodeRequired"),
153
+ maxlength: "15",
154
+ "show-word-limit": "",
155
+ clearable: ""
156
+ }, null, 8, ["modelValue", "placeholder"])
157
+ ]),
158
+ _: 1
159
+ }, 8, ["label"])
160
+ ]),
161
+ _: 1
162
+ }),
163
+ e(d, { span: 12 }, {
164
+ default: s(() => [
165
+ e(r, {
166
+ label: u.$t("goodsSpu.categoryId"),
167
+ prop: "categoryIds"
168
+ }, {
169
+ default: s(() => [
170
+ e(F, {
171
+ modelValue: t(l).categoryIds,
172
+ "onUpdate:modelValue": o[2] || (o[2] = (a) => t(l).categoryIds = a),
173
+ data: t(m).goodsCategoryListBizLayDict.values,
174
+ multiple: "",
175
+ "render-after-expand": !1,
176
+ "show-checkbox": "",
177
+ placeholder: u.$t("goodsSpu.categoryIdRequired"),
178
+ class: "w-full"
179
+ }, null, 8, ["modelValue", "data", "placeholder"])
180
+ ]),
181
+ _: 1
182
+ }, 8, ["label"])
183
+ ]),
184
+ _: 1
185
+ }),
186
+ e(d, { span: 12 }, {
187
+ default: s(() => [
188
+ e(r, {
189
+ label: u.$t("goodsSpu.freightType"),
190
+ prop: "freightType"
191
+ }, {
192
+ default: s(() => [
193
+ e(S, {
194
+ modelValue: t(l).freightType,
195
+ "onUpdate:modelValue": o[3] || (o[3] = (a) => t(l).freightType = a),
196
+ data: t(m).freightTypeEnum.values,
197
+ onChange: A
198
+ }, null, 8, ["modelValue", "data"])
199
+ ]),
200
+ _: 1
201
+ }, 8, ["label"])
202
+ ]),
203
+ _: 1
204
+ }),
205
+ e(d, { span: 12 }, {
206
+ default: s(() => [
207
+ e(r, {
208
+ label: u.$t("goodsSpu.freightAmount"),
209
+ prop: "freightAmount"
210
+ }, {
211
+ default: s(() => [
212
+ e(q, {
213
+ modelValue: t(l).freightAmount,
214
+ "onUpdate:modelValue": o[4] || (o[4] = (a) => t(l).freightAmount = a),
215
+ readonly: t(l).freightType === "FREIGHT_FREE",
216
+ precision: 2,
217
+ step: 0.1,
218
+ controls: !1,
219
+ min: 0,
220
+ placeholder: u.$t("goodsSpu.freightAmountRequired"),
221
+ class: "w-full"
222
+ }, null, 8, ["modelValue", "readonly", "placeholder"])
223
+ ]),
224
+ _: 1
225
+ }, 8, ["label"])
226
+ ]),
227
+ _: 1
228
+ }),
229
+ e(d, { span: 24 }, {
230
+ default: s(() => [
231
+ e(r, {
232
+ label: u.$t("goodsSpu.picUrls"),
233
+ prop: "picUrls"
234
+ }, {
235
+ default: s(() => [
236
+ g("div", x, [
237
+ e(B, {
238
+ modelValue: t(l).picUrls,
239
+ "onUpdate:modelValue": o[5] || (o[5] = (a) => t(l).picUrls = a),
240
+ limit: 6,
241
+ "list-type": "picture-card"
242
+ }, null, 8, ["modelValue"]),
243
+ o[9] || (o[9] = g("div", { class: "red-color" }, " 推荐尺寸:100*100或同比例图片,最少上传1张 ", -1))
244
+ ])
245
+ ]),
246
+ _: 1
247
+ }, 8, ["label"])
248
+ ]),
249
+ _: 1
250
+ }),
251
+ e(d, { span: 12 }, {
252
+ default: s(() => [
253
+ e(r, {
254
+ label: u.$t("goodsSpu.shelf"),
255
+ prop: "shelf"
256
+ }, {
257
+ default: s(() => [
258
+ e(S, {
259
+ modelValue: t(l).shelf,
260
+ "onUpdate:modelValue": o[6] || (o[6] = (a) => t(l).shelf = a),
261
+ data: t(m).shelfDict.values
262
+ }, null, 8, ["modelValue", "data"])
263
+ ]),
264
+ _: 1
265
+ }, 8, ["label"])
266
+ ]),
267
+ _: 1
268
+ }),
269
+ e(d, { span: 12 }, {
270
+ default: s(() => [
271
+ e(r, {
272
+ label: u.$t("goodsSpu.saleNum"),
273
+ prop: "saleNum"
274
+ }, {
275
+ default: s(() => [
276
+ e(q, {
277
+ modelValue: t(l).saleNum,
278
+ "onUpdate:modelValue": o[7] || (o[7] = (a) => t(l).saleNum = a),
279
+ placeholder: u.$t("goodsSpu.saleNumRequired"),
280
+ class: "w-full",
281
+ min: 0,
282
+ controls: !1,
283
+ precision: 0
284
+ }, null, 8, ["modelValue", "placeholder"])
285
+ ]),
286
+ _: 1
287
+ }, 8, ["label"])
288
+ ]),
289
+ _: 1
290
+ }),
291
+ e(d, { span: 24 }, {
292
+ default: s(() => [
293
+ e(r, {
294
+ label: u.$t("goodsSpu.labelIds"),
295
+ prop: "labelIds"
296
+ }, {
297
+ default: s(() => [
298
+ e(L, {
299
+ modelValue: t(l).labelIds,
300
+ "onUpdate:modelValue": o[8] || (o[8] = (a) => t(l).labelIds = a),
301
+ class: "w-full"
302
+ }, {
303
+ default: s(() => [
304
+ (c(!0), v(H, null, P(t(m).labelListBizDict.values, (a) => (c(), R(D, {
305
+ key: a.key,
306
+ label: a.key
307
+ }, {
308
+ default: s(() => [
309
+ w(O(a.value), 1)
310
+ ]),
311
+ _: 2
312
+ }, 1032, ["label"]))), 128))
313
+ ]),
314
+ _: 1
315
+ }, 8, ["modelValue"])
316
+ ]),
317
+ _: 1
318
+ }, 8, ["label"])
319
+ ]),
320
+ _: 1
321
+ })
322
+ ]),
323
+ _: 1
324
+ }),
325
+ o[12] || (o[12] = g("div", { class: "title-content" }, "套装商品", -1)),
326
+ e(_, null, {
327
+ default: s(() => [
328
+ !t(f).query.spuId || V.value ? (c(), R(X, {
329
+ key: 0,
330
+ form: t(l),
331
+ onGetGoodsSku: E
332
+ }, null, 8, ["form"])) : J("", !0)
333
+ ]),
334
+ _: 1
335
+ }),
336
+ e(_, null, {
337
+ default: s(() => [
338
+ e(r, null, {
339
+ default: s(() => [
340
+ e(G, {
341
+ type: "primary",
342
+ onClick: $
343
+ }, {
344
+ default: s(() => o[10] || (o[10] = [
345
+ w("保存")
346
+ ])),
347
+ _: 1,
348
+ __: [10]
349
+ })
350
+ ]),
351
+ _: 1
352
+ })
353
+ ]),
354
+ _: 1
355
+ })
356
+ ]),
357
+ _: 1,
358
+ __: [11, 12]
359
+ }, 8, ["model", "rules"])
360
+ ])
361
+ ]);
362
+ };
363
+ }
364
+ });
365
+ export {
366
+ pe as default
367
+ };