sooyie-material 0.0.5 → 0.0.7

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,4 +1,4 @@
1
- import { _ as f } from "./edit.vue_vue_type_script_setup_true_lang-DjKM67re.mjs";
1
+ import { _ as f } from "./edit.vue_vue_type_script_setup_true_lang-BTsxrugA.mjs";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./edit.vue_vue_type_script_setup_true_lang-7q1-KhGp.mjs";
1
+ import { _ as f } from "./edit.vue_vue_type_script_setup_true_lang-B-EZ_8-e.mjs";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,9 +1,10 @@
1
- import { defineComponent as Y, mergeModels as F, ref as c, reactive as O, useModel as Z, onMounted as x, resolveComponent as u, createBlock as I, openBlock as p, withCtx as t, createVNode as a, unref as n, createElementBlock as v, Fragment as h, renderList as q, createElementVNode as T, createTextVNode as j, toDisplayString as E } from "vue";
2
- import { ElMessage as K } from "element-plus";
3
- import { useI18n as ee } from "vue-i18n";
1
+ import { defineComponent as Z, mergeModels as F, ref as c, reactive as j, useModel as x, onMounted as ee, resolveComponent as d, createBlock as I, openBlock as p, withCtx as o, createVNode as t, unref as n, createElementBlock as h, Fragment as q, renderList as $, createElementVNode as E, createTextVNode as K, toDisplayString as O } from "vue";
2
+ import { ElMessage as S } from "element-plus";
3
+ import { useI18n as le } from "vue-i18n";
4
4
  import "jmash-core";
5
- import { D as S, a as g, g as le } from "./index-CuXtDR2y.mjs";
6
- const ae = { class: "dialog-footer" }, ie = /* @__PURE__ */ Y({
5
+ import { userApi as T } from "jmash-rbac";
6
+ import { D as z, a as g } from "./index-B6o7GKec.mjs";
7
+ const ae = { class: "dialog-footer" }, ie = /* @__PURE__ */ Z({
7
8
  __name: "edit",
8
9
  props: /* @__PURE__ */ F({
9
10
  entityKey: {
@@ -16,143 +17,149 @@ const ae = { class: "dialog-footer" }, ie = /* @__PURE__ */ Y({
16
17
  modelModifiers: {}
17
18
  }),
18
19
  emits: /* @__PURE__ */ F(["refresh"], ["update:modelValue"]),
19
- setup($, { emit: z }) {
20
- const { t: d } = ee();
21
- S.materialCategoryBizDict.useValues();
22
- const w = c(), b = c([]);
23
- let r = O({
20
+ setup(w, { emit: A }) {
21
+ const { t: m } = le();
22
+ z.materialCategoryBizDict.useValues();
23
+ const k = c(), b = c([]);
24
+ let r = j({
24
25
  requestId: Math.random() * 10 + "",
25
- updateMask: "categoryId,materialCode,materialName,specInfo,unit,unitPrice,plannerId"
26
+ updateMask: "categoryId,materialCode,materialName,specInfo,unit,unitPrice,plannerId,operatorId"
26
27
  });
27
- const A = O({
28
+ const J = j({
28
29
  materialCode: [
29
30
  {
30
31
  required: !0,
31
- message: d("materialInfo.materialCodeRequired"),
32
+ message: m("materialInfo.materialCodeRequired"),
32
33
  trigger: "blur"
33
34
  }
34
35
  ],
35
36
  materialName: [
36
37
  {
37
38
  required: !0,
38
- message: d("materialInfo.materialNameRequired"),
39
+ message: m("materialInfo.materialNameRequired"),
39
40
  trigger: "blur"
40
41
  }
41
42
  ],
42
43
  categoryId: [
43
44
  {
44
45
  required: !0,
45
- message: d("materialInfo.categoryIdRequired"),
46
+ message: m("materialInfo.categoryIdRequired"),
46
47
  trigger: "change"
47
48
  }
48
49
  ],
49
50
  specInfo: [
50
51
  {
51
52
  required: !0,
52
- message: d("materialInfo.specInfoRequired"),
53
+ message: m("materialInfo.specInfoRequired"),
53
54
  trigger: "blur"
54
55
  }
55
56
  ],
56
57
  unit: [
57
58
  {
58
59
  required: !0,
59
- message: d("materialInfo.unitRequired"),
60
+ message: m("materialInfo.unitRequired"),
60
61
  trigger: "change"
61
62
  }
62
63
  ],
63
64
  unitPrice: [
64
65
  {
65
66
  required: !0,
66
- message: d("materialInfo.unitPriceRequired"),
67
+ message: m("materialInfo.unitPriceRequired"),
67
68
  trigger: "change"
68
69
  }
69
70
  ]
70
- }), k = c([]), m = Z($, "modelValue"), C = $, R = z, N = (e = "") => {
71
- le.findPageOrganTenant({ loginName: e }).then(({ data: o }) => {
72
- b.value = o.results;
71
+ }), C = c([]), s = x(w, "modelValue"), R = w, N = A, y = (e = "") => {
72
+ console.log(e), T.findPage({ loginName: e }).then(({ data: l }) => {
73
+ b.value = l.results;
73
74
  });
74
75
  };
75
- N();
76
+ y();
76
77
  let P;
77
78
  const U = (e) => {
78
79
  clearTimeout(P), P = setTimeout(() => {
79
- console.log(e, "=> value"), N(e);
80
+ y(e);
80
81
  }, 300);
81
- }, M = (e) => e.realName || e.mobilePhoneIns ? e.realName : e.nickName, J = Object.keys(C.entityKey), B = c(J.length >= 1);
82
- B.value && g.findById(C.entityKey).then(({ data: e }) => {
82
+ }, B = (e) => e.realName || e.nickName, G = Object.keys(R.entityKey), M = c(G.length >= 1);
83
+ M.value && g.findById(R.entityKey).then(({ data: e }) => {
83
84
  Object.assign(r, e);
85
+ const l = [];
86
+ r.plannerId && l.push(r.plannerId), r.operatorId && l.push(r.operatorId), l.length !== 0 && l.map((u) => {
87
+ T.findById({ userId: u }).then(({ data: i }) => {
88
+ y(i.realName);
89
+ });
90
+ });
84
91
  });
85
- const G = async () => {
92
+ const H = async () => {
86
93
  var e;
87
- await ((e = w.value) == null ? void 0 : e.validate((o) => {
88
- o && (B.value ? g.update(r).then((i) => {
89
- console.log(i), i.status === 200 && (K({
90
- message: d("common.submitSuccess"),
94
+ await ((e = k.value) == null ? void 0 : e.validate((l) => {
95
+ l && (M.value ? g.update(r).then((u) => {
96
+ console.log(u), u.status === 200 && (S({
97
+ message: m("common.submitSuccess"),
91
98
  type: "success"
92
- }), m.value && (m.value = !1), R("refresh", i.status === 200));
93
- }) : g.create(r).then((i) => {
94
- console.log(i), i.status === 200 && (K({
95
- message: d("common.submitSuccess"),
99
+ }), s.value && (s.value = !1), N("refresh", u.status === 200));
100
+ }) : g.create(r).then((u) => {
101
+ console.log(u), u.status === 200 && (S({
102
+ message: m("common.submitSuccess"),
96
103
  type: "success"
97
- }), m.value && (m.value = !1), R("refresh", i.status === 200));
104
+ }), s.value && (s.value = !1), N("refresh", u.status === 200));
98
105
  }));
99
106
  }));
100
107
  };
101
108
  function D() {
102
- m.value && (m.value = !1);
109
+ s.value && (s.value = !1);
103
110
  }
104
- return x(() => {
111
+ return ee(() => {
105
112
  g.findUnitList().then(({ data: e }) => {
106
- k.value = e.values;
113
+ C.value = e.values;
107
114
  });
108
- }), (e, o) => {
109
- const i = u("el-tree-select"), s = u("el-form-item"), f = u("el-col"), y = u("el-input"), V = u("el-option"), _ = u("el-select"), H = u("el-input-number"), Q = u("el-row"), W = u("el-form"), L = u("el-button"), X = u("el-dialog");
110
- return p(), I(X, {
111
- modelValue: m.value,
112
- "onUpdate:modelValue": o[8] || (o[8] = (l) => m.value = l),
115
+ }), (e, l) => {
116
+ const u = d("el-tree-select"), i = d("el-form-item"), f = d("el-col"), V = d("el-input"), _ = d("el-option"), v = d("el-select"), Q = d("el-input-number"), W = d("el-row"), X = d("el-form"), L = d("el-button"), Y = d("el-dialog");
117
+ return p(), I(Y, {
118
+ modelValue: s.value,
119
+ "onUpdate:modelValue": l[8] || (l[8] = (a) => s.value = a),
113
120
  onClose: D
114
121
  }, {
115
- footer: t(() => [
116
- T("div", ae, [
117
- a(L, { onClick: D }, {
118
- default: t(() => [
119
- j(E(e.$t("common.cancel")), 1)
122
+ footer: o(() => [
123
+ E("div", ae, [
124
+ t(L, { onClick: D }, {
125
+ default: o(() => [
126
+ K(O(e.$t("common.cancel")), 1)
120
127
  ]),
121
128
  _: 1
122
129
  }),
123
- a(L, {
130
+ t(L, {
124
131
  type: "primary",
125
- onClick: G
132
+ onClick: H
126
133
  }, {
127
- default: t(() => [
128
- j(E(e.$t("common.confirm")), 1)
134
+ default: o(() => [
135
+ K(O(e.$t("common.confirm")), 1)
129
136
  ]),
130
137
  _: 1
131
138
  })
132
139
  ])
133
140
  ]),
134
- default: t(() => [
135
- a(W, {
141
+ default: o(() => [
142
+ t(X, {
136
143
  ref_key: "materialInfoFormRef",
137
- ref: w,
144
+ ref: k,
138
145
  model: n(r),
139
146
  "label-width": "120px",
140
- rules: A
147
+ rules: J
141
148
  }, {
142
- default: t(() => [
143
- a(Q, null, {
144
- default: t(() => [
145
- a(f, { span: 12 }, {
146
- default: t(() => [
147
- a(s, {
149
+ default: o(() => [
150
+ t(W, null, {
151
+ default: o(() => [
152
+ t(f, { span: 12 }, {
153
+ default: o(() => [
154
+ t(i, {
148
155
  label: e.$t("materialInfo.categoryId"),
149
156
  prop: "categoryId"
150
157
  }, {
151
- default: t(() => [
152
- a(i, {
158
+ default: o(() => [
159
+ t(u, {
153
160
  modelValue: n(r).categoryId,
154
- "onUpdate:modelValue": o[0] || (o[0] = (l) => n(r).categoryId = l),
155
- data: n(S).materialCategoryBizDict.values,
161
+ "onUpdate:modelValue": l[0] || (l[0] = (a) => n(r).categoryId = a),
162
+ data: n(z).materialCategoryBizDict.values,
156
163
  filterable: "",
157
164
  clearable: "",
158
165
  "check-strictly": "",
@@ -166,16 +173,16 @@ const ae = { class: "dialog-footer" }, ie = /* @__PURE__ */ Y({
166
173
  ]),
167
174
  _: 1
168
175
  }),
169
- a(f, { span: 12 }, {
170
- default: t(() => [
171
- a(s, {
176
+ t(f, { span: 12 }, {
177
+ default: o(() => [
178
+ t(i, {
172
179
  label: e.$t("materialInfo.materialCode"),
173
180
  prop: "materialCode"
174
181
  }, {
175
- default: t(() => [
176
- a(y, {
182
+ default: o(() => [
183
+ t(V, {
177
184
  modelValue: n(r).materialCode,
178
- "onUpdate:modelValue": o[1] || (o[1] = (l) => n(r).materialCode = l),
185
+ "onUpdate:modelValue": l[1] || (l[1] = (a) => n(r).materialCode = a),
179
186
  placeholder: e.$t("materialInfo.materialCodeRequired"),
180
187
  maxlength: "60",
181
188
  "show-word-limit": "",
@@ -187,16 +194,16 @@ const ae = { class: "dialog-footer" }, ie = /* @__PURE__ */ Y({
187
194
  ]),
188
195
  _: 1
189
196
  }),
190
- a(f, { span: 12 }, {
191
- default: t(() => [
192
- a(s, {
197
+ t(f, { span: 12 }, {
198
+ default: o(() => [
199
+ t(i, {
193
200
  label: e.$t("materialInfo.materialName"),
194
201
  prop: "materialName"
195
202
  }, {
196
- default: t(() => [
197
- a(y, {
203
+ default: o(() => [
204
+ t(V, {
198
205
  modelValue: n(r).materialName,
199
- "onUpdate:modelValue": o[2] || (o[2] = (l) => n(r).materialName = l),
206
+ "onUpdate:modelValue": l[2] || (l[2] = (a) => n(r).materialName = a),
200
207
  placeholder: e.$t("materialInfo.materialNameRequired"),
201
208
  maxlength: "120",
202
209
  "show-word-limit": "",
@@ -208,16 +215,16 @@ const ae = { class: "dialog-footer" }, ie = /* @__PURE__ */ Y({
208
215
  ]),
209
216
  _: 1
210
217
  }),
211
- a(f, { span: 12 }, {
212
- default: t(() => [
213
- a(s, {
218
+ t(f, { span: 12 }, {
219
+ default: o(() => [
220
+ t(i, {
214
221
  label: e.$t("materialInfo.specInfo"),
215
222
  prop: "specInfo"
216
223
  }, {
217
- default: t(() => [
218
- a(y, {
224
+ default: o(() => [
225
+ t(V, {
219
226
  modelValue: n(r).specInfo,
220
- "onUpdate:modelValue": o[3] || (o[3] = (l) => n(r).specInfo = l),
227
+ "onUpdate:modelValue": l[3] || (l[3] = (a) => n(r).specInfo = a),
221
228
  placeholder: e.$t("materialInfo.specInfoRequired"),
222
229
  maxlength: "30",
223
230
  "show-word-limit": "",
@@ -229,26 +236,26 @@ const ae = { class: "dialog-footer" }, ie = /* @__PURE__ */ Y({
229
236
  ]),
230
237
  _: 1
231
238
  }),
232
- a(f, { span: 12 }, {
233
- default: t(() => [
234
- a(s, {
239
+ t(f, { span: 12 }, {
240
+ default: o(() => [
241
+ t(i, {
235
242
  label: e.$t("materialInfo.unit"),
236
243
  prop: "unit"
237
244
  }, {
238
- default: t(() => [
239
- a(_, {
245
+ default: o(() => [
246
+ t(v, {
240
247
  modelValue: n(r).unit,
241
- "onUpdate:modelValue": o[4] || (o[4] = (l) => n(r).unit = l),
248
+ "onUpdate:modelValue": l[4] || (l[4] = (a) => n(r).unit = a),
242
249
  placeholder: e.$t("materialInfo.unitRequired"),
243
250
  filterable: "",
244
251
  "allow-create": "",
245
252
  class: "w-full"
246
253
  }, {
247
- default: t(() => [
248
- (p(!0), v(h, null, q(k.value, (l) => (p(), I(V, {
249
- key: l.key,
250
- label: l.value,
251
- value: l.key
254
+ default: o(() => [
255
+ (p(!0), h(q, null, $(C.value, (a) => (p(), I(_, {
256
+ key: a.key,
257
+ label: a.value,
258
+ value: a.key
252
259
  }, null, 8, ["label", "value"]))), 128))
253
260
  ]),
254
261
  _: 1
@@ -259,16 +266,16 @@ const ae = { class: "dialog-footer" }, ie = /* @__PURE__ */ Y({
259
266
  ]),
260
267
  _: 1
261
268
  }),
262
- a(f, { span: 12 }, {
263
- default: t(() => [
264
- a(s, {
269
+ t(f, { span: 12 }, {
270
+ default: o(() => [
271
+ t(i, {
265
272
  label: e.$t("materialInfo.unitPrice"),
266
273
  prop: "unitPrice"
267
274
  }, {
268
- default: t(() => [
269
- a(H, {
275
+ default: o(() => [
276
+ t(Q, {
270
277
  modelValue: n(r).unitPrice,
271
- "onUpdate:modelValue": o[5] || (o[5] = (l) => n(r).unitPrice = l),
278
+ "onUpdate:modelValue": l[5] || (l[5] = (a) => n(r).unitPrice = a),
272
279
  precision: 2,
273
280
  min: 0,
274
281
  controls: !1,
@@ -276,8 +283,8 @@ const ae = { class: "dialog-footer" }, ie = /* @__PURE__ */ Y({
276
283
  placeholder: e.$t("materialInfo.unitPriceRequired"),
277
284
  class: "w-full"
278
285
  }, {
279
- suffix: t(() => [...o[9] || (o[9] = [
280
- T("span", null, "元", -1)
286
+ suffix: o(() => [...l[9] || (l[9] = [
287
+ E("span", null, "元", -1)
281
288
  ])]),
282
289
  _: 1
283
290
  }, 8, ["modelValue", "placeholder"])
@@ -287,27 +294,28 @@ const ae = { class: "dialog-footer" }, ie = /* @__PURE__ */ Y({
287
294
  ]),
288
295
  _: 1
289
296
  }),
290
- a(f, { span: 12 }, {
291
- default: t(() => [
292
- a(s, {
297
+ t(f, { span: 12 }, {
298
+ default: o(() => [
299
+ t(i, {
293
300
  label: e.$t("materialInfo.plannerId"),
294
301
  prop: "plannerId"
295
302
  }, {
296
- default: t(() => [
297
- a(_, {
303
+ default: o(() => [
304
+ t(v, {
298
305
  modelValue: n(r).plannerId,
299
- "onUpdate:modelValue": o[6] || (o[6] = (l) => n(r).plannerId = l),
306
+ "onUpdate:modelValue": l[6] || (l[6] = (a) => n(r).plannerId = a),
300
307
  placeholder: e.$t("materialInfo.plannerIdRequired"),
308
+ remote: "",
301
309
  clearable: "",
302
310
  filterable: "",
303
311
  "filter-method": U,
304
312
  class: "w-full"
305
313
  }, {
306
- default: t(() => [
307
- (p(!0), v(h, null, q(b.value, (l) => (p(), I(V, {
308
- key: l.userId,
309
- label: M(l),
310
- value: l.userId
314
+ default: o(() => [
315
+ (p(!0), h(q, null, $(b.value, (a) => (p(), I(_, {
316
+ key: a.userId,
317
+ label: B(a),
318
+ value: a.userId
311
319
  }, null, 8, ["label", "value"]))), 128))
312
320
  ]),
313
321
  _: 1
@@ -318,27 +326,27 @@ const ae = { class: "dialog-footer" }, ie = /* @__PURE__ */ Y({
318
326
  ]),
319
327
  _: 1
320
328
  }),
321
- a(f, { span: 12 }, {
322
- default: t(() => [
323
- a(s, {
329
+ t(f, { span: 12 }, {
330
+ default: o(() => [
331
+ t(i, {
324
332
  label: e.$t("materialInfo.operatorId"),
325
333
  prop: "operatorId"
326
334
  }, {
327
- default: t(() => [
328
- a(_, {
335
+ default: o(() => [
336
+ t(v, {
329
337
  modelValue: n(r).operatorId,
330
- "onUpdate:modelValue": o[7] || (o[7] = (l) => n(r).operatorId = l),
338
+ "onUpdate:modelValue": l[7] || (l[7] = (a) => n(r).operatorId = a),
331
339
  placeholder: e.$t("materialInfo.operatorIdRequired"),
332
340
  clearable: "",
333
341
  filterable: "",
334
342
  "filter-method": U,
335
343
  class: "w-full"
336
344
  }, {
337
- default: t(() => [
338
- (p(!0), v(h, null, q(b.value, (l) => (p(), I(V, {
339
- key: l.userId,
340
- label: M(l),
341
- value: l.userId
345
+ default: o(() => [
346
+ (p(!0), h(q, null, $(b.value, (a) => (p(), I(_, {
347
+ key: a.userId,
348
+ label: B(a),
349
+ value: a.userId
342
350
  }, null, 8, ["label", "value"]))), 128))
343
351
  ]),
344
352
  _: 1
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as j, mergeModels as C, ref as v, reactive as h, useModel as F, resolveComponent as i, createBlock as K, openBlock as O, withCtx as m, createVNode as o, unref as n, createElementVNode as S, createTextVNode as N, toDisplayString as k } from "vue";
2
2
  import { ElMessage as I } from "element-plus";
3
3
  import { useI18n as z } from "vue-i18n";
4
- import { D as w, m as c } from "./index-CuXtDR2y.mjs";
4
+ import { D as w, m as c } from "./index-B6o7GKec.mjs";
5
5
  const E = { class: "dialog-footer" }, H = /* @__PURE__ */ j({
6
6
  __name: "edit",
7
7
  props: /* @__PURE__ */ C({