xyvcard-order 0.0.5 → 0.0.6

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.
@@ -1,27 +1,28 @@
1
- import { defineComponent as x, getCurrentInstance as ee, ref as y, reactive as le, resolveComponent as s, resolveDirective as te, openBlock as p, createElementBlock as D, createElementVNode as i, createVNode as o, withCtx as r, unref as n, withKeys as $, createTextVNode as R, toDisplayString as a, withDirectives as S, createBlock as g, isRef as z, createCommentVNode as N } from "vue";
2
- import { useTableHooks as oe } from "jmash-core";
3
- import { useI18n as re } from "vue-i18n";
4
- import { o as ne } from "./index-Dvf0V5EP.mjs";
5
- import { _ as ae } from "./review.vue_vue_type_script_setup_true_lang-CKGCdXD5.mjs";
6
- import { _ as de } from "./info.vue_vue_type_script_setup_true_lang-DLnh7W1x.mjs";
7
- import { D as C } from "./index-suIgymdy.mjs";
8
- const ue = { class: "app-container" }, se = { class: "search-container" }, ie = { class: "orderPrice" }, me = ["onClick"], pe = ["onClick"], fe = ["onClick"], $e = /* @__PURE__ */ x({
1
+ import { defineComponent as oe, getCurrentInstance as te, ref as R, reactive as re, resolveComponent as i, resolveDirective as ne, openBlock as p, createElementBlock as D, createElementVNode as s, createVNode as t, withCtx as r, unref as n, withKeys as $, createTextVNode as C, toDisplayString as a, withDirectives as I, createBlock as _, isRef as M, createCommentVNode as N } from "vue";
2
+ import { ElMessageBox as ae, ElMessage as j } from "element-plus";
3
+ import { useTableHooks as de } from "jmash-core";
4
+ import { useI18n as ue } from "vue-i18n";
5
+ import { o as q } from "./index-BnhfSp6U.mjs";
6
+ import { _ as se } from "./review.vue_vue_type_script_setup_true_lang-BER9b6r2.mjs";
7
+ import { _ as ie } from "./info.vue_vue_type_script_setup_true_lang-CHaAOFGr.mjs";
8
+ import { D as w } from "./index-suIgymdy.mjs";
9
+ const me = { class: "app-container" }, fe = { class: "search-container" }, pe = { class: "orderPrice" }, ce = ["onClick"], ve = ["onClick"], ye = ["onClick"], be = ["onClick"], Te = /* @__PURE__ */ oe({
9
10
  __name: "index",
10
- setup(ve) {
11
- const { t: _ } = re(), { proxy: E } = ee();
12
- C.shopBizDict.useValues();
13
- const k = y([]), d = y({
11
+ setup(Re) {
12
+ const { t: m } = ue(), { proxy: z } = te();
13
+ w.shopBizDict.useValues();
14
+ const k = R([]), d = R({
14
15
  curPage: 1,
15
16
  pageSize: 10
16
17
  }), {
17
18
  tableHooks: u,
18
- multipleTableRef: q,
19
- queryFormRef: A,
20
- listLoading: K,
21
- tableData: M,
22
- total: w
23
- } = oe(_, ne, d);
24
- let v = y([
19
+ multipleTableRef: B,
20
+ queryFormRef: Q,
21
+ listLoading: A,
22
+ tableData: K,
23
+ total: h
24
+ } = de(m, q, d);
25
+ let v = R([
25
26
  {
26
27
  label: "orderInfo.shopName",
27
28
  prop: "shopId",
@@ -80,64 +81,91 @@ const ue = { class: "app-container" }, se = { class: "search-container" }, ie =
80
81
  },
81
82
  {
82
83
  label: "common.operate",
83
- width: "200",
84
+ width: "250",
84
85
  slotName: "operation",
85
86
  columnType: "slot",
86
87
  fixed: "right",
87
88
  isColumn: !0
88
89
  }
89
90
  ]);
90
- const c = y({
91
- title: _("orderRefunds.refundOperation"),
91
+ const y = R({
92
+ title: m("orderRefunds.refundOperation"),
92
93
  visible: !1
93
- }), b = y({
94
- title: _("orderRefunds.info"),
94
+ }), b = R({
95
+ title: m("orderRefunds.info"),
95
96
  visible: !1
96
97
  });
97
- let h = le({});
98
- function Q(t) {
99
- h.refundId = t.refundId, c.value.visible = !0;
98
+ let g = re({});
99
+ function L(o) {
100
+ g.refundId = o.refundId, y.value.visible = !0;
100
101
  }
101
- function B(t) {
102
- h.refundId = t.refundId, b.value.visible = !0;
102
+ const H = async (o) => {
103
+ ae.confirm(
104
+ m("orderRefunds.refundConfirm"),
105
+ m("orderRefunds.refund"),
106
+ {
107
+ confirmButtonText: m("common.confirm"),
108
+ cancelButtonText: m("common.cancel"),
109
+ type: "warning"
110
+ }
111
+ ).then(() => {
112
+ q.refund({
113
+ refundId: o.refundId,
114
+ requestId: Math.random() * 10 + ""
115
+ }).then((l) => {
116
+ l.status === 200 && (j({
117
+ message: m("orderRefunds.refundSuccess"),
118
+ type: "success"
119
+ }), u.handleQuery());
120
+ }).catch((l) => {
121
+ console.error("Error canceling order:", l), j({
122
+ message: m("orderRefunds.refundFailed"),
123
+ type: "error"
124
+ });
125
+ });
126
+ }).catch(() => {
127
+ });
128
+ };
129
+ function O(o) {
130
+ g.refundId = o.refundId, b.value.visible = !0;
103
131
  }
104
- function L(t) {
105
- d.value.startCreateTime = t[0], d.value.endCreateTime = t[1];
132
+ function F(o) {
133
+ d.value.startCreateTime = o[0], d.value.endCreateTime = o[1];
106
134
  }
107
- function H() {
135
+ function W() {
108
136
  k.value = [], d.value.startCreateTime = "", d.value.endCreateTime = "", u.resetQuery();
109
137
  }
110
- function O(t) {
111
- u.selectionRows.value = t;
138
+ function G(o) {
139
+ u.selectionRows.value = o;
112
140
  }
113
- function I(t) {
114
- t && u.getList();
141
+ function Y(o) {
142
+ o && u.getList();
115
143
  }
116
- return u.getList(), (t, l) => {
117
- const Y = s("jmash-select"), f = s("el-form-item"), m = s("el-col"), U = s("el-input"), V = s("el-row"), W = s("el-date-picker"), T = s("el-button"), F = s("el-form"), G = s("jmash-column-select"), J = s("jmash-table"), X = s("jmash-pagination"), Z = s("el-card"), P = te("hasPerm");
118
- return p(), D("div", ue, [
119
- i("div", se, [
120
- o(F, {
144
+ return u.getList(), (o, l) => {
145
+ const E = i("jmash-select"), c = i("el-form-item"), f = i("el-col"), U = i("el-input"), V = i("el-row"), J = i("el-date-picker"), T = i("el-button"), X = i("el-form"), Z = i("jmash-column-select"), x = i("jmash-table"), ee = i("jmash-pagination"), le = i("el-card"), P = ne("hasPerm");
146
+ return p(), D("div", me, [
147
+ s("div", fe, [
148
+ t(X, {
121
149
  ref_key: "queryFormRef",
122
- ref: A,
150
+ ref: Q,
123
151
  model: d.value,
124
152
  inline: !0
125
153
  }, {
126
154
  default: r(() => [
127
- o(V, null, {
155
+ t(V, null, {
128
156
  default: r(() => [
129
- o(m, { span: 6 }, {
157
+ t(f, { span: 6 }, {
130
158
  default: r(() => [
131
- o(f, {
132
- label: t.$t("orderRefunds.shopName"),
159
+ t(c, {
160
+ label: o.$t("orderRefunds.shopName"),
133
161
  prop: "shopId"
134
162
  }, {
135
163
  default: r(() => [
136
- o(Y, {
164
+ t(E, {
137
165
  modelValue: d.value.shopId,
138
166
  "onUpdate:modelValue": l[0] || (l[0] = (e) => d.value.shopId = e),
139
- data: n(C).shopBizDict.values,
140
- placeholder: t.$t("orderRefunds.shopNameRequired"),
167
+ data: n(w).shopBizDict.values,
168
+ placeholder: o.$t("orderRefunds.shopNameRequired"),
141
169
  clearable: "",
142
170
  onKeyup: l[1] || (l[1] = $((e) => n(u).handleQuery(), ["enter"]))
143
171
  }, null, 8, ["modelValue", "data", "placeholder"])
@@ -147,17 +175,17 @@ const ue = { class: "app-container" }, se = { class: "search-container" }, ie =
147
175
  ]),
148
176
  _: 1
149
177
  }),
150
- o(m, { span: 6 }, {
178
+ t(f, { span: 6 }, {
151
179
  default: r(() => [
152
- o(f, {
153
- label: t.$t("orderRefunds.refundCode"),
180
+ t(c, {
181
+ label: o.$t("orderRefunds.refundCode"),
154
182
  prop: "likeOrderCode"
155
183
  }, {
156
184
  default: r(() => [
157
- o(U, {
185
+ t(U, {
158
186
  modelValue: d.value.likeOrderCode,
159
187
  "onUpdate:modelValue": l[2] || (l[2] = (e) => d.value.likeOrderCode = e),
160
- placeholder: t.$t("orderRefunds.refundCodeRequired"),
188
+ placeholder: o.$t("orderRefunds.refundCodeRequired"),
161
189
  clearable: "",
162
190
  onKeyup: l[3] || (l[3] = $((e) => n(u).handleQuery(), ["enter"])),
163
191
  class: "!w-[203px]"
@@ -168,17 +196,17 @@ const ue = { class: "app-container" }, se = { class: "search-container" }, ie =
168
196
  ]),
169
197
  _: 1
170
198
  }),
171
- o(m, { span: 6 }, {
199
+ t(f, { span: 6 }, {
172
200
  default: r(() => [
173
- o(f, {
174
- label: t.$t("orderRefunds.spuName"),
201
+ t(c, {
202
+ label: o.$t("orderRefunds.spuName"),
175
203
  prop: "likeSpuName"
176
204
  }, {
177
205
  default: r(() => [
178
- o(U, {
206
+ t(U, {
179
207
  modelValue: d.value.likeSpuName,
180
208
  "onUpdate:modelValue": l[4] || (l[4] = (e) => d.value.likeSpuName = e),
181
- placeholder: t.$t("orderRefunds.spuNameRequired"),
209
+ placeholder: o.$t("orderRefunds.spuNameRequired"),
182
210
  clearable: "",
183
211
  onKeyup: l[5] || (l[5] = $((e) => n(u).handleQuery(), ["enter"])),
184
212
  class: "!w-[203px]"
@@ -189,18 +217,18 @@ const ue = { class: "app-container" }, se = { class: "search-container" }, ie =
189
217
  ]),
190
218
  _: 1
191
219
  }),
192
- o(m, { span: 6 }, {
220
+ t(f, { span: 6 }, {
193
221
  default: r(() => [
194
- o(f, {
195
- label: t.$t("orderRefunds.refundStatus"),
222
+ t(c, {
223
+ label: o.$t("orderRefunds.refundStatus"),
196
224
  prop: "refundStatus"
197
225
  }, {
198
226
  default: r(() => [
199
- o(Y, {
227
+ t(E, {
200
228
  modelValue: d.value.refundStatus,
201
229
  "onUpdate:modelValue": l[6] || (l[6] = (e) => d.value.refundStatus = e),
202
- data: n(C).refundApplyEnum.values,
203
- placeholder: t.$t("orderRefunds.refundStatusRequired"),
230
+ data: n(w).refundApplyEnum.values,
231
+ placeholder: o.$t("orderRefunds.refundStatusRequired"),
204
232
  clearable: "",
205
233
  onKeyup: l[7] || (l[7] = $((e) => n(u).handleQuery(), ["enter"]))
206
234
  }, null, 8, ["modelValue", "data", "placeholder"])
@@ -213,25 +241,25 @@ const ue = { class: "app-container" }, se = { class: "search-container" }, ie =
213
241
  ]),
214
242
  _: 1
215
243
  }),
216
- o(V, null, {
244
+ t(V, null, {
217
245
  default: r(() => [
218
- o(m, { span: 6 }, {
246
+ t(f, { span: 6 }, {
219
247
  default: r(() => [
220
- o(f, {
221
- label: t.$t("orderRefunds.refundsTime"),
248
+ t(c, {
249
+ label: o.$t("orderRefunds.refundsTime"),
222
250
  prop: "startCreateTime"
223
251
  }, {
224
252
  default: r(() => [
225
- o(W, {
253
+ t(J, {
226
254
  modelValue: k.value,
227
255
  "onUpdate:modelValue": l[8] || (l[8] = (e) => k.value = e),
228
256
  class: "dropdown-left",
229
257
  type: "daterange",
230
- "start-placeholder": t.$t("orderRefunds.startCreateTime"),
231
- "end-placeholder": t.$t("orderRefunds.endCreateTime"),
258
+ "start-placeholder": o.$t("orderRefunds.startCreateTime"),
259
+ "end-placeholder": o.$t("orderRefunds.endCreateTime"),
232
260
  format: "YYYY-MM-DD",
233
261
  "value-format": "YYYY-MM-DD",
234
- onChange: L
262
+ onChange: F
235
263
  }, null, 8, ["modelValue", "start-placeholder", "end-placeholder"])
236
264
  ]),
237
265
  _: 1
@@ -239,22 +267,22 @@ const ue = { class: "app-container" }, se = { class: "search-container" }, ie =
239
267
  ]),
240
268
  _: 1
241
269
  }),
242
- o(m, { span: 18 }, {
270
+ t(f, { span: 18 }, {
243
271
  default: r(() => [
244
- o(f, { class: "search-btn" }, {
272
+ t(c, { class: "search-btn" }, {
245
273
  default: r(() => [
246
- o(T, {
274
+ t(T, {
247
275
  type: "primary",
248
276
  onClick: l[9] || (l[9] = (e) => n(u).handleQuery())
249
277
  }, {
250
278
  default: r(() => [
251
- R(a(t.$t("common.search")), 1)
279
+ C(a(o.$t("common.search")), 1)
252
280
  ]),
253
281
  _: 1
254
282
  }),
255
- o(T, { onClick: H }, {
283
+ t(T, { onClick: W }, {
256
284
  default: r(() => [
257
- R(a(t.$t("common.reset")), 1)
285
+ C(a(o.$t("common.reset")), 1)
258
286
  ]),
259
287
  _: 1
260
288
  })
@@ -270,23 +298,23 @@ const ue = { class: "app-container" }, se = { class: "search-container" }, ie =
270
298
  ]),
271
299
  _: 1
272
300
  }, 8, ["model"]),
273
- l[18] || (l[18] = i("div", { class: "clear" }, null, -1))
301
+ l[18] || (l[18] = s("div", { class: "clear" }, null, -1))
274
302
  ]),
275
- o(Z, {
303
+ t(le, {
276
304
  shadow: "never",
277
305
  class: "table-container"
278
306
  }, {
279
307
  header: r(() => [
280
- o(V, null, {
308
+ t(V, null, {
281
309
  default: r(() => [
282
- o(m, { span: 17 }, {
310
+ t(f, { span: 17 }, {
283
311
  default: r(() => [
284
- S((p(), g(T, {
312
+ I((p(), _(T, {
285
313
  type: "primary",
286
314
  onClick: l[10] || (l[10] = (e) => n(u).deleteRecords())
287
315
  }, {
288
316
  default: r(() => [
289
- R(a(t.$t("common.batchDelete")), 1)
317
+ C(a(o.$t("common.batchDelete")), 1)
290
318
  ]),
291
319
  _: 1
292
320
  })), [
@@ -295,14 +323,14 @@ const ue = { class: "app-container" }, se = { class: "search-container" }, ie =
295
323
  ]),
296
324
  _: 1
297
325
  }),
298
- o(m, {
326
+ t(f, {
299
327
  span: 7,
300
328
  class: "container-float"
301
329
  }, {
302
330
  default: r(() => [
303
- o(G, {
331
+ t(Z, {
304
332
  modelValue: n(v),
305
- "onUpdate:modelValue": l[11] || (l[11] = (e) => z(v) ? v.value = e : v = e),
333
+ "onUpdate:modelValue": l[11] || (l[11] = (e) => M(v) ? v.value = e : v = e),
306
334
  "label-name": "order/order-refunds"
307
335
  }, null, 8, ["modelValue"])
308
336
  ]),
@@ -313,10 +341,10 @@ const ue = { class: "app-container" }, se = { class: "search-container" }, ie =
313
341
  })
314
342
  ]),
315
343
  footer: r(() => [
316
- n(w) > 0 ? (p(), g(X, {
344
+ n(h) > 0 ? (p(), _(ee, {
317
345
  key: 0,
318
- total: n(w),
319
- "onUpdate:total": l[12] || (l[12] = (e) => z(w) ? w.value = e : null),
346
+ total: n(h),
347
+ "onUpdate:total": l[12] || (l[12] = (e) => M(h) ? h.value = e : null),
320
348
  "current-page": d.value.curPage,
321
349
  "onUpdate:currentPage": l[13] || (l[13] = (e) => d.value.curPage = e),
322
350
  "page-size": d.value.pageSize,
@@ -325,77 +353,81 @@ const ue = { class: "app-container" }, se = { class: "search-container" }, ie =
325
353
  }, null, 8, ["total", "current-page", "page-size"])) : N("", !0)
326
354
  ]),
327
355
  default: r(() => [
328
- o(J, {
356
+ t(x, {
329
357
  ref_key: "multipleTableRef",
330
- ref: q,
358
+ ref: B,
331
359
  "row-key": "refundId",
332
- "list-loading": n(K),
333
- data: n(M),
360
+ "list-loading": n(A),
361
+ data: n(K),
334
362
  "table-label": n(v),
335
- onSelectionChange: O
363
+ onSelectionChange: G
336
364
  }, {
337
365
  createTime: r((e) => [
338
- i("span", null, a(n(E).$moment.formatDate(
366
+ s("span", null, a(n(z).$moment.formatDate(
339
367
  e.data.row.createTime,
340
368
  "YYYY-MM-DD HH:mm:ss"
341
369
  )), 1)
342
370
  ]),
343
371
  order: r((e) => [
344
- i("div", null, [
345
- i("div", null, a(t.$t("orderRefunds.orderCode")) + ":" + a(e.data.row.orderCode), 1),
346
- i("div", null, a(t.$t("orderRefunds.orderPrice")) + ":¥" + a(e.data.row.orderPrice), 1),
347
- i("div", null, a(t.$t("orderRefunds.freightPrice")) + ":+¥" + a(e.data.row.freightPrice), 1),
348
- i("div", null, a(t.$t("orderRefunds.paymentCouponPrice")) + ":-¥" + a(e.data.row.paymentCouponPrice), 1),
349
- i("div", ie, a(t.$t("orderRefunds.paidPrice")) + ": " + a(e.data.row.orderPrice + e.data.row.freightPrice - e.data.row.paymentCouponPrice), 1),
350
- i("div", null, a(t.$t("orderRefunds.paymentWay")) + ": " + a(n(C).paymentWayEnum.getEnumValue(e.data.row.paymentWay)), 1)
372
+ s("div", null, [
373
+ s("div", null, a(o.$t("orderRefunds.orderCode")) + ":" + a(e.data.row.orderCode), 1),
374
+ s("div", null, a(o.$t("orderRefunds.orderPrice")) + ":¥" + a(e.data.row.orderPrice), 1),
375
+ s("div", null, a(o.$t("orderRefunds.freightPrice")) + ":+¥" + a(e.data.row.freightPrice), 1),
376
+ s("div", null, a(o.$t("orderRefunds.paymentCouponPrice")) + ":-¥" + a(e.data.row.paymentCouponPrice), 1),
377
+ s("div", pe, a(o.$t("orderRefunds.paidPrice")) + ": " + a(e.data.row.orderPrice + e.data.row.freightPrice - e.data.row.paymentCouponPrice), 1),
378
+ s("div", null, a(o.$t("orderRefunds.paymentWay")) + ": " + a(n(w).paymentWayEnum.getEnumValue(e.data.row.paymentWay)), 1)
351
379
  ])
352
380
  ]),
353
381
  refundStatus: r((e) => [
354
- i("span", null, a(n(C).refundApplyEnum.getEnumValue(e.data.row.status)), 1)
382
+ s("span", null, a(n(w).refundApplyEnum.getEnumValue(e.data.row.status)), 1)
355
383
  ]),
356
384
  operation: r((e) => [
357
- S((p(), D("span", {
385
+ I((p(), D("span", {
358
386
  class: "el-button-color dropdown-left",
359
- onClick: (j) => n(u).deleteRecord(e.data.row)
387
+ onClick: (S) => n(u).deleteRecord(e.data.row)
360
388
  }, [
361
- R(a(t.$t("common.delete")), 1)
362
- ], 8, me)), [
389
+ C(a(o.$t("common.delete")), 1)
390
+ ], 8, ce)), [
363
391
  [P, ["order:order_refunds:delete"]]
364
392
  ]),
365
- S((p(), D("span", {
393
+ I((p(), D("span", {
366
394
  class: "el-button-color dropdown-left",
367
- onClick: (j) => B(e.data.row)
395
+ onClick: (S) => O(e.data.row)
368
396
  }, [
369
- R(a(t.$t("common.view")), 1)
370
- ], 8, pe)), [
397
+ C(a(o.$t("common.view")), 1)
398
+ ], 8, ve)), [
371
399
  [P, ["order:order_refunds:view"]]
372
400
  ]),
373
- i("span", {
401
+ s("span", {
402
+ class: "el-button-color dropdown-left",
403
+ onClick: (S) => L(e.data.row)
404
+ }, a(o.$t("orderRefunds.refundReview")), 9, ye),
405
+ s("span", {
374
406
  class: "el-button-color dropdown-left",
375
- onClick: (j) => Q(e.data.row)
376
- }, a(t.$t("orderRefunds.refundReview")), 9, fe)
407
+ onClick: (S) => H(e.data.row)
408
+ }, a(o.$t("orderRefunds.refund")), 9, be)
377
409
  ]),
378
410
  _: 1
379
411
  }, 8, ["list-loading", "data", "table-label"])
380
412
  ]),
381
413
  _: 1
382
414
  }),
383
- c.value.visible ? (p(), g(ae, {
415
+ y.value.visible ? (p(), _(se, {
384
416
  key: 0,
385
- modelValue: c.value.visible,
386
- "onUpdate:modelValue": l[16] || (l[16] = (e) => c.value.visible = e),
387
- title: c.value.title,
388
- "entity-key": n(h),
389
- onRefresh: I,
417
+ modelValue: y.value.visible,
418
+ "onUpdate:modelValue": l[16] || (l[16] = (e) => y.value.visible = e),
419
+ title: y.value.title,
420
+ "entity-key": n(g),
421
+ onRefresh: Y,
390
422
  width: "800px"
391
423
  }, null, 8, ["modelValue", "title", "entity-key"])) : N("", !0),
392
- b.value.visible ? (p(), g(de, {
424
+ b.value.visible ? (p(), _(ie, {
393
425
  key: 1,
394
426
  modelValue: b.value.visible,
395
427
  "onUpdate:modelValue": l[17] || (l[17] = (e) => b.value.visible = e),
396
428
  title: b.value.title,
397
- "entity-key": n(h),
398
- onRefresh: I,
429
+ "entity-key": n(g),
430
+ onRefresh: Y,
399
431
  width: "600px"
400
432
  }, null, 8, ["modelValue", "title", "entity-key"])) : N("", !0)
401
433
  ]);
@@ -403,5 +435,5 @@ const ue = { class: "app-container" }, se = { class: "search-container" }, ie =
403
435
  }
404
436
  });
405
437
  export {
406
- $e as default
438
+ Te as default
407
439
  };
@@ -60,6 +60,14 @@ class o {
60
60
  data: e
61
61
  });
62
62
  }
63
+ // 退款
64
+ refund(e) {
65
+ return e.tenant = t().user.tenant, n(e), d({
66
+ url: "/v1/order/refund_order",
67
+ method: "post",
68
+ data: e
69
+ });
70
+ }
63
71
  }
64
72
  const m = new o();
65
73
  export {