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