xyvcard-goods 0.0.32 → 0.0.33

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 (54) hide show
  1. package/README.md +51 -51
  2. package/dist/GoodsBaseForm-6rzBkBTh.mjs +4 -0
  3. package/dist/GoodsBaseForm.vue_vue_type_script_setup_true_lang-BmIR352P.mjs +374 -0
  4. package/dist/GoodsLogisticsForm-CHyQ99Mt.mjs +10 -0
  5. package/dist/GoodsSpecForm-BqaN71rS.mjs +4 -0
  6. package/dist/GoodsSpecForm.vue_vue_type_script_setup_true_lang-BTFKRiNW.mjs +140 -0
  7. package/dist/{ImageUpload-BMw9FVJL.mjs → ImageUpload-Bf2jhRs5.mjs} +1 -1
  8. package/dist/edit copy 2-DnKLaz3I.mjs +45 -0
  9. package/dist/edit copy-tfwJCdiV.mjs +526 -0
  10. package/dist/{edit-CyhVo22f.mjs → edit-1Lv_dvlq.mjs} +7 -7
  11. package/dist/{edit-CuGiM5xu.mjs → edit-CZwlbL9o.mjs} +9 -9
  12. package/dist/{edit-DvO1wYIL.mjs → edit-D2zcGl_U.mjs} +1 -1
  13. package/dist/{edit-Bh5jT6eo.mjs → edit-DBTNknBy.mjs} +4 -4
  14. package/dist/{edit-BlQj1xVR.mjs → edit-Db2EJ9dq.mjs} +4 -4
  15. package/dist/{edit.vue_vue_type_script_setup_true_lang-Bx32ZXck.mjs → edit.vue_vue_type_script_setup_true_lang-BmOhw098.mjs} +3 -3
  16. package/dist/el-message-BB2-39XJ.mjs +1221 -0
  17. package/dist/{index-BrBipAPq.mjs → index-BXa-atkT.mjs} +1 -1
  18. package/dist/{index-8JQB4NmH.mjs → index-BhUD_X30.mjs} +281 -250
  19. package/dist/{index-Dz9NSJh1.mjs → index-BpXZNA11.mjs} +3 -3
  20. package/dist/{index-BlZupHNB.mjs → index-CRfiEzkA.mjs} +1488 -1477
  21. package/dist/{index-CVM7nBhM.mjs → index-Cl4wz2yF.mjs} +3 -3
  22. package/dist/{index-DzUSeIbT.mjs → index-DGYGNHfx.mjs} +3 -3
  23. package/dist/{index-Dk9-_0Ir.mjs → index-DXIGHcIv.mjs} +2 -2
  24. package/dist/index-Df-F10aZ.mjs +264 -0
  25. package/dist/index-vHQhUQSO.mjs +95 -0
  26. package/dist/index.mjs +1 -1
  27. package/dist/{info-NFU_3fNY.mjs → info-DDi6GKQH.mjs} +3 -3
  28. package/dist/{info-CLt9Ea38.mjs → info-DfbU-CWk.mjs} +2 -2
  29. package/dist/{skuForm-8WZm2j5V.mjs → skuForm-DWIoveRP.mjs} +14 -14
  30. package/dist/{skuForm-Dr6dKGa4.mjs → skuForm-DoIpxDvq.mjs} +71 -86
  31. package/dist/{skuTable-BwIc5hr5.mjs → skuTable-BVBtWrf9.mjs} +13 -13
  32. package/dist/style.css +1 -1
  33. package/dts/api/goods-base/index.d.ts +11 -0
  34. package/dts/api/goods-base/types.d.ts +33 -0
  35. package/dts/api/goods-logistics/index.d.ts +8 -0
  36. package/dts/api/goods-logistics/types.d.ts +16 -0
  37. package/dts/api/goods-spec/index.d.ts +8 -0
  38. package/dts/api/goods-spec/types.d.ts +15 -0
  39. package/dts/api/goods-spu/index.d.ts +3 -0
  40. package/dts/api/goods-stock/index.d.ts +8 -0
  41. package/dts/api/goods-stock/types.d.ts +32 -0
  42. package/dts/api/index.d.ts +3 -0
  43. package/dts/constant.d.ts +26 -0
  44. package/dts/lang/goods/zh-cn.d.ts +12 -0
  45. package/dts/views/goods/goods-spu/components/GoodsBaseForm.vue.d.ts +7 -0
  46. package/dts/views/goods/goods-spu/components/GoodsLogisticsForm.vue.d.ts +2 -0
  47. package/dts/views/goods/goods-spu/components/GoodsSpecForm.vue.d.ts +7 -0
  48. package/dts/views/goods/goods-spu/edit copy 2.vue.d.ts +2 -0
  49. package/dts/views/goods/goods-spu/edit copy.vue.d.ts +2 -0
  50. package/package.json +63 -63
  51. package/dist/index-B7_M6fAN.mjs +0 -228
  52. package/dts/views/goods/goods-combination/goodsList.vue.d.ts +0 -14
  53. package/dts/views/goods/goods-combination/skuTable.vue.d.ts +0 -40
  54. package/dts/views/goods/goods-spu/goodsList.vue.d.ts +0 -23
package/README.md CHANGED
@@ -1,51 +1,51 @@
1
- # pnpm publish --no-git-checks
2
- npm config set registry https://registry.npmjs.org/
3
-
4
- # pnpm install
5
- npm config set registry https://registry.npmmirror.com/
6
-
7
-
8
- This template should help get you started developing with Vue 3 in Vite.
9
-
10
- ## Recommended IDE Setup
11
-
12
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
13
-
14
- ## Type Support for `.vue` Imports in TS
15
-
16
- TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
17
-
18
- If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
19
-
20
- 1. Disable the built-in TypeScript Extension
21
- 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
22
- 2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
23
- 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
24
-
25
- ## Customize configuration
26
-
27
- See [Vite Configuration Reference](https://vitejs.dev/config/).
28
-
29
- ## Project Setup
30
-
31
- ```sh
32
- pnpm install
33
- ```
34
-
35
- ### Compile and Hot-Reload for Development
36
-
37
- ```sh
38
- pnpm dev
39
- ```
40
-
41
- ### Type-Check, Compile and Minify for Production
42
-
43
- ```sh
44
- pnpm build
45
- ```
46
-
47
- ### Lint with [ESLint](https://eslint.org/)
48
-
49
- ```sh
50
- pnpm lint
51
- ```
1
+ # pnpm publish --no-git-checks
2
+ npm config set registry https://registry.npmjs.org/
3
+
4
+ # pnpm install
5
+ npm config set registry https://registry.npmmirror.com/
6
+
7
+
8
+ This template should help get you started developing with Vue 3 in Vite.
9
+
10
+ ## Recommended IDE Setup
11
+
12
+ [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
13
+
14
+ ## Type Support for `.vue` Imports in TS
15
+
16
+ TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
17
+
18
+ If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
19
+
20
+ 1. Disable the built-in TypeScript Extension
21
+ 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
22
+ 2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
23
+ 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
24
+
25
+ ## Customize configuration
26
+
27
+ See [Vite Configuration Reference](https://vitejs.dev/config/).
28
+
29
+ ## Project Setup
30
+
31
+ ```sh
32
+ pnpm install
33
+ ```
34
+
35
+ ### Compile and Hot-Reload for Development
36
+
37
+ ```sh
38
+ pnpm dev
39
+ ```
40
+
41
+ ### Type-Check, Compile and Minify for Production
42
+
43
+ ```sh
44
+ pnpm build
45
+ ```
46
+
47
+ ### Lint with [ESLint](https://eslint.org/)
48
+
49
+ ```sh
50
+ pnpm lint
51
+ ```
@@ -0,0 +1,4 @@
1
+ import { _ as f } from "./GoodsBaseForm.vue_vue_type_script_setup_true_lang-BmIR352P.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,374 @@
1
+ import { _ as G } from "./ImageUpload-Bf2jhRs5.mjs";
2
+ import { defineComponent as T, reactive as C, ref as j, resolveComponent as m, createBlock as y, openBlock as I, unref as o, withCtx as t, createVNode as e, createCommentVNode as z, createElementVNode as h, createTextVNode as F } from "vue";
3
+ import { useI18n as M } from "vue-i18n";
4
+ import { useRoute as Y, useRouter as W } from "vue-router";
5
+ import { useUserStore as f, clearEmpty as S, request as b, fileApi as H, routerUtil as J } from "jmash-core";
6
+ import { WangEditor as K } from "xyvcard-cms";
7
+ import { D as g, C as U } from "./index-Df-F10aZ.mjs";
8
+ import { a as Q } from "./index-CRfiEzkA.mjs";
9
+ import { E as q } from "./el-message-BB2-39XJ.mjs";
10
+ class X {
11
+ // A创建商品基本信息
12
+ create(d) {
13
+ return d.tenant = f().user.tenant, S(d), b({
14
+ url: "/v1/goods/goods_base",
15
+ method: "post",
16
+ data: d
17
+ });
18
+ }
19
+ // A编辑商品基本信息
20
+ update(d) {
21
+ return d.tenant = f().user.tenant, S(d), b({
22
+ url: "/v1/goods/goods_base",
23
+ method: "patch",
24
+ data: d
25
+ });
26
+ }
27
+ // 导入下载模版
28
+ downloadTemplate() {
29
+ const d = f().user.tenant;
30
+ return b({
31
+ url: `/v1/goods/goods_base/${d}/template.xlsx`,
32
+ method: "get",
33
+ responseType: "blob"
34
+ });
35
+ }
36
+ // A导入商品基本信息请求.
37
+ importExcel(d) {
38
+ return d.tenant = f().user.tenant, S(d), b({
39
+ url: "/v1/ecoupons/grant_users/import",
40
+ method: "patch",
41
+ data: d
42
+ });
43
+ }
44
+ }
45
+ const B = new X(), Z = { class: "image-card" }, de = /* @__PURE__ */ T({
46
+ __name: "GoodsBaseForm",
47
+ emits: ["submit"],
48
+ setup(E, { emit: d }) {
49
+ g.goodsSupClassEnum.useEnumValues(), g.brandListBizDict.useValues(), g.goodsCategoryListBizLayDict.useValues();
50
+ const { t: i } = M(), c = Y(), P = W();
51
+ let s = C({
52
+ requestId: Math.random() * 10 + "",
53
+ updateMask: "spuName,categoryIds,brandId,spuCode,labelIds,picUrls,sellPoint,description,appApiUrl",
54
+ appApiUrl: H.baseApiUrl() || location.origin,
55
+ categoryIds: [],
56
+ labelIds: [],
57
+ spuId: "",
58
+ spuName: "",
59
+ brandId: "",
60
+ spuCode: "",
61
+ picUrls: "",
62
+ sellPoint: "",
63
+ description: "",
64
+ supClass: U.GOODS_SUP_CLASS_VALUES.GOODS_TYPE_REAL,
65
+ isBranchPickup: !1
66
+ });
67
+ c.query.spuId && Q.findById({ spuId: c.query.spuId }).then(({ data: a }) => {
68
+ Object.assign(s, a);
69
+ });
70
+ const w = (a, l, n) => {
71
+ var p;
72
+ const r = (p = s.picUrls) == null ? void 0 : p.split(",").filter(Boolean);
73
+ if (r != null && r.length) {
74
+ if ((r == null ? void 0 : r.length) < 1)
75
+ return n(new Error(i("goodsSpu.imageListsErrors")));
76
+ n();
77
+ } else return n(new Error(i("goodsSpu.picUrlsRequired")));
78
+ }, R = C({
79
+ supClass: [
80
+ {
81
+ required: !0,
82
+ message: i("goodsSpu.supClassRequired"),
83
+ trigger: "blur"
84
+ }
85
+ ],
86
+ isBranchPickup: [
87
+ {
88
+ required: !0,
89
+ message: i("goodsSpu.isBranchPickupRequired"),
90
+ trigger: "blur"
91
+ }
92
+ ],
93
+ spuName: [
94
+ {
95
+ required: !0,
96
+ message: i("goodsSpu.spuNameRequired"),
97
+ trigger: "blur"
98
+ }
99
+ ],
100
+ categoryIds: [
101
+ {
102
+ required: !0,
103
+ message: i("goodsSpu.categoryIdRequired"),
104
+ trigger: "change"
105
+ }
106
+ ],
107
+ brandId: [
108
+ {
109
+ required: !0,
110
+ message: i("goodsSpu.brandIdRequired"),
111
+ trigger: "change"
112
+ }
113
+ ],
114
+ spuCode: [
115
+ {
116
+ required: !0,
117
+ message: i("goodsSpu.spuCodeRequired"),
118
+ trigger: "change"
119
+ }
120
+ ],
121
+ picUrls: [
122
+ {
123
+ validator: w,
124
+ trigger: "change"
125
+ }
126
+ ]
127
+ }), V = j(), v = d;
128
+ function $() {
129
+ var a;
130
+ (a = V.value) == null || a.validate((l) => {
131
+ if (l) {
132
+ if (c.query.spuId) {
133
+ B.update(s).then((n) => {
134
+ n.status === 200 && (q({
135
+ message: i("common.submitSuccess"),
136
+ type: "success"
137
+ }), J.closeTagView(c.fullPath, P, !1));
138
+ });
139
+ return;
140
+ }
141
+ B.create(s).then((n) => {
142
+ n.status === 200 && (q({
143
+ message: i("common.submitSuccess"),
144
+ type: "success"
145
+ }), v("submit", n.data));
146
+ });
147
+ }
148
+ });
149
+ }
150
+ return (a, l) => {
151
+ const n = m("jmash-enum-radio"), r = m("el-form-item"), p = m("el-col"), _ = m("el-input"), N = m("el-tree-select"), A = m("jmash-select"), L = G, k = m("el-row"), D = m("el-button"), O = m("el-form");
152
+ return I(), y(O, {
153
+ ref_key: "goodsBaseFormRef",
154
+ ref: V,
155
+ model: o(s),
156
+ "label-width": "120px",
157
+ rules: R
158
+ }, {
159
+ default: t(() => [
160
+ e(k, null, {
161
+ default: t(() => [
162
+ e(p, { span: 12 }, {
163
+ default: t(() => [
164
+ e(r, {
165
+ label: a.$t("goodsSpu.supClass"),
166
+ prop: "supClass"
167
+ }, {
168
+ default: t(() => [
169
+ e(n, {
170
+ modelValue: o(s).supClass,
171
+ "onUpdate:modelValue": l[0] || (l[0] = (u) => o(s).supClass = u),
172
+ data: o(g).goodsSupClassEnum.values
173
+ }, null, 8, ["modelValue", "data"])
174
+ ]),
175
+ _: 1
176
+ }, 8, ["label"])
177
+ ]),
178
+ _: 1
179
+ }),
180
+ o(s).supClass === o(U).GOODS_SUP_CLASS_VALUES.GOODS_TYPE_REAL ? (I(), y(p, {
181
+ key: 0,
182
+ span: 12
183
+ }, {
184
+ default: t(() => [
185
+ e(r, {
186
+ label: a.$t("goodsSpu.isBranchPickup"),
187
+ prop: "isBranchPickup"
188
+ }, {
189
+ default: t(() => [
190
+ e(n, {
191
+ modelValue: o(s).isBranchPickup,
192
+ "onUpdate:modelValue": l[1] || (l[1] = (u) => o(s).isBranchPickup = u),
193
+ data: o(g).yesOrNoEnum.values
194
+ }, null, 8, ["modelValue", "data"])
195
+ ]),
196
+ _: 1
197
+ }, 8, ["label"])
198
+ ]),
199
+ _: 1
200
+ })) : z("", !0),
201
+ e(p, { span: 12 }, {
202
+ default: t(() => [
203
+ e(r, {
204
+ label: a.$t("goodsSpu.spuName"),
205
+ prop: "spuName"
206
+ }, {
207
+ default: t(() => [
208
+ e(_, {
209
+ modelValue: o(s).spuName,
210
+ "onUpdate:modelValue": l[2] || (l[2] = (u) => o(s).spuName = u),
211
+ placeholder: a.$t("goodsSpu.spuNameRequired"),
212
+ maxlength: "60",
213
+ "show-word-limit": "",
214
+ clearable: ""
215
+ }, null, 8, ["modelValue", "placeholder"])
216
+ ]),
217
+ _: 1
218
+ }, 8, ["label"])
219
+ ]),
220
+ _: 1
221
+ }),
222
+ e(p, { span: 12 }, {
223
+ default: t(() => [
224
+ e(r, {
225
+ label: a.$t("goodsSpu.categoryId"),
226
+ prop: "categoryIds"
227
+ }, {
228
+ default: t(() => [
229
+ e(N, {
230
+ modelValue: o(s).categoryIds,
231
+ "onUpdate:modelValue": l[3] || (l[3] = (u) => o(s).categoryIds = u),
232
+ data: o(g).goodsCategoryListBizLayDict.values,
233
+ multiple: "",
234
+ "render-after-expand": !1,
235
+ "show-checkbox": "",
236
+ placeholder: a.$t("goodsSpu.categoryIdRequired"),
237
+ class: "w-full"
238
+ }, null, 8, ["modelValue", "data", "placeholder"])
239
+ ]),
240
+ _: 1
241
+ }, 8, ["label"])
242
+ ]),
243
+ _: 1
244
+ }),
245
+ e(p, { span: 12 }, {
246
+ default: t(() => [
247
+ e(r, {
248
+ label: a.$t("goodsSpu.brandId"),
249
+ prop: "brandId"
250
+ }, {
251
+ default: t(() => [
252
+ e(A, {
253
+ modelValue: o(s).brandId,
254
+ "onUpdate:modelValue": l[4] || (l[4] = (u) => o(s).brandId = u),
255
+ placeholder: a.$t("goodsSpu.brandIdRequired"),
256
+ data: o(g).brandListBizDict.values,
257
+ class: "w-full",
258
+ clearable: ""
259
+ }, null, 8, ["modelValue", "placeholder", "data"])
260
+ ]),
261
+ _: 1
262
+ }, 8, ["label"])
263
+ ]),
264
+ _: 1
265
+ }),
266
+ e(p, { span: 12 }, {
267
+ default: t(() => [
268
+ e(r, {
269
+ label: a.$t("goodsSpu.spuCode"),
270
+ prop: "spuCode"
271
+ }, {
272
+ default: t(() => [
273
+ e(_, {
274
+ modelValue: o(s).spuCode,
275
+ "onUpdate:modelValue": l[5] || (l[5] = (u) => o(s).spuCode = u),
276
+ placeholder: a.$t("goodsSpu.spuCodeRequired"),
277
+ maxlength: "15",
278
+ "show-word-limit": "",
279
+ clearable: ""
280
+ }, null, 8, ["modelValue", "placeholder"])
281
+ ]),
282
+ _: 1
283
+ }, 8, ["label"])
284
+ ]),
285
+ _: 1
286
+ }),
287
+ e(p, { span: 24 }, {
288
+ default: t(() => [
289
+ e(r, {
290
+ label: a.$t("goodsSpu.picUrls"),
291
+ prop: "picUrls"
292
+ }, {
293
+ default: t(() => [
294
+ h("div", Z, [
295
+ e(L, {
296
+ modelValue: o(s).picUrls,
297
+ "onUpdate:modelValue": l[6] || (l[6] = (u) => o(s).picUrls = u),
298
+ limit: 6,
299
+ "list-type": "picture-card"
300
+ }, null, 8, ["modelValue"]),
301
+ l[9] || (l[9] = h("div", { class: "red-color" }, " 推荐尺寸:100*100或同比例图片,最少上传1张 ", -1))
302
+ ])
303
+ ]),
304
+ _: 1
305
+ }, 8, ["label"])
306
+ ]),
307
+ _: 1
308
+ }),
309
+ e(p, { span: 24 }, {
310
+ default: t(() => [
311
+ e(r, {
312
+ label: a.$t("goodsSpu.sellPoint"),
313
+ prop: "sellPoint"
314
+ }, {
315
+ default: t(() => [
316
+ e(_, {
317
+ type: "textarea",
318
+ modelValue: o(s).sellPoint,
319
+ "onUpdate:modelValue": l[7] || (l[7] = (u) => o(s).sellPoint = u),
320
+ placeholder: a.$t("goodsSpu.sellPointRequired"),
321
+ clearable: "",
322
+ rows: 4
323
+ }, null, 8, ["modelValue", "placeholder"])
324
+ ]),
325
+ _: 1
326
+ }, 8, ["label"])
327
+ ]),
328
+ _: 1
329
+ }),
330
+ e(p, { span: 24 }, {
331
+ default: t(() => [
332
+ e(r, {
333
+ label: a.$t("goodsSpu.description"),
334
+ prop: "description"
335
+ }, {
336
+ default: t(() => [
337
+ e(o(K), {
338
+ modelValue: o(s).description,
339
+ "onUpdate:modelValue": l[8] || (l[8] = (u) => o(s).description = u),
340
+ style: { width: "100%" }
341
+ }, null, 8, ["modelValue"])
342
+ ]),
343
+ _: 1
344
+ }, 8, ["label"])
345
+ ]),
346
+ _: 1
347
+ })
348
+ ]),
349
+ _: 1
350
+ }),
351
+ e(r, null, {
352
+ default: t(() => [
353
+ e(D, {
354
+ type: "primary",
355
+ onClick: $
356
+ }, {
357
+ default: t(() => l[10] || (l[10] = [
358
+ F("保存", -1)
359
+ ])),
360
+ _: 1,
361
+ __: [10]
362
+ })
363
+ ]),
364
+ _: 1
365
+ })
366
+ ]),
367
+ _: 1
368
+ }, 8, ["model", "rules"]);
369
+ };
370
+ }
371
+ });
372
+ export {
373
+ de as _
374
+ };
@@ -0,0 +1,10 @@
1
+ import { createElementBlock as o, openBlock as c } from "vue";
2
+ import { _ as s } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
3
+ const t = {}, e = { class: "container" };
4
+ function r(n, i) {
5
+ return c(), o("div", e, "GoodsLogisticsForm");
6
+ }
7
+ const m = /* @__PURE__ */ s(t, [["render", r]]);
8
+ export {
9
+ m as default
10
+ };
@@ -0,0 +1,4 @@
1
+ import { _ as f } from "./GoodsSpecForm.vue_vue_type_script_setup_true_lang-BTFKRiNW.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,140 @@
1
+ import { defineComponent as G, reactive as _, ref as I, resolveComponent as n, createBlock as v, openBlock as k, unref as o, withCtx as s, createVNode as e, createTextVNode as w } from "vue";
2
+ import { useI18n as C } from "vue-i18n";
3
+ import { useRoute as N, useRouter as O } from "vue-router";
4
+ import { D as i, C as U } from "./index-Df-F10aZ.mjs";
5
+ import { useUserStore as h, clearEmpty as A, request as R, routerUtil as q } from "jmash-core";
6
+ import { a as F } from "./index-CRfiEzkA.mjs";
7
+ import { E as L } from "./el-message-BB2-39XJ.mjs";
8
+ class j {
9
+ // A设置商品规格与定价信息
10
+ create(u) {
11
+ return u.tenant = h().user.tenant, A(u), R({
12
+ url: "/v1/goods/goods_spec",
13
+ method: "patch",
14
+ data: u
15
+ });
16
+ }
17
+ }
18
+ const B = new j(), K = /* @__PURE__ */ G({
19
+ __name: "GoodsSpecForm",
20
+ emits: ["submit"],
21
+ setup(y, { emit: u }) {
22
+ i.presaleTypeEnum.useEnumValues();
23
+ const { t: P } = C(), d = N(), b = O();
24
+ let l = _({
25
+ requestId: Math.random() * 10 + "",
26
+ updateMask: "presaleType,isPointsGift,isPointsDeduct,purchaseLimit,balancePaymentType,balancePaymentDays,balancePaymentDate,specType,specId,skiSpecValues",
27
+ isPointsGift: !1,
28
+ isPointsDeduct: !1,
29
+ purchaseLimit: 0,
30
+ spuId: "",
31
+ presaleType: U.GOODS_PRESALE_TYPE_VALUES.NONE
32
+ });
33
+ d.query.spuId && F.findById({ spuId: d.query.spuId }).then(({ data: a }) => {
34
+ Object.assign(l, a);
35
+ });
36
+ const S = _({}), f = I(), V = u;
37
+ function g() {
38
+ var a;
39
+ V("submit", {}), (a = f.value) == null || a.validate((t) => {
40
+ t && B.create(l).then((r) => {
41
+ r.status === 200 && (L({
42
+ message: P("common.submitSuccess"),
43
+ type: "success"
44
+ }), q.closeTagView(d.fullPath, b, !1));
45
+ });
46
+ });
47
+ }
48
+ return (a, t) => {
49
+ const r = n("jmash-enum-radio"), m = n("el-form-item"), c = n("el-col"), E = n("el-row"), T = n("el-button"), D = n("el-form");
50
+ return k(), v(D, {
51
+ ref_key: "goodsSpecFormRef",
52
+ ref: f,
53
+ model: o(l),
54
+ "label-width": "130px",
55
+ rules: S
56
+ }, {
57
+ default: s(() => [
58
+ e(E, null, {
59
+ default: s(() => [
60
+ e(c, { span: 12 }, {
61
+ default: s(() => [
62
+ e(m, {
63
+ label: a.$t("goodsSpu.presaleType"),
64
+ prop: "presaleType"
65
+ }, {
66
+ default: s(() => [
67
+ e(r, {
68
+ modelValue: o(l).presaleType,
69
+ "onUpdate:modelValue": t[0] || (t[0] = (p) => o(l).presaleType = p),
70
+ data: o(i).presaleTypeEnum.values
71
+ }, null, 8, ["modelValue", "data"])
72
+ ]),
73
+ _: 1
74
+ }, 8, ["label"])
75
+ ]),
76
+ _: 1
77
+ }),
78
+ e(c, { span: 12 }, {
79
+ default: s(() => [
80
+ e(m, {
81
+ label: a.$t("goodsSpu.isPointsGift"),
82
+ prop: "isPointsGift"
83
+ }, {
84
+ default: s(() => [
85
+ e(r, {
86
+ modelValue: o(l).isPointsGift,
87
+ "onUpdate:modelValue": t[1] || (t[1] = (p) => o(l).isPointsGift = p),
88
+ data: o(i).yesOrNoEnum.values
89
+ }, null, 8, ["modelValue", "data"])
90
+ ]),
91
+ _: 1
92
+ }, 8, ["label"])
93
+ ]),
94
+ _: 1
95
+ }),
96
+ e(c, { span: 12 }, {
97
+ default: s(() => [
98
+ e(m, {
99
+ label: a.$t("goodsSpu.isPointsDeduct"),
100
+ prop: "isPointsDeduct"
101
+ }, {
102
+ default: s(() => [
103
+ e(r, {
104
+ modelValue: o(l).isPointsDeduct,
105
+ "onUpdate:modelValue": t[2] || (t[2] = (p) => o(l).isPointsDeduct = p),
106
+ data: o(i).yesOrNoEnum.values
107
+ }, null, 8, ["modelValue", "data"])
108
+ ]),
109
+ _: 1
110
+ }, 8, ["label"])
111
+ ]),
112
+ _: 1
113
+ })
114
+ ]),
115
+ _: 1
116
+ }),
117
+ e(m, null, {
118
+ default: s(() => [
119
+ e(T, {
120
+ type: "primary",
121
+ onClick: g
122
+ }, {
123
+ default: s(() => t[3] || (t[3] = [
124
+ w("保存", -1)
125
+ ])),
126
+ _: 1,
127
+ __: [3]
128
+ })
129
+ ]),
130
+ _: 1
131
+ })
132
+ ]),
133
+ _: 1
134
+ }, 8, ["model", "rules"]);
135
+ };
136
+ }
137
+ });
138
+ export {
139
+ K as _
140
+ };
@@ -87,7 +87,7 @@ const z = ["src"], A = /* @__PURE__ */ b({
87
87
  ], 64);
88
88
  };
89
89
  }
90
- }), J = /* @__PURE__ */ q(A, [["__scopeId", "data-v-f10f6f7e"]]);
90
+ }), J = /* @__PURE__ */ q(A, [["__scopeId", "data-v-611600ed"]]);
91
91
  export {
92
92
  J as _
93
93
  };