@fewangsit/wangsvue-fats 1.0.1-alpha.51 → 1.0.1-alpha.53
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/disposalreport/index.d.ts +62 -0
- package/disposalreport/index.es.js +17 -14
- package/disposalreportbulkaction/index.es.js +18 -15
- package/disposalreportdialogselectasset/index.es.js +238 -0
- package/disposalreporttable/index.es.js +257 -137
- package/disposalreporttablefilter/index.es.js +17 -45
- package/icon/index.d.ts +1 -0
- package/package.json +1 -1
- package/stats.html +1 -1
- package/style.css +1 -1
- package/wangsvue-fats.esm.browser.js +8967 -8648
- package/wangsvue-fats.system.js +65 -65
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AssetServices as
|
|
3
|
-
import { u as
|
|
4
|
-
import { u as
|
|
1
|
+
import { defineComponent as V, onMounted as z, shallowRef as f, ref as W, createElementBlock as j, openBlock as H, Fragment as K, createElementVNode as g, createVNode as l, mergeProps as Q, unref as d, withCtx as X, toDisplayString as C } from "vue";
|
|
2
|
+
import { AssetServices as Y, DisposalServices as Z, DamageServices as B, MissingServices as O } from "@tagsamurai/fats-api-services";
|
|
3
|
+
import { u as ee } from "../assetinfo/index.es.js";
|
|
4
|
+
import { u as te } from "../plugins/basei18n.es.js";
|
|
5
5
|
import "../utils/role.util.es.js";
|
|
6
|
-
import { u as
|
|
7
|
-
import { _ as
|
|
6
|
+
import { u as se } from "../utils/toast.util.es.js";
|
|
7
|
+
import { _ as D } from "../badge/index.es.js";
|
|
8
8
|
import { _ as w } from "../button/index.es.js";
|
|
9
|
-
import { _ as
|
|
10
|
-
import { _ as
|
|
11
|
-
import { D as
|
|
12
|
-
import { _ as
|
|
13
|
-
import { _ as
|
|
14
|
-
import { _ as
|
|
15
|
-
import { _ as
|
|
16
|
-
import { _ as
|
|
17
|
-
|
|
9
|
+
import { _ as ae } from "../buttonfilter/index.es.js";
|
|
10
|
+
import { _ as oe } from "../buttonsearch/index.es.js";
|
|
11
|
+
import { D as re } from "../datatable/index.es.js";
|
|
12
|
+
import { _ as M } from "../dialogconfirm/index.es.js";
|
|
13
|
+
import { _ as ne } from "../image/index.es.js";
|
|
14
|
+
import { _ as le } from "../textarea/index.es.js";
|
|
15
|
+
import { _ as ie } from "../disposalreportbulkaction/index.es.js";
|
|
16
|
+
import { _ as de } from "../disposalreportdialogselectasset/index.es.js";
|
|
17
|
+
import { _ as pe } from "../disposalreporttablefilter/index.es.js";
|
|
18
|
+
const ue = {
|
|
18
19
|
class: "flex flex-col gap-2",
|
|
19
20
|
"data-ts-section": "disposalreporttablewrapper"
|
|
20
|
-
},
|
|
21
|
+
}, me = { class: "flex gap-1 justify-end" }, ce = { class: "flex gap-1 justify-end" }, Me = /* @__PURE__ */ V({
|
|
21
22
|
__name: "DisposalReportTable",
|
|
22
23
|
props: {
|
|
23
24
|
treeTable: { type: Boolean },
|
|
@@ -56,16 +57,19 @@ const Y = {
|
|
|
56
57
|
emptyTableMessage: {},
|
|
57
58
|
singleSelection: {},
|
|
58
59
|
router: {},
|
|
59
|
-
reason: {}
|
|
60
|
+
reason: {},
|
|
61
|
+
from: {}
|
|
60
62
|
},
|
|
61
|
-
setup(
|
|
62
|
-
const u =
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
setup(T) {
|
|
64
|
+
const u = T;
|
|
65
|
+
z(() => {
|
|
66
|
+
$();
|
|
65
67
|
});
|
|
66
|
-
const
|
|
68
|
+
const m = se(), { t: a } = te(), { setLoading: c } = ee(), y = f(!1), v = f(!1), b = f(!1), x = f([]), h = f(), n = f(
|
|
69
|
+
[]
|
|
70
|
+
), p = W(
|
|
67
71
|
/* @__PURE__ */ new Map()
|
|
68
|
-
),
|
|
72
|
+
), k = [
|
|
69
73
|
{
|
|
70
74
|
field: "assetImageSmall",
|
|
71
75
|
header: "Photo",
|
|
@@ -73,10 +77,10 @@ const Y = {
|
|
|
73
77
|
fixed: !0,
|
|
74
78
|
sortable: !1,
|
|
75
79
|
excluded: !0,
|
|
76
|
-
bodyComponent: (
|
|
77
|
-
component:
|
|
80
|
+
bodyComponent: (s) => ({
|
|
81
|
+
component: ne,
|
|
78
82
|
props: {
|
|
79
|
-
src:
|
|
83
|
+
src: s.assetImage,
|
|
80
84
|
description: "asset-report-photo",
|
|
81
85
|
size: "small"
|
|
82
86
|
}
|
|
@@ -87,22 +91,28 @@ const Y = {
|
|
|
87
91
|
field: "name.nameWithSequence",
|
|
88
92
|
sortable: !0,
|
|
89
93
|
fixed: !0,
|
|
90
|
-
bodyTemplate: (
|
|
94
|
+
bodyTemplate: (s) => {
|
|
91
95
|
var e;
|
|
92
|
-
return ((e =
|
|
96
|
+
return ((e = s.name) == null ? void 0 : e.nameWithSequence) ?? "-";
|
|
93
97
|
}
|
|
94
98
|
},
|
|
99
|
+
{
|
|
100
|
+
header: "Asset ID",
|
|
101
|
+
field: "assetId",
|
|
102
|
+
sortable: !0,
|
|
103
|
+
fixed: !0
|
|
104
|
+
},
|
|
95
105
|
{
|
|
96
106
|
header: "Brand",
|
|
97
107
|
field: "brand.name",
|
|
98
108
|
sortable: !0,
|
|
99
109
|
fixed: !1,
|
|
100
|
-
bodyComponent: (
|
|
110
|
+
bodyComponent: (s) => {
|
|
101
111
|
var e;
|
|
102
112
|
return {
|
|
103
|
-
component:
|
|
113
|
+
component: D,
|
|
104
114
|
props: {
|
|
105
|
-
label: (e =
|
|
115
|
+
label: (e = s.brand) == null ? void 0 : e.name,
|
|
106
116
|
severity: "dark",
|
|
107
117
|
format: "nowrap"
|
|
108
118
|
}
|
|
@@ -114,12 +124,12 @@ const Y = {
|
|
|
114
124
|
field: "model.name",
|
|
115
125
|
sortable: !0,
|
|
116
126
|
fixed: !1,
|
|
117
|
-
bodyComponent: (
|
|
127
|
+
bodyComponent: (s) => {
|
|
118
128
|
var e;
|
|
119
129
|
return {
|
|
120
|
-
component:
|
|
130
|
+
component: D,
|
|
121
131
|
props: {
|
|
122
|
-
label: (e =
|
|
132
|
+
label: (e = s.model) == null ? void 0 : e.name,
|
|
123
133
|
severity: "dark",
|
|
124
134
|
format: "nowrap"
|
|
125
135
|
}
|
|
@@ -131,12 +141,12 @@ const Y = {
|
|
|
131
141
|
field: "group.name",
|
|
132
142
|
sortable: !0,
|
|
133
143
|
fixed: !1,
|
|
134
|
-
bodyComponent: (
|
|
144
|
+
bodyComponent: (s) => {
|
|
135
145
|
var e;
|
|
136
146
|
return {
|
|
137
|
-
component:
|
|
147
|
+
component: D,
|
|
138
148
|
props: {
|
|
139
|
-
label: (e =
|
|
149
|
+
label: (e = s.group) == null ? void 0 : e.name,
|
|
140
150
|
format: "nowrap"
|
|
141
151
|
}
|
|
142
152
|
};
|
|
@@ -146,125 +156,228 @@ const Y = {
|
|
|
146
156
|
header: "Note",
|
|
147
157
|
field: "note",
|
|
148
158
|
fixed: !0,
|
|
149
|
-
bodyComponent: (
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
159
|
+
bodyComponent: (s) => {
|
|
160
|
+
var e;
|
|
161
|
+
return {
|
|
162
|
+
component: le,
|
|
163
|
+
props: {
|
|
164
|
+
modelValue: (e = p.value.get(s._id ?? "assetId")) == null ? void 0 : e.notes,
|
|
165
|
+
placeholder: a("Enter note"),
|
|
166
|
+
rows: 1,
|
|
167
|
+
maxlength: 30,
|
|
168
|
+
preventInputOnMaxLength: !0
|
|
169
|
+
},
|
|
170
|
+
events: {
|
|
171
|
+
"update:modelValue": (t) => {
|
|
172
|
+
const o = p.value.get(s._id ?? "assetId");
|
|
173
|
+
p.value.set(s._id ?? "assetId", {
|
|
174
|
+
...o,
|
|
175
|
+
notes: t
|
|
176
|
+
}), s.note = t;
|
|
177
|
+
}
|
|
164
178
|
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
], $ = async () => {
|
|
183
|
+
const s = sessionStorage.getItem("assetsDisposalReport");
|
|
184
|
+
if (!s) {
|
|
185
|
+
m.add({
|
|
186
|
+
message: a("Error, no assets found for disposal report."),
|
|
187
|
+
severity: "error"
|
|
188
|
+
});
|
|
189
|
+
return;
|
|
167
190
|
}
|
|
168
|
-
], S = async () => {
|
|
169
191
|
try {
|
|
170
|
-
|
|
171
|
-
const
|
|
192
|
+
c(!0);
|
|
193
|
+
const { data: e } = await Y.getAllAssets({ _id: s });
|
|
172
194
|
e.data.data.forEach((t) => {
|
|
173
|
-
|
|
195
|
+
p.value.set(t._id ?? "", {
|
|
174
196
|
notes: null,
|
|
175
197
|
reason: ["Damaged", "Missing"].includes(t.status) ? t.status : u.reason
|
|
176
198
|
});
|
|
177
|
-
}),
|
|
178
|
-
} catch (
|
|
179
|
-
console.error(
|
|
180
|
-
error:
|
|
199
|
+
}), n.value = e.data.data;
|
|
200
|
+
} catch (e) {
|
|
201
|
+
console.error(e), m.add({
|
|
202
|
+
error: e,
|
|
181
203
|
message: "Error, failed to get assets. "
|
|
182
204
|
});
|
|
183
205
|
} finally {
|
|
184
|
-
|
|
206
|
+
c(!1);
|
|
185
207
|
}
|
|
186
|
-
},
|
|
208
|
+
}, N = [
|
|
187
209
|
{
|
|
188
|
-
label:
|
|
210
|
+
label: a("Remove from List"),
|
|
189
211
|
icon: "delete-bin",
|
|
190
212
|
danger: !0,
|
|
191
213
|
command: () => {
|
|
192
|
-
|
|
214
|
+
v.value = !0;
|
|
193
215
|
}
|
|
194
216
|
}
|
|
195
|
-
],
|
|
196
|
-
|
|
197
|
-
(e) => !
|
|
198
|
-
),
|
|
199
|
-
},
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}),
|
|
203
|
-
message:
|
|
217
|
+
], I = (s) => {
|
|
218
|
+
n.value = n.value.filter(
|
|
219
|
+
(e) => !s.some((t) => e._id === t._id)
|
|
220
|
+
), E(s);
|
|
221
|
+
}, E = (s) => {
|
|
222
|
+
s.forEach((e) => {
|
|
223
|
+
p.value.delete(e._id ?? "");
|
|
224
|
+
}), n.value.length || _(), m.add({
|
|
225
|
+
message: a("Success, asset has been removed from the list."),
|
|
204
226
|
severity: "success"
|
|
205
227
|
});
|
|
206
|
-
},
|
|
207
|
-
|
|
208
|
-
|
|
228
|
+
}, P = (s, e) => {
|
|
229
|
+
s.forEach((t) => {
|
|
230
|
+
p.value.set(t._id ?? "", {
|
|
209
231
|
notes: e ?? null,
|
|
210
232
|
reason: ["Damaged", "Missing"].includes(t.status) ? t.status : u.reason
|
|
211
233
|
});
|
|
212
234
|
});
|
|
213
|
-
},
|
|
214
|
-
const
|
|
235
|
+
}, _ = () => {
|
|
236
|
+
const s = window.location.pathname, e = s.slice(0, s.lastIndexOf("/"));
|
|
215
237
|
u.router.replace(e), sessionStorage.removeItem("assetsDisposalReport");
|
|
216
|
-
},
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
const
|
|
238
|
+
}, L = async () => {
|
|
239
|
+
const s = [];
|
|
240
|
+
p.value.forEach((e, t) => {
|
|
241
|
+
const o = {
|
|
220
242
|
asset: t,
|
|
221
243
|
notes: e.notes,
|
|
222
244
|
reason: e.reason
|
|
223
245
|
};
|
|
224
|
-
|
|
246
|
+
s.push(o);
|
|
225
247
|
});
|
|
226
248
|
try {
|
|
227
|
-
|
|
228
|
-
message:
|
|
229
|
-
}),
|
|
249
|
+
c(!0), await Z.postReportDisposal({ data: s }), m.add({
|
|
250
|
+
message: a("Success, disposal report has been submitted.")
|
|
251
|
+
}), _();
|
|
252
|
+
} catch (e) {
|
|
253
|
+
console.error(e), m.add({
|
|
254
|
+
error: e,
|
|
255
|
+
message: a("Error, failed to submit disposal report.")
|
|
256
|
+
});
|
|
257
|
+
} finally {
|
|
258
|
+
c(!1);
|
|
259
|
+
}
|
|
260
|
+
}, F = async (s) => {
|
|
261
|
+
try {
|
|
262
|
+
c(!0);
|
|
263
|
+
const e = s.map((t) => {
|
|
264
|
+
var o, r, i, R, S, A;
|
|
265
|
+
return p.value.set(t.asset ?? "", {
|
|
266
|
+
notes: null,
|
|
267
|
+
reason: ["Damaged", "Missing"].includes(t.status) ? t.status : u.reason
|
|
268
|
+
}), {
|
|
269
|
+
...t,
|
|
270
|
+
reportId: t._id,
|
|
271
|
+
_id: t.asset,
|
|
272
|
+
name: t.assetName,
|
|
273
|
+
assetImage: t.assetImage ?? t.damageImage,
|
|
274
|
+
brand: t.assetBrand,
|
|
275
|
+
model: t.assetModel,
|
|
276
|
+
rfid: !1,
|
|
277
|
+
qr: !1,
|
|
278
|
+
transactions: null,
|
|
279
|
+
manager: null,
|
|
280
|
+
licenseStatuses: null,
|
|
281
|
+
category: {
|
|
282
|
+
_id: (o = t.category) == null ? void 0 : o._id,
|
|
283
|
+
name: (r = t.category) == null ? void 0 : r.name,
|
|
284
|
+
key: (i = t.category) == null ? void 0 : i.key
|
|
285
|
+
},
|
|
286
|
+
group: {
|
|
287
|
+
_id: (R = t.assetGroup) == null ? void 0 : R._id,
|
|
288
|
+
name: (S = t.assetGroup) == null ? void 0 : S.name,
|
|
289
|
+
key: (A = t.assetGroup) == null ? void 0 : A.key
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
});
|
|
293
|
+
n.value = n.value.concat(e);
|
|
230
294
|
} catch (e) {
|
|
231
|
-
console.error(e),
|
|
295
|
+
console.error(e), m.add({
|
|
232
296
|
error: e,
|
|
233
|
-
message:
|
|
297
|
+
message: "Error, failed to add asset.",
|
|
298
|
+
severity: "error"
|
|
234
299
|
});
|
|
235
300
|
} finally {
|
|
236
|
-
|
|
301
|
+
c(!1);
|
|
237
302
|
}
|
|
303
|
+
}, q = async (s) => {
|
|
304
|
+
var r;
|
|
305
|
+
const e = JSON.stringify(
|
|
306
|
+
((r = n.value) == null ? void 0 : r.map((i) => i.reportId)) ?? []
|
|
307
|
+
), t = {
|
|
308
|
+
excludeId: e,
|
|
309
|
+
excludeIds: e,
|
|
310
|
+
status: '["Damaged", "Reported Disposal", "On Disposal Process"]',
|
|
311
|
+
...s
|
|
312
|
+
}, { data: o } = await B.getDamageReportList(t);
|
|
313
|
+
return o;
|
|
314
|
+
}, U = async (s) => {
|
|
315
|
+
var r;
|
|
316
|
+
const e = JSON.stringify(
|
|
317
|
+
((r = n.value) == null ? void 0 : r.map((i) => i.reportId)) ?? []
|
|
318
|
+
), t = {
|
|
319
|
+
excludeId: e,
|
|
320
|
+
excludeIds: e,
|
|
321
|
+
status: '["Missing", "Reported Disposal", "On Disposal Process"]',
|
|
322
|
+
...s
|
|
323
|
+
}, { data: o } = await O.getData(t);
|
|
324
|
+
return o;
|
|
325
|
+
}, G = async (s) => {
|
|
326
|
+
var r;
|
|
327
|
+
const e = JSON.stringify(
|
|
328
|
+
((r = n.value) == null ? void 0 : r.map((i) => i.reportId)) ?? []
|
|
329
|
+
), t = {
|
|
330
|
+
excludeId: e,
|
|
331
|
+
excludeIds: e,
|
|
332
|
+
status: '["Missing", "Reported Disposal", "On Disposal Process"]',
|
|
333
|
+
reportedByOptions: "true",
|
|
334
|
+
[s]: !0
|
|
335
|
+
}, { data: o } = await O.getDataOptions(t);
|
|
336
|
+
return o.data[s] ?? [];
|
|
337
|
+
}, J = async (s) => {
|
|
338
|
+
var r;
|
|
339
|
+
const e = JSON.stringify(
|
|
340
|
+
((r = n.value) == null ? void 0 : r.map((i) => i.reportId)) ?? []
|
|
341
|
+
), t = {
|
|
342
|
+
excludeId: e,
|
|
343
|
+
excludeIds: e,
|
|
344
|
+
status: '["Missing", "Reported Disposal", "On Disposal Process"]',
|
|
345
|
+
reportedByOptions: "true",
|
|
346
|
+
[s]: !0
|
|
347
|
+
}, { data: o } = await B.getDamageReportListFilterOptions(t);
|
|
348
|
+
return o.data[s] ?? [];
|
|
238
349
|
};
|
|
239
|
-
return (
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
"assets-to-report":
|
|
244
|
-
"onUpdate:assetsToReport": e[0] || (e[0] = (t) =>
|
|
245
|
-
"selected-data":
|
|
246
|
-
"onUpdate:selectedData": e[1] || (e[1] = (t) =>
|
|
247
|
-
onNoted:
|
|
248
|
-
onRemoved: e[2] || (e[2] = (t) =>
|
|
350
|
+
return (s, e) => (H(), j(K, null, [
|
|
351
|
+
g("div", ue, [
|
|
352
|
+
g("div", me, [
|
|
353
|
+
l(ie, {
|
|
354
|
+
"assets-to-report": n.value,
|
|
355
|
+
"onUpdate:assetsToReport": e[0] || (e[0] = (t) => n.value = t),
|
|
356
|
+
"selected-data": x.value,
|
|
357
|
+
"onUpdate:selectedData": e[1] || (e[1] = (t) => x.value = t),
|
|
358
|
+
onNoted: P,
|
|
359
|
+
onRemoved: e[2] || (e[2] = (t) => I(t)),
|
|
249
360
|
"table-name": "disposal-report-page-table"
|
|
250
361
|
}, null, 8, ["assets-to-report", "selected-data"]),
|
|
251
|
-
|
|
362
|
+
l(oe, {
|
|
252
363
|
class: "ml-auto",
|
|
253
364
|
"table-name": "disposal-report-page-table"
|
|
254
365
|
}),
|
|
255
|
-
|
|
366
|
+
l(ae, { "table-name": "disposal-report-page-table" }),
|
|
367
|
+
l(w, {
|
|
368
|
+
onClick: e[3] || (e[3] = (t) => y.value = !0),
|
|
369
|
+
icon: "add",
|
|
370
|
+
label: "Asset"
|
|
371
|
+
})
|
|
256
372
|
]),
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
a(K, P(o.$props, {
|
|
262
|
-
columns: C,
|
|
263
|
-
data: r.value,
|
|
373
|
+
l(pe, { "table-name": "disposal-report-page-table" }),
|
|
374
|
+
l(re, Q(s.$props, {
|
|
375
|
+
columns: k,
|
|
376
|
+
data: n.value,
|
|
264
377
|
lazy: !1,
|
|
265
|
-
options:
|
|
378
|
+
options: N,
|
|
266
379
|
rows: 10,
|
|
267
|
-
onToggleOption: e[
|
|
380
|
+
onToggleOption: e[4] || (e[4] = (t) => h.value = t),
|
|
268
381
|
"data-key": "_id",
|
|
269
382
|
"rounded-header": "",
|
|
270
383
|
"selection-type": "checkbox",
|
|
@@ -273,41 +386,48 @@ const Y = {
|
|
|
273
386
|
"use-paginator": ""
|
|
274
387
|
}), null, 16, ["data"])
|
|
275
388
|
]),
|
|
276
|
-
|
|
277
|
-
visible:
|
|
278
|
-
"onUpdate:visible": e[
|
|
279
|
-
|
|
280
|
-
"
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
389
|
+
l(de, {
|
|
390
|
+
visible: y.value,
|
|
391
|
+
"onUpdate:visible": e[5] || (e[5] = (t) => y.value = t),
|
|
392
|
+
"fetch-function": u.from === "damage" ? q : U,
|
|
393
|
+
"fetch-option-function": u.from === "damage" ? J : G,
|
|
394
|
+
onSelect: F
|
|
395
|
+
}, null, 8, ["visible", "fetch-function", "fetch-option-function"]),
|
|
396
|
+
l(M, {
|
|
397
|
+
visible: v.value,
|
|
398
|
+
"onUpdate:visible": e[6] || (e[6] = (t) => v.value = t),
|
|
399
|
+
body: d(a)("Are you sure you want to remove it?"),
|
|
400
|
+
"confirm-label": d(a)("Remove"),
|
|
401
|
+
header: d(a)("Remove from List"),
|
|
402
|
+
lists: [h.value],
|
|
403
|
+
onConfirm: e[7] || (e[7] = (t) => I([h.value])),
|
|
284
404
|
"list-label": "name.nameWithSequence",
|
|
285
405
|
severity: "danger"
|
|
286
406
|
}, null, 8, ["visible", "body", "confirm-label", "header", "lists"]),
|
|
287
|
-
|
|
288
|
-
visible:
|
|
289
|
-
"onUpdate:visible": e[
|
|
290
|
-
"confirm-label":
|
|
291
|
-
header:
|
|
292
|
-
onConfirm:
|
|
407
|
+
l(M, {
|
|
408
|
+
visible: b.value,
|
|
409
|
+
"onUpdate:visible": e[8] || (e[8] = (t) => b.value = t),
|
|
410
|
+
"confirm-label": d(a)("Continue"),
|
|
411
|
+
header: d(a)("Cancel Report"),
|
|
412
|
+
onConfirm: _,
|
|
293
413
|
severity: "danger"
|
|
294
414
|
}, {
|
|
295
|
-
body:
|
|
296
|
-
|
|
297
|
-
|
|
415
|
+
body: X(() => [
|
|
416
|
+
g("p", null, C(d(a)("This action will cancel the disposal report.")), 1),
|
|
417
|
+
g("p", null, C(d(a)("Are you sure you want to continue?")), 1)
|
|
298
418
|
]),
|
|
299
419
|
_: 1
|
|
300
420
|
}, 8, ["visible", "confirm-label", "header"]),
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
label:
|
|
304
|
-
onClick: e[
|
|
421
|
+
g("div", ce, [
|
|
422
|
+
l(w, {
|
|
423
|
+
label: d(a)("Cancel"),
|
|
424
|
+
onClick: e[9] || (e[9] = (t) => b.value = !0),
|
|
305
425
|
severity: "dark",
|
|
306
426
|
text: ""
|
|
307
427
|
}, null, 8, ["label"]),
|
|
308
|
-
|
|
309
|
-
label:
|
|
310
|
-
onClick:
|
|
428
|
+
l(w, {
|
|
429
|
+
label: d(a)("Submit"),
|
|
430
|
+
onClick: L,
|
|
311
431
|
severity: "success"
|
|
312
432
|
}, null, 8, ["label"])
|
|
313
433
|
])
|
|
@@ -315,5 +435,5 @@ const Y = {
|
|
|
315
435
|
}
|
|
316
436
|
});
|
|
317
437
|
export {
|
|
318
|
-
|
|
438
|
+
Me as _
|
|
319
439
|
};
|
|
@@ -1,68 +1,40 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { u as k } from "../utils/toast.util.es.js";
|
|
6
|
-
import { _ as v } from "../filtercontainer/index.es.js";
|
|
7
|
-
const x = /* @__PURE__ */ y({
|
|
1
|
+
import { defineComponent as t, shallowRef as o, createBlock as p, openBlock as r } from "vue";
|
|
2
|
+
import { u as s } from "../plugins/basei18n.es.js";
|
|
3
|
+
import { _ as m } from "../filtercontainer/index.es.js";
|
|
4
|
+
const u = /* @__PURE__ */ t({
|
|
8
5
|
__name: "DisposalReportTableFilter",
|
|
9
6
|
props: {
|
|
10
|
-
assets: {},
|
|
11
7
|
tableName: {}
|
|
12
8
|
},
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
9
|
+
setup(n) {
|
|
10
|
+
const { t: e } = s(), l = o([
|
|
15
11
|
{
|
|
16
12
|
label: e("Name"),
|
|
17
13
|
placeholder: e("Select asset name"),
|
|
18
|
-
field: "name.
|
|
19
|
-
type: "multiselect"
|
|
20
|
-
fetchOptionFn: async () => s("nameOptions")
|
|
14
|
+
field: "name.name",
|
|
15
|
+
type: "multiselect"
|
|
21
16
|
},
|
|
22
17
|
{
|
|
23
18
|
label: e("Brand"),
|
|
24
19
|
placeholder: e("Select brand"),
|
|
25
|
-
field: "brand.
|
|
26
|
-
type: "multiselect"
|
|
27
|
-
fetchOptionFn: async () => s("brandOptions")
|
|
20
|
+
field: "brand.name",
|
|
21
|
+
type: "multiselect"
|
|
28
22
|
},
|
|
29
23
|
{
|
|
30
24
|
label: e("Model/Type"),
|
|
31
25
|
placeholder: e("Select model/type"),
|
|
32
|
-
field: "model.
|
|
33
|
-
type: "multiselect"
|
|
34
|
-
fetchOptionFn: async () => s("modelOptions")
|
|
26
|
+
field: "model.name",
|
|
27
|
+
type: "multiselect"
|
|
35
28
|
},
|
|
36
29
|
{
|
|
37
30
|
label: e("Group"),
|
|
38
31
|
field: "group.key",
|
|
39
32
|
type: "group"
|
|
40
33
|
}
|
|
41
|
-
])
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
try {
|
|
46
|
-
n.value[t] = !0;
|
|
47
|
-
const a = o.assets.map((u) => u._id ?? "");
|
|
48
|
-
m.value = a.length;
|
|
49
|
-
const d = {
|
|
50
|
-
_id: JSON.stringify(a),
|
|
51
|
-
[t]: !0
|
|
52
|
-
}, { data: f } = await _.getAllAssetsOptions(d);
|
|
53
|
-
return (l = f.data) == null ? void 0 : l[t];
|
|
54
|
-
} catch (a) {
|
|
55
|
-
return console.error(a), c.add({
|
|
56
|
-
error: a,
|
|
57
|
-
message: "Error, failed to get filter option."
|
|
58
|
-
}), [];
|
|
59
|
-
} finally {
|
|
60
|
-
n.value[t] = !1;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
return (t, l) => (h(), b(v, {
|
|
64
|
-
fields: i.value,
|
|
65
|
-
"table-name": t.tableName,
|
|
34
|
+
]);
|
|
35
|
+
return (a, c) => (r(), p(m, {
|
|
36
|
+
fields: l.value,
|
|
37
|
+
"table-name": a.tableName,
|
|
66
38
|
class: "!gap-x-3 !gap-y-4 !p-3",
|
|
67
39
|
"data-ts-name": "diposalreportfilter",
|
|
68
40
|
static: ""
|
|
@@ -70,5 +42,5 @@ const x = /* @__PURE__ */ y({
|
|
|
70
42
|
}
|
|
71
43
|
});
|
|
72
44
|
export {
|
|
73
|
-
|
|
45
|
+
u as _
|
|
74
46
|
};
|
package/icon/index.d.ts
CHANGED