sooyie-material 0.0.2 → 0.0.3

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