sooyie-task 0.0.14 → 0.0.16

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 "./add.vue_vue_type_script_setup_true_lang-DTf6YjPZ.mjs";
1
+ import { _ as f } from "./add.vue_vue_type_script_setup_true_lang-CiPF4LEJ.mjs";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -0,0 +1,379 @@
1
+ import { defineComponent as ae, mergeModels as oe, ref as $, reactive as j, useModel as se, computed as h, watch as ne, resolveComponent as p, createBlock as m, openBlock as d, withCtx as n, createVNode as c, unref as v, createElementBlock as U, Fragment as C, renderList as O, createElementVNode as f, toDisplayString as _, createCommentVNode as ue, createTextVNode as S } from "vue";
2
+ import { ElMessage as re } from "element-plus";
3
+ import { useI18n as de } from "vue-i18n";
4
+ import { D as b, O as F, U as P, C as R } from "./index-D0yGxoUN.mjs";
5
+ import { useUserStore as x, clearEmpty as z, request as w } from "jmash-core";
6
+ import { d as ce, p as ie } from "./index-DaJ5KrbS.mjs";
7
+ import { useRoute as me } from "vue-router";
8
+ import { _ as fe } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
9
+ class pe {
10
+ getKey() {
11
+ return {};
12
+ }
13
+ // 任务定义查询接口
14
+ findTaskRelById(u) {
15
+ const i = x().user.tenant;
16
+ return z(u), w({
17
+ url: "/v1/front/task/sooyie/task_define_rel/id/" + i + "/" + (u == null ? void 0 : u.taskDefineId),
18
+ method: "get",
19
+ params: u
20
+ });
21
+ }
22
+ // 删除任务关系
23
+ deleteTaskRelById(u) {
24
+ return u.tenant = x().user.tenant, z(u), w({
25
+ url: "/v1/front/task/sooyie/task_define_rel/id",
26
+ method: "delete",
27
+ params: u
28
+ });
29
+ }
30
+ //创建任务关系
31
+ addTaskRel(u) {
32
+ return u.tenant = x().user.tenant, z(u), w({
33
+ url: "/v1/front/task/sooyie/task_define_rel",
34
+ method: "post",
35
+ data: u
36
+ });
37
+ }
38
+ }
39
+ const _e = new pe(), ve = { class: "flex justify-between items-center w-full" }, ke = { style: { color: "#8492a6", "font-size": "12px" } }, ye = { class: "flex justify-between items-center w-full" }, Ie = { style: { color: "#8492a6", "font-size": "12px" } }, be = { class: "flex justify-between items-center w-full" }, ge = { style: { color: "#8492a6", "font-size": "12px" } }, Ve = { class: "dialog-footer" }, De = /* @__PURE__ */ ae({
40
+ __name: "add",
41
+ props: {
42
+ modelValue: { type: Boolean },
43
+ modelModifiers: {}
44
+ },
45
+ emits: /* @__PURE__ */ oe(["refresh"], ["update:modelValue"]),
46
+ setup(M, { emit: u }) {
47
+ b.itemBizLayDict.useValues();
48
+ const i = new F({ orgType: "HALL" });
49
+ i.useValues();
50
+ const g = new P({ userType: "COMPANY_MANAGER" });
51
+ g.useValues();
52
+ const V = new P({ userType: "OUTSOURCE_OPS" });
53
+ V.useValues();
54
+ const T = new F({ orgType: "OUTSOURCE" });
55
+ T.useValues();
56
+ const { t: N } = de(), D = me();
57
+ b.taskInspectTypeDict.useValues();
58
+ const A = $();
59
+ let B = j({
60
+ taskDefineId: D.query.taskDefineId
61
+ });
62
+ const G = j({}), y = se(M, "modelValue"), H = u, K = h(() => !b.itemBizLayDict.values || !i.values ? [] : b.itemBizLayDict.values.map((e) => {
63
+ const o = i.values.find(
64
+ (t) => t.key === e.orgId
65
+ );
66
+ return {
67
+ key: e.key,
68
+ name: e.value,
69
+ // 项目名称
70
+ deptName: o ? o.value : "",
71
+ // 厅局名称
72
+ label: e.value
73
+ // 搜索用的完整文本
74
+ };
75
+ })), Y = h(() => i.values.map((e) => ({
76
+ key: e.key,
77
+ label: e.value
78
+ }))), J = h(() => g.values ? g.values.map((e) => {
79
+ const o = i.values.find(
80
+ (t) => t.key === e.orgId
81
+ );
82
+ return {
83
+ key: e.key,
84
+ name: e.value,
85
+ // 人员姓名
86
+ company: o ? o.value : "",
87
+ // 公司名称
88
+ label: e.value
89
+ // 【关键】选中后输入框只显示姓名
90
+ };
91
+ }) : []), Q = h(() => V.values ? V.values.map((e) => {
92
+ const o = T.values.find(
93
+ (t) => t.key === e.orgId
94
+ );
95
+ return {
96
+ key: e.key,
97
+ name: e.value,
98
+ // 人员姓名
99
+ company: o ? o.value : "",
100
+ // 公司名称
101
+ label: e.value
102
+ // 【关键】选中后输入框只显示姓名
103
+ };
104
+ }) : []), I = $([
105
+ { customerId: "", userId: "", customerDept: "", userCompany: "" }
106
+ ]);
107
+ ne(
108
+ I,
109
+ (e) => {
110
+ const o = D.query.taskSort;
111
+ e.forEach((t) => {
112
+ if (o === R.CUSTOMER) {
113
+ const s = i.values.find((a) => a.key === t.customerId);
114
+ t.customerDept = s ? s.value : "";
115
+ } else {
116
+ const s = b.itemBizLayDict.values.find((a) => a.key === t.customerId);
117
+ if (s && s.orgId) {
118
+ const a = i.values.find((k) => k.key === s.orgId);
119
+ t.customerDept = a ? a.value : "";
120
+ } else
121
+ t.customerDept = "";
122
+ }
123
+ if (o === R.CUSTOMER) {
124
+ const s = g.values.find((a) => a.key === t.userId);
125
+ if (s && s.orgId) {
126
+ const a = i.values.find((k) => k.key === s.orgId);
127
+ t.userCompany = a ? a.value : "";
128
+ }
129
+ } else {
130
+ const s = V.values.find((a) => a.key === t.userId);
131
+ if (s && s.orgId) {
132
+ const a = T.values.find((k) => k.key === s.orgId);
133
+ t.userCompany = a ? a.value : "";
134
+ }
135
+ }
136
+ });
137
+ },
138
+ { deep: !0 }
139
+ );
140
+ function W() {
141
+ I.value.push({
142
+ customerId: "",
143
+ userId: "",
144
+ customerDept: "",
145
+ userCompany: ""
146
+ });
147
+ }
148
+ function X(e) {
149
+ const o = I.value.indexOf(e.row);
150
+ o !== 0 && I.value.splice(o, 1);
151
+ }
152
+ const Z = async () => {
153
+ var e;
154
+ await ((e = A.value) == null ? void 0 : e.validate((o) => {
155
+ o && (B.taskDefineRel = I.value.map((t) => ({
156
+ customerId: t.customerId,
157
+ userId: t.userId
158
+ })), _e.addTaskRel(B).then((t) => {
159
+ t.status === 200 && (re({ message: N("common.submitSuccess"), type: "success" }), y.value && (y.value = !1), H("refresh", t.status === 200));
160
+ }));
161
+ }));
162
+ };
163
+ function L() {
164
+ y.value && (y.value = !1);
165
+ }
166
+ return (e, o) => {
167
+ const t = p("el-table-column"), s = p("el-option"), a = p("el-select"), k = p("el-icon"), q = p("el-table"), E = p("el-button"), ee = p("el-row"), le = p("el-form"), te = p("el-dialog");
168
+ return d(), m(te, {
169
+ modelValue: y.value,
170
+ "onUpdate:modelValue": o[0] || (o[0] = (r) => y.value = r),
171
+ "close-on-click-modal": !1,
172
+ "close-on-press-escape": !1,
173
+ onClose: L
174
+ }, {
175
+ footer: n(() => [
176
+ f("div", Ve, [
177
+ c(E, { onClick: L }, {
178
+ default: n(() => [
179
+ S(_(e.$t("common.cancel")), 1)
180
+ ]),
181
+ _: 1
182
+ }),
183
+ c(E, {
184
+ type: "primary",
185
+ onClick: Z
186
+ }, {
187
+ default: n(() => [
188
+ S(_(e.$t("common.confirm")), 1)
189
+ ]),
190
+ _: 1
191
+ })
192
+ ])
193
+ ]),
194
+ default: n(() => [
195
+ c(le, {
196
+ ref_key: "taskDefineRelFormRef",
197
+ ref: A,
198
+ model: v(B),
199
+ "label-width": "150px",
200
+ rules: G,
201
+ class: "custom-table-form custom-form"
202
+ }, {
203
+ default: n(() => [
204
+ c(ee, null, {
205
+ default: n(() => [
206
+ c(q, {
207
+ data: I.value,
208
+ border: "",
209
+ style: { width: "100%" }
210
+ }, {
211
+ default: n(() => [
212
+ c(t, {
213
+ type: "index",
214
+ label: e.$t("taskDefine.index"),
215
+ width: "60",
216
+ align: "center"
217
+ }, null, 8, ["label"]),
218
+ c(t, {
219
+ prop: "customerId",
220
+ label: e.$t("taskDefine.customerId"),
221
+ "header-align": "center"
222
+ }, {
223
+ default: n(({ row: r }) => [
224
+ v(D).query.taskSort === v(R).CUSTOMER ? (d(), m(a, {
225
+ key: 0,
226
+ modelValue: r.customerId,
227
+ "onUpdate:modelValue": (l) => r.customerId = l,
228
+ placeholder: "请选择服务对象",
229
+ class: "w-full",
230
+ filterable: ""
231
+ }, {
232
+ default: n(() => [
233
+ (d(!0), U(C, null, O(Y.value, (l) => (d(), m(s, {
234
+ key: l.key,
235
+ label: l.label,
236
+ value: l.key
237
+ }, null, 8, ["label", "value"]))), 128))
238
+ ]),
239
+ _: 1
240
+ }, 8, ["modelValue", "onUpdate:modelValue"])) : (d(), m(a, {
241
+ key: 1,
242
+ modelValue: r.customerId,
243
+ "onUpdate:modelValue": (l) => r.customerId = l,
244
+ placeholder: "请选择服务对象",
245
+ class: "w-full",
246
+ filterable: ""
247
+ }, {
248
+ default: n(() => [
249
+ (d(!0), U(C, null, O(K.value, (l) => (d(), m(s, {
250
+ key: l.key,
251
+ label: l.label,
252
+ value: l.key
253
+ }, {
254
+ default: n(() => [
255
+ f("div", ve, [
256
+ f("span", null, _(l.name), 1),
257
+ f("span", ke, _(l.deptName), 1)
258
+ ])
259
+ ]),
260
+ _: 2
261
+ }, 1032, ["label", "value"]))), 128))
262
+ ]),
263
+ _: 1
264
+ }, 8, ["modelValue", "onUpdate:modelValue"]))
265
+ ]),
266
+ _: 1
267
+ }, 8, ["label"]),
268
+ c(t, {
269
+ prop: "userId",
270
+ label: "执行人员",
271
+ "header-align": "center"
272
+ }, {
273
+ default: n(({ row: r }) => [
274
+ v(D).query.taskSort === v(R).CUSTOMER ? (d(), m(a, {
275
+ key: 0,
276
+ modelValue: r.userId,
277
+ "onUpdate:modelValue": (l) => r.userId = l,
278
+ placeholder: "请选择执行人员",
279
+ class: "w-full",
280
+ filterable: ""
281
+ }, {
282
+ default: n(() => [
283
+ (d(!0), U(C, null, O(J.value, (l) => (d(), m(s, {
284
+ key: l.key,
285
+ label: l.label,
286
+ value: l.key
287
+ }, {
288
+ default: n(() => [
289
+ f("div", ye, [
290
+ f("span", null, _(l.name), 1),
291
+ f("span", Ie, _(l.company), 1)
292
+ ])
293
+ ]),
294
+ _: 2
295
+ }, 1032, ["label", "value"]))), 128))
296
+ ]),
297
+ _: 1
298
+ }, 8, ["modelValue", "onUpdate:modelValue"])) : (d(), m(a, {
299
+ key: 1,
300
+ modelValue: r.userId,
301
+ "onUpdate:modelValue": (l) => r.userId = l,
302
+ placeholder: "请选择执行人员",
303
+ class: "w-full",
304
+ filterable: ""
305
+ }, {
306
+ default: n(() => [
307
+ (d(!0), U(C, null, O(Q.value, (l) => (d(), m(s, {
308
+ key: l.key,
309
+ label: l.label,
310
+ value: l.key
311
+ }, {
312
+ default: n(() => [
313
+ f("div", be, [
314
+ f("span", null, _(l.name), 1),
315
+ f("span", ge, _(l.company), 1)
316
+ ])
317
+ ]),
318
+ _: 2
319
+ }, 1032, ["label", "value"]))), 128))
320
+ ]),
321
+ _: 1
322
+ }, 8, ["modelValue", "onUpdate:modelValue"]))
323
+ ]),
324
+ _: 1
325
+ }),
326
+ c(t, {
327
+ label: e.$t("common.operate"),
328
+ width: "60",
329
+ align: "center"
330
+ }, {
331
+ default: n((r) => [
332
+ r.$index !== 0 ? (d(), m(k, {
333
+ key: 0,
334
+ onClick: (l) => X(r),
335
+ size: "18",
336
+ style: { cursor: "pointer", color: "inherit" },
337
+ class: "hover-blue"
338
+ }, {
339
+ default: n(() => [
340
+ c(v(ce))
341
+ ]),
342
+ _: 1
343
+ }, 8, ["onClick"])) : ue("", !0)
344
+ ]),
345
+ _: 1
346
+ }, 8, ["label"])
347
+ ]),
348
+ _: 1
349
+ }, 8, ["data"]),
350
+ c(E, {
351
+ icon: v(ie),
352
+ class: "addButton",
353
+ onClick: W
354
+ }, {
355
+ default: n(() => [
356
+ S(_(v(N)("common.add")), 1)
357
+ ]),
358
+ _: 1
359
+ }, 8, ["icon"])
360
+ ]),
361
+ _: 1
362
+ })
363
+ ]),
364
+ _: 1
365
+ }, 8, ["model", "rules"])
366
+ ]),
367
+ _: 1
368
+ }, 8, ["modelValue"]);
369
+ };
370
+ }
371
+ }), he = /* @__PURE__ */ fe(De, [["__scopeId", "data-v-4b44d590"]]), xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
372
+ __proto__: null,
373
+ default: he
374
+ }, Symbol.toStringTag, { value: "Module" }));
375
+ export {
376
+ _e as a,
377
+ xe as b,
378
+ he as t
379
+ };