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