@fewangsit/wangsvue-fats 1.0.1-alpha.42 → 1.0.1-alpha.44
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.
- package/approverinfo/index.d.ts +4 -0
- package/approverinfo/index.es.js +50 -43
- package/backgroundimagecropper/index.es.js +2 -2
- package/datatable/index.d.ts +9 -12
- package/datatable/index.es.js +40 -48
- package/dialogprintqr/index.es.js +2 -2
- package/dialogselectuser/index.es.js +1 -1
- package/disposalreporttable/index.es.js +56 -57
- package/package.json +1 -1
- package/stats.html +1 -1
- package/style.css +1 -1
- package/utils/role.util.es.js +23 -23
- package/wangsvue-fats.esm.browser.js +933 -935
- package/wangsvue-fats.system.js +27 -27
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as E, onMounted as I, shallowRef as i, ref as M, createElementBlock as N, openBlock as F, Fragment as L, createElementVNode as d, createVNode as a, mergeProps as P, unref as l, withCtx as U, toDisplayString as _ } from "vue";
|
|
2
2
|
import { AssetServices as V, DisposalServices as q } from "@tagsamurai/fats-api-services";
|
|
3
3
|
import { u as z } from "../assetinfo/index.es.js";
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
4
|
+
import { u as O } from "../plugins/basei18n.es.js";
|
|
5
|
+
import { u as W } from "../utils/toast.util.es.js";
|
|
6
6
|
import { _ as g } from "../badge/index.es.js";
|
|
7
7
|
import { _ as w } from "../button/index.es.js";
|
|
8
|
-
import { _ as
|
|
9
|
-
import { _ as
|
|
8
|
+
import { _ as j } from "../buttonfilter/index.es.js";
|
|
9
|
+
import { _ as H } from "../buttonsearch/index.es.js";
|
|
10
10
|
import { D as K } from "../datatable/index.es.js";
|
|
11
11
|
import { _ as R } from "../dialogconfirm/index.es.js";
|
|
12
12
|
import { _ as G } from "../image/index.es.js";
|
|
@@ -23,7 +23,6 @@ const Y = {
|
|
|
23
23
|
childTableProps: {},
|
|
24
24
|
tableName: {},
|
|
25
25
|
tableTitle: {},
|
|
26
|
-
parentHeaders: {},
|
|
27
26
|
useOption: { type: Boolean },
|
|
28
27
|
data: {},
|
|
29
28
|
disableKey: {},
|
|
@@ -63,7 +62,7 @@ const Y = {
|
|
|
63
62
|
I(() => {
|
|
64
63
|
S();
|
|
65
64
|
});
|
|
66
|
-
const p =
|
|
65
|
+
const p = W(), { t: s } = O(), { setLoading: m } = z(), c = i(!1), f = i(!1), D = i(0), y = i([]), b = i(), r = i([]), n = M(
|
|
67
66
|
/* @__PURE__ */ new Map()
|
|
68
67
|
), C = [
|
|
69
68
|
{
|
|
@@ -71,12 +70,12 @@ const Y = {
|
|
|
71
70
|
header: "Photo",
|
|
72
71
|
style: "min-width: 72px",
|
|
73
72
|
fixed: !0,
|
|
74
|
-
sortable: !
|
|
73
|
+
sortable: !1,
|
|
75
74
|
excluded: !0,
|
|
76
|
-
bodyComponent: (
|
|
75
|
+
bodyComponent: (o) => ({
|
|
77
76
|
component: G,
|
|
78
77
|
props: {
|
|
79
|
-
src:
|
|
78
|
+
src: o.assetImageBig,
|
|
80
79
|
description: "asset-report-photo",
|
|
81
80
|
size: "small"
|
|
82
81
|
}
|
|
@@ -87,9 +86,9 @@ const Y = {
|
|
|
87
86
|
field: "name.nameWithSequence",
|
|
88
87
|
sortable: !0,
|
|
89
88
|
fixed: !0,
|
|
90
|
-
bodyTemplate: (
|
|
89
|
+
bodyTemplate: (o) => {
|
|
91
90
|
var e;
|
|
92
|
-
return ((e =
|
|
91
|
+
return ((e = o.name) == null ? void 0 : e.nameWithSequence) ?? "-";
|
|
93
92
|
}
|
|
94
93
|
},
|
|
95
94
|
{
|
|
@@ -97,12 +96,12 @@ const Y = {
|
|
|
97
96
|
field: "brand.name",
|
|
98
97
|
sortable: !0,
|
|
99
98
|
fixed: !1,
|
|
100
|
-
bodyComponent: (
|
|
99
|
+
bodyComponent: (o) => {
|
|
101
100
|
var e;
|
|
102
101
|
return {
|
|
103
102
|
component: g,
|
|
104
103
|
props: {
|
|
105
|
-
label: (e =
|
|
104
|
+
label: (e = o.brand) == null ? void 0 : e.name,
|
|
106
105
|
severity: "dark",
|
|
107
106
|
format: "nowrap"
|
|
108
107
|
}
|
|
@@ -114,12 +113,12 @@ const Y = {
|
|
|
114
113
|
field: "model.name",
|
|
115
114
|
sortable: !0,
|
|
116
115
|
fixed: !1,
|
|
117
|
-
bodyComponent: (
|
|
116
|
+
bodyComponent: (o) => {
|
|
118
117
|
var e;
|
|
119
118
|
return {
|
|
120
119
|
component: g,
|
|
121
120
|
props: {
|
|
122
|
-
label: (e =
|
|
121
|
+
label: (e = o.model) == null ? void 0 : e.name,
|
|
123
122
|
severity: "dark",
|
|
124
123
|
format: "nowrap"
|
|
125
124
|
}
|
|
@@ -131,12 +130,12 @@ const Y = {
|
|
|
131
130
|
field: "group.name",
|
|
132
131
|
sortable: !0,
|
|
133
132
|
fixed: !1,
|
|
134
|
-
bodyComponent: (
|
|
133
|
+
bodyComponent: (o) => {
|
|
135
134
|
var e;
|
|
136
135
|
return {
|
|
137
136
|
component: g,
|
|
138
137
|
props: {
|
|
139
|
-
label: (e =
|
|
138
|
+
label: (e = o.group) == null ? void 0 : e.name,
|
|
140
139
|
format: "nowrap"
|
|
141
140
|
}
|
|
142
141
|
};
|
|
@@ -146,21 +145,21 @@ const Y = {
|
|
|
146
145
|
header: "Note",
|
|
147
146
|
field: "note",
|
|
148
147
|
fixed: !0,
|
|
149
|
-
bodyComponent: (
|
|
148
|
+
bodyComponent: (o) => ({
|
|
150
149
|
component: Q,
|
|
151
150
|
props: {
|
|
152
|
-
modelValue: n.value.get(
|
|
151
|
+
modelValue: n.value.get(o._id ?? "assetId").notes,
|
|
153
152
|
placeholder: s("Enter note"),
|
|
154
153
|
rows: 1,
|
|
155
154
|
maxlength: 30
|
|
156
155
|
},
|
|
157
156
|
events: {
|
|
158
157
|
"update:modelValue": (e) => {
|
|
159
|
-
const
|
|
160
|
-
n.value.set(
|
|
161
|
-
...
|
|
158
|
+
const t = n.value.get(o._id ?? "assetId");
|
|
159
|
+
n.value.set(o._id ?? "assetId", {
|
|
160
|
+
...t,
|
|
162
161
|
notes: e
|
|
163
|
-
}),
|
|
162
|
+
}), o.note = e;
|
|
164
163
|
}
|
|
165
164
|
}
|
|
166
165
|
})
|
|
@@ -168,16 +167,16 @@ const Y = {
|
|
|
168
167
|
], S = async () => {
|
|
169
168
|
try {
|
|
170
169
|
m(!0);
|
|
171
|
-
const
|
|
172
|
-
e.data.data.forEach((
|
|
173
|
-
n.value.set(
|
|
170
|
+
const o = sessionStorage.getItem("assetsDisposalReport") ?? "[]", { data: e } = await V.getAllAssets({ _id: o });
|
|
171
|
+
e.data.data.forEach((t) => {
|
|
172
|
+
n.value.set(t._id ?? "", {
|
|
174
173
|
notes: null,
|
|
175
|
-
reason: ["Damaged", "Missing"].includes(
|
|
174
|
+
reason: ["Damaged", "Missing"].includes(t.status) ? t.status : u.reason
|
|
176
175
|
});
|
|
177
176
|
}), r.value = e.data.data, D.value = e.data.totalRecords;
|
|
178
|
-
} catch (
|
|
179
|
-
console.error(
|
|
180
|
-
error:
|
|
177
|
+
} catch (o) {
|
|
178
|
+
console.error(o), p.add({
|
|
179
|
+
error: o,
|
|
181
180
|
message: "Error, failed to get assets. "
|
|
182
181
|
});
|
|
183
182
|
} finally {
|
|
@@ -192,39 +191,39 @@ const Y = {
|
|
|
192
191
|
c.value = !0;
|
|
193
192
|
}
|
|
194
193
|
}
|
|
195
|
-
], h = (
|
|
194
|
+
], h = (o) => {
|
|
196
195
|
r.value = r.value.filter(
|
|
197
|
-
(e) => !
|
|
198
|
-
), T(
|
|
199
|
-
}, T = (
|
|
200
|
-
|
|
196
|
+
(e) => !o.some((t) => e._id === t._id)
|
|
197
|
+
), T(o);
|
|
198
|
+
}, T = (o) => {
|
|
199
|
+
o.forEach((e) => {
|
|
201
200
|
n.value.delete(e._id ?? "");
|
|
202
201
|
}), r.value.length || v(), p.add({
|
|
203
202
|
message: s("Success, asset has been removed from the list."),
|
|
204
203
|
severity: "success"
|
|
205
204
|
});
|
|
206
|
-
}, $ = (
|
|
207
|
-
|
|
208
|
-
n.value.set(
|
|
205
|
+
}, $ = (o, e) => {
|
|
206
|
+
o.forEach((t) => {
|
|
207
|
+
n.value.set(t._id ?? "", {
|
|
209
208
|
notes: e ?? null,
|
|
210
|
-
reason: ["Damaged", "Missing"].includes(
|
|
209
|
+
reason: ["Damaged", "Missing"].includes(t.status) ? t.status : u.reason
|
|
211
210
|
});
|
|
212
211
|
});
|
|
213
212
|
}, v = () => {
|
|
214
|
-
const
|
|
213
|
+
const o = window.location.pathname, e = o.slice(0, o.lastIndexOf("/"));
|
|
215
214
|
u.router.replace(e), sessionStorage.removeItem("assetsDisposalReport");
|
|
216
215
|
}, A = async () => {
|
|
217
|
-
const
|
|
218
|
-
n.value.forEach((e,
|
|
216
|
+
const o = [];
|
|
217
|
+
n.value.forEach((e, t) => {
|
|
219
218
|
const k = {
|
|
220
|
-
asset:
|
|
219
|
+
asset: t,
|
|
221
220
|
notes: e.notes,
|
|
222
221
|
reason: e.reason
|
|
223
222
|
};
|
|
224
|
-
|
|
223
|
+
o.push(k);
|
|
225
224
|
});
|
|
226
225
|
try {
|
|
227
|
-
m(!0), await q.postReportDisposal({ data:
|
|
226
|
+
m(!0), await q.postReportDisposal({ data: o }), p.add({
|
|
228
227
|
message: s("Success, disposal report has been submitted.")
|
|
229
228
|
}), v();
|
|
230
229
|
} catch (e) {
|
|
@@ -236,35 +235,35 @@ const Y = {
|
|
|
236
235
|
m(!1);
|
|
237
236
|
}
|
|
238
237
|
};
|
|
239
|
-
return (
|
|
238
|
+
return (o, e) => (F(), N(L, null, [
|
|
240
239
|
d("div", Y, [
|
|
241
240
|
d("div", Z, [
|
|
242
241
|
a(J, {
|
|
243
242
|
"assets-to-report": r.value,
|
|
244
|
-
"onUpdate:assetsToReport": e[0] || (e[0] = (
|
|
243
|
+
"onUpdate:assetsToReport": e[0] || (e[0] = (t) => r.value = t),
|
|
245
244
|
"selected-data": y.value,
|
|
246
|
-
"onUpdate:selectedData": e[1] || (e[1] = (
|
|
245
|
+
"onUpdate:selectedData": e[1] || (e[1] = (t) => y.value = t),
|
|
247
246
|
onNoted: $,
|
|
248
|
-
onRemoved: e[2] || (e[2] = (
|
|
247
|
+
onRemoved: e[2] || (e[2] = (t) => h(t)),
|
|
249
248
|
"table-name": "disposal-report-page-table"
|
|
250
249
|
}, null, 8, ["assets-to-report", "selected-data"]),
|
|
251
|
-
a(
|
|
250
|
+
a(H, {
|
|
252
251
|
class: "ml-auto",
|
|
253
252
|
"table-name": "disposal-report-page-table"
|
|
254
253
|
}),
|
|
255
|
-
a(
|
|
254
|
+
a(j, { "table-name": "disposal-report-page-table" })
|
|
256
255
|
]),
|
|
257
256
|
a(X, {
|
|
258
257
|
assets: r.value,
|
|
259
258
|
"table-name": "disposal-report-page-table"
|
|
260
259
|
}, null, 8, ["assets"]),
|
|
261
|
-
a(K, P(
|
|
260
|
+
a(K, P(o.$props, {
|
|
262
261
|
columns: C,
|
|
263
262
|
data: r.value,
|
|
264
263
|
lazy: !1,
|
|
265
264
|
options: B,
|
|
266
265
|
rows: 10,
|
|
267
|
-
onToggleOption: e[3] || (e[3] = (
|
|
266
|
+
onToggleOption: e[3] || (e[3] = (t) => b.value = t),
|
|
268
267
|
"data-key": "_id",
|
|
269
268
|
"rounded-header": "",
|
|
270
269
|
"selection-type": "checkbox",
|
|
@@ -275,18 +274,18 @@ const Y = {
|
|
|
275
274
|
]),
|
|
276
275
|
a(R, {
|
|
277
276
|
visible: c.value,
|
|
278
|
-
"onUpdate:visible": e[4] || (e[4] = (
|
|
277
|
+
"onUpdate:visible": e[4] || (e[4] = (t) => c.value = t),
|
|
279
278
|
body: l(s)("Are you sure you want to remove it?"),
|
|
280
279
|
"confirm-label": l(s)("Remove"),
|
|
281
280
|
header: l(s)("Remove from List"),
|
|
282
281
|
lists: [b.value],
|
|
283
|
-
onConfirm: e[5] || (e[5] = (
|
|
282
|
+
onConfirm: e[5] || (e[5] = (t) => h([b.value])),
|
|
284
283
|
"list-label": "name.nameWithSequence",
|
|
285
284
|
severity: "danger"
|
|
286
285
|
}, null, 8, ["visible", "body", "confirm-label", "header", "lists"]),
|
|
287
286
|
a(R, {
|
|
288
287
|
visible: f.value,
|
|
289
|
-
"onUpdate:visible": e[6] || (e[6] = (
|
|
288
|
+
"onUpdate:visible": e[6] || (e[6] = (t) => f.value = t),
|
|
290
289
|
"confirm-label": l(s)("Continue"),
|
|
291
290
|
header: l(s)("Cancel Report"),
|
|
292
291
|
onConfirm: v,
|
|
@@ -301,7 +300,7 @@ const Y = {
|
|
|
301
300
|
d("div", ee, [
|
|
302
301
|
a(w, {
|
|
303
302
|
label: l(s)("Cancel"),
|
|
304
|
-
onClick: e[7] || (e[7] = (
|
|
303
|
+
onClick: e[7] || (e[7] = (t) => f.value = !0),
|
|
305
304
|
severity: "dark",
|
|
306
305
|
text: ""
|
|
307
306
|
}, null, 8, ["label"]),
|