xyvcard-goods 0.0.33 → 0.0.35
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/BatchSetting-B1LcBFPD.mjs +333 -0
- package/dist/ChannelProfit-CNSIK87d.mjs +4 -0
- package/dist/ChannelProfit.vue_vue_type_script_setup_true_lang-BVTifRY8.mjs +320 -0
- package/dist/{GoodsBaseForm-6rzBkBTh.mjs → GoodsBaseForm-BZ2fZmmp.mjs} +1 -1
- package/dist/GoodsBaseForm.vue_vue_type_script_setup_true_lang-BxBTTLdA.mjs +407 -0
- package/dist/GoodsLogisticsForm-BqlwdGQ1.mjs +4 -0
- package/dist/GoodsLogisticsForm.vue_vue_type_script_setup_true_lang-DJREiSkD.mjs +433 -0
- package/dist/GoodsProfitForm-COYRi8sx.mjs +4 -0
- package/dist/GoodsProfitForm.vue_vue_type_script_setup_true_lang-BYPWP95J.mjs +2550 -0
- package/dist/{GoodsSpecForm-BqaN71rS.mjs → GoodsSpecForm-B4MtETRy.mjs} +1 -1
- package/dist/GoodsSpecForm.vue_vue_type_script_setup_true_lang-BbVK_KNz.mjs +347 -0
- package/dist/SingleSku-rWv9vVhv.mjs +351 -0
- package/dist/constant-sVd2JbJt.mjs +115 -0
- package/dist/edit-B1cmsJpy.mjs +70 -0
- package/dist/{edit-DBTNknBy.mjs → edit-Br1Y569l.mjs} +8 -7
- package/dist/{edit-CZwlbL9o.mjs → edit-CET8Fr-t.mjs} +18 -18
- package/dist/{edit-1Lv_dvlq.mjs → edit-CagYTFKr.mjs} +1 -1
- package/dist/{edit-D2zcGl_U.mjs → edit-iJGrWlSv.mjs} +1 -1
- package/dist/{edit.vue_vue_type_script_setup_true_lang-BmOhw098.mjs → edit.vue_vue_type_script_setup_true_lang-D_0YivhL.mjs} +32 -32
- package/dist/{el-message-BB2-39XJ.mjs → el-message-Dj6aaz4G.mjs} +490 -373
- package/dist/{index-BhUD_X30.mjs → index copy-kNLE7fPg.mjs } +6 -5
- package/dist/index-C61SQFSx.mjs +264 -0
- package/dist/index-CeWPdEJD.mjs +713 -0
- package/dist/{index-BpXZNA11.mjs → index-Cg6GUdSP.mjs} +3 -3
- package/dist/index-CyxnVWnL.mjs +182 -0
- package/dist/{index-DGYGNHfx.mjs → index-D9s8hsVw.mjs} +3 -3
- package/dist/{index-BXa-atkT.mjs → index-DbnKa_BJ.mjs} +1 -1
- package/dist/{index-DXIGHcIv.mjs → index-DoxTu4kg.mjs} +5 -4
- package/dist/{index-Cl4wz2yF.mjs → index-kw0UYOIu.mjs} +3 -3
- package/dist/{index-CRfiEzkA.mjs → index-xQgC-8Gd.mjs} +1237 -1141
- package/dist/index.mjs +1 -1
- package/dist/info-CTElDVo6.mjs +376 -0
- package/dist/{info-DfbU-CWk.mjs → info-DpGJgdac.mjs} +37 -36
- package/dist/{skuForm-DoIpxDvq.mjs → skuForm-C7w9YIDe.mjs} +40 -39
- package/dist/skuForm-CPlnCToi.mjs +279 -0
- package/dist/skuTable-C-LcASbX.mjs +594 -0
- package/dist/spec-DkiGCkuM.mjs +44 -0
- package/dist/style.css +1 -1
- package/dts/xyvcard-goods/src/App.vue.d.ts +2 -0
- package/dts/xyvcard-goods/src/api/dict.d.ts +36 -0
- package/dts/xyvcard-goods/src/api/goods-base/index.d.ts +11 -0
- package/dts/xyvcard-goods/src/api/goods-base/types.d.ts +33 -0
- package/dts/xyvcard-goods/src/api/goods-brand-info/index.d.ts +20 -0
- package/dts/xyvcard-goods/src/api/goods-brand-info/types.d.ts +73 -0
- package/dts/xyvcard-goods/src/api/goods-category/index.d.ts +23 -0
- package/dts/xyvcard-goods/src/api/goods-category/types.d.ts +70 -0
- package/dts/xyvcard-goods/src/api/goods-ensure/index.d.ts +13 -0
- package/dts/xyvcard-goods/src/api/goods-ensure/types.d.ts +13 -0
- package/dts/xyvcard-goods/src/api/goods-label-info/index.d.ts +20 -0
- package/dts/xyvcard-goods/src/api/goods-label-info/types.d.ts +70 -0
- package/dts/xyvcard-goods/src/api/goods-logistics/index.d.ts +8 -0
- package/dts/xyvcard-goods/src/api/goods-logistics/types.d.ts +16 -0
- package/dts/xyvcard-goods/src/api/goods-sku/types.d.ts +21 -0
- package/dts/xyvcard-goods/src/api/goods-spec/index.d.ts +8 -0
- package/dts/xyvcard-goods/src/api/goods-spec/types.d.ts +15 -0
- package/dts/xyvcard-goods/src/api/goods-spu/index.d.ts +72 -0
- package/dts/xyvcard-goods/src/api/goods-spu/types.d.ts +271 -0
- package/dts/xyvcard-goods/src/api/goods-stock/index.d.ts +8 -0
- package/dts/xyvcard-goods/src/api/goods-stock/types.d.ts +32 -0
- package/dts/xyvcard-goods/src/api/index.d.ts +29 -0
- package/dts/xyvcard-goods/src/api/shop-branch/index.d.ts +9 -0
- package/dts/xyvcard-goods/src/api/shop-branch/types.d.ts +28 -0
- package/dts/xyvcard-goods/src/api/types.d.ts +4 -0
- package/dts/xyvcard-goods/src/components/ImageUpload.vue.d.ts +36 -0
- package/dts/xyvcard-goods/src/constant.d.ts +107 -0
- package/dts/xyvcard-goods/src/index.d.ts +12 -0
- package/dts/xyvcard-goods/src/lang/goods/en.d.ts +2 -0
- package/dts/xyvcard-goods/src/lang/goods/zh-cn.d.ts +173 -0
- package/dts/xyvcard-goods/src/lang/index.d.ts +1 -0
- package/dts/xyvcard-goods/src/main.d.ts +7 -0
- package/dts/xyvcard-goods/src/permission.d.ts +1 -0
- package/dts/xyvcard-goods/src/router/index.d.ts +7 -0
- package/dts/xyvcard-goods/src/utils/momentPlugin.d.ts +5 -0
- package/dts/xyvcard-goods/src/utils/returnBizLay.d.ts +2 -0
- package/dts/xyvcard-goods/src/utils/sku.d.ts +19 -0
- package/dts/xyvcard-goods/src/views/goods/goods-brand-info/edit.vue.d.ts +22 -0
- package/dts/xyvcard-goods/src/views/goods/goods-brand-info/index.vue.d.ts +2 -0
- package/dts/xyvcard-goods/src/views/goods/goods-category/edit.vue.d.ts +22 -0
- package/dts/xyvcard-goods/src/views/goods/goods-category/index.vue.d.ts +2 -0
- package/dts/xyvcard-goods/src/views/goods/goods-combination/edit.vue.d.ts +2 -0
- package/dts/xyvcard-goods/src/views/goods/goods-combination/index.vue.d.ts +2 -0
- package/dts/xyvcard-goods/src/views/goods/goods-combination/info.vue.d.ts +2 -0
- package/dts/xyvcard-goods/src/views/goods/goods-combination/skuForm.vue.d.ts +20 -0
- package/dts/xyvcard-goods/src/views/goods/goods-label-info/edit.vue.d.ts +22 -0
- package/dts/xyvcard-goods/src/views/goods/goods-label-info/index.vue.d.ts +2 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/components/BatchSetting.vue.d.ts +35 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/components/ChannelProfit.vue.d.ts +22 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/components/GoodsBaseForm.vue.d.ts +34 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/components/GoodsLogisticsForm.vue.d.ts +42 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/components/GoodsProfitForm.vue.d.ts +34 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/components/GoodsSpecForm.vue.d.ts +42 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/components/SingleSku.vue.d.ts +23 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/edit copy 2.vue.d.ts +2 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/edit copy.vue.d.ts +2 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/edit.vue.d.ts +2 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/index copy.vue.d.ts +2 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/index.vue.d.ts +2 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/info.vue.d.ts +2 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/skuForm.vue.d.ts +42 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/skuTable.vue.d.ts +53 -0
- package/dts/xyvcard-goods/src/views/goods/goods-spu/spec.vue.d.ts +2 -0
- package/dts/xyvcard-shop/src/api/shop-branch/index.d.ts +14 -0
- package/dts/xyvcard-shop/src/api/shop-branch/types.d.ts +76 -0
- package/package.json +6 -5
- package/dist/GoodsBaseForm.vue_vue_type_script_setup_true_lang-BmIR352P.mjs +0 -374
- package/dist/GoodsLogisticsForm-CHyQ99Mt.mjs +0 -10
- package/dist/GoodsSpecForm.vue_vue_type_script_setup_true_lang-BTFKRiNW.mjs +0 -140
- package/dist/edit copy 2-DnKLaz3I.mjs +0 -45
- package/dist/edit copy-tfwJCdiV.mjs +0 -526
- package/dist/edit-Db2EJ9dq.mjs +0 -526
- package/dist/index-BHmGYIuc.mjs +0 -24
- package/dist/index-Df-F10aZ.mjs +0 -264
- package/dist/index-vHQhUQSO.mjs +0 -95
- package/dist/info-DDi6GKQH.mjs +0 -365
- package/dist/skuForm-DWIoveRP.mjs +0 -475
- package/dist/skuTable-BVBtWrf9.mjs +0 -639
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as z, ref as S, watch as E, resolveComponent as i, createBlock as P, openBlock as m, withCtx as r, createVNode as n, unref as
|
|
1
|
+
import { defineComponent as z, ref as S, watch as E, resolveComponent as i, createBlock as P, openBlock as m, withCtx as r, createVNode as n, unref as U, createElementBlock as T, Fragment as Y, renderList as G, createCommentVNode as M, createTextVNode as H, toDisplayString as J } from "vue";
|
|
2
2
|
import { useI18n as K } from "vue-i18n";
|
|
3
|
-
import { p as Q } from "./index-
|
|
4
|
-
import { D as V
|
|
5
|
-
import {
|
|
3
|
+
import { p as Q } from "./index-CyxnVWnL.mjs";
|
|
4
|
+
import { D as V } from "./index-C61SQFSx.mjs";
|
|
5
|
+
import { C as h } from "./constant-sVd2JbJt.mjs";
|
|
6
|
+
import { a as D } from "./index-xQgC-8Gd.mjs";
|
|
6
7
|
import { specValueApi as W } from "xyvcard-shop";
|
|
7
8
|
import { _ as X } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
8
9
|
const Z = { key: 0 }, x = /* @__PURE__ */ z({
|
|
@@ -15,8 +16,8 @@ const Z = { key: 0 }, x = /* @__PURE__ */ z({
|
|
|
15
16
|
}
|
|
16
17
|
},
|
|
17
18
|
emits: ["getGoodsSku", "getFormData"],
|
|
18
|
-
setup($, { emit:
|
|
19
|
-
const { t:
|
|
19
|
+
setup($, { emit: L }) {
|
|
20
|
+
const { t: A } = K(), g = S([]), d = S([
|
|
20
21
|
{
|
|
21
22
|
salePrice: 0,
|
|
22
23
|
skuId: "",
|
|
@@ -30,8 +31,8 @@ const Z = { key: 0 }, x = /* @__PURE__ */ z({
|
|
|
30
31
|
}
|
|
31
32
|
]);
|
|
32
33
|
V.goodsSpuBizDict.useValues();
|
|
33
|
-
const
|
|
34
|
-
function
|
|
34
|
+
const F = L;
|
|
35
|
+
function B(s, e) {
|
|
35
36
|
s.picUrl = e.response.fileSrc;
|
|
36
37
|
}
|
|
37
38
|
const y = $;
|
|
@@ -56,18 +57,18 @@ const Z = { key: 0 }, x = /* @__PURE__ */ z({
|
|
|
56
57
|
specType: "",
|
|
57
58
|
skuOptions: []
|
|
58
59
|
};
|
|
59
|
-
return await v(l.spuId, t), t.saleNum = l.saleNum || 1, t.salePrice = l.salePrice || 0, t.specType ===
|
|
60
|
+
return await v(l.spuId, t), t.saleNum = l.saleNum || 1, t.salePrice = l.salePrice || 0, t.specType === h.SPEC_TYPE_VALUES.MULTI_SPEC && l.skuId && (t.skuId = l.skuId || "", t.salePrice = l.salePrice || 0, t.saleNum = l.saleNum || 1, t.picUrl = l.picUrl || "", C(l.skuId)), t;
|
|
60
61
|
});
|
|
61
62
|
Promise.all(e).then((l) => {
|
|
62
63
|
d.value = l;
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
});
|
|
66
|
-
function
|
|
67
|
+
function O(s) {
|
|
67
68
|
const e = d.value.indexOf(s.row);
|
|
68
69
|
e !== 0 && d.value.splice(e, 1);
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
+
function j() {
|
|
71
72
|
d.value.push({
|
|
72
73
|
salePrice: 0,
|
|
73
74
|
skuId: "",
|
|
@@ -94,31 +95,31 @@ const Z = { key: 0 }, x = /* @__PURE__ */ z({
|
|
|
94
95
|
async function v(s, e) {
|
|
95
96
|
var l, t, I;
|
|
96
97
|
if (e.skuId = "", e.skuOptions = [], e.picUrl = "", e.salePrice = 0, e.saleNum = 1, e.skuName = "", e.marketPrice = 0, !s) {
|
|
97
|
-
e.skuId = "", e.picUrl = "", e.salePrice = 0, e.saleNum = 1, e.skuName = ((l = V.goodsSpuBizDict.values.find((
|
|
98
|
+
e.skuId = "", e.picUrl = "", e.salePrice = 0, e.saleNum = 1, e.skuName = ((l = V.goodsSpuBizDict.values.find((u) => u.key === s)) == null ? void 0 : l.value) ?? "", e.skuOptions = [], e.marketPrice = 0;
|
|
98
99
|
return;
|
|
99
100
|
}
|
|
100
101
|
try {
|
|
101
|
-
const { data:
|
|
102
|
-
if (e.specType =
|
|
103
|
-
const f =
|
|
102
|
+
const { data: u } = await D.findById({ spuId: s });
|
|
103
|
+
if (e.specType = u.specType, e.marketPrice = u.maxPrice, e.specType === h.SPEC_TYPE_VALUES.UNIFIED_SPEC && (e.picUrl = u.picUrls ? u.picUrls.split(",")[0] : "", e.salePrice = (t = u.skuList) == null ? void 0 : t.results[0].salePrice, e.skuId = (I = u.skuList) == null ? void 0 : I.results[0].skuId, e.skuName = u.spuName), e.specType === h.SPEC_TYPE_VALUES.MULTI_SPEC && u.skuList) {
|
|
104
|
+
const f = u.skuList.results, k = f.map((o) => o.specValues && Array.isArray(o.specValues) ? o.specValues.map(
|
|
104
105
|
(p) => p.specValueId
|
|
105
|
-
) : []), N = k.flat().map((
|
|
106
|
+
) : []), N = k.flat().map((o) => R(o));
|
|
106
107
|
await Promise.all(N);
|
|
107
108
|
const _ = k.map(
|
|
108
|
-
(
|
|
109
|
+
(o) => o.map((p) => g.value[p] || p)
|
|
109
110
|
);
|
|
110
|
-
e.skuOptions = f.map((
|
|
111
|
-
key:
|
|
111
|
+
e.skuOptions = f.map((o, p) => ({
|
|
112
|
+
key: o.skuId,
|
|
112
113
|
value: _[p].join(" "),
|
|
113
114
|
specInfo: _[p].join(" "),
|
|
114
|
-
picUrl:
|
|
115
|
-
salePrice:
|
|
116
|
-
stock:
|
|
117
|
-
})), f.forEach((
|
|
118
|
-
|
|
119
|
-
...
|
|
115
|
+
picUrl: o.picUrl || (u.picUrls ? u.picUrls.split(",")[0] : ""),
|
|
116
|
+
salePrice: o.salePrice,
|
|
117
|
+
stock: o.stock
|
|
118
|
+
})), f.forEach((o, p) => {
|
|
119
|
+
o.skuId && (b.value[o.skuId] = {
|
|
120
|
+
...o,
|
|
120
121
|
specInfo: _[p].join(" "),
|
|
121
|
-
spuPicUrls:
|
|
122
|
+
spuPicUrls: u.picUrls
|
|
122
123
|
});
|
|
123
124
|
});
|
|
124
125
|
}
|
|
@@ -148,17 +149,17 @@ const Z = { key: 0 }, x = /* @__PURE__ */ z({
|
|
|
148
149
|
skuName: l.skuName,
|
|
149
150
|
marketPrice: l.marketPrice
|
|
150
151
|
}));
|
|
151
|
-
console.log("filteredValue", e),
|
|
152
|
+
console.log("filteredValue", e), F("getGoodsSku", e);
|
|
152
153
|
},
|
|
153
154
|
{
|
|
154
155
|
deep: !0,
|
|
155
156
|
immediate: !0
|
|
156
157
|
}
|
|
157
158
|
), (s, e) => {
|
|
158
|
-
const l = i("jmash-select"), t = i("el-table-column"), I = i("el-option"),
|
|
159
|
+
const l = i("jmash-select"), t = i("el-table-column"), I = i("el-option"), u = i("el-select"), f = i("jmash-single-image-upload"), k = i("el-input-number"), N = i("DeleteFilled"), _ = i("el-icon"), o = i("el-table"), p = i("el-button"), q = i("el-row");
|
|
159
160
|
return m(), P(q, null, {
|
|
160
161
|
default: r(() => [
|
|
161
|
-
n(
|
|
162
|
+
n(o, {
|
|
162
163
|
data: d.value,
|
|
163
164
|
border: "",
|
|
164
165
|
style: { width: "100%" }
|
|
@@ -173,7 +174,7 @@ const Z = { key: 0 }, x = /* @__PURE__ */ z({
|
|
|
173
174
|
n(l, {
|
|
174
175
|
modelValue: a.spuId,
|
|
175
176
|
"onUpdate:modelValue": (c) => a.spuId = c,
|
|
176
|
-
data:
|
|
177
|
+
data: U(V).goodsSpuBizDict.values,
|
|
177
178
|
filterable: "",
|
|
178
179
|
clearable: "",
|
|
179
180
|
placeholder: s.$t("goodsSpu.spuNameRequireds"),
|
|
@@ -188,7 +189,7 @@ const Z = { key: 0 }, x = /* @__PURE__ */ z({
|
|
|
188
189
|
"header-align": "center"
|
|
189
190
|
}, {
|
|
190
191
|
default: r(({ row: a }) => [
|
|
191
|
-
a.specType === h
|
|
192
|
+
a.specType === U(h).SPEC_TYPE_VALUES.UNIFIED_SPEC ? (m(), T("span", Z, " 统一规格 ")) : (m(), P(u, {
|
|
192
193
|
key: 1,
|
|
193
194
|
modelValue: a.skuId,
|
|
194
195
|
"onUpdate:modelValue": (c) => a.skuId = c,
|
|
@@ -216,10 +217,10 @@ const Z = { key: 0 }, x = /* @__PURE__ */ z({
|
|
|
216
217
|
default: r(({ row: a }) => [
|
|
217
218
|
n(f, {
|
|
218
219
|
"picture-url": a.picUrl,
|
|
219
|
-
|
|
220
|
+
onUploadFile: (c) => B(a, c),
|
|
220
221
|
width: 80,
|
|
221
222
|
type: "trans"
|
|
222
|
-
}, null, 8, ["picture-url", "
|
|
223
|
+
}, null, 8, ["picture-url", "onUploadFile"])
|
|
223
224
|
]),
|
|
224
225
|
_: 1
|
|
225
226
|
}, 8, ["label"]),
|
|
@@ -267,7 +268,7 @@ const Z = { key: 0 }, x = /* @__PURE__ */ z({
|
|
|
267
268
|
default: r((a) => [
|
|
268
269
|
a.$index !== 0 ? (m(), P(_, {
|
|
269
270
|
key: 0,
|
|
270
|
-
onClick: (c) =>
|
|
271
|
+
onClick: (c) => O(a),
|
|
271
272
|
size: "18",
|
|
272
273
|
style: { cursor: "pointer", color: "inherit" },
|
|
273
274
|
class: "hover-blue"
|
|
@@ -284,12 +285,12 @@ const Z = { key: 0 }, x = /* @__PURE__ */ z({
|
|
|
284
285
|
_: 1
|
|
285
286
|
}, 8, ["data"]),
|
|
286
287
|
n(p, {
|
|
287
|
-
icon:
|
|
288
|
+
icon: U(Q),
|
|
288
289
|
class: "addButton",
|
|
289
|
-
onClick:
|
|
290
|
+
onClick: j
|
|
290
291
|
}, {
|
|
291
292
|
default: r(() => [
|
|
292
|
-
H(J(
|
|
293
|
+
H(J(U(A)("common.add")), 1)
|
|
293
294
|
]),
|
|
294
295
|
_: 1
|
|
295
296
|
}, 8, ["icon"])
|
|
@@ -298,7 +299,7 @@ const Z = { key: 0 }, x = /* @__PURE__ */ z({
|
|
|
298
299
|
});
|
|
299
300
|
};
|
|
300
301
|
}
|
|
301
|
-
}),
|
|
302
|
+
}), ce = /* @__PURE__ */ X(x, [["__scopeId", "data-v-605dcad9"]]);
|
|
302
303
|
export {
|
|
303
|
-
|
|
304
|
+
ce as default
|
|
304
305
|
};
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { defineComponent as Z, ref as _, computed as z, watch as M, resolveComponent as i, createElementBlock as g, openBlock as p, createVNode as r, withCtx as s, Fragment as b, renderList as S, createElementVNode as h, toDisplayString as $, createTextVNode as y, createBlock as D, createCommentVNode as x } from "vue";
|
|
2
|
+
import "./constant-sVd2JbJt.mjs";
|
|
3
|
+
import { D as ee, S as G, a as le } from "./index-C61SQFSx.mjs";
|
|
4
|
+
import te from "./skuTable-C-LcASbX.mjs";
|
|
5
|
+
import { _ as ae } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
6
|
+
const oe = { class: "w-full" }, se = { class: "goods-title" }, ue = ["onClick"], ne = { class: "goods-content" }, ce = { class: "goods-tag" }, re = /* @__PURE__ */ Z({
|
|
7
|
+
__name: "skuForm",
|
|
8
|
+
props: {
|
|
9
|
+
// 规格类型
|
|
10
|
+
specType: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: () => ""
|
|
13
|
+
},
|
|
14
|
+
form: {
|
|
15
|
+
type: Object,
|
|
16
|
+
default: () => {
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
goodsSpuModel: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: () => {
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
emits: ["getGoodsSku", "getFormData"],
|
|
26
|
+
setup(w, { expose: N, emit: q }) {
|
|
27
|
+
var E, j;
|
|
28
|
+
const t = _([]), L = _(), v = _([]), V = _([]), C = _([]), k = w, O = q, I = z(() => t.value.filter(
|
|
29
|
+
(e) => e.name && e.specValueList != null && e.specValueList.length
|
|
30
|
+
));
|
|
31
|
+
M(
|
|
32
|
+
k.form,
|
|
33
|
+
(e) => e,
|
|
34
|
+
{
|
|
35
|
+
deep: !0,
|
|
36
|
+
immediate: !0
|
|
37
|
+
}
|
|
38
|
+
), M(
|
|
39
|
+
I,
|
|
40
|
+
(e) => e,
|
|
41
|
+
{
|
|
42
|
+
deep: !0,
|
|
43
|
+
immediate: !0
|
|
44
|
+
}
|
|
45
|
+
), k.form.spuId && (C.value = (E = k.goodsSpuModel.skuList) == null ? void 0 : E.results, (j = k.goodsSpuModel.skuList) == null || j.results.forEach((e) => {
|
|
46
|
+
var l;
|
|
47
|
+
(l = e.specValues) == null || l.map((a) => {
|
|
48
|
+
ee.specInfoDict.useValues().then((n) => {
|
|
49
|
+
const d = n.find((c) => a.specId === c.key);
|
|
50
|
+
if (d) {
|
|
51
|
+
let c = {
|
|
52
|
+
id: a.specId,
|
|
53
|
+
name: d.value,
|
|
54
|
+
specValueList: []
|
|
55
|
+
};
|
|
56
|
+
t.value.push(c);
|
|
57
|
+
}
|
|
58
|
+
const o = /* @__PURE__ */ new Map();
|
|
59
|
+
t.value = t.value.filter(
|
|
60
|
+
(c) => !o.has(c.id) && o.set(c.id, c)
|
|
61
|
+
), U(a.specValueId);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}));
|
|
65
|
+
function U(e) {
|
|
66
|
+
t.value.forEach((l) => {
|
|
67
|
+
v.value = new G({ specId: l.id }), v.value.useValues().then((a) => {
|
|
68
|
+
a.forEach((n) => {
|
|
69
|
+
if (n.key === e) {
|
|
70
|
+
let o = {
|
|
71
|
+
id: e,
|
|
72
|
+
name: n.value
|
|
73
|
+
};
|
|
74
|
+
l.specValueList.push(o);
|
|
75
|
+
}
|
|
76
|
+
const d = /* @__PURE__ */ new Map();
|
|
77
|
+
l.specValueList = l.specValueList.filter(
|
|
78
|
+
(o) => !d.has(o.id) && d.set(o.id, o)
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function H(e) {
|
|
85
|
+
t.value.splice(e, 1);
|
|
86
|
+
}
|
|
87
|
+
function J(e, l) {
|
|
88
|
+
t.value[e].specValueList.splice(l, 1);
|
|
89
|
+
}
|
|
90
|
+
function K() {
|
|
91
|
+
V.value = new le({}), V.value.useValues().then((e) => {
|
|
92
|
+
e.forEach((l) => {
|
|
93
|
+
Array.isArray(t.value) && t.value.length > 0 && t.value.forEach((a) => {
|
|
94
|
+
l.key === a.id && (l.disabled = !0);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function P(e) {
|
|
100
|
+
let l = V.value.values.filter((n) => n.key === e), a = {
|
|
101
|
+
id: l[0].key,
|
|
102
|
+
name: l[0].value,
|
|
103
|
+
specValueList: []
|
|
104
|
+
};
|
|
105
|
+
t.value.push(a), L.value = "";
|
|
106
|
+
}
|
|
107
|
+
function Q(e) {
|
|
108
|
+
v.value = new G({
|
|
109
|
+
specId: t.value[e].id
|
|
110
|
+
}), v.value.useValues().then((l) => {
|
|
111
|
+
l.map((a) => {
|
|
112
|
+
Array.isArray(t.value[e].specValueList) && t.value[e].specValueList.length > 0 && t.value[e].specValueList.forEach((n) => {
|
|
113
|
+
a.key === n.id && (a.disabled = !0);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function W(e, l) {
|
|
119
|
+
var d, o;
|
|
120
|
+
let a = v.value.values.filter((c) => c.key === e), n = {
|
|
121
|
+
id: a[0].key,
|
|
122
|
+
name: a[0].value
|
|
123
|
+
};
|
|
124
|
+
(o = (d = t.value[l]) == null ? void 0 : d.specValueList) == null || o.push(n), t.value[l].specValueId = "";
|
|
125
|
+
}
|
|
126
|
+
function X(e) {
|
|
127
|
+
O("getFormData", e);
|
|
128
|
+
}
|
|
129
|
+
const F = _();
|
|
130
|
+
return N({
|
|
131
|
+
formRef: () => {
|
|
132
|
+
var e;
|
|
133
|
+
return (e = F.value) == null ? void 0 : e.formRef();
|
|
134
|
+
}
|
|
135
|
+
}), (e, l) => {
|
|
136
|
+
const a = i("Delete"), n = i("el-icon"), d = i("el-tag"), o = i("el-button"), c = i("el-option"), R = i("el-select"), T = i("el-popover"), A = i("el-tab-pane"), B = i("el-tabs");
|
|
137
|
+
return p(), g("div", oe, [
|
|
138
|
+
r(B, { type: "border-card" }, {
|
|
139
|
+
default: s(() => [
|
|
140
|
+
r(A, { label: "商品规格" }, {
|
|
141
|
+
default: s(() => [
|
|
142
|
+
(p(!0), g(b, null, S(t.value, (f, m) => (p(), g("div", {
|
|
143
|
+
class: "goods-spec",
|
|
144
|
+
key: m
|
|
145
|
+
}, [
|
|
146
|
+
h("div", se, [
|
|
147
|
+
h("span", null, $(f.name), 1),
|
|
148
|
+
h("span", {
|
|
149
|
+
class: "goods-delete",
|
|
150
|
+
onClick: (u) => H(m)
|
|
151
|
+
}, [
|
|
152
|
+
r(n, null, {
|
|
153
|
+
default: s(() => [
|
|
154
|
+
r(a)
|
|
155
|
+
]),
|
|
156
|
+
_: 1
|
|
157
|
+
}),
|
|
158
|
+
l[1] || (l[1] = y("移除 ", -1))
|
|
159
|
+
], 8, ue)
|
|
160
|
+
]),
|
|
161
|
+
h("div", ne, [
|
|
162
|
+
h("div", ce, [
|
|
163
|
+
(p(!0), g(b, null, S(t.value[m].specValueList, (u, Y) => (p(), D(d, {
|
|
164
|
+
key: u,
|
|
165
|
+
closable: "",
|
|
166
|
+
type: "info",
|
|
167
|
+
class: "right-dis",
|
|
168
|
+
onClose: (de) => J(m, Y)
|
|
169
|
+
}, {
|
|
170
|
+
default: s(() => [
|
|
171
|
+
y($(u.name), 1)
|
|
172
|
+
]),
|
|
173
|
+
_: 2
|
|
174
|
+
}, 1032, ["onClose"]))), 128))
|
|
175
|
+
]),
|
|
176
|
+
r(T, {
|
|
177
|
+
placement: "bottom",
|
|
178
|
+
width: 200,
|
|
179
|
+
trigger: "click",
|
|
180
|
+
onShow: (u) => Q(m)
|
|
181
|
+
}, {
|
|
182
|
+
reference: s(() => [
|
|
183
|
+
r(o, { class: "m-2" }, {
|
|
184
|
+
default: s(() => l[2] || (l[2] = [
|
|
185
|
+
y("添加规格值", -1)
|
|
186
|
+
])),
|
|
187
|
+
_: 1,
|
|
188
|
+
__: [2]
|
|
189
|
+
})
|
|
190
|
+
]),
|
|
191
|
+
default: s(() => [
|
|
192
|
+
r(R, {
|
|
193
|
+
modelValue: t.value[m].specValueId,
|
|
194
|
+
"onUpdate:modelValue": (u) => t.value[m].specValueId = u,
|
|
195
|
+
placeholder: e.$t("goodsSpu.specValueRequired"),
|
|
196
|
+
onChange: (u) => W(u, m)
|
|
197
|
+
}, {
|
|
198
|
+
default: s(() => [
|
|
199
|
+
(p(!0), g(b, null, S(v.value.values, (u) => (p(), D(c, {
|
|
200
|
+
key: u.key,
|
|
201
|
+
label: u.value,
|
|
202
|
+
value: u.key,
|
|
203
|
+
disabled: u.disabled
|
|
204
|
+
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
205
|
+
]),
|
|
206
|
+
_: 2
|
|
207
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"])
|
|
208
|
+
]),
|
|
209
|
+
_: 2
|
|
210
|
+
}, 1032, ["onShow"])
|
|
211
|
+
])
|
|
212
|
+
]))), 128)),
|
|
213
|
+
r(T, {
|
|
214
|
+
placement: "bottom",
|
|
215
|
+
width: 200,
|
|
216
|
+
trigger: "click",
|
|
217
|
+
onShow: K
|
|
218
|
+
}, {
|
|
219
|
+
reference: s(() => [
|
|
220
|
+
r(o, { class: "m-2" }, {
|
|
221
|
+
default: s(() => l[3] || (l[3] = [
|
|
222
|
+
y("添加规格", -1)
|
|
223
|
+
])),
|
|
224
|
+
_: 1,
|
|
225
|
+
__: [3]
|
|
226
|
+
})
|
|
227
|
+
]),
|
|
228
|
+
default: s(() => [
|
|
229
|
+
r(R, {
|
|
230
|
+
modelValue: L.value,
|
|
231
|
+
"onUpdate:modelValue": l[0] || (l[0] = (f) => L.value = f),
|
|
232
|
+
placeholder: e.$t("goodsSpu.specRequired"),
|
|
233
|
+
onChange: P
|
|
234
|
+
}, {
|
|
235
|
+
default: s(() => [
|
|
236
|
+
(p(!0), g(b, null, S(V.value.values, (f) => (p(), D(c, {
|
|
237
|
+
key: f.key,
|
|
238
|
+
label: f.value,
|
|
239
|
+
value: f.key,
|
|
240
|
+
disabled: f.disabled
|
|
241
|
+
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
242
|
+
]),
|
|
243
|
+
_: 1
|
|
244
|
+
}, 8, ["modelValue", "placeholder"])
|
|
245
|
+
]),
|
|
246
|
+
_: 1
|
|
247
|
+
})
|
|
248
|
+
]),
|
|
249
|
+
_: 1
|
|
250
|
+
})
|
|
251
|
+
]),
|
|
252
|
+
_: 1
|
|
253
|
+
}),
|
|
254
|
+
r(B, { type: "border-card" }, {
|
|
255
|
+
default: s(() => [
|
|
256
|
+
r(A, { label: "规格售价与库存" }, {
|
|
257
|
+
default: s(() => [
|
|
258
|
+
t.value.length > 0 ? (p(), D(te, {
|
|
259
|
+
key: 0,
|
|
260
|
+
ref_key: "skuTableRef",
|
|
261
|
+
ref: F,
|
|
262
|
+
specData: I.value,
|
|
263
|
+
goodsSku: C.value,
|
|
264
|
+
form: w.form,
|
|
265
|
+
onGetFormData: X
|
|
266
|
+
}, null, 8, ["specData", "goodsSku", "form"])) : x("", !0)
|
|
267
|
+
]),
|
|
268
|
+
_: 1
|
|
269
|
+
})
|
|
270
|
+
]),
|
|
271
|
+
_: 1
|
|
272
|
+
})
|
|
273
|
+
]);
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
}), _e = /* @__PURE__ */ ae(re, [["__scopeId", "data-v-11e63cd5"]]);
|
|
277
|
+
export {
|
|
278
|
+
_e as default
|
|
279
|
+
};
|