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,8 +1,8 @@
1
1
  import { defineComponent as J, ref as w, reactive as R, onActivated as O, resolveComponent as r, resolveDirective as W, createElementBlock as $, openBlock as d, createElementVNode as X, createVNode as l, createBlock as b, createCommentVNode as D, withCtx as o, withKeys as Y, unref as n, createTextVNode as u, toDisplayString as c, withDirectives as C, isRef as S } from "vue";
2
2
  import { useTableHooks as Z } from "jmash-core";
3
3
  import { useI18n as ee } from "vue-i18n";
4
- import { D as te, m as oe } from "./index-YdYarUAc.mjs";
5
- import { _ as le } from "./edit.vue_vue_type_script_setup_true_lang-aB2_di1J.mjs";
4
+ import { D as te, m as oe } from "./index-B54kJjCF.mjs";
5
+ import { _ as le } from "./edit.vue_vue_type_script_setup_true_lang-4b_9pBbW.mjs";
6
6
  const ae = { class: "app-container" }, ne = { class: "search-container" }, re = ["onClick"], ie = ["onClick"], fe = /* @__PURE__ */ J({
7
7
  __name: "index",
8
8
  setup(me) {
@@ -0,0 +1,384 @@
1
+ import { D as k, a as x, _ as ee } from "./index-B54kJjCF.mjs";
2
+ import { defineComponent as le, ref as V, reactive as U, onActivated as ae, resolveComponent as m, resolveDirective as te, createElementBlock as N, openBlock as d, createElementVNode as w, createVNode as o, createBlock as f, createCommentVNode as h, withCtx as t, unref as n, withKeys as S, createTextVNode as s, toDisplayString as u, withDirectives as I, isRef as T } from "vue";
3
+ import { useTableHooks as oe } from "jmash-core";
4
+ import { useI18n as ne } from "vue-i18n";
5
+ import "element-plus";
6
+ const re = { class: "app-container" }, ie = { class: "search-container" }, me = ["onClick"], ue = ["onClick"], be = /* @__PURE__ */ le({
7
+ __name: "index",
8
+ setup(de) {
9
+ const { t: c } = ne();
10
+ k.materialCategoryBizDict.useValues(), k.userDict.useValues();
11
+ const r = V({}), {
12
+ tableHooks: i,
13
+ multipleTableRef: M,
14
+ queryFormRef: j,
15
+ listLoading: z,
16
+ tableData: q,
17
+ total: $
18
+ } = oe(c, x, r);
19
+ let g = 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: "100",
66
+ slotName: "plannerId",
67
+ columnType: "slot",
68
+ isColumn: !0
69
+ },
70
+ {
71
+ label: "common.operate",
72
+ width: "130",
73
+ slotName: "operation",
74
+ columnType: "slot",
75
+ fixed: "right",
76
+ isColumn: !0
77
+ }
78
+ ]);
79
+ const p = V({
80
+ title: c("common.edit"),
81
+ visible: !1
82
+ }), C = V(!1);
83
+ let P = U({});
84
+ function E() {
85
+ P = U({}), p.value.title = c("common.add"), p.value.visible = !0;
86
+ }
87
+ function B(a) {
88
+ P.materialId = a.materialId, p.value.title = c("common.edit"), p.value.visible = !0;
89
+ }
90
+ function K(a) {
91
+ i.selectionRows.value = a;
92
+ }
93
+ function Q(a) {
94
+ i.handleSort(a.prop, a.order);
95
+ }
96
+ function L() {
97
+ C.value = !1;
98
+ }
99
+ function A(a) {
100
+ a.updateMask = "", i.importExcel(a).then((e) => {
101
+ C.value = !1;
102
+ });
103
+ }
104
+ return ae(() => {
105
+ i.getList();
106
+ }), (a, e) => {
107
+ const F = m("el-tree-select"), _ = m("el-form-item"), v = m("el-col"), D = m("el-input"), R = m("el-row"), b = m("el-button"), H = m("el-form"), G = m("jmash-column-select"), J = m("jmash-table"), O = m("jmash-pagination"), W = m("el-card"), X = m("jmash-import-upload"), Y = ee, y = te("hasPerm");
108
+ return d(), N("div", re, [
109
+ w("div", ie, [
110
+ o(H, {
111
+ ref_key: "queryFormRef",
112
+ ref: j,
113
+ model: r.value,
114
+ inline: !0
115
+ }, {
116
+ default: t(() => [
117
+ o(R, null, {
118
+ default: t(() => [
119
+ o(v, { span: 6 }, {
120
+ default: t(() => [
121
+ o(_, {
122
+ label: a.$t("materialInfo.categoryId"),
123
+ prop: "categoryId"
124
+ }, {
125
+ default: t(() => [
126
+ o(F, {
127
+ modelValue: r.value.categoryId,
128
+ "onUpdate:modelValue": e[0] || (e[0] = (l) => r.value.categoryId = l),
129
+ data: n(k).materialCategoryBizDict.values,
130
+ filterable: "",
131
+ clearable: "",
132
+ "check-strictly": "",
133
+ "render-after-expand": !1,
134
+ class: "w-full",
135
+ placeholder: a.$t("materialInfo.categoryIdRequired")
136
+ }, null, 8, ["modelValue", "data", "placeholder"])
137
+ ]),
138
+ _: 1
139
+ }, 8, ["label"])
140
+ ]),
141
+ _: 1
142
+ }),
143
+ o(v, { span: 6 }, {
144
+ default: t(() => [
145
+ o(_, {
146
+ label: a.$t("materialInfo.materialCode"),
147
+ prop: "likeMaterialCode"
148
+ }, {
149
+ default: t(() => [
150
+ o(D, {
151
+ modelValue: r.value.likeMaterialCode,
152
+ "onUpdate:modelValue": e[1] || (e[1] = (l) => r.value.likeMaterialCode = l),
153
+ placeholder: a.$t("materialInfo.materialCodeRequired"),
154
+ onKeyup: e[2] || (e[2] = S((l) => n(i).handleQuery(), ["enter"])),
155
+ class: "!w-[203px]"
156
+ }, null, 8, ["modelValue", "placeholder"])
157
+ ]),
158
+ _: 1
159
+ }, 8, ["label"])
160
+ ]),
161
+ _: 1
162
+ }),
163
+ o(v, { span: 6 }, {
164
+ default: t(() => [
165
+ o(_, {
166
+ label: a.$t("materialInfo.materialName"),
167
+ prop: "likeMaterialName"
168
+ }, {
169
+ default: t(() => [
170
+ o(D, {
171
+ modelValue: r.value.likeMaterialName,
172
+ "onUpdate:modelValue": e[3] || (e[3] = (l) => r.value.likeMaterialName = l),
173
+ placeholder: a.$t("materialInfo.materialNameRequired"),
174
+ onKeyup: e[4] || (e[4] = S((l) => n(i).handleQuery(), ["enter"])),
175
+ class: "!w-[203px]"
176
+ }, null, 8, ["modelValue", "placeholder"])
177
+ ]),
178
+ _: 1
179
+ }, 8, ["label"])
180
+ ]),
181
+ _: 1
182
+ }),
183
+ o(v, { span: 6 }, {
184
+ default: t(() => [
185
+ o(_, {
186
+ label: a.$t("materialInfo.specInfo"),
187
+ prop: "likeSpecInfo"
188
+ }, {
189
+ default: t(() => [
190
+ o(D, {
191
+ modelValue: r.value.likeSpecInfo,
192
+ "onUpdate:modelValue": e[5] || (e[5] = (l) => r.value.likeSpecInfo = l),
193
+ placeholder: a.$t("materialInfo.specInfoRequired"),
194
+ onKeyup: e[6] || (e[6] = S((l) => n(i).handleQuery(), ["enter"])),
195
+ class: "!w-[203px]"
196
+ }, null, 8, ["modelValue", "placeholder"])
197
+ ]),
198
+ _: 1
199
+ }, 8, ["label"])
200
+ ]),
201
+ _: 1
202
+ })
203
+ ]),
204
+ _: 1
205
+ }),
206
+ o(_, { class: "search-btn" }, {
207
+ default: t(() => [
208
+ o(b, {
209
+ type: "primary",
210
+ onClick: e[7] || (e[7] = (l) => n(i).handleQuery())
211
+ }, {
212
+ default: t(() => [
213
+ s(u(a.$t("common.search")), 1)
214
+ ]),
215
+ _: 1
216
+ }),
217
+ o(b, {
218
+ onClick: e[8] || (e[8] = (l) => n(i).resetQuery())
219
+ }, {
220
+ default: t(() => [
221
+ s(u(a.$t("common.reset")), 1)
222
+ ]),
223
+ _: 1
224
+ })
225
+ ]),
226
+ _: 1
227
+ })
228
+ ]),
229
+ _: 1
230
+ }, 8, ["model"]),
231
+ e[19] || (e[19] = w("div", { class: "clear" }, null, -1))
232
+ ]),
233
+ o(W, {
234
+ shadow: "never",
235
+ class: "table-container"
236
+ }, {
237
+ header: t(() => [
238
+ o(R, null, {
239
+ default: t(() => [
240
+ o(v, { span: 17 }, {
241
+ default: t(() => [
242
+ I((d(), f(b, {
243
+ type: "primary",
244
+ onClick: E
245
+ }, {
246
+ default: t(() => [
247
+ s(u(a.$t("common.add")), 1)
248
+ ]),
249
+ _: 1
250
+ })), [
251
+ [y, ["material:material_info:add"]]
252
+ ]),
253
+ I((d(), f(b, {
254
+ type: "primary",
255
+ onClick: e[9] || (e[9] = (l) => n(i).deleteRecords())
256
+ }, {
257
+ default: t(() => [
258
+ s(u(a.$t("common.batchDelete")), 1)
259
+ ]),
260
+ _: 1
261
+ })), [
262
+ [y, ["material:material_info:delete"]]
263
+ ])
264
+ ]),
265
+ _: 1
266
+ }),
267
+ o(v, {
268
+ span: 7,
269
+ class: "container-float"
270
+ }, {
271
+ default: t(() => [
272
+ I((d(), f(b, {
273
+ plain: "",
274
+ type: "primary",
275
+ onClick: e[10] || (e[10] = (l) => C.value = !0)
276
+ }, {
277
+ default: t(() => [
278
+ s(u(a.$t("common.import")), 1)
279
+ ]),
280
+ _: 1
281
+ })), [
282
+ [y, ["material:material_info:import"]]
283
+ ]),
284
+ I((d(), f(b, {
285
+ plain: "",
286
+ type: "primary",
287
+ onClick: e[11] || (e[11] = (l) => n(i).handleExport(n(c)("materialInfo.name")))
288
+ }, {
289
+ default: t(() => [
290
+ s(u(a.$t("common.export")), 1)
291
+ ]),
292
+ _: 1
293
+ })), [
294
+ [y, ["material:material_info:export"]]
295
+ ]),
296
+ o(G, {
297
+ modelValue: n(g),
298
+ "onUpdate:modelValue": e[12] || (e[12] = (l) => T(g) ? g.value = l : g = l),
299
+ "label-name": "mat-material-info"
300
+ }, null, 8, ["modelValue"])
301
+ ]),
302
+ _: 1
303
+ })
304
+ ]),
305
+ _: 1
306
+ })
307
+ ]),
308
+ footer: t(() => [
309
+ n($) > 0 ? (d(), f(O, {
310
+ key: 0,
311
+ total: n($),
312
+ "onUpdate:total": e[13] || (e[13] = (l) => T($) ? $.value = l : null),
313
+ "current-page": r.value.curPage,
314
+ "onUpdate:currentPage": e[14] || (e[14] = (l) => r.value.curPage = l),
315
+ "page-size": r.value.pageSize,
316
+ "onUpdate:pageSize": e[15] || (e[15] = (l) => r.value.pageSize = l),
317
+ onPagination: e[16] || (e[16] = (l) => n(i).getList())
318
+ }, null, 8, ["total", "current-page", "page-size"])) : h("", !0)
319
+ ]),
320
+ default: t(() => [
321
+ o(J, {
322
+ ref_key: "multipleTableRef",
323
+ ref: M,
324
+ "row-key": "materialId",
325
+ "list-loading": n(z),
326
+ data: n(q),
327
+ "table-label": n(g),
328
+ onSelectionChange: K,
329
+ onSortChange: Q
330
+ }, {
331
+ categoryId: t((l) => [
332
+ w("span", null, u(n(k).materialCategoryBizDict.getValue(l.data.row.categoryId)), 1)
333
+ ]),
334
+ unitPrice: t((l) => [
335
+ w("span", null, u(l.data.row.unitPrice | 0) + "元 ", 1)
336
+ ]),
337
+ plannerId: t((l) => [
338
+ w("span", null, u(n(k).userDict.getValue(l.data.row.plannerId)), 1)
339
+ ]),
340
+ operation: t((l) => [
341
+ I((d(), N("span", {
342
+ class: "el-button-color",
343
+ onClick: (Z) => B(l.data.row)
344
+ }, [
345
+ s(u(a.$t("common.edit")), 1)
346
+ ], 8, me)), [
347
+ [y, ["material:material_info:update"]]
348
+ ]),
349
+ I((d(), N("span", {
350
+ class: "el-button-color dropdown-left",
351
+ onClick: (Z) => n(i).deleteRecord(l.data.row)
352
+ }, [
353
+ s(u(a.$t("common.delete")), 1)
354
+ ], 8, ue)), [
355
+ [y, ["material:material_info:delete"]]
356
+ ])
357
+ ]),
358
+ _: 1
359
+ }, 8, ["list-loading", "data", "table-label"])
360
+ ]),
361
+ _: 1
362
+ }),
363
+ C.value ? (d(), f(X, {
364
+ key: 0,
365
+ "upload-visible": C.value,
366
+ "template-title": a.$t("sysUser.templateDownload"),
367
+ onTemplateDown: e[17] || (e[17] = (l) => n(i).downloadTemplate(n(c)("materialInfo.name"))),
368
+ onImportEvents: A,
369
+ onUploadClosed: L
370
+ }, null, 8, ["upload-visible", "template-title"])) : h("", !0),
371
+ p.value.visible ? (d(), f(Y, {
372
+ key: 1,
373
+ modelValue: p.value.visible,
374
+ "onUpdate:modelValue": e[18] || (e[18] = (l) => p.value.visible = l),
375
+ title: "选择物料",
376
+ width: "1000px"
377
+ }, null, 8, ["modelValue"])) : h("", !0)
378
+ ]);
379
+ };
380
+ }
381
+ });
382
+ export {
383
+ be as default
384
+ };
package/dist/index.mjs CHANGED
@@ -1,68 +1,7 @@
1
- import { deepMerge as n, addViteMenus as i, i18n as r } from "jmash-core";
2
- const o = {}, l = {
3
- // 出入库明细
4
- inventoryDetail: {
5
- name: "出入库明细",
6
- tenantId: "租户ID",
7
- detailId: "明细ID",
8
- taskId: "任务ID",
9
- inventoryId: "库存ID",
10
- applyId: "物料申请ID",
11
- deptId: "出入部门ID",
12
- inventoryType: "库存类型(入库、出库、归还)",
13
- quantity: "出入数量",
14
- amount: "出入金额"
15
- },
16
- // 材料分类
17
- materialCategory: {
18
- categoryName: "分类名称",
19
- parentId: "上级分类",
20
- orderBy: "排序",
21
- note: "备注",
22
- categoryNameRequired: "请输入分类名称",
23
- parentIdRequired: "请选择上级分类",
24
- noteRequired: "请输入备注"
25
- },
26
- // 材料信息
27
- materialInfo: {
28
- name: "材料信息",
29
- categoryId: "材料分类",
30
- materialCode: "材料编码",
31
- materialName: "材料名称",
32
- specInfo: "规格型号",
33
- unit: "计量单位",
34
- unitPrice: "单价",
35
- plannerId: "计划员",
36
- categoryIdRequired: "请选择材料分类",
37
- materialCodeRequired: "请输入材料编码",
38
- materialNameRequired: "请输入材料名称",
39
- specInfoRequired: "请输入规格型号",
40
- unitRequired: "请输入计量单位",
41
- unitPriceRequired: "请输入单价",
42
- plannerIdRequired: "请选择计划员"
43
- },
44
- // 材料库存信息
45
- materialInventory: {
46
- name: "材料库存信息",
47
- tenantId: "租户ID",
48
- inventoryId: "库存ID",
49
- materialId: "材料ID",
50
- deptId: "部门ID",
51
- parentId: "上级部门",
52
- stock: "当前库存"
53
- }
54
- };
55
- function d(e) {
56
- let a = e.global.getLocaleMessage("zh-cn");
57
- a = n(a, l);
58
- let t = e.global.getLocaleMessage("en");
59
- t = n(t, o), e.global.setLocaleMessage("zh-cn", a), e.global.setLocaleMessage("en", t);
60
- }
61
- const m = /* @__PURE__ */ Object.assign({ "./views/mat-material-category/edit.vue": () => import("./edit-BwUVt41m.mjs"), "./views/mat-material-category/index.vue": () => import("./index-Mo5kukd_.mjs"), "./views/mat-material-info/edit.vue": () => import("./edit-DJxSeb24.mjs"), "./views/mat-material-info/index.vue": () => import("./index-CW8xN0Yq.mjs") }), s = {
62
- install(e) {
63
- i(m, 7), d(r);
64
- }
65
- };
1
+ import "jmash-core";
2
+ import { M as r, b as e, a as o } from "./index-B54kJjCF.mjs";
66
3
  export {
67
- s as default
4
+ r as MaterialCategoryBizLayDict,
5
+ e as default,
6
+ o as materialInfoApi
68
7
  };
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .material-modal{width:100%;display:flex}.material-modal-left{width:20%;border-right:1px solid #d1d5db}.material-modal-right{padding-left:3%;width:80%}.material-modal-search{margin-bottom:20px;width:100%}.margin-right{margin-right:20px}.pagination-container{margin-top:20px;display:flex}
@@ -3,7 +3,7 @@ export interface MaterialInfoApi extends EntityApi {
3
3
  }
4
4
  export interface MaterialInfoReq extends EntityReq {
5
5
  categoryId?: string;
6
- likeCategoryName?: string;
6
+ likeMaterialName?: string;
7
7
  likeMaterialCode?: string;
8
8
  likeSpecInfo?: string;
9
9
  }
@@ -0,0 +1,11 @@
1
+ type __VLS_PublicProps = {
2
+ modelValue?: boolean;
3
+ };
4
+ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ selectMaterial: (...args: any[]) => void;
6
+ "update:modelValue": (value: boolean | undefined) => void;
7
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
8
+ onSelectMaterial?: ((...args: any[]) => any) | undefined;
9
+ "onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ export default _default;
@@ -1,4 +1,8 @@
1
1
  import type { App } from "vue";
2
+ export { materialInfoApi } from "./api/mat-material-info/index";
3
+ export type { MaterialInfoReq, MaterialInfoModel, } from "./api/mat-material-info/types";
4
+ export { MaterialCategoryBizLayDict } from "./api/dict";
5
+ import "./styles/index.scss";
2
6
  declare const material: {
3
7
  install(app: App): void;
4
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sooyie-material",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "private": false,
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dts/src/index.d.ts",
@@ -11,13 +11,13 @@
11
11
  "peerDependencies": {
12
12
  "axios": "^1.9.0",
13
13
  "element-plus": "^2.9.10",
14
+ "jmash-core": "^0.1.13",
15
+ "jmash-dict": "^0.1.4",
16
+ "jmash-rbac": "^0.1.21",
14
17
  "pinia": "^2.3.1",
15
18
  "vue": "^3.5.13",
16
19
  "vue-i18n": "^9.14.4",
17
- "vue-router": "^4.5.1",
18
- "jmash-core": "^0.1.13",
19
- "jmash-dict": "^0.1.4",
20
- "jmash-rbac": "^0.1.21"
20
+ "vue-router": "^4.5.1"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@eslint/js": "^9.14.0",
@@ -39,9 +39,10 @@
39
39
  "vue-tsc": "^2.1.10"
40
40
  },
41
41
  "dependencies": {
42
+ "@element-plus/icons-vue": "^2.3.2",
43
+ "@vueuse/core": "^10.9.0",
42
44
  "file-saver": "^2.0.5",
43
45
  "nprogress": "^0.2.0",
44
- "@vueuse/core": "^10.9.0",
45
46
  "qs": "^6.14.0"
46
47
  },
47
48
  "scripts": {
@@ -1,4 +0,0 @@
1
- import { _ as f } from "./edit.vue_vue_type_script_setup_true_lang-Dx7mFloi.mjs";
2
- export {
3
- f as default
4
- };