xyvcard-goods 0.0.21 → 0.0.23
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 +93 -0
- package/dist/{edit-DFc_TNP3.mjs → edit-9jPSycsG.mjs} +148 -212
- package/dist/edit-CJpoa4Ck.mjs +368 -0
- package/dist/{edit-DxnsmaXV.mjs → edit-CWQMgvVP.mjs} +38 -38
- package/dist/{edit-CkR-I5aJ.mjs → edit-DU-BEAcq.mjs} +1 -1
- package/dist/{edit-BcokSKfN.mjs → edit-Ziwv43v0.mjs} +27 -27
- package/dist/edit.vue_vue_type_script_setup_true_lang-BP0C4d2-.mjs +24173 -0
- package/dist/{goodsList-HmPAwD_C.mjs → goodsList-2AwsJVoO.mjs} +1 -1
- package/dist/{goodsList-TX2ZnRR9.mjs → goodsList-CyWliLjg.mjs} +1 -1
- package/dist/{goodsList.vue_vue_type_script_setup_true_lang-CGV1dm3W.mjs → goodsList.vue_vue_type_script_setup_true_lang-Bq06GIMe.mjs} +2 -2
- package/dist/{goodsList.vue_vue_type_script_setup_true_lang-f1Fc6pbd.mjs → goodsList.vue_vue_type_script_setup_true_lang-DjKzEAB7.mjs} +136 -147
- package/dist/{index-B0SXNsHW.mjs → index-8E7BciYp.mjs} +7 -7
- package/dist/{index-Dt3PP8dN.mjs → index-B1H5hqEi.mjs} +2 -2
- package/dist/{index-BZw9XfQo.mjs → index-B88acg0Q.mjs} +2 -2
- package/dist/{index-VFsDup14.mjs → index-BdP_dXBK.mjs} +3 -3
- package/dist/index-C7oatDPl.mjs +4432 -0
- package/dist/{index-Ctva-XF0.mjs → index-DPjR32Kv.mjs} +3 -3
- package/dist/{index-r0u-27m7.mjs → index-DR3Gk44r.mjs} +1 -1
- package/dist/index-jCpYt-EU.mjs +221 -0
- package/dist/index.mjs +6 -2864
- package/dist/info-BEMxnD6-.mjs +325 -0
- package/dist/{info-BTKv0IRt.mjs → info-DFIeVs66.mjs} +3 -3
- package/dist/{skuForm-C7rF2noo.mjs → skuForm-BhAbf2AG.mjs} +2 -2
- package/dist/skuForm-C2aQcL90.mjs +314 -0
- package/dist/{skuTable-CEwT-I1Q.mjs → skuTable-9JJqGeRx.mjs} +255 -208
- package/dist/style.css +1 -1
- package/dts/api/dict.d.ts +3 -0
- package/dts/api/goods-spu/index.d.ts +4 -1
- package/dts/api/goods-spu/types.d.ts +28 -0
- package/dts/api/index.d.ts +2 -1
- package/dts/index.d.ts +4 -0
- package/dts/lang/goods/zh-cn.d.ts +5 -1
- package/dts/router/index.d.ts +1 -0
- package/dts/views/goods/goods-combination/skuForm.vue.d.ts +0 -9
- package/package.json +3 -2
- package/dist/edit-tCGa_9Kt.mjs +0 -507
- package/dist/edit.vue_vue_type_script_setup_true_lang-BlNwikUO.mjs +0 -234
- package/dist/index-CqOoZ5xQ.mjs +0 -305
- package/dist/index-DR7GlHNd.mjs +0 -1288
- package/dist/index-jTDhsbYM.mjs +0 -141
- package/dist/info-CrghLmS4.mjs +0 -365
- package/dist/sku-B-IzfYLq.mjs +0 -52
- package/dist/skuForm-D2n8sQJo.mjs +0 -475
- package/dist/skuTable-D-awlXgj.mjs +0 -592
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { defineComponent as M, ref as v, resolveComponent as f, openBlock as _, createElementBlock as k, createVNode as o, withCtx as l, createTextVNode as r, toDisplayString as u, createElementVNode as p, Fragment as V, renderList as E, createBlock as D, unref as m } from "vue";
|
|
2
|
+
import { fileApi as P, routerUtil as R } from "jmash-core";
|
|
3
|
+
import { useRouter as j, useRoute as G } from "vue-router";
|
|
4
|
+
import { D as y, C as S } from "./index-jCpYt-EU.mjs";
|
|
5
|
+
import { a as L } from "./index-C7oatDPl.mjs";
|
|
6
|
+
import { specValueApi as H } from "xyvcard-shop";
|
|
7
|
+
const J = { class: "app-container" }, K = { class: "cell-item" }, Q = { class: "cell-item" }, W = { class: "cell-item" }, X = { class: "cell-item" }, Z = { class: "cell-item" }, w = { class: "cell-item" }, x = { class: "cell-item" }, ee = { class: "cell-item" }, se = { class: "cell-item" }, le = { key: 0 }, te = { key: 1 }, pe = /* @__PURE__ */ M({
|
|
8
|
+
__name: "info",
|
|
9
|
+
setup(ae) {
|
|
10
|
+
const O = j(), b = G(), d = v({}), $ = v([]), B = v({}), N = v([]);
|
|
11
|
+
y.goodsCategoryListBizLayDict.useValues(), y.labelListBizDict.useValues(), y.goodsSpuBizDict.useValues();
|
|
12
|
+
const U = v([
|
|
13
|
+
{
|
|
14
|
+
salePrice: 0,
|
|
15
|
+
skuId: "",
|
|
16
|
+
spuId: "",
|
|
17
|
+
specInfo: "",
|
|
18
|
+
saleNum: 0,
|
|
19
|
+
picUrl: "",
|
|
20
|
+
specType: "",
|
|
21
|
+
skuOptions: []
|
|
22
|
+
}
|
|
23
|
+
]);
|
|
24
|
+
b.query.spuId && (L.findById({ spuId: b.query.spuId }).then(({ data: s }) => {
|
|
25
|
+
var e;
|
|
26
|
+
d.value = Object.assign(d, s), $.value = (e = s.picUrls) == null ? void 0 : e.split(",");
|
|
27
|
+
}), L.findGroupList({ goodsId: b.query.spuId }).then(({ data: s }) => {
|
|
28
|
+
if (s && s.results.length > 0) {
|
|
29
|
+
U.value = [];
|
|
30
|
+
const e = s.results.map(async (t) => {
|
|
31
|
+
const i = {
|
|
32
|
+
salePrice: t.salePrice || 0,
|
|
33
|
+
skuId: t.skuId || "",
|
|
34
|
+
spuId: t.spuId || "",
|
|
35
|
+
saleNum: t.saleNum || 0,
|
|
36
|
+
picUrl: t.picUrl || "",
|
|
37
|
+
specType: "",
|
|
38
|
+
skuOptions: []
|
|
39
|
+
};
|
|
40
|
+
return await A(t.spuId, i), i.specType === S.SPEC_TYPE.MULTI_SPEC && t.skuId && (i.skuId = t.skuId || "", i.salePrice = t.salePrice || 0, i.saleNum = t.saleNum || 0, i.picUrl = t.picUrl || "", z(t.skuId)), i;
|
|
41
|
+
});
|
|
42
|
+
Promise.all(e).then((t) => {
|
|
43
|
+
U.value = t;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
async function A(s, e) {
|
|
48
|
+
var t, i, h;
|
|
49
|
+
if (e.skuId = "", e.skuOptions = [], e.picUrl = "", e.salePrice = 0, e.saleNum = 0, !s) {
|
|
50
|
+
e.skuId = "", e.picUrl = "", e.salePrice = 0, e.saleNum = 0, e.skuOptions = [];
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const { data: c } = await L.findById({ spuId: s });
|
|
55
|
+
if (e.specType = c.specType, e.specType === S.SPEC_TYPE.UNIFIED_SPEC && (e.picUrl = c.picUrls ? c.picUrls.split(",")[0] : "", e.salePrice = (t = c.skuList) == null ? void 0 : t.results[0].salePrice, e.saleNum = (i = c.skuList) == null ? void 0 : i.results[0].stock, e.skuId = (h = c.skuList) == null ? void 0 : h.results[0].skuId), e.specType === S.SPEC_TYPE.MULTI_SPEC && c.skuList) {
|
|
56
|
+
const I = c.skuList.results, g = I.map((n) => n.specValues && Array.isArray(n.specValues) ? n.specValues.map(
|
|
57
|
+
(a) => a.specValueId
|
|
58
|
+
) : []), C = g.flat().map((n) => Y(n));
|
|
59
|
+
await Promise.all(C);
|
|
60
|
+
const T = g.map(
|
|
61
|
+
(n) => n.map((a) => N.value[a] || a)
|
|
62
|
+
);
|
|
63
|
+
e.skuOptions = I.map((n, a) => ({
|
|
64
|
+
key: n.skuId,
|
|
65
|
+
value: T[a].join(" "),
|
|
66
|
+
picUrl: n.picUrl || (c.picUrls ? c.picUrls.split(",")[0] : ""),
|
|
67
|
+
salePrice: n.salePrice,
|
|
68
|
+
stock: n.stock
|
|
69
|
+
})), I.forEach((n) => {
|
|
70
|
+
n.skuId && (B.value[n.skuId] = {
|
|
71
|
+
...n,
|
|
72
|
+
spuPicUrls: c.picUrls
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
} catch {
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function z(s) {
|
|
80
|
+
const e = U.value.find((t) => t.skuId === s);
|
|
81
|
+
if (e && s) {
|
|
82
|
+
const t = B.value[s];
|
|
83
|
+
if (t) {
|
|
84
|
+
const i = t.spuPicUrls ? t.spuPicUrls.split(",")[0] : "";
|
|
85
|
+
e.picUrl = t.picUrl || i, e.salePrice = t.salePrice, e.saleNum = t.stock;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async function Y(s) {
|
|
90
|
+
if (!N.value[s])
|
|
91
|
+
try {
|
|
92
|
+
const { data: e } = await H.findById({
|
|
93
|
+
specValueId: s
|
|
94
|
+
});
|
|
95
|
+
return N.value[s] = e.valueName, e.valueName;
|
|
96
|
+
} catch {
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function q(s) {
|
|
100
|
+
if (!s.skuId || !s.skuOptions || s.skuOptions.length === 0)
|
|
101
|
+
return "";
|
|
102
|
+
const e = s.skuOptions.find(
|
|
103
|
+
(t) => t.key === s.skuId
|
|
104
|
+
);
|
|
105
|
+
return e ? e.value : "";
|
|
106
|
+
}
|
|
107
|
+
function F() {
|
|
108
|
+
R.closeTagView(b.fullPath, O, !1);
|
|
109
|
+
}
|
|
110
|
+
return (s, e) => {
|
|
111
|
+
const t = f("el-button"), i = f("el-descriptions-item"), h = f("el-tag"), c = f("el-image"), I = f("el-descriptions"), g = f("el-table-column"), C = f("el-table"), T = f("el-row"), n = f("el-card");
|
|
112
|
+
return _(), k("div", J, [
|
|
113
|
+
o(n, { shadow: "never" }, {
|
|
114
|
+
header: l(() => [
|
|
115
|
+
o(t, {
|
|
116
|
+
type: "primary",
|
|
117
|
+
onClick: F
|
|
118
|
+
}, {
|
|
119
|
+
default: l(() => [
|
|
120
|
+
r(u(s.$t("common.back")), 1)
|
|
121
|
+
]),
|
|
122
|
+
_: 1
|
|
123
|
+
})
|
|
124
|
+
]),
|
|
125
|
+
default: l(() => [
|
|
126
|
+
e[0] || (e[0] = p("div", { class: "title-content" }, "基本信息", -1)),
|
|
127
|
+
o(I, {
|
|
128
|
+
class: "margin-top",
|
|
129
|
+
column: 2,
|
|
130
|
+
border: ""
|
|
131
|
+
}, {
|
|
132
|
+
default: l(() => [
|
|
133
|
+
o(i, null, {
|
|
134
|
+
label: l(() => [
|
|
135
|
+
p("div", K, u(s.$t("goodsSpu.spuName")), 1)
|
|
136
|
+
]),
|
|
137
|
+
default: l(() => [
|
|
138
|
+
r(" " + u(d.value.spuName), 1)
|
|
139
|
+
]),
|
|
140
|
+
_: 1
|
|
141
|
+
}),
|
|
142
|
+
o(i, null, {
|
|
143
|
+
label: l(() => [
|
|
144
|
+
p("div", Q, u(s.$t("goodsSpu.spuCode")), 1)
|
|
145
|
+
]),
|
|
146
|
+
default: l(() => [
|
|
147
|
+
r(" " + u(d.value.spuCode), 1)
|
|
148
|
+
]),
|
|
149
|
+
_: 1
|
|
150
|
+
}),
|
|
151
|
+
o(i, null, {
|
|
152
|
+
label: l(() => [
|
|
153
|
+
p("div", W, u(s.$t("goodsSpu.categoryId")), 1)
|
|
154
|
+
]),
|
|
155
|
+
default: l(() => [
|
|
156
|
+
(_(!0), k(V, null, E(d.value.categoryIds, (a) => (_(), D(h, {
|
|
157
|
+
type: "info",
|
|
158
|
+
key: a,
|
|
159
|
+
style: { "margin-right": "8px", "margin-bottom": "4px" }
|
|
160
|
+
}, {
|
|
161
|
+
default: l(() => [
|
|
162
|
+
r(u(m(y).goodsCategoryListBizLayDict.getValue(a) || a), 1)
|
|
163
|
+
]),
|
|
164
|
+
_: 2
|
|
165
|
+
}, 1024))), 128))
|
|
166
|
+
]),
|
|
167
|
+
_: 1
|
|
168
|
+
}),
|
|
169
|
+
o(i, null, {
|
|
170
|
+
label: l(() => [
|
|
171
|
+
p("div", X, u(s.$t("goodsSpu.labelIds")), 1)
|
|
172
|
+
]),
|
|
173
|
+
default: l(() => [
|
|
174
|
+
(_(!0), k(V, null, E(d.value.labelIds, (a) => (_(), D(h, {
|
|
175
|
+
type: "info",
|
|
176
|
+
key: a,
|
|
177
|
+
style: { "margin-right": "8px", "margin-bottom": "4px" }
|
|
178
|
+
}, {
|
|
179
|
+
default: l(() => [
|
|
180
|
+
r(u(m(y).labelListBizDict.getValue(a) || a), 1)
|
|
181
|
+
]),
|
|
182
|
+
_: 2
|
|
183
|
+
}, 1024))), 128))
|
|
184
|
+
]),
|
|
185
|
+
_: 1
|
|
186
|
+
}),
|
|
187
|
+
o(i, null, {
|
|
188
|
+
label: l(() => [
|
|
189
|
+
p("div", Z, u(s.$t("goodsSpu.picUrls")), 1)
|
|
190
|
+
]),
|
|
191
|
+
default: l(() => [
|
|
192
|
+
(_(!0), k(V, null, E($.value, (a) => (_(), D(c, {
|
|
193
|
+
key: a,
|
|
194
|
+
src: m(P).imageUrl(a, 80, 80),
|
|
195
|
+
"preview-src-list": [m(P).imageUrl(a)],
|
|
196
|
+
"preview-teleported": "",
|
|
197
|
+
"hide-on-click-modal": "",
|
|
198
|
+
fit: "contain"
|
|
199
|
+
}, null, 8, ["src", "preview-src-list"]))), 128))
|
|
200
|
+
]),
|
|
201
|
+
_: 1
|
|
202
|
+
}),
|
|
203
|
+
o(i, null, {
|
|
204
|
+
label: l(() => [
|
|
205
|
+
p("div", w, u(s.$t("goodsSpu.freightType")), 1)
|
|
206
|
+
]),
|
|
207
|
+
default: l(() => [
|
|
208
|
+
r(" " + u(m(y).freightTypeEnum.getEnumValue(
|
|
209
|
+
d.value.freightType
|
|
210
|
+
)), 1)
|
|
211
|
+
]),
|
|
212
|
+
_: 1
|
|
213
|
+
}),
|
|
214
|
+
o(i, null, {
|
|
215
|
+
label: l(() => [
|
|
216
|
+
p("div", x, u(s.$t("goodsSpu.freightAmount")), 1)
|
|
217
|
+
]),
|
|
218
|
+
default: l(() => [
|
|
219
|
+
r(" " + u(d.value.freightAmount), 1)
|
|
220
|
+
]),
|
|
221
|
+
_: 1
|
|
222
|
+
}),
|
|
223
|
+
o(i, null, {
|
|
224
|
+
label: l(() => [
|
|
225
|
+
p("div", ee, u(s.$t("goodsSpu.shelf")), 1)
|
|
226
|
+
]),
|
|
227
|
+
default: l(() => [
|
|
228
|
+
r(" " + u(m(y).shelfDict.getValue(d.value.shelf)), 1)
|
|
229
|
+
]),
|
|
230
|
+
_: 1
|
|
231
|
+
}),
|
|
232
|
+
o(i, null, {
|
|
233
|
+
label: l(() => [
|
|
234
|
+
p("div", se, u(s.$t("goodsSpu.saleNum")), 1)
|
|
235
|
+
]),
|
|
236
|
+
default: l(() => [
|
|
237
|
+
r(" " + u(d.value.saleNum), 1)
|
|
238
|
+
]),
|
|
239
|
+
_: 1
|
|
240
|
+
})
|
|
241
|
+
]),
|
|
242
|
+
_: 1
|
|
243
|
+
}),
|
|
244
|
+
e[1] || (e[1] = p("div", { class: "title-content" }, "套装商品", -1)),
|
|
245
|
+
o(T, null, {
|
|
246
|
+
default: l(() => [
|
|
247
|
+
o(C, {
|
|
248
|
+
data: U.value,
|
|
249
|
+
border: "",
|
|
250
|
+
style: { width: "100%" }
|
|
251
|
+
}, {
|
|
252
|
+
default: l(() => [
|
|
253
|
+
o(g, {
|
|
254
|
+
label: s.$t("goodsSpu.spuName"),
|
|
255
|
+
prop: "spuId",
|
|
256
|
+
"header-align": "center"
|
|
257
|
+
}, {
|
|
258
|
+
default: l(({ row: a }) => [
|
|
259
|
+
r(u(m(y).goodsSpuBizDict.getValue(a.spuId)), 1)
|
|
260
|
+
]),
|
|
261
|
+
_: 1
|
|
262
|
+
}, 8, ["label"]),
|
|
263
|
+
o(g, {
|
|
264
|
+
label: s.$t("goodsSpu.specType"),
|
|
265
|
+
"header-align": "center"
|
|
266
|
+
}, {
|
|
267
|
+
default: l(({ row: a }) => [
|
|
268
|
+
a.specType === m(S).SPEC_TYPE.UNIFIED_SPEC ? (_(), k("span", le, " 统一规格 ")) : (_(), k("span", te, u(q(a)), 1))
|
|
269
|
+
]),
|
|
270
|
+
_: 1
|
|
271
|
+
}, 8, ["label"]),
|
|
272
|
+
o(g, {
|
|
273
|
+
label: s.$t("goodsSpu.picUrls"),
|
|
274
|
+
prop: "picUrl",
|
|
275
|
+
width: "105",
|
|
276
|
+
"header-align": "center"
|
|
277
|
+
}, {
|
|
278
|
+
default: l(({ row: a }) => [
|
|
279
|
+
o(c, {
|
|
280
|
+
src: m(P).imageUrl(a.picUrl, 80, 80),
|
|
281
|
+
"preview-src-list": [m(P).imageUrl(a.picUrl)],
|
|
282
|
+
"preview-teleported": "",
|
|
283
|
+
"hide-on-click-modal": "",
|
|
284
|
+
fit: "contain"
|
|
285
|
+
}, null, 8, ["src", "preview-src-list"])
|
|
286
|
+
]),
|
|
287
|
+
_: 1
|
|
288
|
+
}, 8, ["label"]),
|
|
289
|
+
o(g, {
|
|
290
|
+
label: s.$t("goodsSpu.salePriceV1"),
|
|
291
|
+
prop: "salePrice",
|
|
292
|
+
"header-align": "center"
|
|
293
|
+
}, {
|
|
294
|
+
default: l(({ row: a }) => [
|
|
295
|
+
r(u(a.salePrice), 1)
|
|
296
|
+
]),
|
|
297
|
+
_: 1
|
|
298
|
+
}, 8, ["label"]),
|
|
299
|
+
o(g, {
|
|
300
|
+
label: s.$t("goodsSpu.saleNums"),
|
|
301
|
+
prop: "saleNum",
|
|
302
|
+
"header-align": "center"
|
|
303
|
+
}, {
|
|
304
|
+
default: l(({ row: a }) => [
|
|
305
|
+
r(u(a.saleNum), 1)
|
|
306
|
+
]),
|
|
307
|
+
_: 1
|
|
308
|
+
}, 8, ["label"])
|
|
309
|
+
]),
|
|
310
|
+
_: 1
|
|
311
|
+
}, 8, ["data"])
|
|
312
|
+
]),
|
|
313
|
+
_: 1
|
|
314
|
+
})
|
|
315
|
+
]),
|
|
316
|
+
_: 1,
|
|
317
|
+
__: [0, 1]
|
|
318
|
+
})
|
|
319
|
+
]);
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
export {
|
|
324
|
+
pe as default
|
|
325
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as M, ref as y, computed as q, watch as j, resolveComponent as b, openBlock as r, createElementBlock as k, createVNode as i, withCtx as e, createTextVNode as n, toDisplayString as s, createElementVNode as a, Fragment as L, renderList as I, createBlock as S, unref as _, createCommentVNode as B } from "vue";
|
|
2
2
|
import { fileApi as w, routerUtil as F } from "jmash-core";
|
|
3
3
|
import { useRouter as H, useRoute as O } from "vue-router";
|
|
4
|
-
import { D as d, C as N, S as R } from "./index-
|
|
5
|
-
import Y from "./skuTable-
|
|
6
|
-
import {
|
|
4
|
+
import { D as d, C as N, S as R } from "./index-jCpYt-EU.mjs";
|
|
5
|
+
import Y from "./skuTable-9JJqGeRx.mjs";
|
|
6
|
+
import { a as G } from "./index-C7oatDPl.mjs";
|
|
7
7
|
import { g as J } from "./index-BHmGYIuc.mjs";
|
|
8
8
|
const K = { class: "app-container" }, Q = { class: "cell-item" }, W = { class: "cell-item" }, X = { class: "cell-item" }, Z = { class: "cell-item" }, x = { class: "cell-item" }, ee = { class: "cell-item" }, le = { class: "cell-item" }, se = { class: "cell-item" }, te = { class: "cell-item" }, oe = { class: "cell-item" }, ue = { class: "cell-item" }, ae = { class: "cell-item" }, ie = { class: "title-content" }, ne = { class: "cell-item" }, ce = { class: "cell-item" }, de = { class: "cell-item" }, re = { class: "cell-item" }, pe = { class: "cell-item" }, me = { class: "cell-item" }, _e = { class: "cell-item" }, fe = { class: "cell-item" }, ge = ["innerHTML"], Ie = /* @__PURE__ */ M({
|
|
9
9
|
__name: "info",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as te, ref as S, computed as se, watch as $, resolveComponent as i, openBlock as m, createElementBlock as g, Fragment as b, unref as M, createVNode as o, withCtx as a, createCommentVNode as I, renderList as P, createElementVNode as k, toDisplayString as O, createTextVNode as y, createBlock as w } from "vue";
|
|
2
|
-
import { C as D, D as ue, S as Y, a as ne } from "./index-
|
|
3
|
-
import re from "./skuTable-
|
|
2
|
+
import { C as D, D as ue, S as Y, a as ne } from "./index-jCpYt-EU.mjs";
|
|
3
|
+
import re from "./skuTable-9JJqGeRx.mjs";
|
|
4
4
|
import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
5
|
const pe = { key: 0 }, ce = {
|
|
6
6
|
key: 1,
|
|
@@ -0,0 +1,314 @@
|
|
|
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-jCpYt-EU.mjs";
|
|
4
|
+
import { a as L } from "./index-C7oatDPl.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
|
+
};
|