xyvcard-goods 0.0.25 → 0.0.27
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.
- package/dist/{ImageUpload-Dk6GY6PA.mjs → ImageUpload-BMw9FVJL.mjs} +2 -2
- package/dist/{edit-DAyPJb0b.mjs → edit-C6CESv8X.mjs} +3 -3
- package/dist/{edit-DiWa_ZLE.mjs → edit-CuYE3fHS.mjs} +3 -3
- package/dist/edit-CvY-V0N5.mjs +428 -0
- package/dist/{edit-Dw0brF_L.mjs → edit-CwYGsVHI.mjs} +6 -6
- package/dist/{edit-CajMDPUo.mjs → edit-DmT9V-gh.mjs} +1 -1
- package/dist/{edit.vue_vue_type_script_setup_true_lang-C2XSQSoV.mjs → edit.vue_vue_type_script_setup_true_lang-DfFKgB6q.mjs} +76 -74
- package/dist/{goodsList-D5D6w8qJ.mjs → goodsList-Bj9pZI5X.mjs} +1 -1
- package/dist/{goodsList-DebLyKkm.mjs → goodsList-v98w-P_d.mjs} +1 -1
- package/dist/{goodsList.vue_vue_type_script_setup_true_lang-BovyDKOb.mjs → goodsList.vue_vue_type_script_setup_true_lang-BsItIhFh.mjs} +3 -3
- package/dist/{goodsList.vue_vue_type_script_setup_true_lang-BZZYw7U2.mjs → goodsList.vue_vue_type_script_setup_true_lang-QHlAuCT3.mjs} +3 -3
- package/dist/{index-DcreTzbx.mjs → index-0g53MREL.mjs} +14 -14
- package/dist/{index-gnGbjAJC.mjs → index-B0qodJxZ.mjs} +2 -2
- package/dist/{index-Bq-VIy8T.mjs → index-BrR_OdFN.mjs} +3 -3
- package/dist/{index-CtbKf0QD.mjs → index-CXEbqy-N.mjs} +14 -14
- package/dist/{index-DLPUpw3h.mjs → index-CXtRrzoC.mjs} +2006 -1879
- package/dist/{index-Ti58GY9z.mjs → index-D7Zknkay.mjs} +14 -14
- package/dist/{index-C4DAxQ7e.mjs → index-DWtdS9Gu.mjs} +3 -3
- package/dist/{index-C_El1x3C.mjs → index-szFiZJnI.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{info-BYntI7av.mjs → info-Bn5lfzNP.mjs} +4 -4
- package/dist/{info-Bkzvf5Mw.mjs → info-PRjY0AD1.mjs} +111 -105
- package/dist/skuForm-DF02pgox.mjs +318 -0
- package/dist/{skuForm-C0s08DP2.mjs → skuForm-EQVH7pCG.mjs} +6 -6
- package/dist/{skuTable-DyzW7iCQ.mjs → skuTable-DWpm1OMq.mjs} +4 -4
- package/dist/style.css +1 -1
- package/dts/api/goods-spu/types.d.ts +5 -0
- package/dts/lang/goods/zh-cn.d.ts +4 -0
- package/package.json +62 -62
- package/dist/edit-CWq3UNZW.mjs +0 -368
- package/dist/skuForm-WOvsR26d.mjs +0 -314
- package/dts/views/goods/goods-combination/skuTable.vue.d.ts +0 -40
package/dist/edit-CWq3UNZW.mjs
DELETED
|
@@ -1,368 +0,0 @@
|
|
|
1
|
-
import { _ as O } from "./ImageUpload-Dk6GY6PA.mjs";
|
|
2
|
-
import { defineComponent as P, ref as q, reactive as v, resolveComponent as n, openBlock as c, createElementBlock as R, createElementVNode as g, createVNode as e, unref as t, withCtx as s, Fragment as j, renderList as M, createBlock as k, createTextVNode as C, toDisplayString as H, createCommentVNode as Y } from "vue";
|
|
3
|
-
import { ElMessage as T } from "element-plus";
|
|
4
|
-
import { useRouter as J, useRoute as K } from "vue-router";
|
|
5
|
-
import { routerUtil as U } from "jmash-core";
|
|
6
|
-
import { useI18n as Q } from "vue-i18n";
|
|
7
|
-
import { D as m, C as W } from "./index-gnGbjAJC.mjs";
|
|
8
|
-
import { a as h } from "./index-DLPUpw3h.mjs";
|
|
9
|
-
import X from "./skuForm-WOvsR26d.mjs";
|
|
10
|
-
const Z = { class: "app-container" }, x = { class: "search-container" }, ee = { class: "image-card" }, ie = /* @__PURE__ */ P({
|
|
11
|
-
__name: "edit",
|
|
12
|
-
setup(le) {
|
|
13
|
-
const { t: p } = Q(), y = J(), f = K(), b = q();
|
|
14
|
-
m.goodsCategoryListBizLayDict.useValues(), m.labelListBizDict.useValues();
|
|
15
|
-
let o = v({
|
|
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
|
-
goodsType: W.GOODS_TYPE.GROUP
|
|
23
|
-
});
|
|
24
|
-
const w = (u, l, i) => {
|
|
25
|
-
var d;
|
|
26
|
-
const r = (d = o.picUrls) == null ? void 0 : d.split(",").filter(Boolean);
|
|
27
|
-
if (r != null && r.length) {
|
|
28
|
-
if ((r == null ? void 0 : r.length) < 1)
|
|
29
|
-
return i(new Error(p("goodsSpu.imageListsErrors")));
|
|
30
|
-
i();
|
|
31
|
-
} else return i(new Error(p("goodsSpu.picUrlsRequired")));
|
|
32
|
-
}, N = v({
|
|
33
|
-
spuName: [
|
|
34
|
-
{
|
|
35
|
-
required: !0,
|
|
36
|
-
message: p("goodsSpu.spuNameRequired"),
|
|
37
|
-
trigger: "blur"
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
categoryIds: [
|
|
41
|
-
{
|
|
42
|
-
required: !0,
|
|
43
|
-
message: p("goodsSpu.categoryIdRequired"),
|
|
44
|
-
trigger: "change"
|
|
45
|
-
}
|
|
46
|
-
],
|
|
47
|
-
spuCode: [
|
|
48
|
-
{
|
|
49
|
-
required: !0,
|
|
50
|
-
message: p("goodsSpu.spuCodeRequired"),
|
|
51
|
-
trigger: "change"
|
|
52
|
-
}
|
|
53
|
-
],
|
|
54
|
-
freightType: [
|
|
55
|
-
{
|
|
56
|
-
required: !0,
|
|
57
|
-
message: p("goodsSpu.freightTypeRequired"),
|
|
58
|
-
trigger: "change"
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
freightAmount: [
|
|
62
|
-
{
|
|
63
|
-
required: !0,
|
|
64
|
-
message: p("goodsSpu.freightAmountRequired"),
|
|
65
|
-
trigger: "blur"
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
picUrls: [
|
|
69
|
-
{
|
|
70
|
-
validator: w,
|
|
71
|
-
trigger: "change"
|
|
72
|
-
}
|
|
73
|
-
],
|
|
74
|
-
shelf: [
|
|
75
|
-
{
|
|
76
|
-
required: !0,
|
|
77
|
-
message: p("goodsSpu.shelfRequired"),
|
|
78
|
-
trigger: "change"
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
}), V = q(!1);
|
|
82
|
-
function E(u) {
|
|
83
|
-
o.groupInfos = u;
|
|
84
|
-
}
|
|
85
|
-
f.query.spuId && h.findById({ spuId: f.query.spuId }).then(({ data: u }) => {
|
|
86
|
-
Object.assign(o, u), V.value = !0;
|
|
87
|
-
});
|
|
88
|
-
const $ = async () => {
|
|
89
|
-
var u;
|
|
90
|
-
await ((u = b.value) == null ? void 0 : u.validate((l) => {
|
|
91
|
-
l && (f.query.spuId ? h.updateList(o).then((i) => {
|
|
92
|
-
i.status === 200 && (T({
|
|
93
|
-
message: p("common.submitSuccess"),
|
|
94
|
-
type: "success"
|
|
95
|
-
}), U.closeTagView(f.fullPath, y, !1));
|
|
96
|
-
}) : h.createList(o).then((i) => {
|
|
97
|
-
i.status === 200 && (T({
|
|
98
|
-
message: p("common.submitSuccess"),
|
|
99
|
-
type: "success"
|
|
100
|
-
}), U.closeTagView(f.fullPath, y, !1));
|
|
101
|
-
}));
|
|
102
|
-
}));
|
|
103
|
-
};
|
|
104
|
-
function A(u) {
|
|
105
|
-
u === "FREIGHT_FREE" && (o.freightAmount = 0);
|
|
106
|
-
}
|
|
107
|
-
return (u, l) => {
|
|
108
|
-
const i = n("el-input"), r = n("el-form-item"), d = n("el-col"), D = n("el-tree-select"), S = n("jmash-enum-radio"), I = n("el-input-number"), F = O, L = n("el-checkbox"), B = n("el-checkbox-group"), _ = n("el-row"), G = n("el-button"), z = n("el-form");
|
|
109
|
-
return c(), R("div", Z, [
|
|
110
|
-
g("div", x, [
|
|
111
|
-
e(z, {
|
|
112
|
-
ref_key: "goodsSpuFormRef",
|
|
113
|
-
ref: b,
|
|
114
|
-
model: t(o),
|
|
115
|
-
"label-width": "120px",
|
|
116
|
-
rules: N
|
|
117
|
-
}, {
|
|
118
|
-
default: s(() => [
|
|
119
|
-
l[11] || (l[11] = g("div", { class: "title-content" }, "基本信息", -1)),
|
|
120
|
-
e(_, null, {
|
|
121
|
-
default: s(() => [
|
|
122
|
-
e(d, { span: 12 }, {
|
|
123
|
-
default: s(() => [
|
|
124
|
-
e(r, {
|
|
125
|
-
label: u.$t("goodsSpu.spuName"),
|
|
126
|
-
prop: "spuName"
|
|
127
|
-
}, {
|
|
128
|
-
default: s(() => [
|
|
129
|
-
e(i, {
|
|
130
|
-
modelValue: t(o).spuName,
|
|
131
|
-
"onUpdate:modelValue": l[0] || (l[0] = (a) => t(o).spuName = a),
|
|
132
|
-
placeholder: u.$t("goodsSpu.spuNameRequired"),
|
|
133
|
-
maxlength: "60",
|
|
134
|
-
"show-word-limit": "",
|
|
135
|
-
clearable: ""
|
|
136
|
-
}, null, 8, ["modelValue", "placeholder"])
|
|
137
|
-
]),
|
|
138
|
-
_: 1
|
|
139
|
-
}, 8, ["label"])
|
|
140
|
-
]),
|
|
141
|
-
_: 1
|
|
142
|
-
}),
|
|
143
|
-
e(d, { span: 12 }, {
|
|
144
|
-
default: s(() => [
|
|
145
|
-
e(r, {
|
|
146
|
-
label: u.$t("goodsSpu.spuCode"),
|
|
147
|
-
prop: "spuCode"
|
|
148
|
-
}, {
|
|
149
|
-
default: s(() => [
|
|
150
|
-
e(i, {
|
|
151
|
-
modelValue: t(o).spuCode,
|
|
152
|
-
"onUpdate:modelValue": l[1] || (l[1] = (a) => t(o).spuCode = a),
|
|
153
|
-
placeholder: u.$t("goodsSpu.spuCodeRequired"),
|
|
154
|
-
maxlength: "15",
|
|
155
|
-
"show-word-limit": "",
|
|
156
|
-
clearable: ""
|
|
157
|
-
}, null, 8, ["modelValue", "placeholder"])
|
|
158
|
-
]),
|
|
159
|
-
_: 1
|
|
160
|
-
}, 8, ["label"])
|
|
161
|
-
]),
|
|
162
|
-
_: 1
|
|
163
|
-
}),
|
|
164
|
-
e(d, { span: 12 }, {
|
|
165
|
-
default: s(() => [
|
|
166
|
-
e(r, {
|
|
167
|
-
label: u.$t("goodsSpu.categoryId"),
|
|
168
|
-
prop: "categoryIds"
|
|
169
|
-
}, {
|
|
170
|
-
default: s(() => [
|
|
171
|
-
e(D, {
|
|
172
|
-
modelValue: t(o).categoryIds,
|
|
173
|
-
"onUpdate:modelValue": l[2] || (l[2] = (a) => t(o).categoryIds = a),
|
|
174
|
-
data: t(m).goodsCategoryListBizLayDict.values,
|
|
175
|
-
multiple: "",
|
|
176
|
-
"render-after-expand": !1,
|
|
177
|
-
"show-checkbox": "",
|
|
178
|
-
placeholder: u.$t("goodsSpu.categoryIdRequired"),
|
|
179
|
-
class: "w-full"
|
|
180
|
-
}, null, 8, ["modelValue", "data", "placeholder"])
|
|
181
|
-
]),
|
|
182
|
-
_: 1
|
|
183
|
-
}, 8, ["label"])
|
|
184
|
-
]),
|
|
185
|
-
_: 1
|
|
186
|
-
}),
|
|
187
|
-
e(d, { span: 12 }, {
|
|
188
|
-
default: s(() => [
|
|
189
|
-
e(r, {
|
|
190
|
-
label: u.$t("goodsSpu.freightType"),
|
|
191
|
-
prop: "freightType"
|
|
192
|
-
}, {
|
|
193
|
-
default: s(() => [
|
|
194
|
-
e(S, {
|
|
195
|
-
modelValue: t(o).freightType,
|
|
196
|
-
"onUpdate:modelValue": l[3] || (l[3] = (a) => t(o).freightType = a),
|
|
197
|
-
data: t(m).freightTypeEnum.values,
|
|
198
|
-
onChange: A
|
|
199
|
-
}, null, 8, ["modelValue", "data"])
|
|
200
|
-
]),
|
|
201
|
-
_: 1
|
|
202
|
-
}, 8, ["label"])
|
|
203
|
-
]),
|
|
204
|
-
_: 1
|
|
205
|
-
}),
|
|
206
|
-
e(d, { span: 12 }, {
|
|
207
|
-
default: s(() => [
|
|
208
|
-
e(r, {
|
|
209
|
-
label: u.$t("goodsSpu.freightAmount"),
|
|
210
|
-
prop: "freightAmount"
|
|
211
|
-
}, {
|
|
212
|
-
default: s(() => [
|
|
213
|
-
e(I, {
|
|
214
|
-
modelValue: t(o).freightAmount,
|
|
215
|
-
"onUpdate:modelValue": l[4] || (l[4] = (a) => t(o).freightAmount = a),
|
|
216
|
-
readonly: t(o).freightType === "FREIGHT_FREE",
|
|
217
|
-
precision: 2,
|
|
218
|
-
step: 0.1,
|
|
219
|
-
controls: !1,
|
|
220
|
-
min: 0,
|
|
221
|
-
placeholder: u.$t("goodsSpu.freightAmountRequired"),
|
|
222
|
-
class: "w-full"
|
|
223
|
-
}, null, 8, ["modelValue", "readonly", "placeholder"])
|
|
224
|
-
]),
|
|
225
|
-
_: 1
|
|
226
|
-
}, 8, ["label"])
|
|
227
|
-
]),
|
|
228
|
-
_: 1
|
|
229
|
-
}),
|
|
230
|
-
e(d, { span: 24 }, {
|
|
231
|
-
default: s(() => [
|
|
232
|
-
e(r, {
|
|
233
|
-
label: u.$t("goodsSpu.picUrls"),
|
|
234
|
-
prop: "picUrls"
|
|
235
|
-
}, {
|
|
236
|
-
default: s(() => [
|
|
237
|
-
g("div", ee, [
|
|
238
|
-
e(F, {
|
|
239
|
-
modelValue: t(o).picUrls,
|
|
240
|
-
"onUpdate:modelValue": l[5] || (l[5] = (a) => t(o).picUrls = a),
|
|
241
|
-
limit: 6,
|
|
242
|
-
"list-type": "picture-card"
|
|
243
|
-
}, null, 8, ["modelValue"]),
|
|
244
|
-
l[9] || (l[9] = g("div", { class: "red-color" }, " 推荐尺寸:100*100或同比例图片,最少上传1张 ", -1))
|
|
245
|
-
])
|
|
246
|
-
]),
|
|
247
|
-
_: 1
|
|
248
|
-
}, 8, ["label"])
|
|
249
|
-
]),
|
|
250
|
-
_: 1
|
|
251
|
-
}),
|
|
252
|
-
e(d, { span: 12 }, {
|
|
253
|
-
default: s(() => [
|
|
254
|
-
e(r, {
|
|
255
|
-
label: u.$t("goodsSpu.shelf"),
|
|
256
|
-
prop: "shelf"
|
|
257
|
-
}, {
|
|
258
|
-
default: s(() => [
|
|
259
|
-
e(S, {
|
|
260
|
-
modelValue: t(o).shelf,
|
|
261
|
-
"onUpdate:modelValue": l[6] || (l[6] = (a) => t(o).shelf = a),
|
|
262
|
-
data: t(m).shelfDict.values
|
|
263
|
-
}, null, 8, ["modelValue", "data"])
|
|
264
|
-
]),
|
|
265
|
-
_: 1
|
|
266
|
-
}, 8, ["label"])
|
|
267
|
-
]),
|
|
268
|
-
_: 1
|
|
269
|
-
}),
|
|
270
|
-
e(d, { span: 12 }, {
|
|
271
|
-
default: s(() => [
|
|
272
|
-
e(r, {
|
|
273
|
-
label: u.$t("goodsSpu.saleNum"),
|
|
274
|
-
prop: "saleNum"
|
|
275
|
-
}, {
|
|
276
|
-
default: s(() => [
|
|
277
|
-
e(I, {
|
|
278
|
-
modelValue: t(o).saleNum,
|
|
279
|
-
"onUpdate:modelValue": l[7] || (l[7] = (a) => t(o).saleNum = a),
|
|
280
|
-
placeholder: u.$t("goodsSpu.saleNumRequired"),
|
|
281
|
-
class: "w-full",
|
|
282
|
-
min: 0,
|
|
283
|
-
controls: !1,
|
|
284
|
-
precision: 0
|
|
285
|
-
}, null, 8, ["modelValue", "placeholder"])
|
|
286
|
-
]),
|
|
287
|
-
_: 1
|
|
288
|
-
}, 8, ["label"])
|
|
289
|
-
]),
|
|
290
|
-
_: 1
|
|
291
|
-
}),
|
|
292
|
-
e(d, { span: 24 }, {
|
|
293
|
-
default: s(() => [
|
|
294
|
-
e(r, {
|
|
295
|
-
label: u.$t("goodsSpu.labelIds"),
|
|
296
|
-
prop: "labelIds"
|
|
297
|
-
}, {
|
|
298
|
-
default: s(() => [
|
|
299
|
-
e(B, {
|
|
300
|
-
modelValue: t(o).labelIds,
|
|
301
|
-
"onUpdate:modelValue": l[8] || (l[8] = (a) => t(o).labelIds = a),
|
|
302
|
-
class: "w-full"
|
|
303
|
-
}, {
|
|
304
|
-
default: s(() => [
|
|
305
|
-
(c(!0), R(j, null, M(t(m).labelListBizDict.values, (a) => (c(), k(L, {
|
|
306
|
-
key: a.key,
|
|
307
|
-
label: a.key
|
|
308
|
-
}, {
|
|
309
|
-
default: s(() => [
|
|
310
|
-
C(H(a.value), 1)
|
|
311
|
-
]),
|
|
312
|
-
_: 2
|
|
313
|
-
}, 1032, ["label"]))), 128))
|
|
314
|
-
]),
|
|
315
|
-
_: 1
|
|
316
|
-
}, 8, ["modelValue"])
|
|
317
|
-
]),
|
|
318
|
-
_: 1
|
|
319
|
-
}, 8, ["label"])
|
|
320
|
-
]),
|
|
321
|
-
_: 1
|
|
322
|
-
})
|
|
323
|
-
]),
|
|
324
|
-
_: 1
|
|
325
|
-
}),
|
|
326
|
-
l[12] || (l[12] = g("div", { class: "title-content" }, "套装商品", -1)),
|
|
327
|
-
e(_, null, {
|
|
328
|
-
default: s(() => [
|
|
329
|
-
!t(f).query.spuId || V.value ? (c(), k(X, {
|
|
330
|
-
key: 0,
|
|
331
|
-
form: t(o),
|
|
332
|
-
onGetGoodsSku: E
|
|
333
|
-
}, null, 8, ["form"])) : Y("", !0)
|
|
334
|
-
]),
|
|
335
|
-
_: 1
|
|
336
|
-
}),
|
|
337
|
-
e(_, null, {
|
|
338
|
-
default: s(() => [
|
|
339
|
-
e(r, null, {
|
|
340
|
-
default: s(() => [
|
|
341
|
-
e(G, {
|
|
342
|
-
type: "primary",
|
|
343
|
-
onClick: $
|
|
344
|
-
}, {
|
|
345
|
-
default: s(() => l[10] || (l[10] = [
|
|
346
|
-
C("保存")
|
|
347
|
-
])),
|
|
348
|
-
_: 1,
|
|
349
|
-
__: [10]
|
|
350
|
-
})
|
|
351
|
-
]),
|
|
352
|
-
_: 1
|
|
353
|
-
})
|
|
354
|
-
]),
|
|
355
|
-
_: 1
|
|
356
|
-
})
|
|
357
|
-
]),
|
|
358
|
-
_: 1,
|
|
359
|
-
__: [11, 12]
|
|
360
|
-
}, 8, ["model", "rules"])
|
|
361
|
-
])
|
|
362
|
-
]);
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
});
|
|
366
|
-
export {
|
|
367
|
-
ie as default
|
|
368
|
-
};
|
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
import { defineComponent as O, openBlock as m, createElementBlock as S, createElementVNode as M, ref as v, watch as $, resolveComponent as r, createBlock as h, withCtx as i, createVNode as c, unref as g, Fragment as Y, renderList as G, createCommentVNode as H, createTextVNode as x, toDisplayString as J } from "vue";
|
|
2
|
-
import { useI18n as K } from "vue-i18n";
|
|
3
|
-
import { D as B, C as U } from "./index-gnGbjAJC.mjs";
|
|
4
|
-
import { a as L } from "./index-DLPUpw3h.mjs";
|
|
5
|
-
import { specValueApi as Q } from "xyvcard-shop";
|
|
6
|
-
import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
7
|
-
/*! Element Plus Icons Vue v2.3.1 */
|
|
8
|
-
var X = /* @__PURE__ */ O({
|
|
9
|
-
name: "Plus",
|
|
10
|
-
__name: "plus",
|
|
11
|
-
setup(b) {
|
|
12
|
-
return (N, C) => (m(), S("svg", {
|
|
13
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
-
viewBox: "0 0 1024 1024"
|
|
15
|
-
}, [
|
|
16
|
-
M("path", {
|
|
17
|
-
fill: "currentColor",
|
|
18
|
-
d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"
|
|
19
|
-
})
|
|
20
|
-
]));
|
|
21
|
-
}
|
|
22
|
-
}), Z = X;
|
|
23
|
-
const w = { key: 0 }, ee = /* @__PURE__ */ O({
|
|
24
|
-
__name: "skuForm",
|
|
25
|
-
props: {
|
|
26
|
-
form: {
|
|
27
|
-
type: Object,
|
|
28
|
-
default: () => {
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
emits: ["getGoodsSku", "getFormData"],
|
|
33
|
-
setup(b, { emit: N }) {
|
|
34
|
-
const { t: C } = K(), P = v([]), d = v([
|
|
35
|
-
{
|
|
36
|
-
salePrice: 0,
|
|
37
|
-
skuId: "",
|
|
38
|
-
spuId: "",
|
|
39
|
-
specInfo: "",
|
|
40
|
-
saleNum: 0,
|
|
41
|
-
picUrl: "",
|
|
42
|
-
specType: "",
|
|
43
|
-
skuOptions: []
|
|
44
|
-
}
|
|
45
|
-
]);
|
|
46
|
-
B.goodsSpuBizDict.useValues();
|
|
47
|
-
const j = N;
|
|
48
|
-
function F(s, e) {
|
|
49
|
-
s.picUrl = e;
|
|
50
|
-
}
|
|
51
|
-
const y = b;
|
|
52
|
-
$(
|
|
53
|
-
y.form,
|
|
54
|
-
(s) => s,
|
|
55
|
-
{
|
|
56
|
-
deep: !0,
|
|
57
|
-
immediate: !0
|
|
58
|
-
}
|
|
59
|
-
), y.form.spuId && L.findGroupList({ goodsId: y.form.spuId }).then(({ data: s }) => {
|
|
60
|
-
if (s && s.results.length > 0) {
|
|
61
|
-
d.value = [];
|
|
62
|
-
const e = s.results.map(async (l) => {
|
|
63
|
-
const t = {
|
|
64
|
-
salePrice: l.salePrice || 0,
|
|
65
|
-
skuId: l.skuId || "",
|
|
66
|
-
spuId: l.spuId || "",
|
|
67
|
-
saleNum: l.saleNum || 0,
|
|
68
|
-
picUrl: l.picUrl || "",
|
|
69
|
-
specType: "",
|
|
70
|
-
skuOptions: []
|
|
71
|
-
};
|
|
72
|
-
return await T(l.spuId, t), t.specType === U.SPEC_TYPE.MULTI_SPEC && l.skuId && (t.skuId = l.skuId || "", t.salePrice = l.salePrice || 0, t.saleNum = l.saleNum || 0, t.picUrl = l.picUrl || "", D(l.skuId)), t;
|
|
73
|
-
});
|
|
74
|
-
Promise.all(e).then((l) => {
|
|
75
|
-
d.value = l;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
function A(s) {
|
|
80
|
-
const e = d.value.indexOf(s.row);
|
|
81
|
-
e !== 0 && d.value.splice(e, 1);
|
|
82
|
-
}
|
|
83
|
-
function R() {
|
|
84
|
-
d.value.push({
|
|
85
|
-
salePrice: 0,
|
|
86
|
-
skuId: "",
|
|
87
|
-
spuId: "",
|
|
88
|
-
specInfo: "",
|
|
89
|
-
saleNum: 0,
|
|
90
|
-
picUrl: "",
|
|
91
|
-
specType: "",
|
|
92
|
-
skuOptions: []
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
const E = v({});
|
|
96
|
-
async function q(s) {
|
|
97
|
-
if (!P.value[s])
|
|
98
|
-
try {
|
|
99
|
-
const { data: e } = await Q.findById({
|
|
100
|
-
specValueId: s
|
|
101
|
-
});
|
|
102
|
-
return P.value[s] = e.valueName, e.valueName;
|
|
103
|
-
} catch {
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
async function T(s, e) {
|
|
107
|
-
var l, t, k;
|
|
108
|
-
if (e.skuId = "", e.skuOptions = [], e.picUrl = "", e.salePrice = 0, e.saleNum = 0, !s) {
|
|
109
|
-
e.skuId = "", e.picUrl = "", e.salePrice = 0, e.saleNum = 0, e.skuOptions = [];
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
try {
|
|
113
|
-
const { data: n } = await L.findById({ spuId: s });
|
|
114
|
-
if (e.specType = n.specType, e.specType === U.SPEC_TYPE.UNIFIED_SPEC && (e.picUrl = n.picUrls ? n.picUrls.split(",")[0] : "", e.salePrice = (l = n.skuList) == null ? void 0 : l.results[0].salePrice, e.saleNum = (t = n.skuList) == null ? void 0 : t.results[0].stock, e.skuId = (k = n.skuList) == null ? void 0 : k.results[0].skuId), e.specType === U.SPEC_TYPE.MULTI_SPEC && n.skuList) {
|
|
115
|
-
const f = n.skuList.results, _ = f.map((o) => o.specValues && Array.isArray(o.specValues) ? o.specValues.map(
|
|
116
|
-
(p) => p.specValueId
|
|
117
|
-
) : []), V = _.flat().map((o) => q(o));
|
|
118
|
-
await Promise.all(V);
|
|
119
|
-
const I = _.map(
|
|
120
|
-
(o) => o.map((p) => P.value[p] || p)
|
|
121
|
-
);
|
|
122
|
-
e.skuOptions = f.map((o, p) => ({
|
|
123
|
-
key: o.skuId,
|
|
124
|
-
value: I[p].join(" "),
|
|
125
|
-
specInfo: I[p].join(" "),
|
|
126
|
-
picUrl: o.picUrl || (n.picUrls ? n.picUrls.split(",")[0] : ""),
|
|
127
|
-
salePrice: o.salePrice,
|
|
128
|
-
stock: o.stock
|
|
129
|
-
})), f.forEach((o, p) => {
|
|
130
|
-
o.skuId && (E.value[o.skuId] = {
|
|
131
|
-
...o,
|
|
132
|
-
specInfo: I[p].join(" "),
|
|
133
|
-
spuPicUrls: n.picUrls
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
} catch {
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
function D(s) {
|
|
141
|
-
const e = d.value.find((l) => l.skuId === s);
|
|
142
|
-
if (e && s) {
|
|
143
|
-
const l = E.value[s];
|
|
144
|
-
if (l) {
|
|
145
|
-
const t = l.spuPicUrls ? l.spuPicUrls.split(",")[0] : "";
|
|
146
|
-
e.picUrl = l.picUrl || t, e.salePrice = l.salePrice, e.saleNum = l.stock, e.specInfo = l.specInfo;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return $(
|
|
151
|
-
d,
|
|
152
|
-
(s) => {
|
|
153
|
-
const e = s.filter((l) => l.spuId && l.skuId).map((l) => ({
|
|
154
|
-
salePrice: l.salePrice,
|
|
155
|
-
skuId: l.skuId,
|
|
156
|
-
spuId: l.spuId,
|
|
157
|
-
specInfo: l.specInfo,
|
|
158
|
-
saleNum: l.saleNum,
|
|
159
|
-
picUrl: l.picUrl
|
|
160
|
-
}));
|
|
161
|
-
j("getGoodsSku", e), console.log("filteredValue", e);
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
deep: !0,
|
|
165
|
-
immediate: !0
|
|
166
|
-
}
|
|
167
|
-
), (s, e) => {
|
|
168
|
-
const l = r("jmash-select"), t = r("el-table-column"), k = r("el-option"), n = r("el-select"), f = r("jmash-single-image-upload"), _ = r("el-input-number"), V = r("DeleteFilled"), I = r("el-icon"), o = r("el-table"), p = r("el-button"), z = r("el-row");
|
|
169
|
-
return m(), h(z, null, {
|
|
170
|
-
default: i(() => [
|
|
171
|
-
c(o, {
|
|
172
|
-
data: d.value,
|
|
173
|
-
border: "",
|
|
174
|
-
style: { width: "100%" }
|
|
175
|
-
}, {
|
|
176
|
-
default: i(() => [
|
|
177
|
-
c(t, {
|
|
178
|
-
label: s.$t("goodsSpu.spuName"),
|
|
179
|
-
prop: "spuId",
|
|
180
|
-
"header-align": "center"
|
|
181
|
-
}, {
|
|
182
|
-
default: i(({ row: a }) => [
|
|
183
|
-
c(l, {
|
|
184
|
-
modelValue: a.spuId,
|
|
185
|
-
"onUpdate:modelValue": (u) => a.spuId = u,
|
|
186
|
-
data: g(B).goodsSpuBizDict.values,
|
|
187
|
-
filterable: "",
|
|
188
|
-
clearable: "",
|
|
189
|
-
placeholder: s.$t("goodsSpu.spuNameRequireds"),
|
|
190
|
-
class: "w-full",
|
|
191
|
-
onChange: (u) => T(a.spuId, a)
|
|
192
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "data", "placeholder", "onChange"])
|
|
193
|
-
]),
|
|
194
|
-
_: 1
|
|
195
|
-
}, 8, ["label"]),
|
|
196
|
-
c(t, {
|
|
197
|
-
label: s.$t("goodsSpu.specType"),
|
|
198
|
-
"header-align": "center"
|
|
199
|
-
}, {
|
|
200
|
-
default: i(({ row: a }) => [
|
|
201
|
-
a.specType === g(U).SPEC_TYPE.UNIFIED_SPEC ? (m(), S("span", w, " 统一规格 ")) : (m(), h(n, {
|
|
202
|
-
key: 1,
|
|
203
|
-
modelValue: a.skuId,
|
|
204
|
-
"onUpdate:modelValue": (u) => a.skuId = u,
|
|
205
|
-
placeholder: s.$t("goodsSpu.specTypeRequired"),
|
|
206
|
-
onChange: (u) => D(a.skuId)
|
|
207
|
-
}, {
|
|
208
|
-
default: i(() => [
|
|
209
|
-
(m(!0), S(Y, null, G(a.skuOptions, (u) => (m(), h(k, {
|
|
210
|
-
key: u.key,
|
|
211
|
-
label: u.value,
|
|
212
|
-
value: u.key
|
|
213
|
-
}, null, 8, ["label", "value"]))), 128))
|
|
214
|
-
]),
|
|
215
|
-
_: 2
|
|
216
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"]))
|
|
217
|
-
]),
|
|
218
|
-
_: 1
|
|
219
|
-
}, 8, ["label"]),
|
|
220
|
-
c(t, {
|
|
221
|
-
label: s.$t("goodsSpu.picUrls"),
|
|
222
|
-
prop: "picUrl",
|
|
223
|
-
width: "105",
|
|
224
|
-
"header-align": "center"
|
|
225
|
-
}, {
|
|
226
|
-
default: i(({ row: a }) => [
|
|
227
|
-
c(f, {
|
|
228
|
-
"picture-url": a.picUrl,
|
|
229
|
-
onImageSrc: (u) => F(a, u),
|
|
230
|
-
width: 80,
|
|
231
|
-
type: "trans"
|
|
232
|
-
}, null, 8, ["picture-url", "onImageSrc"])
|
|
233
|
-
]),
|
|
234
|
-
_: 1
|
|
235
|
-
}, 8, ["label"]),
|
|
236
|
-
c(t, {
|
|
237
|
-
label: s.$t("goodsSpu.salePriceV1"),
|
|
238
|
-
prop: "salePrice",
|
|
239
|
-
"header-align": "center"
|
|
240
|
-
}, {
|
|
241
|
-
default: i(({ row: a }) => [
|
|
242
|
-
c(_, {
|
|
243
|
-
modelValue: a.salePrice,
|
|
244
|
-
"onUpdate:modelValue": (u) => a.salePrice = u,
|
|
245
|
-
precision: 2,
|
|
246
|
-
min: 0,
|
|
247
|
-
placeholder: s.$t("goodsSpu.salePriceV1Required"),
|
|
248
|
-
class: "w-full",
|
|
249
|
-
controls: !1
|
|
250
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
251
|
-
]),
|
|
252
|
-
_: 1
|
|
253
|
-
}, 8, ["label"]),
|
|
254
|
-
c(t, {
|
|
255
|
-
label: s.$t("goodsSpu.saleNums"),
|
|
256
|
-
prop: "saleNum",
|
|
257
|
-
"header-align": "center"
|
|
258
|
-
}, {
|
|
259
|
-
default: i(({ row: a }) => [
|
|
260
|
-
c(_, {
|
|
261
|
-
modelValue: a.saleNum,
|
|
262
|
-
"onUpdate:modelValue": (u) => a.saleNum = u,
|
|
263
|
-
placeholder: s.$t("goodsSpu.saleNumRequireds"),
|
|
264
|
-
class: "w-full",
|
|
265
|
-
controls: !1,
|
|
266
|
-
precision: 0,
|
|
267
|
-
min: 0
|
|
268
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
269
|
-
]),
|
|
270
|
-
_: 1
|
|
271
|
-
}, 8, ["label"]),
|
|
272
|
-
c(t, {
|
|
273
|
-
label: s.$t("common.operate"),
|
|
274
|
-
width: "60",
|
|
275
|
-
align: "center"
|
|
276
|
-
}, {
|
|
277
|
-
default: i((a) => [
|
|
278
|
-
a.$index !== 0 ? (m(), h(I, {
|
|
279
|
-
key: 0,
|
|
280
|
-
onClick: (u) => A(a),
|
|
281
|
-
size: "18",
|
|
282
|
-
style: { cursor: "pointer", color: "inherit" },
|
|
283
|
-
class: "hover-blue"
|
|
284
|
-
}, {
|
|
285
|
-
default: i(() => [
|
|
286
|
-
c(V)
|
|
287
|
-
]),
|
|
288
|
-
_: 2
|
|
289
|
-
}, 1032, ["onClick"])) : H("", !0)
|
|
290
|
-
]),
|
|
291
|
-
_: 1
|
|
292
|
-
}, 8, ["label"])
|
|
293
|
-
]),
|
|
294
|
-
_: 1
|
|
295
|
-
}, 8, ["data"]),
|
|
296
|
-
c(p, {
|
|
297
|
-
icon: g(Z),
|
|
298
|
-
class: "addButton",
|
|
299
|
-
onClick: R
|
|
300
|
-
}, {
|
|
301
|
-
default: i(() => [
|
|
302
|
-
x(J(g(C)("common.add")), 1)
|
|
303
|
-
]),
|
|
304
|
-
_: 1
|
|
305
|
-
}, 8, ["icon"])
|
|
306
|
-
]),
|
|
307
|
-
_: 1
|
|
308
|
-
});
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
}), ne = /* @__PURE__ */ W(ee, [["__scopeId", "data-v-f953fc89"]]);
|
|
312
|
-
export {
|
|
313
|
-
ne as default
|
|
314
|
-
};
|