@wisemen/wise-crm-web 2.0.0-alpha.4 → 2.0.0-alpha.6
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/dist/{BusinessDetailView-DfdH3xGZ.js → BusinessDetailView-BdD672Xc.js} +2 -2
- package/dist/{CrmDetailView.vue_vue_type_script_setup_true_lang-BoCwerkk.js → CrmDetailView.vue_vue_type_script_setup_true_lang-Cl6b9lH3.js} +10 -10
- package/dist/{DealCommunicationTabView-BrreGv1K.js → DealCommunicationTabView-FzTeJrPo.js} +1 -1
- package/dist/{DealDetailView-Dt3K3j8o.js → DealDetailView-DNcPhzGL.js} +546 -552
- package/dist/{IndividualDetailView-CzBArU3i.js → IndividualDetailView-Dn5lJBjU.js} +5 -5
- package/dist/{index-uh3Ew2Yy.js → index-DhVEfWNY.js} +3209 -3299
- package/dist/index.js +12 -12
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouteParams as
|
|
3
|
-
import { useI18n as
|
|
4
|
-
import { aV as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { d as
|
|
7
|
-
import { UITextField as
|
|
8
|
-
import { useForm as
|
|
9
|
-
import
|
|
10
|
-
import { useMutation as
|
|
11
|
-
import { Motion as
|
|
12
|
-
import { useQueryClient as
|
|
13
|
-
function
|
|
14
|
-
return
|
|
1
|
+
import { defineComponent as D, ref as T, useTemplateRef as De, openBlock as m, createElementBlock as M, createBlock as g, unref as e, withCtx as s, createVNode as l, mergeProps as q, createElementVNode as k, toDisplayString as j, nextTick as Ie, computed as P, createCommentVNode as N, Fragment as Z, createTextVNode as ee, renderList as xe, useModel as Ne, mergeModels as Se } from "vue";
|
|
2
|
+
import { useRouteParams as ke } from "@vueuse/router";
|
|
3
|
+
import { useI18n as x } from "vue-i18n";
|
|
4
|
+
import { aV as ie, a$ as Fe, b1 as $e, b4 as Te } from "./uuid.util-B9bkU4IX.js";
|
|
5
|
+
import { _ as Me } from "./CrmDetailView.vue_vue_type_script_setup_true_lang-Cl6b9lH3.js";
|
|
6
|
+
import { d as F, e as L, f as Ve, E as re, g as se, h as Le, i as qe, L as Ee, j as Oe, k as K, a as Be, P as Ae, l as Qe, m as ae, n as Ke, I as je, o as ue, p as ze, q as O, r as ce, s as Re, t as Ge, U as He, v as Ye, u as Ze, w as Je, x as We, y as Xe, z as ea, B as aa, F as te, G as de, H as ta, J as ne, K as na, N as la, O as oa, Q as ia, R as ra, S as me, T as sa, V as ua, W as ca, X as da, Y as ma, Z as pa, $ as fa, a0 as _a, a1 as ga, a2 as ya, a3 as ba, a4 as va, A as ha } from "./index-DhVEfWNY.js";
|
|
7
|
+
import { UITextField as z, toFormField as E, UIIconButton as pe, UIDropdownMenu as Ua, UIDropdownMenuGroup as Ca, UIDropdownMenuItem as le, UIPhoneNumberField as oe, UIFormLayout as J, UIFormFieldGroup as B, UIFormFieldGrid as A, UIFormDialog as fe, UIDialogHeader as _e, UIDialogBody as ge, UIDialogFooter as ye, UIDialogFooterSubmit as be, createAutocompleteOptions as Pa, createSelectOptions as H, UIAutocomplete as wa, UISelect as Y, useOverlay as W, UIButton as Da, UIBadge as ve } from "@wisemen/vue-core-design-system";
|
|
8
|
+
import { useForm as R } from "formango";
|
|
9
|
+
import G, { z as S } from "zod";
|
|
10
|
+
import { useMutation as $, useQuery as he, useOffsetInfiniteQuery as Ia, useKeysetInfiniteQuery as xa } from "@wisemen/vue-core-api-utils";
|
|
11
|
+
import { Motion as Na } from "motion-v";
|
|
12
|
+
import { useQueryClient as Sa, useMutation as ka } from "@tanstack/vue-query";
|
|
13
|
+
function Fa() {
|
|
14
|
+
return $({
|
|
15
15
|
queryFn: async ({
|
|
16
16
|
body: t,
|
|
17
17
|
params: a
|
|
18
|
-
}) => await
|
|
18
|
+
}) => await F.update(a.dealUuid, {
|
|
19
19
|
dealLanguage: t.dealLanguage
|
|
20
20
|
}),
|
|
21
21
|
queryKeysToInvalidate: {
|
|
@@ -26,12 +26,12 @@ function Ea() {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
29
|
+
function $a() {
|
|
30
|
+
return $({
|
|
31
31
|
queryFn: async ({
|
|
32
32
|
body: t,
|
|
33
33
|
params: a
|
|
34
|
-
}) => await
|
|
34
|
+
}) => await F.update(a.dealUuid, {
|
|
35
35
|
dealSource: t.dealSource
|
|
36
36
|
}),
|
|
37
37
|
queryKeysToInvalidate: {
|
|
@@ -42,12 +42,12 @@ function Aa() {
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
return
|
|
45
|
+
function Ta() {
|
|
46
|
+
return $({
|
|
47
47
|
queryFn: async ({
|
|
48
48
|
body: t,
|
|
49
49
|
params: a
|
|
50
|
-
}) => await
|
|
50
|
+
}) => await F.update(a.dealUuid, {
|
|
51
51
|
dealOwner: t.dealOwner
|
|
52
52
|
}),
|
|
53
53
|
queryKeysToInvalidate: {
|
|
@@ -58,12 +58,12 @@ function Oa() {
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
return
|
|
61
|
+
function Ma() {
|
|
62
|
+
return $({
|
|
63
63
|
queryFn: async ({
|
|
64
64
|
body: t,
|
|
65
65
|
params: a
|
|
66
|
-
}) => await
|
|
66
|
+
}) => await F.update(a.dealUuid, {
|
|
67
67
|
name: t.name
|
|
68
68
|
}),
|
|
69
69
|
queryKeysToInvalidate: {
|
|
@@ -74,18 +74,18 @@ function Ba() {
|
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
const
|
|
77
|
+
const Va = {
|
|
78
78
|
key: 1,
|
|
79
79
|
class: "flex justify-between"
|
|
80
|
-
},
|
|
80
|
+
}, La = { class: "text-xl font-bold text-primary" }, qa = /* @__PURE__ */ D({
|
|
81
81
|
__name: "DealDetailSidebarNameField",
|
|
82
82
|
props: {
|
|
83
83
|
deal: {}
|
|
84
84
|
},
|
|
85
85
|
setup(t) {
|
|
86
|
-
const a = t, n =
|
|
87
|
-
schema:
|
|
88
|
-
name:
|
|
86
|
+
const a = t, n = x(), i = L(), o = T(!1), u = De("nameFieldContainerRef"), p = Ma(), f = R({
|
|
87
|
+
schema: G.object({
|
|
88
|
+
name: G.string().min(1)
|
|
89
89
|
}),
|
|
90
90
|
onSubmit: async (_) => {
|
|
91
91
|
try {
|
|
@@ -103,64 +103,64 @@ const Qa = {
|
|
|
103
103
|
o.value = !1;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
}),
|
|
107
|
-
async function
|
|
108
|
-
o.value = !0, await
|
|
106
|
+
}), d = f.register("name", a.deal.name);
|
|
107
|
+
async function c() {
|
|
108
|
+
o.value = !0, await Ie(), v();
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
|
|
110
|
+
function v() {
|
|
111
|
+
u.value?.querySelector(
|
|
112
112
|
"input"
|
|
113
113
|
)?.focus();
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function h() {
|
|
116
116
|
if (!f.isDirty.value) {
|
|
117
117
|
o.value = !1;
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
120
|
f.submit();
|
|
121
121
|
}
|
|
122
|
-
return (_, y) => (
|
|
122
|
+
return (_, y) => (m(), M("div", {
|
|
123
123
|
ref_key: "nameFieldContainerRef",
|
|
124
|
-
ref:
|
|
124
|
+
ref: u
|
|
125
125
|
}, [
|
|
126
|
-
o.value ? (
|
|
126
|
+
o.value ? (m(), g(Ve, {
|
|
127
127
|
key: 0,
|
|
128
128
|
form: e(f)
|
|
129
129
|
}, {
|
|
130
|
-
default:
|
|
131
|
-
l(e(
|
|
130
|
+
default: s(() => [
|
|
131
|
+
l(e(z), q(e(E)(e(d)), {
|
|
132
132
|
"is-loading": e(f).isSubmitting.value,
|
|
133
133
|
label: e(n).t("wise_crm.deal.detail.sidebar.name_field.label"),
|
|
134
134
|
class: "[&_input]:text-xl [&_input]:font-bold",
|
|
135
|
-
onBlur:
|
|
135
|
+
onBlur: h
|
|
136
136
|
}), null, 16, ["is-loading", "label"]),
|
|
137
|
-
y[0] || (y[0] =
|
|
137
|
+
y[0] || (y[0] = k("button", {
|
|
138
138
|
type: "submit",
|
|
139
139
|
class: "sr-only"
|
|
140
140
|
}, null, -1))
|
|
141
141
|
]),
|
|
142
142
|
_: 1
|
|
143
|
-
}, 8, ["form"])) : (
|
|
144
|
-
|
|
145
|
-
l(e(
|
|
143
|
+
}, 8, ["form"])) : (m(), M("div", Va, [
|
|
144
|
+
k("h2", La, j(a.deal.name), 1),
|
|
145
|
+
l(e(pe), {
|
|
146
146
|
label: e(n).t("wise_crm.deal.detail.sidebar.name_field.edit_label"),
|
|
147
147
|
icon: e(re),
|
|
148
148
|
variant: "tertiary",
|
|
149
149
|
class: "shrink-0",
|
|
150
|
-
onClick:
|
|
150
|
+
onClick: c
|
|
151
151
|
}, null, 8, ["label", "icon"])
|
|
152
152
|
]))
|
|
153
153
|
], 512));
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
|
-
function
|
|
157
|
-
const t =
|
|
156
|
+
function Ea() {
|
|
157
|
+
const t = Sa(), a = "dealDetail", n = ka({
|
|
158
158
|
mutationFn: async (i) => {
|
|
159
|
-
const o = await
|
|
159
|
+
const o = await F.setPrimaryContactPerson(i.dealUuid, i.contactPersonUuid);
|
|
160
160
|
if (o.isErr())
|
|
161
161
|
throw o.error;
|
|
162
162
|
},
|
|
163
|
-
onError: (i, o,
|
|
163
|
+
onError: (i, o, u) => {
|
|
164
164
|
t.setQueryData(
|
|
165
165
|
[
|
|
166
166
|
a,
|
|
@@ -168,7 +168,7 @@ function za() {
|
|
|
168
168
|
dealUuid: o.dealUuid
|
|
169
169
|
}
|
|
170
170
|
],
|
|
171
|
-
|
|
171
|
+
u?.previousData
|
|
172
172
|
);
|
|
173
173
|
},
|
|
174
174
|
onMutate: async (i) => {
|
|
@@ -195,9 +195,9 @@ function za() {
|
|
|
195
195
|
dealUuid: i.dealUuid
|
|
196
196
|
}
|
|
197
197
|
],
|
|
198
|
-
o.map((
|
|
199
|
-
...
|
|
200
|
-
contactPersons:
|
|
198
|
+
o.map((u) => ({
|
|
199
|
+
...u,
|
|
200
|
+
contactPersons: u.contactPersons.map((p) => ({
|
|
201
201
|
...p,
|
|
202
202
|
isPrimary: p.uuid === i.contactPersonUuid
|
|
203
203
|
}))
|
|
@@ -206,29 +206,29 @@ function za() {
|
|
|
206
206
|
previousData: o
|
|
207
207
|
});
|
|
208
208
|
},
|
|
209
|
-
onSettled: (i, o,
|
|
210
|
-
|
|
209
|
+
onSettled: (i, o, u) => {
|
|
210
|
+
u !== void 0 && t.invalidateQueries({
|
|
211
211
|
queryKey: [
|
|
212
212
|
a,
|
|
213
213
|
{
|
|
214
|
-
dealUuid:
|
|
214
|
+
dealUuid: u.dealUuid
|
|
215
215
|
}
|
|
216
216
|
]
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
});
|
|
220
220
|
return {
|
|
221
|
-
isLoading:
|
|
222
|
-
data:
|
|
221
|
+
isLoading: P(() => n.isPending.value),
|
|
222
|
+
data: P(() => n.data.value),
|
|
223
223
|
execute: async (i) => await n.mutateAsync(i.params)
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
return
|
|
226
|
+
function Oa() {
|
|
227
|
+
return $({
|
|
228
228
|
queryFn: async ({
|
|
229
229
|
body: t,
|
|
230
230
|
params: a
|
|
231
|
-
}) => await
|
|
231
|
+
}) => await F.unlinkContactPerson(a.dealUuid, t.contactPersonUuid),
|
|
232
232
|
queryKeysToInvalidate: {
|
|
233
233
|
dealDetail: {
|
|
234
234
|
dealUuid: (t) => t.dealUuid
|
|
@@ -237,10 +237,10 @@ function Ra() {
|
|
|
237
237
|
}
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
|
-
const
|
|
240
|
+
const Ba = { class: "flex items-start justify-between" }, Aa = { class: "flex flex-col items-start" }, Qa = {
|
|
241
241
|
key: 1,
|
|
242
|
-
class: "text-brand-700"
|
|
243
|
-
},
|
|
242
|
+
class: "mt-sm text-brand-700"
|
|
243
|
+
}, Ka = { class: "-mt-2 -mr-2 flex items-center justify-end" }, ja = { class: "grid gap-lg" }, za = /* @__PURE__ */ D({
|
|
244
244
|
__name: "CrmDetailSidebarAccordionGenericContactPersonInfo",
|
|
245
245
|
props: {
|
|
246
246
|
contactPerson: {},
|
|
@@ -249,67 +249,67 @@ const Ga = { class: "flex items-start justify-between" }, Ha = { class: "flex fl
|
|
|
249
249
|
},
|
|
250
250
|
emits: ["delete", "update"],
|
|
251
251
|
setup(t, { emit: a }) {
|
|
252
|
-
const n = t, i = a, o =
|
|
252
|
+
const n = t, i = a, o = x(), u = n.contactPerson.uuid ?? n.contactPerson.contactPersonUuid, p = {
|
|
253
253
|
left: {
|
|
254
254
|
icon: re,
|
|
255
255
|
type: "icon"
|
|
256
256
|
}
|
|
257
257
|
}, f = {
|
|
258
258
|
left: {
|
|
259
|
-
icon:
|
|
259
|
+
icon: Ee,
|
|
260
260
|
type: "icon"
|
|
261
261
|
}
|
|
262
262
|
};
|
|
263
|
-
function
|
|
263
|
+
function d() {
|
|
264
264
|
i("update");
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function c() {
|
|
267
267
|
i("delete");
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function v() {
|
|
270
270
|
n.onToggleIsPrimary();
|
|
271
271
|
}
|
|
272
|
-
return (
|
|
273
|
-
default:
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
e(
|
|
272
|
+
return (h, _) => (m(), g(se, { class: "flex flex-col gap-lg" }, {
|
|
273
|
+
default: s(() => [
|
|
274
|
+
k("div", Ba, [
|
|
275
|
+
k("div", Aa, [
|
|
276
|
+
e(u) ? (m(), g(Le, {
|
|
277
277
|
key: 0,
|
|
278
278
|
label: `${n.contactPerson.firstName} ${n.contactPerson.lastName}`,
|
|
279
|
-
"entity-type": e(
|
|
280
|
-
uuid: e(
|
|
279
|
+
"entity-type": e(ie).INDIVIDUAL,
|
|
280
|
+
uuid: e(u),
|
|
281
281
|
class: "-m-xs"
|
|
282
|
-
}, null, 8, ["label", "entity-type", "uuid"])) :
|
|
283
|
-
n.description ? (
|
|
282
|
+
}, null, 8, ["label", "entity-type", "uuid"])) : N("", !0),
|
|
283
|
+
n.description ? (m(), M("p", Qa, j(n.description), 1)) : N("", !0)
|
|
284
284
|
]),
|
|
285
|
-
|
|
286
|
-
l(
|
|
285
|
+
k("div", Ka, [
|
|
286
|
+
l(qe, {
|
|
287
287
|
"is-active": n.contactPerson.isPrimary,
|
|
288
|
-
onClick:
|
|
288
|
+
onClick: v
|
|
289
289
|
}, null, 8, ["is-active"]),
|
|
290
|
-
l(e(
|
|
291
|
-
trigger:
|
|
292
|
-
l(e(
|
|
293
|
-
icon: e(
|
|
290
|
+
l(e(Ua), { "popover-align": "end" }, {
|
|
291
|
+
trigger: s(() => [
|
|
292
|
+
l(e(pe), {
|
|
293
|
+
icon: e(Oe),
|
|
294
294
|
variant: "tertiary",
|
|
295
295
|
size: "sm",
|
|
296
296
|
label: "actionMenu"
|
|
297
297
|
}, null, 8, ["icon"])
|
|
298
298
|
]),
|
|
299
|
-
content:
|
|
300
|
-
l(e(
|
|
301
|
-
default:
|
|
302
|
-
l(e(
|
|
299
|
+
content: s(() => [
|
|
300
|
+
l(e(Ca), null, {
|
|
301
|
+
default: s(() => [
|
|
302
|
+
l(e(le), {
|
|
303
303
|
config: p,
|
|
304
304
|
label: e(o).t("wise_crm.info_dialog.sidebar.overview.update_contact_person"),
|
|
305
|
-
onSelect:
|
|
305
|
+
onSelect: d
|
|
306
306
|
}, null, 8, ["label"]),
|
|
307
|
-
l(e(
|
|
307
|
+
l(e(le), {
|
|
308
308
|
"is-destructive": !0,
|
|
309
309
|
"is-disabled": n.contactPerson.isPrimary,
|
|
310
310
|
config: f,
|
|
311
311
|
label: e(o).t("wise_crm.info_dialog.sidebar.overview.delete_contact_person"),
|
|
312
|
-
onSelect:
|
|
312
|
+
onSelect: c
|
|
313
313
|
}, null, 8, ["is-disabled", "label"])
|
|
314
314
|
]),
|
|
315
315
|
_: 1
|
|
@@ -319,34 +319,34 @@ const Ga = { class: "flex items-start justify-between" }, Ha = { class: "flex fl
|
|
|
319
319
|
})
|
|
320
320
|
])
|
|
321
321
|
]),
|
|
322
|
-
|
|
323
|
-
n.contactPerson.email !== null ? (
|
|
322
|
+
k("div", ja, [
|
|
323
|
+
n.contactPerson.email !== null ? (m(), g(K, {
|
|
324
324
|
key: 0,
|
|
325
325
|
label: n.contactPerson.email,
|
|
326
|
-
icon: e(
|
|
327
|
-
}, null, 8, ["label", "icon"])) :
|
|
328
|
-
n.contactPerson.mobilePhone !== null ? (
|
|
326
|
+
icon: e(Be)
|
|
327
|
+
}, null, 8, ["label", "icon"])) : N("", !0),
|
|
328
|
+
n.contactPerson.mobilePhone !== null ? (m(), g(K, {
|
|
329
329
|
key: 1,
|
|
330
330
|
label: n.contactPerson.mobilePhone,
|
|
331
|
-
icon: e(
|
|
332
|
-
}, null, 8, ["label", "icon"])) :
|
|
333
|
-
n.contactPerson.phone !== null ? (
|
|
331
|
+
icon: e(Ae)
|
|
332
|
+
}, null, 8, ["label", "icon"])) : N("", !0),
|
|
333
|
+
n.contactPerson.phone !== null ? (m(), g(K, {
|
|
334
334
|
key: 2,
|
|
335
335
|
label: n.contactPerson.phone,
|
|
336
|
-
icon: e(
|
|
337
|
-
}, null, 8, ["label", "icon"])) :
|
|
336
|
+
icon: e(Qe)
|
|
337
|
+
}, null, 8, ["label", "icon"])) : N("", !0)
|
|
338
338
|
])
|
|
339
339
|
]),
|
|
340
340
|
_: 1
|
|
341
341
|
}));
|
|
342
342
|
}
|
|
343
343
|
});
|
|
344
|
-
function
|
|
345
|
-
return
|
|
344
|
+
function Ra() {
|
|
345
|
+
return $({
|
|
346
346
|
queryFn: async ({
|
|
347
347
|
body: t,
|
|
348
348
|
params: a
|
|
349
|
-
}) => await
|
|
349
|
+
}) => await F.linkContactPerson(
|
|
350
350
|
a.dealUuid,
|
|
351
351
|
t.contactPersonUuid,
|
|
352
352
|
t.contactInfo
|
|
@@ -359,39 +359,7 @@ function Xa() {
|
|
|
359
359
|
}
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
|
-
const
|
|
363
|
-
__name: "AppDialog",
|
|
364
|
-
props: {
|
|
365
|
-
title: {},
|
|
366
|
-
description: {}
|
|
367
|
-
},
|
|
368
|
-
emits: ["close"],
|
|
369
|
-
setup(t, { emit: a }) {
|
|
370
|
-
const n = t, i = a;
|
|
371
|
-
function o() {
|
|
372
|
-
i("close");
|
|
373
|
-
}
|
|
374
|
-
return (r, p) => (d(), g(e(Ca), {
|
|
375
|
-
size: "xl",
|
|
376
|
-
onClose: o
|
|
377
|
-
}, {
|
|
378
|
-
default: c(() => [
|
|
379
|
-
l(Oe, { class: "flex flex-1 flex-col gap-xl" }, {
|
|
380
|
-
default: c(() => [
|
|
381
|
-
l(Be, {
|
|
382
|
-
title: n.title,
|
|
383
|
-
description: n.description,
|
|
384
|
-
icon: e(Qe)
|
|
385
|
-
}, null, 8, ["title", "description", "icon"]),
|
|
386
|
-
ie(r.$slots, "default")
|
|
387
|
-
]),
|
|
388
|
-
_: 3
|
|
389
|
-
})
|
|
390
|
-
]),
|
|
391
|
-
_: 3
|
|
392
|
-
}));
|
|
393
|
-
}
|
|
394
|
-
}), W = /* @__PURE__ */ x({
|
|
362
|
+
const X = /* @__PURE__ */ D({
|
|
395
363
|
__name: "ContactPersonFormContactField",
|
|
396
364
|
props: {
|
|
397
365
|
email: {},
|
|
@@ -399,163 +367,181 @@ const et = /* @__PURE__ */ x({
|
|
|
399
367
|
phone: {}
|
|
400
368
|
},
|
|
401
369
|
setup(t) {
|
|
402
|
-
const a = t, n =
|
|
403
|
-
return (i, o) => (
|
|
404
|
-
l(e(
|
|
370
|
+
const a = t, n = x();
|
|
371
|
+
return (i, o) => (m(), M(Z, null, [
|
|
372
|
+
l(e(z), q(e(E)(a.email), {
|
|
405
373
|
label: e(n).t("wise_crm.contact.create_dialog.form.fields.email"),
|
|
406
374
|
placeholder: e(n).t("wise_crm.contact.create_dialog.form.fields.email"),
|
|
407
375
|
class: "col-span-2"
|
|
408
376
|
}), null, 16, ["label", "placeholder"]),
|
|
409
|
-
l(
|
|
410
|
-
default:
|
|
411
|
-
|
|
377
|
+
l(ae, { class: "col-span-2" }, {
|
|
378
|
+
default: s(() => [
|
|
379
|
+
ee(j(e(n).t("wise_crm.contact.create_dialog.form.seperator_label")), 1)
|
|
412
380
|
]),
|
|
413
381
|
_: 1
|
|
414
382
|
}),
|
|
415
|
-
l(e(
|
|
383
|
+
l(e(oe), q(e(E)(a.mobilePhone), {
|
|
416
384
|
label: e(n).t("wise_crm.contact.create_dialog.form.fields.mobile_phone"),
|
|
417
385
|
placeholder: e(n).t("wise_crm.contact.create_dialog.form.fields.mobile_phone"),
|
|
418
386
|
class: "col-span-2"
|
|
419
387
|
}), null, 16, ["label", "placeholder"]),
|
|
420
|
-
l(
|
|
421
|
-
default:
|
|
422
|
-
|
|
388
|
+
l(ae, { class: "col-span-2" }, {
|
|
389
|
+
default: s(() => [
|
|
390
|
+
ee(j(e(n).t("wise_crm.contact.create_dialog.form.seperator_label")), 1)
|
|
423
391
|
]),
|
|
424
392
|
_: 1
|
|
425
393
|
}),
|
|
426
|
-
l(e(
|
|
394
|
+
l(e(oe), q(e(E)(a.phone), {
|
|
427
395
|
label: e(n).t("wise_crm.contact.create_dialog.form.fields.phone"),
|
|
428
396
|
placeholder: e(n).t("wise_crm.contact.create_dialog.form.fields.phone"),
|
|
429
397
|
class: "col-span-2"
|
|
430
398
|
}), null, 16, ["label", "placeholder"])
|
|
431
399
|
], 64));
|
|
432
400
|
}
|
|
433
|
-
}),
|
|
401
|
+
}), Ga = /* @__PURE__ */ D({
|
|
434
402
|
__name: "DealContactPersonCreateExistingForm",
|
|
435
403
|
props: {
|
|
436
404
|
form: {}
|
|
437
405
|
},
|
|
438
406
|
emits: ["createNewContactPerson"],
|
|
439
407
|
setup(t, { emit: a }) {
|
|
440
|
-
const n = t, i = a, o =
|
|
441
|
-
async function h
|
|
442
|
-
if (
|
|
408
|
+
const n = t, i = a, o = x(), u = n.form.register("email"), p = n.form.register("phone"), f = n.form.register("mobile"), d = n.form.register("existingContactPerson"), c = T(null);
|
|
409
|
+
async function v(h) {
|
|
410
|
+
if (c.value = h, d.setValue(h?.uuid ?? null), h === null)
|
|
443
411
|
return;
|
|
444
|
-
const _ = await je.getByUuid(
|
|
412
|
+
const _ = await je.getByUuid(h.uuid);
|
|
445
413
|
if (_.isErr())
|
|
446
414
|
return;
|
|
447
415
|
const y = _.value;
|
|
448
|
-
|
|
416
|
+
u.setValue(y.email), p.setValue(y.phone), f.setValue(y.mobilePhone);
|
|
449
417
|
}
|
|
450
|
-
return (
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
default: c(() => [
|
|
455
|
-
l(Z, { cols: 2 }, {
|
|
456
|
-
default: c(() => [
|
|
418
|
+
return (h, _) => (m(), g(e(J), null, {
|
|
419
|
+
default: s(() => [
|
|
420
|
+
l(e(B), null, {
|
|
421
|
+
default: s(() => [
|
|
457
422
|
l(Ke, {
|
|
458
|
-
modelValue:
|
|
423
|
+
modelValue: c.value,
|
|
459
424
|
"onUpdate:modelValue": [
|
|
460
|
-
_[0] || (_[0] = (y) =>
|
|
461
|
-
|
|
425
|
+
_[0] || (_[0] = (y) => c.value = y),
|
|
426
|
+
v
|
|
462
427
|
],
|
|
463
428
|
label: e(o).t("wise_crm.contact.create_dialog.form.fields.contact_person"),
|
|
464
|
-
class: "col-span-2",
|
|
465
429
|
onCreateNew: _[1] || (_[1] = (y) => i("createNewContactPerson"))
|
|
466
|
-
}, null, 8, ["modelValue", "label"])
|
|
467
|
-
l(W, {
|
|
468
|
-
email: e(r),
|
|
469
|
-
"mobile-phone": e(f),
|
|
470
|
-
phone: e(p)
|
|
471
|
-
}, null, 8, ["email", "mobile-phone", "phone"])
|
|
430
|
+
}, null, 8, ["modelValue", "label"])
|
|
472
431
|
]),
|
|
473
432
|
_: 1
|
|
474
433
|
}),
|
|
475
|
-
l(
|
|
476
|
-
default:
|
|
477
|
-
l(
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
},
|
|
434
|
+
l(e(B), null, {
|
|
435
|
+
default: s(() => [
|
|
436
|
+
l(e(A), {
|
|
437
|
+
sm: 1,
|
|
438
|
+
lg: 1,
|
|
439
|
+
variant: "card"
|
|
440
|
+
}, {
|
|
441
|
+
default: s(() => [
|
|
442
|
+
l(X, {
|
|
443
|
+
email: e(u),
|
|
444
|
+
"mobile-phone": e(f),
|
|
445
|
+
phone: e(p)
|
|
446
|
+
}, null, 8, ["email", "mobile-phone", "phone"])
|
|
447
|
+
]),
|
|
448
|
+
_: 1
|
|
449
|
+
})
|
|
482
450
|
]),
|
|
483
451
|
_: 1
|
|
484
452
|
})
|
|
485
453
|
]),
|
|
486
454
|
_: 1
|
|
487
|
-
}
|
|
455
|
+
}));
|
|
488
456
|
}
|
|
489
|
-
}),
|
|
457
|
+
}), Ue = /* @__PURE__ */ D({
|
|
490
458
|
__name: "ContactPersonFormNameField",
|
|
491
459
|
props: {
|
|
492
460
|
firstName: {},
|
|
493
461
|
lastName: {}
|
|
494
462
|
},
|
|
495
463
|
setup(t) {
|
|
496
|
-
const a = t, n =
|
|
497
|
-
return (i, o) => (
|
|
498
|
-
l(e(
|
|
464
|
+
const a = t, n = x();
|
|
465
|
+
return (i, o) => (m(), M(Z, null, [
|
|
466
|
+
l(e(z), q(e(E)(a.firstName), {
|
|
499
467
|
label: e(n).t("wise_crm.contact.create_dialog.form.fields.first_name"),
|
|
500
468
|
placeholder: e(n).t("wise_crm.contact.create_dialog.form.fields.first_name")
|
|
501
469
|
}), null, 16, ["label", "placeholder"]),
|
|
502
|
-
l(e(
|
|
470
|
+
l(e(z), q(e(E)(a.lastName), {
|
|
503
471
|
label: e(n).t("wise_crm.contact.create_dialog.form.fields.last_name"),
|
|
504
472
|
placeholder: e(n).t("wise_crm.contact.create_dialog.form.fields.last_name")
|
|
505
473
|
}), null, 16, ["label", "placeholder"])
|
|
506
474
|
], 64));
|
|
507
475
|
}
|
|
508
|
-
}),
|
|
476
|
+
}), Ha = /* @__PURE__ */ D({
|
|
509
477
|
__name: "DealContactPersonCreateNewForm",
|
|
510
478
|
props: {
|
|
511
479
|
form: {}
|
|
512
480
|
},
|
|
513
481
|
setup(t) {
|
|
514
|
-
const a = t, n = a.form.register("firstName"), i = a.form.register("lastName"), o = a.form.register("email"),
|
|
515
|
-
return (f,
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}
|
|
531
|
-
|
|
482
|
+
const a = t, n = a.form.register("firstName"), i = a.form.register("lastName"), o = a.form.register("email"), u = a.form.register("mobilePhone"), p = a.form.register("phone");
|
|
483
|
+
return (f, d) => (m(), g(e(J), null, {
|
|
484
|
+
default: s(() => [
|
|
485
|
+
l(e(B), null, {
|
|
486
|
+
default: s(() => [
|
|
487
|
+
l(e(A), {
|
|
488
|
+
sm: 1,
|
|
489
|
+
lg: 2
|
|
490
|
+
}, {
|
|
491
|
+
default: s(() => [
|
|
492
|
+
l(Ue, {
|
|
493
|
+
"first-name": e(n),
|
|
494
|
+
"last-name": e(i)
|
|
495
|
+
}, null, 8, ["first-name", "last-name"])
|
|
496
|
+
]),
|
|
497
|
+
_: 1
|
|
498
|
+
})
|
|
499
|
+
]),
|
|
500
|
+
_: 1
|
|
501
|
+
}),
|
|
502
|
+
l(e(B), null, {
|
|
503
|
+
default: s(() => [
|
|
504
|
+
l(e(A), {
|
|
505
|
+
sm: 1,
|
|
506
|
+
lg: 1,
|
|
507
|
+
variant: "card"
|
|
508
|
+
}, {
|
|
509
|
+
default: s(() => [
|
|
510
|
+
l(X, {
|
|
511
|
+
email: e(o),
|
|
512
|
+
"mobile-phone": e(u),
|
|
513
|
+
phone: e(p)
|
|
514
|
+
}, null, 8, ["email", "mobile-phone", "phone"])
|
|
515
|
+
]),
|
|
516
|
+
_: 1
|
|
517
|
+
}),
|
|
518
|
+
l(ue, {
|
|
532
519
|
form: a.form
|
|
533
520
|
}, null, 8, ["form"])
|
|
534
521
|
]),
|
|
535
522
|
_: 1
|
|
536
|
-
})
|
|
537
|
-
ie(f.$slots, "actions")
|
|
523
|
+
})
|
|
538
524
|
]),
|
|
539
|
-
_:
|
|
540
|
-
}
|
|
525
|
+
_: 1
|
|
526
|
+
}));
|
|
541
527
|
}
|
|
542
|
-
}),
|
|
543
|
-
email:
|
|
528
|
+
}), Ya = G.object({
|
|
529
|
+
email: G.email().nullable(),
|
|
544
530
|
existingContactPerson: ze,
|
|
545
|
-
mobile:
|
|
546
|
-
phone:
|
|
547
|
-
}),
|
|
548
|
-
email:
|
|
549
|
-
firstName:
|
|
550
|
-
lastName:
|
|
551
|
-
mobilePhone:
|
|
552
|
-
phone:
|
|
531
|
+
mobile: O.nullable(),
|
|
532
|
+
phone: O.nullable()
|
|
533
|
+
}), Za = S.object({
|
|
534
|
+
email: S.email().min(1).nullable(),
|
|
535
|
+
firstName: S.string().min(1),
|
|
536
|
+
lastName: S.string().min(1),
|
|
537
|
+
mobilePhone: O.nullable(),
|
|
538
|
+
phone: O.nullable()
|
|
553
539
|
}).superRefine((t, a) => {
|
|
554
540
|
t.email !== null && t.email !== "" || t.mobilePhone !== null && t.mobilePhone !== "" || t.phone !== null && t.phone !== "" || a.addIssue({
|
|
555
|
-
code:
|
|
556
|
-
message:
|
|
541
|
+
code: S.ZodIssueCode.custom,
|
|
542
|
+
message: ce.global.t("wise_crm.form.errors.at_least_one")
|
|
557
543
|
});
|
|
558
|
-
}),
|
|
544
|
+
}), Ja = /* @__PURE__ */ D({
|
|
559
545
|
__name: "DealContactPersonCreateDialog",
|
|
560
546
|
props: {
|
|
561
547
|
dealUuid: {},
|
|
@@ -563,121 +549,128 @@ const et = /* @__PURE__ */ x({
|
|
|
563
549
|
},
|
|
564
550
|
emits: ["close", "createNewContactPerson"],
|
|
565
551
|
setup(t, { emit: a }) {
|
|
566
|
-
const n = t, i = a, o =
|
|
567
|
-
schema:
|
|
568
|
-
onSubmit: async (
|
|
552
|
+
const n = t, i = a, o = x(), u = L(), p = Ra(), f = Re(), d = T(n.isCreatingNewContactPerson), c = R({
|
|
553
|
+
schema: Za,
|
|
554
|
+
onSubmit: async (r) => {
|
|
569
555
|
try {
|
|
570
|
-
const
|
|
556
|
+
const U = await f.execute({
|
|
571
557
|
body: {
|
|
572
|
-
email:
|
|
573
|
-
firstName:
|
|
574
|
-
lastName:
|
|
575
|
-
mobilePhone:
|
|
576
|
-
phone:
|
|
558
|
+
email: r.email,
|
|
559
|
+
firstName: r.firstName,
|
|
560
|
+
lastName: r.lastName,
|
|
561
|
+
mobilePhone: r.mobilePhone,
|
|
562
|
+
phone: r.phone
|
|
577
563
|
}
|
|
578
564
|
});
|
|
579
|
-
if (
|
|
580
|
-
|
|
565
|
+
if (U.isErr()) {
|
|
566
|
+
u.show(U.error);
|
|
581
567
|
return;
|
|
582
568
|
}
|
|
583
|
-
const
|
|
569
|
+
const I = U.value;
|
|
584
570
|
n.isCreatingNewContactPerson || await p.execute({
|
|
585
571
|
body: {
|
|
586
|
-
contactPersonUuid:
|
|
572
|
+
contactPersonUuid: I,
|
|
587
573
|
contactInfo: {
|
|
588
|
-
email:
|
|
589
|
-
mobilePhone:
|
|
590
|
-
phone:
|
|
574
|
+
email: r.email,
|
|
575
|
+
mobilePhone: r.mobilePhone,
|
|
576
|
+
phone: r.phone
|
|
591
577
|
}
|
|
592
578
|
},
|
|
593
579
|
params: {
|
|
594
580
|
dealUuid: n.dealUuid
|
|
595
581
|
}
|
|
596
|
-
}),
|
|
597
|
-
label: `${
|
|
598
|
-
value:
|
|
582
|
+
}), b({
|
|
583
|
+
label: `${r.firstName} ${r.lastName}`,
|
|
584
|
+
value: I
|
|
599
585
|
});
|
|
600
|
-
} catch (
|
|
601
|
-
|
|
586
|
+
} catch (U) {
|
|
587
|
+
u.show(U);
|
|
602
588
|
}
|
|
603
589
|
}
|
|
604
|
-
}),
|
|
605
|
-
schema:
|
|
606
|
-
onSubmit: async (
|
|
607
|
-
await
|
|
608
|
-
|
|
590
|
+
}), v = R({
|
|
591
|
+
schema: Ya,
|
|
592
|
+
onSubmit: async (r) => {
|
|
593
|
+
await y(
|
|
594
|
+
r.existingContactPerson,
|
|
609
595
|
{
|
|
610
|
-
email:
|
|
611
|
-
mobilePhone:
|
|
612
|
-
phone:
|
|
596
|
+
email: r.email,
|
|
597
|
+
mobilePhone: r.mobile,
|
|
598
|
+
phone: r.phone
|
|
613
599
|
}
|
|
614
600
|
);
|
|
615
601
|
}
|
|
616
|
-
})
|
|
617
|
-
|
|
618
|
-
|
|
602
|
+
}), h = P(
|
|
603
|
+
() => d.value ? c : v
|
|
604
|
+
);
|
|
605
|
+
function _() {
|
|
606
|
+
d.value = !0;
|
|
619
607
|
}
|
|
620
|
-
async function
|
|
621
|
-
if (
|
|
608
|
+
async function y(r, U) {
|
|
609
|
+
if (r !== null)
|
|
622
610
|
try {
|
|
623
611
|
await p.execute({
|
|
624
612
|
body: {
|
|
625
|
-
contactPersonUuid:
|
|
626
|
-
contactInfo:
|
|
613
|
+
contactPersonUuid: r,
|
|
614
|
+
contactInfo: U
|
|
627
615
|
},
|
|
628
616
|
params: {
|
|
629
617
|
dealUuid: n.dealUuid
|
|
630
618
|
}
|
|
631
|
-
}),
|
|
632
|
-
} catch (
|
|
633
|
-
|
|
619
|
+
}), b();
|
|
620
|
+
} catch (I) {
|
|
621
|
+
u.show(I);
|
|
634
622
|
}
|
|
635
623
|
}
|
|
636
|
-
function
|
|
637
|
-
if (
|
|
624
|
+
function b(r) {
|
|
625
|
+
if (r === void 0) {
|
|
638
626
|
i("close");
|
|
639
627
|
return;
|
|
640
628
|
}
|
|
641
|
-
i("createNewContactPerson",
|
|
629
|
+
i("createNewContactPerson", r), i("close");
|
|
642
630
|
}
|
|
643
|
-
return (
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
onClose:
|
|
631
|
+
return (r, U) => (m(), g(e(fe), {
|
|
632
|
+
form: h.value,
|
|
633
|
+
size: "md",
|
|
634
|
+
onClose: b
|
|
647
635
|
}, {
|
|
648
|
-
default:
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
},
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
})
|
|
636
|
+
default: s(() => [
|
|
637
|
+
l(e(_e), {
|
|
638
|
+
title: e(o).t("wise_crm.info_dialog.contact_person_create.title"),
|
|
639
|
+
description: e(o).t("wise_crm.info_dialog.contact_person_create.description")
|
|
640
|
+
}, null, 8, ["title", "description"]),
|
|
641
|
+
l(e(ge), null, {
|
|
642
|
+
default: s(() => [
|
|
643
|
+
d.value ? (m(), g(Ha, {
|
|
644
|
+
key: 0,
|
|
645
|
+
form: e(c)
|
|
646
|
+
}, null, 8, ["form"])) : (m(), g(Ga, {
|
|
647
|
+
key: 1,
|
|
648
|
+
form: e(v),
|
|
649
|
+
onCreateNewContactPerson: _
|
|
650
|
+
}, null, 8, ["form"]))
|
|
663
651
|
]),
|
|
664
652
|
_: 1
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
653
|
+
}),
|
|
654
|
+
l(e(ye), null, {
|
|
655
|
+
right: s(() => [
|
|
656
|
+
l(e(be), {
|
|
657
|
+
"is-loading": h.value.isSubmitting.value,
|
|
658
|
+
label: e(o).t("wise_crm.shared.create")
|
|
659
|
+
}, null, 8, ["is-loading", "label"])
|
|
660
|
+
]),
|
|
661
|
+
_: 1
|
|
662
|
+
})
|
|
670
663
|
]),
|
|
671
664
|
_: 1
|
|
672
|
-
}, 8, ["
|
|
665
|
+
}, 8, ["form"]));
|
|
673
666
|
}
|
|
674
667
|
});
|
|
675
|
-
function
|
|
676
|
-
return
|
|
668
|
+
function Wa() {
|
|
669
|
+
return $({
|
|
677
670
|
queryFn: async ({
|
|
678
671
|
body: t,
|
|
679
672
|
params: a
|
|
680
|
-
}) => await
|
|
673
|
+
}) => await F.updateContactPerson(a.dealUuid, a.contactPersonUuid, t.form),
|
|
681
674
|
queryKeysToInvalidate: {
|
|
682
675
|
dealContactPersonDetail: {
|
|
683
676
|
contactPersonUuid: (t) => t.contactPersonUuid,
|
|
@@ -690,27 +683,27 @@ function it() {
|
|
|
690
683
|
}
|
|
691
684
|
});
|
|
692
685
|
}
|
|
693
|
-
function
|
|
694
|
-
return
|
|
686
|
+
function Xa(t, a) {
|
|
687
|
+
return he("dealContactPersonDetail", {
|
|
695
688
|
params: {
|
|
696
689
|
contactPersonUuid: a,
|
|
697
690
|
dealUuid: t
|
|
698
691
|
},
|
|
699
|
-
queryFn: () =>
|
|
692
|
+
queryFn: () => F.getContactPerson(t.value, a.value)
|
|
700
693
|
});
|
|
701
694
|
}
|
|
702
|
-
const
|
|
703
|
-
email:
|
|
704
|
-
firstName:
|
|
705
|
-
lastName:
|
|
706
|
-
mobilePhone:
|
|
707
|
-
phone:
|
|
695
|
+
const et = S.object({
|
|
696
|
+
email: S.email().min(1).nullable(),
|
|
697
|
+
firstName: S.string().min(1),
|
|
698
|
+
lastName: S.string().min(1),
|
|
699
|
+
mobilePhone: O.nullable(),
|
|
700
|
+
phone: O.nullable()
|
|
708
701
|
}).superRefine((t, a) => {
|
|
709
702
|
t.email !== null && t.email !== "" || t.mobilePhone !== null && t.mobilePhone !== "" || t.phone !== null && t.phone !== "" || a.addIssue({
|
|
710
|
-
code:
|
|
711
|
-
message:
|
|
703
|
+
code: S.ZodIssueCode.custom,
|
|
704
|
+
message: ce.global.t("wise_crm.form.errors.at_least_one")
|
|
712
705
|
});
|
|
713
|
-
}),
|
|
706
|
+
}), at = /* @__PURE__ */ D({
|
|
714
707
|
__name: "DealContactPersonUpdateDialog",
|
|
715
708
|
props: {
|
|
716
709
|
contactPersonUuid: {},
|
|
@@ -718,64 +711,64 @@ const rt = N.object({
|
|
|
718
711
|
},
|
|
719
712
|
emits: ["close"],
|
|
720
713
|
setup(t, { emit: a }) {
|
|
721
|
-
const n = t, i = a, o =
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
),
|
|
725
|
-
initialState:
|
|
726
|
-
email:
|
|
727
|
-
firstName:
|
|
728
|
-
lastName:
|
|
729
|
-
mobilePhone:
|
|
730
|
-
phone:
|
|
714
|
+
const n = t, i = a, o = x(), u = L(), p = Wa(), f = Xa(
|
|
715
|
+
P(() => n.dealUuid),
|
|
716
|
+
P(() => n.contactPersonUuid)
|
|
717
|
+
), d = P(() => f.result.value.isOk() ? f.result.value.getValue() : null), c = R({
|
|
718
|
+
initialState: P(() => d.value === null ? null : {
|
|
719
|
+
email: d.value.email,
|
|
720
|
+
firstName: d.value.firstName,
|
|
721
|
+
lastName: d.value.lastName,
|
|
722
|
+
mobilePhone: d.value.mobilePhone,
|
|
723
|
+
phone: d.value.phone
|
|
731
724
|
}),
|
|
732
|
-
schema:
|
|
733
|
-
onSubmit: async (
|
|
734
|
-
await
|
|
725
|
+
schema: et,
|
|
726
|
+
onSubmit: async (I) => {
|
|
727
|
+
await r(I);
|
|
735
728
|
}
|
|
736
|
-
}),
|
|
737
|
-
async function
|
|
729
|
+
}), v = c.register("firstName"), h = c.register("lastName"), _ = c.register("email"), y = c.register("mobilePhone"), b = c.register("phone");
|
|
730
|
+
async function r(I) {
|
|
738
731
|
try {
|
|
739
732
|
await p.execute({
|
|
740
733
|
body: {
|
|
741
|
-
form:
|
|
734
|
+
form: I
|
|
742
735
|
},
|
|
743
736
|
params: {
|
|
744
737
|
contactPersonUuid: n.contactPersonUuid,
|
|
745
738
|
dealUuid: n.dealUuid
|
|
746
739
|
}
|
|
747
740
|
}), i("close");
|
|
748
|
-
} catch (
|
|
749
|
-
|
|
741
|
+
} catch (Q) {
|
|
742
|
+
u.show(Q);
|
|
750
743
|
}
|
|
751
744
|
}
|
|
752
|
-
function
|
|
745
|
+
function U() {
|
|
753
746
|
i("close");
|
|
754
747
|
}
|
|
755
|
-
return (
|
|
756
|
-
form: e(
|
|
748
|
+
return (I, Q) => (m(), g(e(fe), {
|
|
749
|
+
form: e(c),
|
|
757
750
|
size: "md",
|
|
758
|
-
onClose:
|
|
751
|
+
onClose: U
|
|
759
752
|
}, {
|
|
760
|
-
default:
|
|
761
|
-
l(e(
|
|
753
|
+
default: s(() => [
|
|
754
|
+
l(e(_e), {
|
|
762
755
|
title: e(o).t("wise_crm.info_dialog.contact_person_update.title"),
|
|
763
756
|
description: e(o).t("wise_crm.info_dialog.contact_person_create.description")
|
|
764
757
|
}, null, 8, ["title", "description"]),
|
|
765
|
-
|
|
766
|
-
default:
|
|
767
|
-
l(e(
|
|
768
|
-
default:
|
|
769
|
-
l(e(
|
|
770
|
-
default:
|
|
771
|
-
l(e(
|
|
758
|
+
d.value !== null ? (m(), g(e(ge), { key: 0 }, {
|
|
759
|
+
default: s(() => [
|
|
760
|
+
l(e(J), null, {
|
|
761
|
+
default: s(() => [
|
|
762
|
+
l(e(B), null, {
|
|
763
|
+
default: s(() => [
|
|
764
|
+
l(e(A), {
|
|
772
765
|
sm: 1,
|
|
773
766
|
lg: 2
|
|
774
767
|
}, {
|
|
775
|
-
default:
|
|
776
|
-
l(
|
|
777
|
-
"first-name": e(
|
|
778
|
-
"last-name": e(
|
|
768
|
+
default: s(() => [
|
|
769
|
+
l(Ue, {
|
|
770
|
+
"first-name": e(v),
|
|
771
|
+
"last-name": e(h)
|
|
779
772
|
}, null, 8, ["first-name", "last-name"])
|
|
780
773
|
]),
|
|
781
774
|
_: 1
|
|
@@ -786,22 +779,22 @@ const rt = N.object({
|
|
|
786
779
|
l(Ge, {
|
|
787
780
|
title: e(o).t("wise_crm.shared.contact_info")
|
|
788
781
|
}, {
|
|
789
|
-
default:
|
|
790
|
-
l(e(
|
|
782
|
+
default: s(() => [
|
|
783
|
+
l(e(A), {
|
|
791
784
|
sm: 1,
|
|
792
785
|
lg: 1,
|
|
793
786
|
variant: "card"
|
|
794
787
|
}, {
|
|
795
|
-
default:
|
|
796
|
-
l(
|
|
788
|
+
default: s(() => [
|
|
789
|
+
l(X, {
|
|
797
790
|
email: e(_),
|
|
798
791
|
"mobile-phone": e(y),
|
|
799
|
-
phone: e(
|
|
792
|
+
phone: e(b)
|
|
800
793
|
}, null, 8, ["email", "mobile-phone", "phone"])
|
|
801
794
|
]),
|
|
802
795
|
_: 1
|
|
803
796
|
}),
|
|
804
|
-
l(
|
|
797
|
+
l(ue, { form: e(c) }, null, 8, ["form"])
|
|
805
798
|
]),
|
|
806
799
|
_: 1
|
|
807
800
|
}, 8, ["title"])
|
|
@@ -810,11 +803,11 @@ const rt = N.object({
|
|
|
810
803
|
})
|
|
811
804
|
]),
|
|
812
805
|
_: 1
|
|
813
|
-
})) :
|
|
814
|
-
l(e(
|
|
815
|
-
right:
|
|
816
|
-
l(e(
|
|
817
|
-
"is-loading": e(
|
|
806
|
+
})) : N("", !0),
|
|
807
|
+
l(e(ye), null, {
|
|
808
|
+
right: s(() => [
|
|
809
|
+
l(e(be), {
|
|
810
|
+
"is-loading": e(c).isSubmitting.value,
|
|
818
811
|
label: e(o).t("wise_crm.shared.save_changes")
|
|
819
812
|
}, null, 8, ["is-loading", "label"])
|
|
820
813
|
]),
|
|
@@ -825,8 +818,8 @@ const rt = N.object({
|
|
|
825
818
|
}, 8, ["form"]));
|
|
826
819
|
}
|
|
827
820
|
});
|
|
828
|
-
function
|
|
829
|
-
return
|
|
821
|
+
function tt(t) {
|
|
822
|
+
return Ia("userIndex", {
|
|
830
823
|
params: t,
|
|
831
824
|
queryFn: (a) => He.getAll({
|
|
832
825
|
pagination: a,
|
|
@@ -834,128 +827,128 @@ function ct(t) {
|
|
|
834
827
|
})
|
|
835
828
|
});
|
|
836
829
|
}
|
|
837
|
-
const
|
|
830
|
+
const nt = { class: "p-lg" }, lt = /* @__PURE__ */ D({
|
|
838
831
|
__name: "DealDetailSidebarGeneralInfo",
|
|
839
832
|
props: {
|
|
840
833
|
deal: {}
|
|
841
834
|
},
|
|
842
835
|
setup(t) {
|
|
843
|
-
const a = t, n =
|
|
836
|
+
const a = t, n = x(), i = L(), o = Fa(), u = $a(), p = Ta(), f = Ye({
|
|
844
837
|
persistInUrl: !1
|
|
845
|
-
}),
|
|
838
|
+
}), d = tt({
|
|
846
839
|
params: {
|
|
847
840
|
search: f.debouncedSearch
|
|
848
841
|
}
|
|
849
|
-
}),
|
|
842
|
+
}), c = T(a.deal.dealLanguage), v = T(a.deal.dealSource), h = T(
|
|
850
843
|
a.deal.owner ? {
|
|
851
844
|
uuid: a.deal.owner.uuid,
|
|
852
845
|
name: a.deal.owner.name
|
|
853
846
|
} : null
|
|
854
|
-
), _ =
|
|
855
|
-
const
|
|
856
|
-
uuid:
|
|
857
|
-
name: `${
|
|
847
|
+
), _ = P(() => {
|
|
848
|
+
const C = (d.result.value.isOk() ? d.result.value.getValue().data : []).map((w) => ({
|
|
849
|
+
uuid: w.uuid,
|
|
850
|
+
name: `${w.firstName} ${w.lastName}`
|
|
858
851
|
}));
|
|
859
|
-
return
|
|
852
|
+
return Pa(C);
|
|
860
853
|
});
|
|
861
|
-
function y(
|
|
862
|
-
return n.t(
|
|
854
|
+
function y(C) {
|
|
855
|
+
return n.t(Xe.getI18nKey(C));
|
|
863
856
|
}
|
|
864
|
-
function
|
|
865
|
-
return n.t(
|
|
857
|
+
function b(C) {
|
|
858
|
+
return n.t(ea.getI18nKey(C));
|
|
866
859
|
}
|
|
867
|
-
const
|
|
868
|
-
function
|
|
869
|
-
f.updateSearch(
|
|
860
|
+
const r = H(Object.values(Fe)), U = H(Object.values($e)), I = Ze();
|
|
861
|
+
function Q(C) {
|
|
862
|
+
f.updateSearch(C);
|
|
870
863
|
}
|
|
871
|
-
async function
|
|
872
|
-
if (
|
|
864
|
+
async function Ce(C) {
|
|
865
|
+
if (c.value = C, C !== null)
|
|
873
866
|
try {
|
|
874
867
|
await o.execute({
|
|
875
868
|
body: {
|
|
876
|
-
dealLanguage:
|
|
869
|
+
dealLanguage: C
|
|
877
870
|
},
|
|
878
871
|
params: {
|
|
879
872
|
dealUuid: a.deal.uuid
|
|
880
873
|
}
|
|
881
874
|
});
|
|
882
|
-
} catch (
|
|
883
|
-
i.show(
|
|
875
|
+
} catch (w) {
|
|
876
|
+
i.show(w);
|
|
884
877
|
}
|
|
885
878
|
}
|
|
886
|
-
async function
|
|
887
|
-
if (
|
|
879
|
+
async function Pe(C) {
|
|
880
|
+
if (v.value = C, C !== null)
|
|
888
881
|
try {
|
|
889
|
-
await
|
|
882
|
+
await u.execute({
|
|
890
883
|
body: {
|
|
891
|
-
dealSource:
|
|
884
|
+
dealSource: C
|
|
892
885
|
},
|
|
893
886
|
params: {
|
|
894
887
|
dealUuid: a.deal.uuid
|
|
895
888
|
}
|
|
896
889
|
});
|
|
897
|
-
} catch (
|
|
898
|
-
i.show(
|
|
890
|
+
} catch (w) {
|
|
891
|
+
i.show(w);
|
|
899
892
|
}
|
|
900
893
|
}
|
|
901
|
-
async function
|
|
902
|
-
if (
|
|
894
|
+
async function we(C) {
|
|
895
|
+
if (h.value = C, C !== null)
|
|
903
896
|
try {
|
|
904
897
|
await p.execute({
|
|
905
898
|
body: {
|
|
906
|
-
dealOwner:
|
|
899
|
+
dealOwner: C
|
|
907
900
|
},
|
|
908
901
|
params: {
|
|
909
902
|
dealUuid: a.deal.uuid
|
|
910
903
|
}
|
|
911
904
|
});
|
|
912
|
-
} catch (
|
|
913
|
-
i.show(
|
|
905
|
+
} catch (w) {
|
|
906
|
+
i.show(w);
|
|
914
907
|
}
|
|
915
908
|
}
|
|
916
|
-
return (
|
|
917
|
-
l(
|
|
918
|
-
default:
|
|
919
|
-
|
|
920
|
-
l(
|
|
921
|
-
default:
|
|
922
|
-
l(e(
|
|
923
|
-
modelValue:
|
|
909
|
+
return (C, w) => (m(), M("div", null, [
|
|
910
|
+
l(se, null, {
|
|
911
|
+
default: s(() => [
|
|
912
|
+
k("form", null, [
|
|
913
|
+
l(Je, { cols: 1 }, {
|
|
914
|
+
default: s(() => [
|
|
915
|
+
l(e(wa), {
|
|
916
|
+
modelValue: h.value,
|
|
924
917
|
"onUpdate:modelValue": [
|
|
925
|
-
|
|
926
|
-
|
|
918
|
+
w[0] || (w[0] = (V) => h.value = V),
|
|
919
|
+
we
|
|
927
920
|
],
|
|
928
921
|
items: _.value,
|
|
929
922
|
"display-fn": (V) => V.name,
|
|
930
|
-
"is-loading": e(
|
|
923
|
+
"is-loading": e(d).isLoading.value || e(p).isLoading.value,
|
|
931
924
|
"search-mode": "remote",
|
|
932
925
|
placeholder: "Select deal owner",
|
|
933
926
|
label: "Deal owner",
|
|
934
|
-
"onUpdate:search":
|
|
927
|
+
"onUpdate:search": Q
|
|
935
928
|
}, null, 8, ["modelValue", "items", "display-fn", "is-loading"]),
|
|
936
|
-
l(e(
|
|
937
|
-
modelValue:
|
|
929
|
+
l(e(Y), {
|
|
930
|
+
modelValue: c.value,
|
|
938
931
|
"onUpdate:modelValue": [
|
|
939
|
-
|
|
940
|
-
|
|
932
|
+
w[1] || (w[1] = (V) => c.value = V),
|
|
933
|
+
Ce
|
|
941
934
|
],
|
|
942
935
|
label: e(n).t("wise_crm.deal.form.fields.language"),
|
|
943
936
|
placeholder: e(n).t("wise_crm.deal.form.fields.language_placeholder"),
|
|
944
937
|
"display-fn": y,
|
|
945
938
|
"is-loading": e(o).isLoading.value,
|
|
946
|
-
items: e(
|
|
939
|
+
items: e(r)
|
|
947
940
|
}, null, 8, ["modelValue", "label", "placeholder", "is-loading", "items"]),
|
|
948
|
-
l(e(
|
|
949
|
-
modelValue:
|
|
941
|
+
l(e(Y), {
|
|
942
|
+
modelValue: v.value,
|
|
950
943
|
"onUpdate:modelValue": [
|
|
951
|
-
|
|
952
|
-
|
|
944
|
+
w[2] || (w[2] = (V) => v.value = V),
|
|
945
|
+
Pe
|
|
953
946
|
],
|
|
954
|
-
"display-fn":
|
|
947
|
+
"display-fn": b,
|
|
955
948
|
label: e(n).t("wise_crm.deal.form.fields.source"),
|
|
956
949
|
placeholder: e(n).t("wise_crm.deal.form.fields.source_placeholder"),
|
|
957
|
-
"is-loading": e(
|
|
958
|
-
items: e(
|
|
950
|
+
"is-loading": e(u).isLoading.value,
|
|
951
|
+
items: e(U)
|
|
959
952
|
}, null, 8, ["modelValue", "label", "placeholder", "is-loading", "items"])
|
|
960
953
|
]),
|
|
961
954
|
_: 1
|
|
@@ -964,112 +957,112 @@ const dt = { class: "p-lg" }, mt = /* @__PURE__ */ x({
|
|
|
964
957
|
]),
|
|
965
958
|
_: 1
|
|
966
959
|
}),
|
|
967
|
-
|
|
968
|
-
l(
|
|
960
|
+
k("div", nt, [
|
|
961
|
+
l(K, {
|
|
969
962
|
label: e(n).t("wise_crm.deal.sidebar.created_at", {
|
|
970
|
-
date: e(
|
|
963
|
+
date: e(I).toDate(a.deal.createdAt.toPlainDate())
|
|
971
964
|
}),
|
|
972
|
-
icon: e(
|
|
965
|
+
icon: e(We),
|
|
973
966
|
"text-color": "text-quaternary",
|
|
974
967
|
class: "text-sm"
|
|
975
968
|
}, null, 8, ["label", "icon"])
|
|
976
969
|
])
|
|
977
970
|
]));
|
|
978
971
|
}
|
|
979
|
-
}),
|
|
972
|
+
}), ot = /* @__PURE__ */ D({
|
|
980
973
|
__name: "DealDetailSidebarOverviewContent",
|
|
981
974
|
props: {
|
|
982
975
|
deal: {}
|
|
983
976
|
},
|
|
984
977
|
setup(t) {
|
|
985
|
-
const a = t, n =
|
|
986
|
-
function
|
|
978
|
+
const a = t, n = x(), i = L(), o = Ea(), u = Oa(), p = W(), f = p.create(Ja), d = p.create(at), c = P(() => a.deal.contactPersons.length > 0);
|
|
979
|
+
function v() {
|
|
987
980
|
f.open({
|
|
988
981
|
dealUuid: a.deal.uuid
|
|
989
982
|
});
|
|
990
983
|
}
|
|
991
|
-
function
|
|
992
|
-
|
|
993
|
-
contactPersonUuid:
|
|
984
|
+
function h(b) {
|
|
985
|
+
d.open({
|
|
986
|
+
contactPersonUuid: b,
|
|
994
987
|
dealUuid: a.deal.uuid
|
|
995
988
|
});
|
|
996
989
|
}
|
|
997
|
-
async function _(
|
|
990
|
+
async function _(b) {
|
|
998
991
|
try {
|
|
999
|
-
await
|
|
992
|
+
await u.execute({
|
|
1000
993
|
body: {
|
|
1001
|
-
contactPersonUuid:
|
|
994
|
+
contactPersonUuid: b
|
|
1002
995
|
},
|
|
1003
996
|
params: {
|
|
1004
997
|
dealUuid: a.deal.uuid
|
|
1005
998
|
}
|
|
1006
999
|
});
|
|
1007
|
-
} catch (
|
|
1008
|
-
i.show(
|
|
1000
|
+
} catch (r) {
|
|
1001
|
+
i.show(r);
|
|
1009
1002
|
}
|
|
1010
1003
|
}
|
|
1011
|
-
function y(
|
|
1004
|
+
function y(b) {
|
|
1012
1005
|
o.execute({
|
|
1013
1006
|
params: {
|
|
1014
|
-
contactPersonUuid:
|
|
1007
|
+
contactPersonUuid: b,
|
|
1015
1008
|
dealUuid: a.deal.uuid
|
|
1016
1009
|
}
|
|
1017
1010
|
});
|
|
1018
1011
|
}
|
|
1019
|
-
return (
|
|
1020
|
-
default:
|
|
1021
|
-
l(
|
|
1012
|
+
return (b, r) => (m(), g(aa, { "default-values": ["general-info", "contact-persons"] }, {
|
|
1013
|
+
default: s(() => [
|
|
1014
|
+
l(te, {
|
|
1022
1015
|
label: e(n).t("wise_crm.deal.detail.sidebar.accordion.general_info"),
|
|
1023
|
-
icon: e(
|
|
1016
|
+
icon: e(de),
|
|
1024
1017
|
value: "general-info"
|
|
1025
1018
|
}, {
|
|
1026
|
-
default:
|
|
1027
|
-
l(
|
|
1019
|
+
default: s(() => [
|
|
1020
|
+
l(lt, {
|
|
1028
1021
|
deal: a.deal
|
|
1029
1022
|
}, null, 8, ["deal"])
|
|
1030
1023
|
]),
|
|
1031
1024
|
_: 1
|
|
1032
1025
|
}, 8, ["label", "icon"]),
|
|
1033
|
-
l(
|
|
1034
|
-
"is-empty": !
|
|
1026
|
+
l(te, {
|
|
1027
|
+
"is-empty": !c.value,
|
|
1035
1028
|
label: e(n).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
|
|
1036
|
-
icon: e(
|
|
1029
|
+
icon: e(ta),
|
|
1037
1030
|
value: "contact-persons",
|
|
1038
|
-
onAdd:
|
|
1031
|
+
onAdd: v
|
|
1039
1032
|
}, {
|
|
1040
|
-
actions:
|
|
1041
|
-
|
|
1033
|
+
actions: s(() => [
|
|
1034
|
+
c.value ? N("", !0) : (m(), g(na, {
|
|
1042
1035
|
key: 0,
|
|
1043
1036
|
label: e(n).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
|
|
1044
|
-
icon: e(
|
|
1037
|
+
icon: e(ne),
|
|
1045
1038
|
class: "z-1",
|
|
1046
|
-
onClick:
|
|
1039
|
+
onClick: v
|
|
1047
1040
|
}, null, 8, ["label", "icon"]))
|
|
1048
1041
|
]),
|
|
1049
|
-
default:
|
|
1050
|
-
(
|
|
1051
|
-
key:
|
|
1052
|
-
"layout-id":
|
|
1042
|
+
default: s(() => [
|
|
1043
|
+
(m(!0), M(Z, null, xe(a.deal.contactPersons, (U) => (m(), g(e(Na), {
|
|
1044
|
+
key: U.uuid,
|
|
1045
|
+
"layout-id": U.uuid
|
|
1053
1046
|
}, {
|
|
1054
|
-
default:
|
|
1055
|
-
l(
|
|
1056
|
-
"contact-person":
|
|
1057
|
-
"on-toggle-is-primary": () => y(
|
|
1058
|
-
description:
|
|
1059
|
-
onUpdate: (
|
|
1060
|
-
onDelete: (
|
|
1047
|
+
default: s(() => [
|
|
1048
|
+
l(za, {
|
|
1049
|
+
"contact-person": U,
|
|
1050
|
+
"on-toggle-is-primary": () => y(U.uuid),
|
|
1051
|
+
description: U.phone,
|
|
1052
|
+
onUpdate: (I) => h(U.uuid),
|
|
1053
|
+
onDelete: (I) => _(U.uuid)
|
|
1061
1054
|
}, null, 8, ["contact-person", "on-toggle-is-primary", "description", "onUpdate", "onDelete"])
|
|
1062
1055
|
]),
|
|
1063
1056
|
_: 2
|
|
1064
1057
|
}, 1032, ["layout-id"]))), 128)),
|
|
1065
|
-
|
|
1058
|
+
c.value ? (m(), g(e(Da), {
|
|
1066
1059
|
key: 0,
|
|
1067
|
-
"icon-left": e(
|
|
1060
|
+
"icon-left": e(ne),
|
|
1068
1061
|
label: e(n).t("wise_crm.shared.add"),
|
|
1069
1062
|
variant: "tertiary",
|
|
1070
1063
|
size: "sm",
|
|
1071
|
-
onClick:
|
|
1072
|
-
}, null, 8, ["icon-left", "label"])) :
|
|
1064
|
+
onClick: v
|
|
1065
|
+
}, null, 8, ["icon-left", "label"])) : N("", !0)
|
|
1073
1066
|
]),
|
|
1074
1067
|
_: 1
|
|
1075
1068
|
}, 8, ["is-empty", "label", "icon"])
|
|
@@ -1078,12 +1071,12 @@ const dt = { class: "p-lg" }, mt = /* @__PURE__ */ x({
|
|
|
1078
1071
|
}));
|
|
1079
1072
|
}
|
|
1080
1073
|
});
|
|
1081
|
-
function
|
|
1082
|
-
return
|
|
1074
|
+
function it() {
|
|
1075
|
+
return $({
|
|
1083
1076
|
queryFn: async ({
|
|
1084
1077
|
body: t,
|
|
1085
1078
|
params: a
|
|
1086
|
-
}) => await
|
|
1079
|
+
}) => await F.transition(a.dealUuid, t.toBoardColumnUuid),
|
|
1087
1080
|
queryKeysToInvalidate: {
|
|
1088
1081
|
dealDetail: {
|
|
1089
1082
|
dealUuid: (t) => t.dealUuid
|
|
@@ -1092,17 +1085,17 @@ function ft() {
|
|
|
1092
1085
|
}
|
|
1093
1086
|
});
|
|
1094
1087
|
}
|
|
1095
|
-
function
|
|
1096
|
-
return
|
|
1088
|
+
function rt(t, a) {
|
|
1089
|
+
return he("boardColumnsTransition", {
|
|
1097
1090
|
params: {
|
|
1098
1091
|
boardColumnUuid: t
|
|
1099
1092
|
},
|
|
1100
|
-
queryFn: () =>
|
|
1093
|
+
queryFn: () => la.getTransitions(t.value, a.value)
|
|
1101
1094
|
});
|
|
1102
1095
|
}
|
|
1103
|
-
const
|
|
1096
|
+
const st = /* @__PURE__ */ D({
|
|
1104
1097
|
__name: "DealDetailSidebarTransitionSelect",
|
|
1105
|
-
props: /* @__PURE__ */
|
|
1098
|
+
props: /* @__PURE__ */ Se({
|
|
1106
1099
|
deal: {}
|
|
1107
1100
|
}, {
|
|
1108
1101
|
modelValue: {
|
|
@@ -1112,54 +1105,55 @@ const gt = /* @__PURE__ */ x({
|
|
|
1112
1105
|
}),
|
|
1113
1106
|
emits: ["update:modelValue"],
|
|
1114
1107
|
setup(t) {
|
|
1115
|
-
const a = t, n =
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
),
|
|
1119
|
-
|
|
1120
|
-
] :
|
|
1121
|
-
...
|
|
1122
|
-
toColumnDisplayName:
|
|
1108
|
+
const a = t, n = x(), i = oa(), u = W().create(ia), p = Ne(t, "modelValue"), f = L(), d = it(), c = rt(
|
|
1109
|
+
P(() => p.value.toColumnUuid),
|
|
1110
|
+
P(() => i.getOptions().deals?.allowedTransitionTriggerTypes ?? [])
|
|
1111
|
+
), v = P(() => (c.result.value.isOk() ? c.result.value.getValue() : []).flatMap((r) => r.triggers.length === 0 ? [
|
|
1112
|
+
r
|
|
1113
|
+
] : r.triggers.map((U) => ({
|
|
1114
|
+
...r,
|
|
1115
|
+
toColumnDisplayName: r.toColumnDisplayName,
|
|
1123
1116
|
triggers: [
|
|
1124
|
-
|
|
1117
|
+
U
|
|
1125
1118
|
]
|
|
1126
1119
|
}))));
|
|
1127
|
-
function
|
|
1128
|
-
return
|
|
1120
|
+
function h(b) {
|
|
1121
|
+
return b?.toColumnDisplayName ?? "-";
|
|
1129
1122
|
}
|
|
1130
|
-
const _ =
|
|
1131
|
-
async function y(
|
|
1132
|
-
if (
|
|
1133
|
-
if (
|
|
1134
|
-
|
|
1123
|
+
const _ = P(() => H(v.value));
|
|
1124
|
+
async function y(b) {
|
|
1125
|
+
if (b.triggers.length !== 0) {
|
|
1126
|
+
if (b.triggers[0]?.triggerType === Te.EMAIL) {
|
|
1127
|
+
u.open({
|
|
1135
1128
|
dealUuid: a.deal.uuid,
|
|
1136
1129
|
client: {
|
|
1137
1130
|
uuid: a.deal.client.uuid,
|
|
1138
1131
|
type: a.deal.client.type
|
|
1139
1132
|
},
|
|
1140
|
-
|
|
1133
|
+
defaultSenderEmails: a.deal.contactPersons.map((r) => r.email).filter((r) => r !== null),
|
|
1134
|
+
templateKey: b.triggers[0].config.mailTemplateKey
|
|
1141
1135
|
});
|
|
1142
1136
|
return;
|
|
1143
1137
|
}
|
|
1144
1138
|
try {
|
|
1145
|
-
p.value =
|
|
1139
|
+
p.value = b, await d.execute({
|
|
1146
1140
|
body: {
|
|
1147
|
-
toBoardColumnUuid:
|
|
1141
|
+
toBoardColumnUuid: b.toColumnUuid
|
|
1148
1142
|
},
|
|
1149
1143
|
params: {
|
|
1150
1144
|
dealUuid: a.deal.uuid
|
|
1151
1145
|
}
|
|
1152
1146
|
});
|
|
1153
|
-
} catch (
|
|
1154
|
-
f.show(
|
|
1147
|
+
} catch (r) {
|
|
1148
|
+
f.show(r);
|
|
1155
1149
|
}
|
|
1156
1150
|
}
|
|
1157
1151
|
}
|
|
1158
|
-
return (
|
|
1152
|
+
return (b, r) => (m(), g(ra, {
|
|
1159
1153
|
color: p.value?.toColumnColor ?? null
|
|
1160
1154
|
}, {
|
|
1161
|
-
default:
|
|
1162
|
-
|
|
1155
|
+
default: s(() => [
|
|
1156
|
+
v.value.length === 0 ? (m(), g(e(ve), {
|
|
1163
1157
|
key: 0,
|
|
1164
1158
|
"class-config": {
|
|
1165
1159
|
root: "text-nowrap"
|
|
@@ -1167,11 +1161,11 @@ const gt = /* @__PURE__ */ x({
|
|
|
1167
1161
|
label: p.value.toColumnDisplayName,
|
|
1168
1162
|
variant: "translucent",
|
|
1169
1163
|
color: "brand"
|
|
1170
|
-
}, null, 8, ["label"])) : (
|
|
1164
|
+
}, null, 8, ["label"])) : (m(), g(e(Y), {
|
|
1171
1165
|
key: 1,
|
|
1172
1166
|
"model-value": p.value,
|
|
1173
|
-
"is-loading": e(
|
|
1174
|
-
"display-fn":
|
|
1167
|
+
"is-loading": e(d).isLoading.value,
|
|
1168
|
+
"display-fn": h,
|
|
1175
1169
|
items: _.value,
|
|
1176
1170
|
"is-label-hidden": !0,
|
|
1177
1171
|
placeholder: e(n).t("wise_crm.deal.transition.placeholder"),
|
|
@@ -1184,12 +1178,12 @@ const gt = /* @__PURE__ */ x({
|
|
|
1184
1178
|
}, 8, ["color"]));
|
|
1185
1179
|
}
|
|
1186
1180
|
});
|
|
1187
|
-
function
|
|
1188
|
-
return
|
|
1181
|
+
function ut() {
|
|
1182
|
+
return $({
|
|
1189
1183
|
queryFn: async ({
|
|
1190
1184
|
body: t,
|
|
1191
1185
|
params: a
|
|
1192
|
-
}) => await
|
|
1186
|
+
}) => await me.create(t, {
|
|
1193
1187
|
dealUuid: a.dealUuid
|
|
1194
1188
|
}),
|
|
1195
1189
|
queryKeysToInvalidate: {
|
|
@@ -1197,34 +1191,34 @@ function yt() {
|
|
|
1197
1191
|
}
|
|
1198
1192
|
});
|
|
1199
1193
|
}
|
|
1200
|
-
function
|
|
1201
|
-
return
|
|
1194
|
+
function ct(t, a) {
|
|
1195
|
+
return xa("noteDealIndex", {
|
|
1202
1196
|
params: {
|
|
1203
1197
|
params: a?.params
|
|
1204
1198
|
},
|
|
1205
|
-
queryFn: (n) =>
|
|
1199
|
+
queryFn: (n) => me.getDealNotes({
|
|
1206
1200
|
pagination: n
|
|
1207
1201
|
}, t.value)
|
|
1208
1202
|
});
|
|
1209
1203
|
}
|
|
1210
|
-
const
|
|
1204
|
+
const dt = /* @__PURE__ */ D({
|
|
1211
1205
|
__name: "DealDialogSidebarNotesContent",
|
|
1212
1206
|
props: {
|
|
1213
1207
|
deal: {}
|
|
1214
1208
|
},
|
|
1215
1209
|
setup(t) {
|
|
1216
|
-
const a = t, i =
|
|
1217
|
-
|
|
1218
|
-
),
|
|
1219
|
-
async function
|
|
1220
|
-
await
|
|
1210
|
+
const a = t, i = W().create(sa), o = L(), u = ut(), p = ua(), f = ct(
|
|
1211
|
+
P(() => a.deal.uuid)
|
|
1212
|
+
), d = P(() => f.result.value.isOk() ? f.result.value.getValue().data : []);
|
|
1213
|
+
async function c(_) {
|
|
1214
|
+
await u.execute({
|
|
1221
1215
|
body: _,
|
|
1222
1216
|
params: {
|
|
1223
1217
|
dealUuid: a.deal.uuid
|
|
1224
1218
|
}
|
|
1225
1219
|
});
|
|
1226
1220
|
}
|
|
1227
|
-
async function
|
|
1221
|
+
async function v(_) {
|
|
1228
1222
|
try {
|
|
1229
1223
|
await p.execute({
|
|
1230
1224
|
params: {
|
|
@@ -1235,31 +1229,31 @@ const ht = /* @__PURE__ */ x({
|
|
|
1235
1229
|
o.show(y);
|
|
1236
1230
|
}
|
|
1237
1231
|
}
|
|
1238
|
-
function
|
|
1232
|
+
function h(_) {
|
|
1239
1233
|
i.open({
|
|
1240
1234
|
note: _
|
|
1241
1235
|
});
|
|
1242
1236
|
}
|
|
1243
|
-
return (_, y) => (
|
|
1237
|
+
return (_, y) => (m(), g(ca, {
|
|
1244
1238
|
"is-loading": e(f).isLoading.value,
|
|
1245
|
-
notes:
|
|
1246
|
-
"on-submit":
|
|
1239
|
+
notes: d.value,
|
|
1240
|
+
"on-submit": c,
|
|
1247
1241
|
"has-next-page": e(f).hasNextPage.value,
|
|
1248
|
-
onNext: y[0] || (y[0] = (
|
|
1249
|
-
onDelete:
|
|
1250
|
-
onUpdate:
|
|
1242
|
+
onNext: y[0] || (y[0] = (b) => e(f).fetchNextPage()),
|
|
1243
|
+
onDelete: v,
|
|
1244
|
+
onUpdate: h
|
|
1251
1245
|
}, null, 8, ["is-loading", "notes", "has-next-page"]));
|
|
1252
1246
|
}
|
|
1253
|
-
}),
|
|
1247
|
+
}), mt = { class: "flex h-full flex-1 flex-col" }, pt = { class: "flex flex-col gap-xl rounded-2xl border border-primary p-xl" }, ft = { class: "flex w-full flex-wrap items-center gap-sm" }, _t = /* @__PURE__ */ D({
|
|
1254
1248
|
__name: "DealDetailSidebar",
|
|
1255
1249
|
props: {
|
|
1256
1250
|
deal: {}
|
|
1257
1251
|
},
|
|
1258
1252
|
setup(t) {
|
|
1259
|
-
const a = t, n =
|
|
1253
|
+
const a = t, n = x(), i = da(), o = T(
|
|
1260
1254
|
"overview"
|
|
1261
1255
|
/* OVERVIEW */
|
|
1262
|
-
),
|
|
1256
|
+
), u = T({
|
|
1263
1257
|
// There is no uuid available for the initial value, so a placeholder is used
|
|
1264
1258
|
uuid: "",
|
|
1265
1259
|
toColumnUuid: a.deal.boardColumn.uuid,
|
|
@@ -1267,44 +1261,44 @@ const ht = /* @__PURE__ */ x({
|
|
|
1267
1261
|
toColumnDisplayName: a.deal.boardColumn.displayName,
|
|
1268
1262
|
toColumnKey: "",
|
|
1269
1263
|
triggers: []
|
|
1270
|
-
}), p =
|
|
1264
|
+
}), p = P(() => [
|
|
1271
1265
|
{
|
|
1272
|
-
icon:
|
|
1266
|
+
icon: de,
|
|
1273
1267
|
label: n.t("wise_crm.shared.overview"),
|
|
1274
1268
|
value: "overview"
|
|
1275
1269
|
/* OVERVIEW */
|
|
1276
1270
|
},
|
|
1277
1271
|
{
|
|
1278
|
-
icon:
|
|
1272
|
+
icon: ma,
|
|
1279
1273
|
label: n.t("wise_crm.shared.activity"),
|
|
1280
1274
|
value: "activity"
|
|
1281
1275
|
/* ACTIVITY */
|
|
1282
1276
|
},
|
|
1283
1277
|
{
|
|
1284
|
-
icon:
|
|
1278
|
+
icon: pa,
|
|
1285
1279
|
label: n.t("wise_crm.shared.notes"),
|
|
1286
1280
|
value: "notes"
|
|
1287
1281
|
/* NOTES */
|
|
1288
1282
|
}
|
|
1289
1283
|
]);
|
|
1290
|
-
return (f,
|
|
1291
|
-
|
|
1292
|
-
l(
|
|
1284
|
+
return (f, d) => (m(), M("div", mt, [
|
|
1285
|
+
k("div", pt, [
|
|
1286
|
+
l(qa, {
|
|
1293
1287
|
deal: a.deal
|
|
1294
1288
|
}, null, 8, ["deal"]),
|
|
1295
|
-
|
|
1296
|
-
l(
|
|
1297
|
-
onClick:
|
|
1289
|
+
k("div", ft, [
|
|
1290
|
+
l(fa, {
|
|
1291
|
+
onClick: d[0] || (d[0] = (c) => e(i).openBusinessDetail(
|
|
1298
1292
|
a.deal.client.uuid
|
|
1299
1293
|
))
|
|
1300
1294
|
}, {
|
|
1301
|
-
default:
|
|
1302
|
-
l(e(
|
|
1295
|
+
default: s(() => [
|
|
1296
|
+
l(e(ve), {
|
|
1303
1297
|
"class-config": {
|
|
1304
1298
|
icon: "shrink-0 size-4",
|
|
1305
1299
|
root: "text-nowrap"
|
|
1306
1300
|
},
|
|
1307
|
-
icon: e(
|
|
1301
|
+
icon: e(_a),
|
|
1308
1302
|
label: a.deal.client.name,
|
|
1309
1303
|
variant: "translucent",
|
|
1310
1304
|
color: "brand"
|
|
@@ -1312,82 +1306,82 @@ const ht = /* @__PURE__ */ x({
|
|
|
1312
1306
|
]),
|
|
1313
1307
|
_: 1
|
|
1314
1308
|
}),
|
|
1315
|
-
l(
|
|
1316
|
-
modelValue:
|
|
1317
|
-
"onUpdate:modelValue":
|
|
1309
|
+
l(st, {
|
|
1310
|
+
modelValue: u.value,
|
|
1311
|
+
"onUpdate:modelValue": d[1] || (d[1] = (c) => u.value = c),
|
|
1318
1312
|
deal: a.deal
|
|
1319
1313
|
}, null, 8, ["modelValue", "deal"])
|
|
1320
1314
|
])
|
|
1321
1315
|
]),
|
|
1322
|
-
l(
|
|
1316
|
+
l(ga, {
|
|
1323
1317
|
modelValue: o.value,
|
|
1324
|
-
"onUpdate:modelValue":
|
|
1318
|
+
"onUpdate:modelValue": d[2] || (d[2] = (c) => o.value = c),
|
|
1325
1319
|
tabs: p.value
|
|
1326
1320
|
}, {
|
|
1327
|
-
default:
|
|
1328
|
-
o.value === "overview" ? (
|
|
1321
|
+
default: s(() => [
|
|
1322
|
+
o.value === "overview" ? (m(), g(ot, {
|
|
1329
1323
|
key: 0,
|
|
1330
1324
|
deal: a.deal
|
|
1331
|
-
}, null, 8, ["deal"])) : o.value === "notes" ? (
|
|
1325
|
+
}, null, 8, ["deal"])) : o.value === "notes" ? (m(), g(dt, {
|
|
1332
1326
|
key: 1,
|
|
1333
1327
|
deal: a.deal
|
|
1334
|
-
}, null, 8, ["deal"])) :
|
|
1328
|
+
}, null, 8, ["deal"])) : N("", !0)
|
|
1335
1329
|
]),
|
|
1336
1330
|
_: 1
|
|
1337
1331
|
}, 8, ["modelValue", "tabs"])
|
|
1338
1332
|
]));
|
|
1339
1333
|
}
|
|
1340
|
-
}),
|
|
1334
|
+
}), gt = /* @__PURE__ */ D({
|
|
1341
1335
|
__name: "DealDetailSidebarProvider",
|
|
1342
1336
|
props: {
|
|
1343
1337
|
dealUuid: {}
|
|
1344
1338
|
},
|
|
1345
1339
|
setup(t) {
|
|
1346
|
-
const a = t, n =
|
|
1347
|
-
|
|
1348
|
-
), i =
|
|
1349
|
-
return (o,
|
|
1350
|
-
default:
|
|
1351
|
-
e(n).isError.value ? (
|
|
1340
|
+
const a = t, n = ya(
|
|
1341
|
+
P(() => a.dealUuid)
|
|
1342
|
+
), i = x();
|
|
1343
|
+
return (o, u) => (m(), g(ba, null, {
|
|
1344
|
+
default: s(() => [
|
|
1345
|
+
e(n).isError.value ? (m(), g(va, {
|
|
1352
1346
|
key: 0,
|
|
1353
1347
|
message: e(i).t("error.deal_details.description"),
|
|
1354
1348
|
title: e(i).t("error.deal_details.title")
|
|
1355
|
-
}, null, 8, ["message", "title"])) : e(n).isLoading.value ? (
|
|
1349
|
+
}, null, 8, ["message", "title"])) : e(n).isLoading.value ? (m(), g(ha, {
|
|
1356
1350
|
key: 1,
|
|
1357
1351
|
class: "h-full"
|
|
1358
|
-
})) : e(n).result.value.isOk() ? (
|
|
1352
|
+
})) : e(n).result.value.isOk() ? (m(), g(_t, {
|
|
1359
1353
|
key: e(n).result.value.getValue().boardColumn.uuid,
|
|
1360
1354
|
deal: e(n).result.value.getValue()
|
|
1361
|
-
}, null, 8, ["deal"])) :
|
|
1355
|
+
}, null, 8, ["deal"])) : N("", !0)
|
|
1362
1356
|
]),
|
|
1363
1357
|
_: 1
|
|
1364
1358
|
}));
|
|
1365
1359
|
}
|
|
1366
|
-
}),
|
|
1360
|
+
}), St = /* @__PURE__ */ D({
|
|
1367
1361
|
__name: "DealDetailView",
|
|
1368
1362
|
props: {
|
|
1369
1363
|
tabs: {}
|
|
1370
1364
|
},
|
|
1371
1365
|
setup(t) {
|
|
1372
|
-
const a = t, n =
|
|
1366
|
+
const a = t, n = x(), i = ke("dealUuid"), o = P(() => [
|
|
1373
1367
|
...a.tabs,
|
|
1374
1368
|
{
|
|
1375
|
-
label:
|
|
1369
|
+
label: P(() => n.t("wise_crm.deal.detail_view.communication_tab_label")),
|
|
1376
1370
|
to: "deal-communication"
|
|
1377
1371
|
}
|
|
1378
1372
|
]);
|
|
1379
|
-
return (
|
|
1373
|
+
return (u, p) => (m(), g(Me, {
|
|
1380
1374
|
key: e(i),
|
|
1381
|
-
"entity-type": e(
|
|
1375
|
+
"entity-type": e(ie).BUSINESS,
|
|
1382
1376
|
tabs: o.value
|
|
1383
1377
|
}, {
|
|
1384
|
-
sidebar:
|
|
1385
|
-
l(
|
|
1378
|
+
sidebar: s(() => [
|
|
1379
|
+
l(gt, { "deal-uuid": e(i) }, null, 8, ["deal-uuid"])
|
|
1386
1380
|
]),
|
|
1387
1381
|
_: 1
|
|
1388
1382
|
}, 8, ["entity-type", "tabs"]));
|
|
1389
1383
|
}
|
|
1390
1384
|
});
|
|
1391
1385
|
export {
|
|
1392
|
-
|
|
1386
|
+
St as default
|
|
1393
1387
|
};
|