xyvcard-itsm-flow 0.0.12 → 0.0.14

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.
@@ -0,0 +1,517 @@
1
+ import { defineComponent as Z, mergeModels as ee, ref as m, useModel as le, resolveComponent as d, createElementBlock as A, openBlock as k, Fragment as O, createVNode as e, withCtx as l, createElementVNode as s, createTextVNode as u, toDisplayString as i, unref as b, createBlock as $, createCommentVNode as V, renderList as te } from "vue";
2
+ import "element-plus";
3
+ import { D as F, i as I, C as y, u as ae, a as oe } from "./index-CMpeLVvR.mjs";
4
+ import { fileApi as ne } from "jmash-core";
5
+ import { useI18n as se } from "vue-i18n";
6
+ import { F as ue } from "./FileSaver.min-5d27MsC6.mjs";
7
+ import { E as j } from "./el-message-DweX1k3E.mjs";
8
+ const ve = /* @__PURE__ */ Z({
9
+ __name: "index",
10
+ props: /* @__PURE__ */ ee({
11
+ task: {
12
+ type: Object,
13
+ default: () => {
14
+ }
15
+ }
16
+ }, {
17
+ modelValue: {},
18
+ modelModifiers: {}
19
+ }),
20
+ emits: ["update:modelValue"],
21
+ setup(E, { expose: B }) {
22
+ const { t: N } = se();
23
+ async function P(t) {
24
+ try {
25
+ const a = ne.fileUrl(t.filePath), n = await (await fetch(a)).blob(), r = window.URL.createObjectURL(n), v = document.createElement("a");
26
+ v.href = r, v.download = t.fileName || "download", document.body.appendChild(v), v.click();
27
+ } catch {
28
+ }
29
+ }
30
+ const S = () => {
31
+ I.exportFilePdf({ acceptanceId: D.value.acceptanceId }).then((t) => {
32
+ const a = new Blob([t.data], {
33
+ type: "application/octet-stream"
34
+ });
35
+ ue.saveAs(a, N("itsmFlowAcceptance.name") + ".pdf");
36
+ });
37
+ };
38
+ F.orgIdBizDict.useValues();
39
+ const f = E, D = m({
40
+ acceptanceId: f.task.businessKey
41
+ }), c = m({}), _ = le(E, "modelValue"), L = m(), K = m({}), h = m(!1), M = m(), p = m([]), U = m();
42
+ function R() {
43
+ h.value = !0, M.value.clearFileList();
44
+ }
45
+ function q(t) {
46
+ p == null || p.value.splice(t, 1);
47
+ }
48
+ function z(t) {
49
+ const a = {
50
+ fileName: t.name,
51
+ fileId: t.response.fileId
52
+ };
53
+ p == null || p.value.push(a), p.value = [...new Set(p.value)], U.value = {
54
+ requestId: Math.random() * 10 + "",
55
+ taskId: f.task.id,
56
+ name: t.name,
57
+ type: t.response.contentType,
58
+ url: t.response.fileSrc
59
+ }, T();
60
+ }
61
+ function T() {
62
+ oe.uploadFile(U.value).then(() => {
63
+ j.success(N("common.uploadSuccess"));
64
+ }).catch(() => {
65
+ j.error(N("common.uploadError"));
66
+ });
67
+ }
68
+ function W() {
69
+ I.findFilesList({ actionId: f.task.businessKey }).then(({ data: t }) => {
70
+ t.results.forEach((a) => {
71
+ a.filePath = a.fileSrc;
72
+ }), c.value.files = t.results;
73
+ });
74
+ }
75
+ f.task.businessKey && x(), B({
76
+ changeModel: () => G()
77
+ });
78
+ function x() {
79
+ I.findById({ acceptanceId: D.value.acceptanceId }).then(({ data: t }) => {
80
+ c.value = Object.assign(c.value, t);
81
+ }), W();
82
+ }
83
+ function G() {
84
+ return _.value && (_.value.selectActions = [
85
+ { key: "true", value: "同意" },
86
+ { key: "false", value: "不同意" }
87
+ ], _.value.varName = "approved", _.value.module = "", _.value.module = y.MODULE_ITSMFLOW), new Promise((t, a) => {
88
+ var o;
89
+ (o = L.value) == null || o.validate((n) => {
90
+ n ? (_.value && (_.value.comment = ""), t(!0)) : a(!1);
91
+ });
92
+ });
93
+ }
94
+ return (t, a) => {
95
+ const o = d("el-col"), n = d("el-form-item"), r = d("el-row"), v = d("el-table-column"), C = d("el-button"), H = d("el-table"), J = d("CircleClose"), Q = d("el-icon"), X = d("el-form"), Y = d("jmash-multi-upload");
96
+ return k(), A(O, null, [
97
+ e(o, { span: 24 }, {
98
+ default: l(() => a[1] || (a[1] = [
99
+ s("div", { class: "title" }, "山西云时代技术有限公司大数据中心分公司项目验收书", -1)
100
+ ])),
101
+ _: 1,
102
+ __: [1]
103
+ }),
104
+ e(X, {
105
+ ref_key: "taskFormRef",
106
+ ref: L,
107
+ model: K.value,
108
+ "label-width": "150px",
109
+ class: "custom-table-form"
110
+ }, {
111
+ default: l(() => [
112
+ e(r, null, {
113
+ default: l(() => [
114
+ e(o, { span: 24 }, {
115
+ default: l(() => [
116
+ e(n, {
117
+ label: t.$t("itsmFlowAcceptance.contractName"),
118
+ prop: "contractName"
119
+ }, {
120
+ default: l(() => [
121
+ u(i(c.value.contractName), 1)
122
+ ]),
123
+ _: 1
124
+ }, 8, ["label"])
125
+ ]),
126
+ _: 1
127
+ })
128
+ ]),
129
+ _: 1
130
+ }),
131
+ e(r, null, {
132
+ default: l(() => [
133
+ e(o, { span: 24 }, {
134
+ default: l(() => [
135
+ e(n, {
136
+ label: t.$t("itsmFlowAcceptance.contractNo"),
137
+ prop: "contractNo"
138
+ }, {
139
+ default: l(() => [
140
+ u(i(c.value.contractNo), 1)
141
+ ]),
142
+ _: 1
143
+ }, 8, ["label"])
144
+ ]),
145
+ _: 1
146
+ })
147
+ ]),
148
+ _: 1
149
+ }),
150
+ e(r, null, {
151
+ default: l(() => [
152
+ e(o, { span: 24 }, {
153
+ default: l(() => [
154
+ e(n, {
155
+ label: t.$t("itsmFlowAcceptance.orderId"),
156
+ prop: "orderNo"
157
+ }, {
158
+ default: l(() => [
159
+ u(i(c.value.orderNo), 1)
160
+ ]),
161
+ _: 1
162
+ }, 8, ["label"])
163
+ ]),
164
+ _: 1
165
+ })
166
+ ]),
167
+ _: 1
168
+ }),
169
+ e(r, null, {
170
+ default: l(() => [
171
+ e(o, { span: 24 }, {
172
+ default: l(() => [
173
+ e(n, {
174
+ label: t.$t("itsmFlowAcceptance.entrustName"),
175
+ prop: "entrustName"
176
+ }, {
177
+ default: l(() => [
178
+ u(i(b(F).projectNameDict.getDictValue(c.value.entrustName)), 1)
179
+ ]),
180
+ _: 1
181
+ }, 8, ["label"])
182
+ ]),
183
+ _: 1
184
+ })
185
+ ]),
186
+ _: 1
187
+ }),
188
+ e(r, null, {
189
+ default: l(() => [
190
+ e(o, { span: 12 }, {
191
+ default: l(() => [
192
+ e(n, {
193
+ label: t.$t("itsmFlowAcceptance.serviceOrg"),
194
+ prop: "serviceOrg"
195
+ }, {
196
+ default: l(() => [
197
+ u(i(b(F).orgIdBizDict.getValue(c.value.serviceOrg)), 1)
198
+ ]),
199
+ _: 1
200
+ }, 8, ["label"])
201
+ ]),
202
+ _: 1
203
+ }),
204
+ e(o, { span: 12 }, {
205
+ default: l(() => [
206
+ e(n, {
207
+ label: t.$t("itsmFlowAcceptance.stage"),
208
+ prop: "stage"
209
+ }, {
210
+ default: l(() => [
211
+ u(i(c.value.stage), 1)
212
+ ]),
213
+ _: 1
214
+ }, 8, ["label"])
215
+ ]),
216
+ _: 1
217
+ }),
218
+ e(o, { span: 12 }, {
219
+ default: l(() => [
220
+ e(n, {
221
+ label: t.$t("itsmFlowAcceptance.headman"),
222
+ prop: "headmanName"
223
+ }, {
224
+ default: l(() => [
225
+ u(i(c.value.headmanName), 1)
226
+ ]),
227
+ _: 1
228
+ }, 8, ["label"])
229
+ ]),
230
+ _: 1
231
+ }),
232
+ e(o, { span: 12 }, {
233
+ default: l(() => [
234
+ e(n, {
235
+ label: t.$t("itsmFlowAcceptance.members"),
236
+ prop: "membersName"
237
+ }, {
238
+ default: l(() => [
239
+ u(i(c.value.membersName), 1)
240
+ ]),
241
+ _: 1
242
+ }, 8, ["label"])
243
+ ]),
244
+ _: 1
245
+ })
246
+ ]),
247
+ _: 1
248
+ }),
249
+ e(r, null, {
250
+ default: l(() => [
251
+ e(o, { span: 24 }, {
252
+ default: l(() => [
253
+ e(n, {
254
+ label: t.$t("itsmFlowAcceptance.files"),
255
+ prop: "files"
256
+ }, {
257
+ default: l(() => [
258
+ e(H, {
259
+ data: c.value.files,
260
+ border: ""
261
+ }, {
262
+ default: l(() => [
263
+ e(v, {
264
+ prop: "fileName",
265
+ label: "附件名称"
266
+ }),
267
+ e(v, {
268
+ prop: "",
269
+ label: "操作",
270
+ width: "100"
271
+ }, {
272
+ default: l((w) => [
273
+ e(C, {
274
+ type: "primary",
275
+ link: "",
276
+ size: "small",
277
+ onClick: (g) => P(w.row)
278
+ }, {
279
+ default: l(() => a[2] || (a[2] = [
280
+ u(" 查看 ")
281
+ ])),
282
+ _: 2,
283
+ __: [2]
284
+ }, 1032, ["onClick"])
285
+ ]),
286
+ _: 1
287
+ })
288
+ ]),
289
+ _: 1
290
+ }, 8, ["data"])
291
+ ]),
292
+ _: 1
293
+ }, 8, ["label"])
294
+ ]),
295
+ _: 1
296
+ })
297
+ ]),
298
+ _: 1
299
+ }),
300
+ e(r, null, {
301
+ default: l(() => [
302
+ e(o, { span: 24 }, {
303
+ default: l(() => [
304
+ e(n, {
305
+ label: t.$t("itsmFlowAcceptance.serviceContent"),
306
+ prop: "serviceContent"
307
+ }, {
308
+ default: l(() => [
309
+ u(i(c.value.serviceContent), 1)
310
+ ]),
311
+ _: 1
312
+ }, 8, ["label"])
313
+ ]),
314
+ _: 1
315
+ })
316
+ ]),
317
+ _: 1
318
+ }),
319
+ e(r, null, {
320
+ default: l(() => [
321
+ f.task.taskDefinitionKey !== b(y).node.sign ? (k(), $(o, {
322
+ key: 0,
323
+ span: 24
324
+ }, {
325
+ default: l(() => [
326
+ e(n, {
327
+ label: t.$t("itsmFlowAcceptance.result"),
328
+ prop: "result"
329
+ }, {
330
+ default: l(() => [
331
+ u(i(b(F).isValuesDict.getValue(c.value.result)), 1)
332
+ ]),
333
+ _: 1
334
+ }, 8, ["label"])
335
+ ]),
336
+ _: 1
337
+ })) : V("", !0)
338
+ ]),
339
+ _: 1
340
+ }),
341
+ e(r, null, {
342
+ default: l(() => [
343
+ e(o, { span: 24 }, {
344
+ default: l(() => [
345
+ e(n, {
346
+ label: t.$t("itsmFlowAcceptance.acceptanceNo"),
347
+ prop: "acceptanceNo"
348
+ }, {
349
+ default: l(() => [
350
+ u(i(c.value.acceptanceNo), 1)
351
+ ]),
352
+ _: 1
353
+ }, 8, ["label"])
354
+ ]),
355
+ _: 1
356
+ })
357
+ ]),
358
+ _: 1
359
+ }),
360
+ e(r, null, {
361
+ default: l(() => [
362
+ e(o, { span: 24 }, {
363
+ default: l(() => [
364
+ e(n, {
365
+ label: t.$t("itsmFlowAcceptance.evaluate"),
366
+ prop: "evaluate"
367
+ }, {
368
+ default: l(() => [
369
+ u(i(c.value.evaluate), 1)
370
+ ]),
371
+ _: 1
372
+ }, 8, ["label"])
373
+ ]),
374
+ _: 1
375
+ })
376
+ ]),
377
+ _: 1
378
+ }),
379
+ e(r, { class: "bordered-row" }, {
380
+ default: l(() => [
381
+ e(o, { span: 12 }, {
382
+ default: l(() => a[3] || (a[3] = [
383
+ s("div", { class: "content-box" }, [
384
+ s("div", { class: "content-box-top" }, [
385
+ s("div", null, "甲方单位(盖章)"),
386
+ s("div", null, "负责人(签字):"),
387
+ s("div", null, "或授权代理人(签字):")
388
+ ]),
389
+ s("div", { class: "content-box-bottom" }, [
390
+ u(" 日期: "),
391
+ s("span", null, "年"),
392
+ s("span", null, "月"),
393
+ s("span", null, "日")
394
+ ])
395
+ ], -1)
396
+ ])),
397
+ _: 1,
398
+ __: [3]
399
+ }),
400
+ e(o, {
401
+ span: 12,
402
+ class: "with-divider"
403
+ }, {
404
+ default: l(() => a[4] || (a[4] = [
405
+ s("div", { class: "content-box" }, [
406
+ s("div", { class: "content-box-top" }, [
407
+ s("div", null, "服务人员所属单位(盖章)"),
408
+ s("div", null, "法定代表人(签字):"),
409
+ s("div", null, "或授权代理人(签字):")
410
+ ]),
411
+ s("div", { class: "content-box-bottom" }, [
412
+ u(" 日期: "),
413
+ s("span", null, "年"),
414
+ s("span", null, "月"),
415
+ s("span", null, "日")
416
+ ])
417
+ ], -1)
418
+ ])),
419
+ _: 1,
420
+ __: [4]
421
+ })
422
+ ]),
423
+ _: 1
424
+ }),
425
+ e(r, null, {
426
+ default: l(() => [
427
+ f.task.taskDefinitionKey === b(y).node.upload ? (k(), $(o, {
428
+ key: 0,
429
+ span: 12
430
+ }, {
431
+ default: l(() => [
432
+ e(n, {
433
+ label: t.$t("itsmFlowEntrust.scannedCopy")
434
+ }, {
435
+ default: l(() => [
436
+ e(C, {
437
+ type: "primary",
438
+ icon: b(ae),
439
+ onClick: R
440
+ }, {
441
+ default: l(() => [
442
+ u(i(t.$t("common.uploadFiles")), 1)
443
+ ]),
444
+ _: 1
445
+ }, 8, ["icon"])
446
+ ]),
447
+ _: 1
448
+ }, 8, ["label"]),
449
+ e(n, null, {
450
+ default: l(() => [
451
+ (k(!0), A(O, null, te(p.value, (w, g) => (k(), A("div", {
452
+ key: g,
453
+ class: "files-list"
454
+ }, [
455
+ u(i(w.fileName) + " ", 1),
456
+ e(Q, {
457
+ size: "16",
458
+ class: "icon-right",
459
+ onClick: (ce) => q(g)
460
+ }, {
461
+ default: l(() => [
462
+ e(J)
463
+ ]),
464
+ _: 2
465
+ }, 1032, ["onClick"])
466
+ ]))), 128))
467
+ ]),
468
+ _: 1
469
+ })
470
+ ]),
471
+ _: 1
472
+ })) : V("", !0),
473
+ f.task.taskDefinitionKey === b(y).node.upload ? (k(), $(o, {
474
+ key: 1,
475
+ span: 12
476
+ }, {
477
+ default: l(() => [
478
+ e(n, {
479
+ label: t.$t("itsmFlowEntrust.export")
480
+ }, {
481
+ default: l(() => [
482
+ e(C, {
483
+ plain: "",
484
+ type: "primary",
485
+ onClick: S
486
+ }, {
487
+ default: l(() => [
488
+ u(i(t.$t("itsmFlowEntrust.export")), 1)
489
+ ]),
490
+ _: 1
491
+ })
492
+ ]),
493
+ _: 1
494
+ }, 8, ["label"])
495
+ ]),
496
+ _: 1
497
+ })) : V("", !0)
498
+ ]),
499
+ _: 1
500
+ })
501
+ ]),
502
+ _: 1
503
+ }, 8, ["model"]),
504
+ e(Y, {
505
+ ref_key: "uploadRef",
506
+ ref: M,
507
+ modelValue: h.value,
508
+ "onUpdate:modelValue": a[0] || (a[0] = (w) => h.value = w),
509
+ onUploadFileList: z
510
+ }, null, 8, ["modelValue"])
511
+ ], 64);
512
+ };
513
+ }
514
+ });
515
+ export {
516
+ ve as default
517
+ };