sooyie-material 0.0.7 → 0.0.9

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-BTsxrugA.mjs";
1
+ import { _ as f } from "./edit.vue_vue_type_script_setup_true_lang-CP8YDK0i.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-B-EZ_8-e.mjs";
1
+ import { _ as f } from "./edit.vue_vue_type_script_setup_true_lang-3Fr5DcBF.mjs";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -3,7 +3,7 @@ import { ElMessage as S } from "element-plus";
3
3
  import { useI18n as le } from "vue-i18n";
4
4
  import "jmash-core";
5
5
  import { userApi as T } from "jmash-rbac";
6
- import { D as z, a as g } from "./index-B6o7GKec.mjs";
6
+ import { D as z, a as g } from "./index-a4l0CC2S.mjs";
7
7
  const ae = { class: "dialog-footer" }, ie = /* @__PURE__ */ Z({
8
8
  __name: "edit",
9
9
  props: /* @__PURE__ */ F({
@@ -305,7 +305,6 @@ const ae = { class: "dialog-footer" }, ie = /* @__PURE__ */ Z({
305
305
  modelValue: n(r).plannerId,
306
306
  "onUpdate:modelValue": l[6] || (l[6] = (a) => n(r).plannerId = a),
307
307
  placeholder: e.$t("materialInfo.plannerIdRequired"),
308
- remote: "",
309
308
  clearable: "",
310
309
  filterable: "",
311
310
  "filter-method": U,
@@ -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-B6o7GKec.mjs";
4
+ import { D as w, m as c } from "./index-a4l0CC2S.mjs";
5
5
  const E = { class: "dialog-footer" }, H = /* @__PURE__ */ j({
6
6
  __name: "edit",
7
7
  props: /* @__PURE__ */ C({
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as W, ref as w, reactive as R, onActivated as X, resolveComponent as r, resolveDirective as D, createElementBlock as $, openBlock as d, createElementVNode as Y, createVNode as l, createBlock as _, createCommentVNode as S, withCtx as o, withKeys as Z, unref as n, createTextVNode as u, toDisplayString as c, withDirectives as f, isRef as z } from "vue";
2
2
  import { useTableHooks as ee } from "jmash-core";
3
3
  import { useI18n as te } from "vue-i18n";
4
- import { D as oe, m as le } from "./index-B6o7GKec.mjs";
5
- import { _ as ae } from "./edit.vue_vue_type_script_setup_true_lang-BTsxrugA.mjs";
4
+ import { D as oe, m as le } from "./index-a4l0CC2S.mjs";
5
+ import { _ as ae } from "./edit.vue_vue_type_script_setup_true_lang-CP8YDK0i.mjs";
6
6
  const ne = { class: "app-container" }, re = { class: "search-container" }, ie = ["onClick"], me = ["onClick"], fe = /* @__PURE__ */ W({
7
7
  __name: "index",
8
8
  setup(se) {
@@ -24,7 +24,7 @@ const qt = {}, kt = {
24
24
  materialName: "材料名称",
25
25
  specInfo: "规格型号",
26
26
  unit: "计量单位",
27
- unitPrice: "单价",
27
+ unitPrice: "单价(元)",
28
28
  plannerId: "计划员",
29
29
  operatorId: "库管",
30
30
  categoryIdRequired: "请选择材料分类",
@@ -1892,7 +1892,7 @@ const Ko = { class: "material-modal-search" }, Qo = { class: "search-btn" }, jo
1892
1892
  }, 8, ["modelValue"]);
1893
1893
  };
1894
1894
  }
1895
- }), ri = /* @__PURE__ */ Object.assign({ "./views/mat-material-category/edit.vue": () => import("./edit-BcFpISQ4.mjs"), "./views/mat-material-category/index.vue": () => import("./index-BUKVaWqd.mjs"), "./views/mat-material-info/edit.vue": () => import("./edit-DU3x8xdk.mjs"), "./views/mat-material-info/index.vue": () => import("./index-jMDq0b49.mjs") }), li = {
1895
+ }), ri = /* @__PURE__ */ Object.assign({ "./views/mat-material-category/edit.vue": () => import("./edit-Bw0KffqZ.mjs"), "./views/mat-material-category/index.vue": () => import("./index-B2kdf457.mjs"), "./views/mat-material-info/edit.vue": () => import("./edit-CHw2AMaE.mjs"), "./views/mat-material-info/index.vue": () => import("./index-v9MsYTcw.mjs") }), li = {
1896
1896
  install(r) {
1897
1897
  Rt(ri, 7), Wt(xt), r.component("material-modal-selector", ei);
1898
1898
  }
@@ -0,0 +1,477 @@
1
+ import { defineComponent as me, ref as V, reactive as E, onActivated as pe, resolveComponent as d, resolveDirective as B, createElementBlock as $, openBlock as u, createElementVNode as h, createVNode as o, createBlock as p, createCommentVNode as S, withCtx as t, unref as n, withKeys as T, Fragment as K, renderList as Q, createTextVNode as c, toDisplayString as m, withDirectives as I, isRef as A } from "vue";
2
+ import { useTableHooks as se } from "jmash-core";
3
+ import { userApi as fe } from "jmash-rbac";
4
+ import { useI18n as ce } from "vue-i18n";
5
+ import { D as g, a as ve } from "./index-a4l0CC2S.mjs";
6
+ import { _ as Ie } from "./edit.vue_vue_type_script_setup_true_lang-3Fr5DcBF.mjs";
7
+ const be = { class: "app-container" }, ye = { class: "search-container" }, _e = ["onClick"], ge = ["onClick"], Ne = /* @__PURE__ */ me({
8
+ __name: "index",
9
+ setup(ke) {
10
+ const { t: b } = ce();
11
+ g.materialCategoryBizDict.useValues(), g.userDict.useValues();
12
+ const r = V({}), {
13
+ tableHooks: i,
14
+ multipleTableRef: F,
15
+ queryFormRef: H,
16
+ listLoading: J,
17
+ tableData: G,
18
+ total: w
19
+ } = se(b, ve, r);
20
+ let k = V([
21
+ {
22
+ label: "materialInfo.categoryId",
23
+ prop: "categoryId",
24
+ width: "110",
25
+ slotName: "categoryId",
26
+ columnType: "slot",
27
+ isColumn: !0
28
+ },
29
+ {
30
+ label: "materialInfo.materialCode",
31
+ prop: "materialCode",
32
+ width: "110",
33
+ sortable: "custom",
34
+ isColumn: !0
35
+ },
36
+ {
37
+ label: "materialInfo.materialName",
38
+ prop: "materialName",
39
+ width: "200",
40
+ isColumn: !0
41
+ },
42
+ {
43
+ label: "materialInfo.specInfo",
44
+ prop: "specInfo",
45
+ isColumn: !0
46
+ },
47
+ {
48
+ label: "materialInfo.unit",
49
+ prop: "unit",
50
+ width: "110",
51
+ sortable: "custom",
52
+ isColumn: !0
53
+ },
54
+ {
55
+ label: "materialInfo.unitPrice",
56
+ prop: "unitPrice",
57
+ width: "120",
58
+ sortable: "custom",
59
+ isColumn: !0
60
+ },
61
+ {
62
+ label: "materialInfo.plannerId",
63
+ prop: "plannerId",
64
+ width: "90",
65
+ slotName: "plannerId",
66
+ columnType: "slot",
67
+ isColumn: !0
68
+ },
69
+ {
70
+ label: "materialInfo.operatorId",
71
+ prop: "operatorId",
72
+ width: "90",
73
+ slotName: "operatorId",
74
+ columnType: "slot",
75
+ isColumn: !0
76
+ },
77
+ {
78
+ label: "common.operate",
79
+ width: "130",
80
+ slotName: "operation",
81
+ columnType: "slot",
82
+ fixed: "right",
83
+ isColumn: !0
84
+ }
85
+ ]);
86
+ const D = V([]), f = V({
87
+ title: b("common.edit"),
88
+ visible: !1
89
+ }), C = V(!1);
90
+ let N = E({});
91
+ function O() {
92
+ N = E({}), f.value.title = b("common.add"), f.value.visible = !0;
93
+ }
94
+ function W(a) {
95
+ N.materialId = a.materialId, f.value.title = b("common.edit"), f.value.visible = !0;
96
+ }
97
+ function X(a) {
98
+ i.selectionRows.value = a;
99
+ }
100
+ function Y(a) {
101
+ i.handleSort(a.prop, a.order);
102
+ }
103
+ function Z(a) {
104
+ a && i.getList();
105
+ }
106
+ function x() {
107
+ C.value = !1;
108
+ }
109
+ function ee(a) {
110
+ a.updateMask = "", i.importExcel(a).then((l) => {
111
+ C.value = !1;
112
+ });
113
+ }
114
+ const P = (a = "") => {
115
+ console.log(a), fe.findPage({ loginName: a }).then(({ data: l }) => {
116
+ D.value = l.results;
117
+ });
118
+ };
119
+ let q;
120
+ const j = (a) => {
121
+ clearTimeout(q), q = setTimeout(() => {
122
+ P(a);
123
+ }, 300);
124
+ }, z = (a) => a.realName || a.nickName;
125
+ return pe(() => {
126
+ i.getList(), P();
127
+ }), (a, l) => {
128
+ const le = d("el-tree-select"), v = d("el-form-item"), s = d("el-col"), R = d("el-input"), U = d("el-row"), L = d("el-option"), M = d("el-select"), y = d("el-button"), ae = d("el-form"), te = d("jmash-column-select"), oe = d("jmash-table"), ne = d("jmash-pagination"), re = d("el-card"), ie = d("jmash-import-upload"), _ = B("hasPerm"), ue = B("loading");
129
+ return u(), $("div", be, [
130
+ h("div", ye, [
131
+ o(ae, {
132
+ ref_key: "queryFormRef",
133
+ ref: H,
134
+ model: r.value,
135
+ inline: !0
136
+ }, {
137
+ default: t(() => [
138
+ o(U, null, {
139
+ default: t(() => [
140
+ o(s, { span: 6 }, {
141
+ default: t(() => [
142
+ o(v, {
143
+ label: a.$t("materialInfo.categoryId"),
144
+ prop: "categoryId"
145
+ }, {
146
+ default: t(() => [
147
+ o(le, {
148
+ modelValue: r.value.categoryId,
149
+ "onUpdate:modelValue": l[0] || (l[0] = (e) => r.value.categoryId = e),
150
+ data: n(g).materialCategoryBizDict.values,
151
+ filterable: "",
152
+ clearable: "",
153
+ "check-strictly": "",
154
+ "render-after-expand": !1,
155
+ class: "w-full",
156
+ placeholder: a.$t("materialInfo.categoryIdRequired")
157
+ }, null, 8, ["modelValue", "data", "placeholder"])
158
+ ]),
159
+ _: 1
160
+ }, 8, ["label"])
161
+ ]),
162
+ _: 1
163
+ }),
164
+ o(s, { span: 6 }, {
165
+ default: t(() => [
166
+ o(v, {
167
+ label: a.$t("materialInfo.materialCode"),
168
+ prop: "likeMaterialCode"
169
+ }, {
170
+ default: t(() => [
171
+ o(R, {
172
+ modelValue: r.value.likeMaterialCode,
173
+ "onUpdate:modelValue": l[1] || (l[1] = (e) => r.value.likeMaterialCode = e),
174
+ placeholder: a.$t("materialInfo.materialCodeRequired"),
175
+ onKeyup: l[2] || (l[2] = T((e) => n(i).handleQuery(), ["enter"])),
176
+ class: "!w-[203px]"
177
+ }, null, 8, ["modelValue", "placeholder"])
178
+ ]),
179
+ _: 1
180
+ }, 8, ["label"])
181
+ ]),
182
+ _: 1
183
+ }),
184
+ o(s, { span: 6 }, {
185
+ default: t(() => [
186
+ o(v, {
187
+ label: a.$t("materialInfo.materialName"),
188
+ prop: "likeMaterialName"
189
+ }, {
190
+ default: t(() => [
191
+ o(R, {
192
+ modelValue: r.value.likeMaterialName,
193
+ "onUpdate:modelValue": l[3] || (l[3] = (e) => r.value.likeMaterialName = e),
194
+ placeholder: a.$t("materialInfo.materialNameRequired"),
195
+ onKeyup: l[4] || (l[4] = T((e) => n(i).handleQuery(), ["enter"])),
196
+ class: "!w-[203px]"
197
+ }, null, 8, ["modelValue", "placeholder"])
198
+ ]),
199
+ _: 1
200
+ }, 8, ["label"])
201
+ ]),
202
+ _: 1
203
+ }),
204
+ o(s, { span: 6 }, {
205
+ default: t(() => [
206
+ o(v, {
207
+ label: a.$t("materialInfo.specInfo"),
208
+ prop: "likeSpecInfo"
209
+ }, {
210
+ default: t(() => [
211
+ o(R, {
212
+ modelValue: r.value.likeSpecInfo,
213
+ "onUpdate:modelValue": l[5] || (l[5] = (e) => r.value.likeSpecInfo = e),
214
+ placeholder: a.$t("materialInfo.specInfoRequired"),
215
+ onKeyup: l[6] || (l[6] = T((e) => n(i).handleQuery(), ["enter"])),
216
+ class: "!w-[203px]"
217
+ }, null, 8, ["modelValue", "placeholder"])
218
+ ]),
219
+ _: 1
220
+ }, 8, ["label"])
221
+ ]),
222
+ _: 1
223
+ })
224
+ ]),
225
+ _: 1
226
+ }),
227
+ o(U, null, {
228
+ default: t(() => [
229
+ o(s, { span: 6 }, {
230
+ default: t(() => [
231
+ o(v, {
232
+ label: a.$t("materialInfo.plannerId"),
233
+ prop: "plannerId"
234
+ }, {
235
+ default: t(() => [
236
+ o(M, {
237
+ modelValue: r.value.plannerId,
238
+ "onUpdate:modelValue": l[7] || (l[7] = (e) => r.value.plannerId = e),
239
+ placeholder: a.$t("materialInfo.plannerIdRequired"),
240
+ filterable: "",
241
+ "filter-method": j,
242
+ class: "!w-[203px]"
243
+ }, {
244
+ default: t(() => [
245
+ (u(!0), $(K, null, Q(D.value, (e) => (u(), p(L, {
246
+ key: e.userId,
247
+ label: z(e),
248
+ value: e.userId
249
+ }, null, 8, ["label", "value"]))), 128))
250
+ ]),
251
+ _: 1
252
+ }, 8, ["modelValue", "placeholder"])
253
+ ]),
254
+ _: 1
255
+ }, 8, ["label"])
256
+ ]),
257
+ _: 1
258
+ }),
259
+ o(s, { span: 6 }, {
260
+ default: t(() => [
261
+ o(v, {
262
+ label: a.$t("materialInfo.operatorId"),
263
+ prop: "operatorId"
264
+ }, {
265
+ default: t(() => [
266
+ o(M, {
267
+ modelValue: r.value.operatorId,
268
+ "onUpdate:modelValue": l[8] || (l[8] = (e) => r.value.operatorId = e),
269
+ placeholder: a.$t("materialInfo.operatorIdRequired"),
270
+ filterable: "",
271
+ "filter-method": j,
272
+ class: "!w-[203px]"
273
+ }, {
274
+ default: t(() => [
275
+ (u(!0), $(K, null, Q(D.value, (e) => (u(), p(L, {
276
+ key: e.userId,
277
+ label: z(e),
278
+ value: e.userId
279
+ }, null, 8, ["label", "value"]))), 128))
280
+ ]),
281
+ _: 1
282
+ }, 8, ["modelValue", "placeholder"])
283
+ ]),
284
+ _: 1
285
+ }, 8, ["label"])
286
+ ]),
287
+ _: 1
288
+ }),
289
+ o(s, { span: 12 }, {
290
+ default: t(() => [
291
+ o(v, { class: "search-btn" }, {
292
+ default: t(() => [
293
+ o(y, {
294
+ type: "primary",
295
+ onClick: l[9] || (l[9] = (e) => n(i).handleQuery())
296
+ }, {
297
+ default: t(() => [
298
+ c(m(a.$t("common.search")), 1)
299
+ ]),
300
+ _: 1
301
+ }),
302
+ o(y, {
303
+ onClick: l[10] || (l[10] = (e) => n(i).resetQuery())
304
+ }, {
305
+ default: t(() => [
306
+ c(m(a.$t("common.reset")), 1)
307
+ ]),
308
+ _: 1
309
+ })
310
+ ]),
311
+ _: 1
312
+ })
313
+ ]),
314
+ _: 1
315
+ })
316
+ ]),
317
+ _: 1
318
+ })
319
+ ]),
320
+ _: 1
321
+ }, 8, ["model"])
322
+ ]),
323
+ o(re, {
324
+ shadow: "never",
325
+ class: "table-container"
326
+ }, {
327
+ header: t(() => [
328
+ o(U, null, {
329
+ default: t(() => [
330
+ o(s, { span: 17 }, {
331
+ default: t(() => [
332
+ I((u(), p(y, {
333
+ type: "primary",
334
+ onClick: O
335
+ }, {
336
+ default: t(() => [
337
+ c(m(a.$t("common.add")), 1)
338
+ ]),
339
+ _: 1
340
+ })), [
341
+ [_, ["material:material_info:add"]]
342
+ ]),
343
+ I((u(), p(y, {
344
+ type: "primary",
345
+ onClick: l[11] || (l[11] = (e) => n(i).deleteRecords())
346
+ }, {
347
+ default: t(() => [
348
+ c(m(a.$t("common.batchDelete")), 1)
349
+ ]),
350
+ _: 1
351
+ })), [
352
+ [_, ["material:material_info:delete"]]
353
+ ])
354
+ ]),
355
+ _: 1
356
+ }),
357
+ o(s, {
358
+ span: 7,
359
+ class: "container-float"
360
+ }, {
361
+ default: t(() => [
362
+ I((u(), p(y, {
363
+ plain: "",
364
+ type: "primary",
365
+ onClick: l[12] || (l[12] = (e) => C.value = !0)
366
+ }, {
367
+ default: t(() => [
368
+ c(m(a.$t("common.import")), 1)
369
+ ]),
370
+ _: 1
371
+ })), [
372
+ [_, ["material:material_info:import"]]
373
+ ]),
374
+ I((u(), p(y, {
375
+ plain: "",
376
+ type: "primary",
377
+ onClick: l[13] || (l[13] = (e) => n(i).handleExport(n(b)("materialInfo.name")))
378
+ }, {
379
+ default: t(() => [
380
+ c(m(a.$t("common.export")), 1)
381
+ ]),
382
+ _: 1
383
+ })), [
384
+ [_, ["material:material_info:export"]]
385
+ ]),
386
+ o(te, {
387
+ modelValue: n(k),
388
+ "onUpdate:modelValue": l[14] || (l[14] = (e) => A(k) ? k.value = e : k = e),
389
+ "label-name": "mat-material-info"
390
+ }, null, 8, ["modelValue"])
391
+ ]),
392
+ _: 1
393
+ })
394
+ ]),
395
+ _: 1
396
+ })
397
+ ]),
398
+ footer: t(() => [
399
+ n(w) > 0 ? (u(), p(ne, {
400
+ key: 0,
401
+ total: n(w),
402
+ "onUpdate:total": l[15] || (l[15] = (e) => A(w) ? w.value = e : null),
403
+ "current-page": r.value.curPage,
404
+ "onUpdate:currentPage": l[16] || (l[16] = (e) => r.value.curPage = e),
405
+ "page-size": r.value.pageSize,
406
+ "onUpdate:pageSize": l[17] || (l[17] = (e) => r.value.pageSize = e),
407
+ onPagination: l[18] || (l[18] = (e) => n(i).getList())
408
+ }, null, 8, ["total", "current-page", "page-size"])) : S("", !0)
409
+ ]),
410
+ default: t(() => [
411
+ I((u(), p(oe, {
412
+ ref_key: "multipleTableRef",
413
+ ref: F,
414
+ "row-key": "materialId",
415
+ data: n(G),
416
+ "table-label": n(k),
417
+ onSelectionChange: X,
418
+ onSortChange: Y
419
+ }, {
420
+ categoryId: t((e) => [
421
+ h("span", null, m(n(g).materialCategoryBizDict.getValue(e.data.row.categoryId)), 1)
422
+ ]),
423
+ plannerId: t((e) => [
424
+ h("span", null, m(n(g).userDict.getValue(e.data.row.plannerId)), 1)
425
+ ]),
426
+ operatorId: t((e) => [
427
+ h("span", null, m(n(g).userDict.getValue(e.data.row.operatorId)), 1)
428
+ ]),
429
+ operation: t((e) => [
430
+ I((u(), $("span", {
431
+ class: "el-button-color",
432
+ onClick: (de) => W(e.data.row)
433
+ }, [
434
+ c(m(a.$t("common.edit")), 1)
435
+ ], 8, _e)), [
436
+ [_, ["material:material_info:update"]]
437
+ ]),
438
+ I((u(), $("span", {
439
+ class: "el-button-color dropdown-left",
440
+ onClick: (de) => n(i).deleteRecord(e.data.row)
441
+ }, [
442
+ c(m(a.$t("common.delete")), 1)
443
+ ], 8, ge)), [
444
+ [_, ["material:material_info:delete"]]
445
+ ])
446
+ ]),
447
+ _: 1
448
+ }, 8, ["data", "table-label"])), [
449
+ [ue, n(J)]
450
+ ])
451
+ ]),
452
+ _: 1
453
+ }),
454
+ f.value.visible ? (u(), p(Ie, {
455
+ key: 0,
456
+ modelValue: f.value.visible,
457
+ "onUpdate:modelValue": l[19] || (l[19] = (e) => f.value.visible = e),
458
+ title: f.value.title,
459
+ "entity-key": n(N),
460
+ onRefresh: Z,
461
+ width: "900px"
462
+ }, null, 8, ["modelValue", "title", "entity-key"])) : S("", !0),
463
+ C.value ? (u(), p(ie, {
464
+ key: 1,
465
+ "upload-visible": C.value,
466
+ "template-title": a.$t("sysUser.templateDownload"),
467
+ onTemplateDown: l[20] || (l[20] = (e) => n(i).downloadTemplate(n(b)("materialInfo.name"))),
468
+ onImportEvents: ee,
469
+ onUploadClosed: x
470
+ }, null, 8, ["upload-visible", "template-title"])) : S("", !0)
471
+ ]);
472
+ };
473
+ }
474
+ });
475
+ export {
476
+ Ne as default
477
+ };
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import "jmash-core";
2
- import { M as r, b as e, a as o } from "./index-B6o7GKec.mjs";
2
+ import { M as r, b as e, a as o } from "./index-a4l0CC2S.mjs";
3
3
  export {
4
4
  r as MaterialCategoryBizLayDict,
5
5
  e as default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sooyie-material",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "private": false,
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dts/src/index.d.ts",
@@ -1,401 +0,0 @@
1
- import { defineComponent as le, ref as V, reactive as T, onActivated as te, resolveComponent as m, resolveDirective as U, createElementBlock as N, openBlock as d, createElementVNode as g, createVNode as n, createBlock as p, createCommentVNode as R, withCtx as a, unref as o, withKeys as P, createTextVNode as f, toDisplayString as u, withDirectives as c, isRef as j } from "vue";
2
- import { useTableHooks as ae } from "jmash-core";
3
- import { useI18n as oe } from "vue-i18n";
4
- import { D as C, a as ne } from "./index-B6o7GKec.mjs";
5
- import { _ as re } from "./edit.vue_vue_type_script_setup_true_lang-B-EZ_8-e.mjs";
6
- const ie = { class: "app-container" }, me = { class: "search-container" }, ue = ["onClick"], de = ["onClick"], be = /* @__PURE__ */ le({
7
- __name: "index",
8
- setup(se) {
9
- const { t: v } = oe();
10
- C.materialCategoryBizDict.useValues(), C.userDict.useValues();
11
- const i = V({}), {
12
- tableHooks: r,
13
- multipleTableRef: z,
14
- queryFormRef: q,
15
- listLoading: E,
16
- tableData: M,
17
- total: $
18
- } = ae(v, ne, i);
19
- let _ = V([
20
- {
21
- label: "materialInfo.categoryId",
22
- prop: "categoryId",
23
- width: "110",
24
- slotName: "categoryId",
25
- columnType: "slot",
26
- isColumn: !0
27
- },
28
- {
29
- label: "materialInfo.materialCode",
30
- prop: "materialCode",
31
- width: "110",
32
- sortable: "custom",
33
- isColumn: !0
34
- },
35
- {
36
- label: "materialInfo.materialName",
37
- prop: "materialName",
38
- width: "200",
39
- isColumn: !0
40
- },
41
- {
42
- label: "materialInfo.specInfo",
43
- prop: "specInfo",
44
- isColumn: !0
45
- },
46
- {
47
- label: "materialInfo.unit",
48
- prop: "unit",
49
- width: "110",
50
- sortable: "custom",
51
- isColumn: !0
52
- },
53
- {
54
- label: "materialInfo.unitPrice",
55
- prop: "unitPrice",
56
- width: "80",
57
- sortable: "custom",
58
- slotName: "unitPrice",
59
- columnType: "slot",
60
- isColumn: !0
61
- },
62
- {
63
- label: "materialInfo.plannerId",
64
- prop: "plannerId",
65
- width: "90",
66
- slotName: "plannerId",
67
- columnType: "slot",
68
- isColumn: !0
69
- },
70
- {
71
- label: "materialInfo.operatorId",
72
- prop: "operatorId",
73
- width: "90",
74
- slotName: "operatorId",
75
- columnType: "slot",
76
- isColumn: !0
77
- },
78
- {
79
- label: "common.operate",
80
- width: "130",
81
- slotName: "operation",
82
- columnType: "slot",
83
- fixed: "right",
84
- isColumn: !0
85
- }
86
- ]);
87
- const s = V({
88
- title: v("common.edit"),
89
- visible: !1
90
- }), k = V(!1);
91
- let h = T({});
92
- function B() {
93
- h = T({}), s.value.title = v("common.add"), s.value.visible = !0;
94
- }
95
- function K(t) {
96
- h.materialId = t.materialId, s.value.title = v("common.edit"), s.value.visible = !0;
97
- }
98
- function L(t) {
99
- r.selectionRows.value = t;
100
- }
101
- function Q(t) {
102
- r.handleSort(t.prop, t.order);
103
- }
104
- function A(t) {
105
- t && r.getList();
106
- }
107
- function F() {
108
- k.value = !1;
109
- }
110
- function H(t) {
111
- t.updateMask = "", r.importExcel(t).then((e) => {
112
- k.value = !1;
113
- });
114
- }
115
- return te(() => {
116
- r.getList();
117
- }), (t, e) => {
118
- const G = m("el-tree-select"), w = m("el-form-item"), y = m("el-col"), D = m("el-input"), S = m("el-row"), b = m("el-button"), J = m("el-form"), O = m("jmash-column-select"), W = m("jmash-table"), X = m("jmash-pagination"), Y = m("el-card"), Z = m("jmash-import-upload"), I = U("hasPerm"), x = U("loading");
119
- return d(), N("div", ie, [
120
- g("div", me, [
121
- n(J, {
122
- ref_key: "queryFormRef",
123
- ref: q,
124
- model: i.value,
125
- inline: !0
126
- }, {
127
- default: a(() => [
128
- n(S, null, {
129
- default: a(() => [
130
- n(y, { span: 6 }, {
131
- default: a(() => [
132
- n(w, {
133
- label: t.$t("materialInfo.categoryId"),
134
- prop: "categoryId"
135
- }, {
136
- default: a(() => [
137
- n(G, {
138
- modelValue: i.value.categoryId,
139
- "onUpdate:modelValue": e[0] || (e[0] = (l) => i.value.categoryId = l),
140
- data: o(C).materialCategoryBizDict.values,
141
- filterable: "",
142
- clearable: "",
143
- "check-strictly": "",
144
- "render-after-expand": !1,
145
- class: "w-full",
146
- placeholder: t.$t("materialInfo.categoryIdRequired")
147
- }, null, 8, ["modelValue", "data", "placeholder"])
148
- ]),
149
- _: 1
150
- }, 8, ["label"])
151
- ]),
152
- _: 1
153
- }),
154
- n(y, { span: 6 }, {
155
- default: a(() => [
156
- n(w, {
157
- label: t.$t("materialInfo.materialCode"),
158
- prop: "likeMaterialCode"
159
- }, {
160
- default: a(() => [
161
- n(D, {
162
- modelValue: i.value.likeMaterialCode,
163
- "onUpdate:modelValue": e[1] || (e[1] = (l) => i.value.likeMaterialCode = l),
164
- placeholder: t.$t("materialInfo.materialCodeRequired"),
165
- onKeyup: e[2] || (e[2] = P((l) => o(r).handleQuery(), ["enter"])),
166
- class: "!w-[203px]"
167
- }, null, 8, ["modelValue", "placeholder"])
168
- ]),
169
- _: 1
170
- }, 8, ["label"])
171
- ]),
172
- _: 1
173
- }),
174
- n(y, { span: 6 }, {
175
- default: a(() => [
176
- n(w, {
177
- label: t.$t("materialInfo.materialName"),
178
- prop: "likeMaterialName"
179
- }, {
180
- default: a(() => [
181
- n(D, {
182
- modelValue: i.value.likeMaterialName,
183
- "onUpdate:modelValue": e[3] || (e[3] = (l) => i.value.likeMaterialName = l),
184
- placeholder: t.$t("materialInfo.materialNameRequired"),
185
- onKeyup: e[4] || (e[4] = P((l) => o(r).handleQuery(), ["enter"])),
186
- class: "!w-[203px]"
187
- }, null, 8, ["modelValue", "placeholder"])
188
- ]),
189
- _: 1
190
- }, 8, ["label"])
191
- ]),
192
- _: 1
193
- }),
194
- n(y, { span: 6 }, {
195
- default: a(() => [
196
- n(w, {
197
- label: t.$t("materialInfo.specInfo"),
198
- prop: "likeSpecInfo"
199
- }, {
200
- default: a(() => [
201
- n(D, {
202
- modelValue: i.value.likeSpecInfo,
203
- "onUpdate:modelValue": e[5] || (e[5] = (l) => i.value.likeSpecInfo = l),
204
- placeholder: t.$t("materialInfo.specInfoRequired"),
205
- onKeyup: e[6] || (e[6] = P((l) => o(r).handleQuery(), ["enter"])),
206
- class: "!w-[203px]"
207
- }, null, 8, ["modelValue", "placeholder"])
208
- ]),
209
- _: 1
210
- }, 8, ["label"])
211
- ]),
212
- _: 1
213
- })
214
- ]),
215
- _: 1
216
- }),
217
- n(w, { class: "search-btn" }, {
218
- default: a(() => [
219
- n(b, {
220
- type: "primary",
221
- onClick: e[7] || (e[7] = (l) => o(r).handleQuery())
222
- }, {
223
- default: a(() => [
224
- f(u(t.$t("common.search")), 1)
225
- ]),
226
- _: 1
227
- }),
228
- n(b, {
229
- onClick: e[8] || (e[8] = (l) => o(r).resetQuery())
230
- }, {
231
- default: a(() => [
232
- f(u(t.$t("common.reset")), 1)
233
- ]),
234
- _: 1
235
- })
236
- ]),
237
- _: 1
238
- })
239
- ]),
240
- _: 1
241
- }, 8, ["model"]),
242
- e[19] || (e[19] = g("div", { class: "clear" }, null, -1))
243
- ]),
244
- n(Y, {
245
- shadow: "never",
246
- class: "table-container"
247
- }, {
248
- header: a(() => [
249
- n(S, null, {
250
- default: a(() => [
251
- n(y, { span: 17 }, {
252
- default: a(() => [
253
- c((d(), p(b, {
254
- type: "primary",
255
- onClick: B
256
- }, {
257
- default: a(() => [
258
- f(u(t.$t("common.add")), 1)
259
- ]),
260
- _: 1
261
- })), [
262
- [I, ["material:material_info:add"]]
263
- ]),
264
- c((d(), p(b, {
265
- type: "primary",
266
- onClick: e[9] || (e[9] = (l) => o(r).deleteRecords())
267
- }, {
268
- default: a(() => [
269
- f(u(t.$t("common.batchDelete")), 1)
270
- ]),
271
- _: 1
272
- })), [
273
- [I, ["material:material_info:delete"]]
274
- ])
275
- ]),
276
- _: 1
277
- }),
278
- n(y, {
279
- span: 7,
280
- class: "container-float"
281
- }, {
282
- default: a(() => [
283
- c((d(), p(b, {
284
- plain: "",
285
- type: "primary",
286
- onClick: e[10] || (e[10] = (l) => k.value = !0)
287
- }, {
288
- default: a(() => [
289
- f(u(t.$t("common.import")), 1)
290
- ]),
291
- _: 1
292
- })), [
293
- [I, ["material:material_info:import"]]
294
- ]),
295
- c((d(), p(b, {
296
- plain: "",
297
- type: "primary",
298
- onClick: e[11] || (e[11] = (l) => o(r).handleExport(o(v)("materialInfo.name")))
299
- }, {
300
- default: a(() => [
301
- f(u(t.$t("common.export")), 1)
302
- ]),
303
- _: 1
304
- })), [
305
- [I, ["material:material_info:export"]]
306
- ]),
307
- n(O, {
308
- modelValue: o(_),
309
- "onUpdate:modelValue": e[12] || (e[12] = (l) => j(_) ? _.value = l : _ = l),
310
- "label-name": "mat-material-info"
311
- }, null, 8, ["modelValue"])
312
- ]),
313
- _: 1
314
- })
315
- ]),
316
- _: 1
317
- })
318
- ]),
319
- footer: a(() => [
320
- o($) > 0 ? (d(), p(X, {
321
- key: 0,
322
- total: o($),
323
- "onUpdate:total": e[13] || (e[13] = (l) => j($) ? $.value = l : null),
324
- "current-page": i.value.curPage,
325
- "onUpdate:currentPage": e[14] || (e[14] = (l) => i.value.curPage = l),
326
- "page-size": i.value.pageSize,
327
- "onUpdate:pageSize": e[15] || (e[15] = (l) => i.value.pageSize = l),
328
- onPagination: e[16] || (e[16] = (l) => o(r).getList())
329
- }, null, 8, ["total", "current-page", "page-size"])) : R("", !0)
330
- ]),
331
- default: a(() => [
332
- c((d(), p(W, {
333
- ref_key: "multipleTableRef",
334
- ref: z,
335
- "row-key": "materialId",
336
- data: o(M),
337
- "table-label": o(_),
338
- onSelectionChange: L,
339
- onSortChange: Q
340
- }, {
341
- categoryId: a((l) => [
342
- g("span", null, u(o(C).materialCategoryBizDict.getValue(l.data.row.categoryId)), 1)
343
- ]),
344
- unitPrice: a((l) => [
345
- g("span", null, u(l.data.row.unitPrice | 0) + "元 ", 1)
346
- ]),
347
- plannerId: a((l) => [
348
- g("span", null, u(o(C).userDict.getValue(l.data.row.plannerId)), 1)
349
- ]),
350
- operatorId: a((l) => [
351
- g("span", null, u(o(C).userDict.getValue(l.data.row.operatorId)), 1)
352
- ]),
353
- operation: a((l) => [
354
- c((d(), N("span", {
355
- class: "el-button-color",
356
- onClick: (ee) => K(l.data.row)
357
- }, [
358
- f(u(t.$t("common.edit")), 1)
359
- ], 8, ue)), [
360
- [I, ["material:material_info:update"]]
361
- ]),
362
- c((d(), N("span", {
363
- class: "el-button-color dropdown-left",
364
- onClick: (ee) => o(r).deleteRecord(l.data.row)
365
- }, [
366
- f(u(t.$t("common.delete")), 1)
367
- ], 8, de)), [
368
- [I, ["material:material_info:delete"]]
369
- ])
370
- ]),
371
- _: 1
372
- }, 8, ["data", "table-label"])), [
373
- [x, o(E)]
374
- ])
375
- ]),
376
- _: 1
377
- }),
378
- s.value.visible ? (d(), p(re, {
379
- key: 0,
380
- modelValue: s.value.visible,
381
- "onUpdate:modelValue": e[17] || (e[17] = (l) => s.value.visible = l),
382
- title: s.value.title,
383
- "entity-key": o(h),
384
- onRefresh: A,
385
- width: "900px"
386
- }, null, 8, ["modelValue", "title", "entity-key"])) : R("", !0),
387
- k.value ? (d(), p(Z, {
388
- key: 1,
389
- "upload-visible": k.value,
390
- "template-title": t.$t("sysUser.templateDownload"),
391
- onTemplateDown: e[18] || (e[18] = (l) => o(r).downloadTemplate(o(v)("materialInfo.name"))),
392
- onImportEvents: H,
393
- onUploadClosed: F
394
- }, null, 8, ["upload-visible", "template-title"])) : R("", !0)
395
- ]);
396
- };
397
- }
398
- });
399
- export {
400
- be as default
401
- };