@wisemen/wise-crm-web 2.0.0-alpha.11 → 2.0.0-alpha.13
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-D7hxiONf.js → BusinessDetailView-DTY5Ov9g.js} +3 -3
- package/dist/{CrmDetailView.vue_vue_type_script_setup_true_lang-BF8hf6cf.js → CrmDetailView.vue_vue_type_script_setup_true_lang-DVQiT3Dp.js} +1 -1
- package/dist/{DealCommunicationTabView-eB4ZK4Xm.js → DealCommunicationTabView-Bu35rD0n.js} +1 -1
- package/dist/{DealDetailView-SkQ6e-Oe.js → DealDetailView-DrvM0GwH.js} +261 -252
- package/dist/{IndividualDetailView-B5Jyf-Vf.js → IndividualDetailView-C6mdYISi.js} +3 -3
- package/dist/{index-CZFDtbuz.js → index-xck90fnP.js} +3065 -2978
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/testing.js +1 -1
- package/dist/{uuid.util-CaePLXHv.js → uuid.util-90e4mXv8.js} +459 -459
- package/package.json +3 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as x, ref as M, useTemplateRef as xe, openBlock as d, createElementBlock as V, createBlock as g, unref as e, withCtx as
|
|
1
|
+
import { defineComponent as x, ref as M, useTemplateRef as xe, openBlock as d, createElementBlock as V, createBlock as g, unref as e, withCtx as i, createVNode as l, mergeProps as q, createElementVNode as F, toDisplayString as R, nextTick as Ie, computed as C, createCommentVNode as S, Fragment as ee, createTextVNode as le, renderList as Ne, useModel as Se, mergeModels as Fe } from "vue";
|
|
2
2
|
import { useRouteParams as ke } from "@vueuse/router";
|
|
3
3
|
import { useI18n as I } from "vue-i18n";
|
|
4
|
-
import {
|
|
5
|
-
import { _ as Ve } from "./CrmDetailView.vue_vue_type_script_setup_true_lang-
|
|
6
|
-
import { c as k, d as
|
|
7
|
-
import { UITextField as z, toFormField as O, UIIconButton as
|
|
8
|
-
import { useForm as
|
|
9
|
-
import
|
|
10
|
-
import { useMutation as T, useQuery as
|
|
4
|
+
import { aZ as de, b3 as $e, b5 as Te, b8 as Me } from "./uuid.util-90e4mXv8.js";
|
|
5
|
+
import { _ as Ve } from "./CrmDetailView.vue_vue_type_script_setup_true_lang-DVQiT3Dp.js";
|
|
6
|
+
import { c as k, d as E, e as Le, E as me, C as pe, f as Ee, h as qe, i as Oe, j as Qe, k as j, g as Ae, J as Be, l as Ke, n as oe, o as je, I as Re, p as fe, q as Q, r as ze, s as _e, t as Ge, v as Ze, U as Ye, w as He, u as Je, x as Xe, Q as We, y as ea, z as aa, B as ta, F as re, G as ge, H as na, K as ie, L as la, N as oa, O as ra, P as ia, R as sa, S as be, T as ua, V as ca, W as da, X as ma, Y as pa, Z as fa, $ as _a, a0 as ga, a1 as ba, a2 as ya, a3 as va, A as ha } from "./index-xck90fnP.js";
|
|
7
|
+
import { UITextField as z, toFormField as O, UIIconButton as ye, UIDropdownMenu as Ua, UIDropdownMenuGroup as wa, UIDropdownMenuItem as se, UIPhoneNumberField as ue, UIFormLayout as ae, UIFormFieldGroup as A, UIFormFieldGrid as B, useToast as Ca, UIFormDialog as ve, UIDialogHeader as he, UIForm as ce, UIDialogBody as Y, UIDialogFooter as H, UIDialogFooterSubmit as J, createAutocompleteOptions as Pa, createSelectOptions as X, UIAutocomplete as Da, UISelect as W, useOverlay as te, UIButton as xa, UIBadge as Ue } from "@wisemen/vue-core-design-system";
|
|
8
|
+
import { useForm as G } from "formango";
|
|
9
|
+
import Z, { z as N } from "zod";
|
|
10
|
+
import { useMutation as T, useQuery as we, useOffsetInfiniteQuery as Ia, useKeysetInfiniteQuery as Na } from "@wisemen/vue-core-api-utils";
|
|
11
11
|
import { Motion as Sa } from "motion-v";
|
|
12
12
|
import { useQueryClient as Fa, useMutation as ka } from "@tanstack/vue-query";
|
|
13
13
|
function $a() {
|
|
@@ -77,15 +77,15 @@ function Va() {
|
|
|
77
77
|
const La = {
|
|
78
78
|
key: 1,
|
|
79
79
|
class: "flex justify-between"
|
|
80
|
-
},
|
|
80
|
+
}, Ea = { class: "text-xl font-bold text-primary" }, qa = /* @__PURE__ */ x({
|
|
81
81
|
__name: "DealDetailSidebarNameField",
|
|
82
82
|
props: {
|
|
83
83
|
deal: {}
|
|
84
84
|
},
|
|
85
85
|
setup(t) {
|
|
86
|
-
const a = t, n = I(),
|
|
87
|
-
schema:
|
|
88
|
-
name:
|
|
86
|
+
const a = t, n = I(), r = E(), o = M(!1), s = xe("nameFieldContainerRef"), p = Va(), f = G({
|
|
87
|
+
schema: Z.object({
|
|
88
|
+
name: Z.string().min(1)
|
|
89
89
|
}),
|
|
90
90
|
onSubmit: async (_) => {
|
|
91
91
|
try {
|
|
@@ -98,7 +98,7 @@ const La = {
|
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
} catch (b) {
|
|
101
|
-
|
|
101
|
+
r.show(b);
|
|
102
102
|
} finally {
|
|
103
103
|
o.value = !1;
|
|
104
104
|
}
|
|
@@ -127,8 +127,8 @@ const La = {
|
|
|
127
127
|
key: 0,
|
|
128
128
|
form: e(f)
|
|
129
129
|
}, {
|
|
130
|
-
default:
|
|
131
|
-
l(e(z),
|
|
130
|
+
default: i(() => [
|
|
131
|
+
l(e(z), q(e(O)(e(m)), {
|
|
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",
|
|
@@ -141,10 +141,10 @@ const La = {
|
|
|
141
141
|
]),
|
|
142
142
|
_: 1
|
|
143
143
|
}, 8, ["form"])) : (d(), V("div", La, [
|
|
144
|
-
F("h2",
|
|
145
|
-
l(e(
|
|
144
|
+
F("h2", Ea, R(a.deal.name), 1),
|
|
145
|
+
l(e(ye), {
|
|
146
146
|
label: e(n).t("wise_crm.deal.detail.sidebar.name_field.edit_label"),
|
|
147
|
-
icon: e(
|
|
147
|
+
icon: e(me),
|
|
148
148
|
variant: "tertiary",
|
|
149
149
|
class: "shrink-0",
|
|
150
150
|
onClick: u
|
|
@@ -155,12 +155,12 @@ const La = {
|
|
|
155
155
|
});
|
|
156
156
|
function Oa() {
|
|
157
157
|
const t = Fa(), a = "dealDetail", n = ka({
|
|
158
|
-
mutationFn: async (
|
|
159
|
-
const o = await k.setPrimaryContactPerson(
|
|
158
|
+
mutationFn: async (r) => {
|
|
159
|
+
const o = await k.setPrimaryContactPerson(r.dealUuid, r.contactPersonUuid);
|
|
160
160
|
if (o.isErr())
|
|
161
161
|
throw o.error;
|
|
162
162
|
},
|
|
163
|
-
onError: (
|
|
163
|
+
onError: (r, o, s) => {
|
|
164
164
|
t.setQueryData(
|
|
165
165
|
[
|
|
166
166
|
a,
|
|
@@ -171,12 +171,12 @@ function Oa() {
|
|
|
171
171
|
s?.previousData
|
|
172
172
|
);
|
|
173
173
|
},
|
|
174
|
-
onMutate: async (
|
|
174
|
+
onMutate: async (r) => {
|
|
175
175
|
await t.cancelQueries({
|
|
176
176
|
queryKey: [
|
|
177
177
|
a,
|
|
178
178
|
{
|
|
179
|
-
dealUuid:
|
|
179
|
+
dealUuid: r.dealUuid
|
|
180
180
|
}
|
|
181
181
|
]
|
|
182
182
|
});
|
|
@@ -184,7 +184,7 @@ function Oa() {
|
|
|
184
184
|
[
|
|
185
185
|
a,
|
|
186
186
|
{
|
|
187
|
-
dealUuid:
|
|
187
|
+
dealUuid: r.dealUuid
|
|
188
188
|
}
|
|
189
189
|
]
|
|
190
190
|
);
|
|
@@ -192,21 +192,21 @@ function Oa() {
|
|
|
192
192
|
[
|
|
193
193
|
a,
|
|
194
194
|
{
|
|
195
|
-
dealUuid:
|
|
195
|
+
dealUuid: r.dealUuid
|
|
196
196
|
}
|
|
197
197
|
],
|
|
198
198
|
o.map((s) => ({
|
|
199
199
|
...s,
|
|
200
200
|
contactPersons: s.contactPersons.map((p) => ({
|
|
201
201
|
...p,
|
|
202
|
-
isPrimary: p.uuid ===
|
|
202
|
+
isPrimary: p.uuid === r.contactPersonUuid
|
|
203
203
|
}))
|
|
204
204
|
}))
|
|
205
205
|
), {
|
|
206
206
|
previousData: o
|
|
207
207
|
});
|
|
208
208
|
},
|
|
209
|
-
onSettled: (
|
|
209
|
+
onSettled: (r, o, s) => {
|
|
210
210
|
s !== void 0 && t.invalidateQueries({
|
|
211
211
|
queryKey: [
|
|
212
212
|
a,
|
|
@@ -218,9 +218,9 @@ function Oa() {
|
|
|
218
218
|
}
|
|
219
219
|
});
|
|
220
220
|
return {
|
|
221
|
-
isLoading:
|
|
222
|
-
data:
|
|
223
|
-
execute: async (
|
|
221
|
+
isLoading: C(() => n.isPending.value),
|
|
222
|
+
data: C(() => n.data.value),
|
|
223
|
+
execute: async (r) => await n.mutateAsync(r.params)
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
226
|
function Qa() {
|
|
@@ -240,7 +240,7 @@ function Qa() {
|
|
|
240
240
|
const Aa = { class: "flex items-start justify-between" }, Ba = { class: "flex flex-col items-start" }, Ka = {
|
|
241
241
|
key: 1,
|
|
242
242
|
class: "mt-sm text-brand-700"
|
|
243
|
-
}, ja = { class: "-mt-2 -mr-2 flex items-center justify-end" },
|
|
243
|
+
}, ja = { class: "-mt-2 -mr-2 flex items-center justify-end" }, Ra = { class: "grid gap-lg" }, za = /* @__PURE__ */ x({
|
|
244
244
|
__name: "CrmDetailSidebarAccordionGenericContactPersonInfo",
|
|
245
245
|
props: {
|
|
246
246
|
contactPerson: {},
|
|
@@ -249,9 +249,9 @@ const Aa = { class: "flex items-start justify-between" }, Ba = { class: "flex fl
|
|
|
249
249
|
},
|
|
250
250
|
emits: ["delete", "update"],
|
|
251
251
|
setup(t, { emit: a }) {
|
|
252
|
-
const n = t,
|
|
252
|
+
const n = t, r = a, o = I(), s = n.contactPerson.uuid ?? n.contactPerson.contactPersonUuid, p = {
|
|
253
253
|
left: {
|
|
254
|
-
icon:
|
|
254
|
+
icon: me,
|
|
255
255
|
type: "icon"
|
|
256
256
|
}
|
|
257
257
|
}, f = {
|
|
@@ -261,50 +261,50 @@ const Aa = { class: "flex items-start justify-between" }, Ba = { class: "flex fl
|
|
|
261
261
|
}
|
|
262
262
|
};
|
|
263
263
|
function m() {
|
|
264
|
-
|
|
264
|
+
r("update");
|
|
265
265
|
}
|
|
266
266
|
function u() {
|
|
267
|
-
|
|
267
|
+
r("delete");
|
|
268
268
|
}
|
|
269
269
|
function y() {
|
|
270
270
|
n.onToggleIsPrimary();
|
|
271
271
|
}
|
|
272
|
-
return (v, _) => (d(), g(
|
|
273
|
-
default:
|
|
272
|
+
return (v, _) => (d(), g(pe, { class: "flex flex-col gap-lg" }, {
|
|
273
|
+
default: i(() => [
|
|
274
274
|
F("div", Aa, [
|
|
275
275
|
F("div", Ba, [
|
|
276
|
-
e(s) ? (d(), g(
|
|
276
|
+
e(s) ? (d(), g(Ee, {
|
|
277
277
|
key: 0,
|
|
278
278
|
label: `${n.contactPerson.firstName} ${n.contactPerson.lastName}`,
|
|
279
|
-
"entity-type": e(
|
|
279
|
+
"entity-type": e(de).INDIVIDUAL,
|
|
280
280
|
uuid: e(s),
|
|
281
281
|
class: "-m-xs"
|
|
282
|
-
}, null, 8, ["label", "entity-type", "uuid"])) :
|
|
283
|
-
n.description ? (d(), V("p", Ka,
|
|
282
|
+
}, null, 8, ["label", "entity-type", "uuid"])) : S("", !0),
|
|
283
|
+
n.description ? (d(), V("p", Ka, R(n.description), 1)) : S("", !0)
|
|
284
284
|
]),
|
|
285
285
|
F("div", ja, [
|
|
286
|
-
l(
|
|
286
|
+
l(qe, {
|
|
287
287
|
"is-active": n.contactPerson.isPrimary,
|
|
288
288
|
onClick: y
|
|
289
289
|
}, null, 8, ["is-active"]),
|
|
290
290
|
l(e(Ua), { "popover-align": "end" }, {
|
|
291
|
-
trigger:
|
|
292
|
-
l(e(
|
|
291
|
+
trigger: i(() => [
|
|
292
|
+
l(e(ye), {
|
|
293
293
|
icon: e(Qe),
|
|
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: i(() => [
|
|
300
|
+
l(e(wa), null, {
|
|
301
|
+
default: i(() => [
|
|
302
|
+
l(e(se), {
|
|
303
303
|
config: p,
|
|
304
304
|
label: e(o).t("wise_crm.info_dialog.sidebar.overview.update_contact_person"),
|
|
305
305
|
onSelect: m
|
|
306
306
|
}, null, 8, ["label"]),
|
|
307
|
-
l(e(
|
|
307
|
+
l(e(se), {
|
|
308
308
|
"is-destructive": !0,
|
|
309
309
|
"is-disabled": n.contactPerson.isPrimary,
|
|
310
310
|
config: f,
|
|
@@ -319,22 +319,22 @@ const Aa = { class: "flex items-start justify-between" }, Ba = { class: "flex fl
|
|
|
319
319
|
})
|
|
320
320
|
])
|
|
321
321
|
]),
|
|
322
|
-
F("div",
|
|
323
|
-
n.contactPerson.email !== null ? (d(), g(
|
|
322
|
+
F("div", Ra, [
|
|
323
|
+
n.contactPerson.email !== null ? (d(), g(j, {
|
|
324
324
|
key: 0,
|
|
325
325
|
label: n.contactPerson.email,
|
|
326
326
|
icon: e(Ae)
|
|
327
|
-
}, null, 8, ["label", "icon"])) :
|
|
328
|
-
n.contactPerson.mobilePhone !== null ? (d(), g(
|
|
327
|
+
}, null, 8, ["label", "icon"])) : S("", !0),
|
|
328
|
+
n.contactPerson.mobilePhone !== null ? (d(), g(j, {
|
|
329
329
|
key: 1,
|
|
330
330
|
label: n.contactPerson.mobilePhone,
|
|
331
331
|
icon: e(Be)
|
|
332
|
-
}, null, 8, ["label", "icon"])) :
|
|
333
|
-
n.contactPerson.phone !== null ? (d(), g(
|
|
332
|
+
}, null, 8, ["label", "icon"])) : S("", !0),
|
|
333
|
+
n.contactPerson.phone !== null ? (d(), g(j, {
|
|
334
334
|
key: 2,
|
|
335
335
|
label: n.contactPerson.phone,
|
|
336
336
|
icon: e(Ke)
|
|
337
|
-
}, null, 8, ["label", "icon"])) :
|
|
337
|
+
}, null, 8, ["label", "icon"])) : S("", !0)
|
|
338
338
|
])
|
|
339
339
|
]),
|
|
340
340
|
_: 1
|
|
@@ -359,7 +359,7 @@ function Ga() {
|
|
|
359
359
|
}
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
|
-
const
|
|
362
|
+
const ne = /* @__PURE__ */ x({
|
|
363
363
|
__name: "ContactPersonFormContactField",
|
|
364
364
|
props: {
|
|
365
365
|
email: {},
|
|
@@ -368,57 +368,57 @@ const te = /* @__PURE__ */ x({
|
|
|
368
368
|
},
|
|
369
369
|
setup(t) {
|
|
370
370
|
const a = t, n = I();
|
|
371
|
-
return (
|
|
372
|
-
l(e(z),
|
|
371
|
+
return (r, o) => (d(), V(ee, null, [
|
|
372
|
+
l(e(z), q(e(O)(a.email), {
|
|
373
373
|
label: e(n).t("wise_crm.contact.create_dialog.form.fields.email"),
|
|
374
374
|
placeholder: e(n).t("wise_crm.contact.create_dialog.form.fields.email"),
|
|
375
375
|
class: "col-span-2"
|
|
376
376
|
}), null, 16, ["label", "placeholder"]),
|
|
377
|
-
l(
|
|
378
|
-
default:
|
|
379
|
-
|
|
377
|
+
l(oe, { class: "col-span-2" }, {
|
|
378
|
+
default: i(() => [
|
|
379
|
+
le(R(e(n).t("wise_crm.contact.create_dialog.form.seperator_label")), 1)
|
|
380
380
|
]),
|
|
381
381
|
_: 1
|
|
382
382
|
}),
|
|
383
|
-
l(e(
|
|
383
|
+
l(e(ue), q(e(O)(a.mobilePhone), {
|
|
384
384
|
label: e(n).t("wise_crm.contact.create_dialog.form.fields.mobile_phone"),
|
|
385
385
|
placeholder: e(n).t("wise_crm.contact.create_dialog.form.fields.mobile_phone"),
|
|
386
386
|
class: "col-span-2"
|
|
387
387
|
}), null, 16, ["label", "placeholder"]),
|
|
388
|
-
l(
|
|
389
|
-
default:
|
|
390
|
-
|
|
388
|
+
l(oe, { class: "col-span-2" }, {
|
|
389
|
+
default: i(() => [
|
|
390
|
+
le(R(e(n).t("wise_crm.contact.create_dialog.form.seperator_label")), 1)
|
|
391
391
|
]),
|
|
392
392
|
_: 1
|
|
393
393
|
}),
|
|
394
|
-
l(e(
|
|
394
|
+
l(e(ue), q(e(O)(a.phone), {
|
|
395
395
|
label: e(n).t("wise_crm.contact.create_dialog.form.fields.phone"),
|
|
396
396
|
placeholder: e(n).t("wise_crm.contact.create_dialog.form.fields.phone"),
|
|
397
397
|
class: "col-span-2"
|
|
398
398
|
}), null, 16, ["label", "placeholder"])
|
|
399
399
|
], 64));
|
|
400
400
|
}
|
|
401
|
-
}),
|
|
401
|
+
}), Za = /* @__PURE__ */ x({
|
|
402
402
|
__name: "DealContactPersonCreateExistingForm",
|
|
403
403
|
props: {
|
|
404
404
|
form: {}
|
|
405
405
|
},
|
|
406
406
|
emits: ["createNewContactPerson"],
|
|
407
407
|
setup(t, { emit: a }) {
|
|
408
|
-
const n = t,
|
|
408
|
+
const n = t, r = a, o = I(), s = n.form.register("email"), p = n.form.register("phone"), f = n.form.register("mobile"), m = n.form.register("existingContactPerson"), u = M(null);
|
|
409
409
|
async function y(v) {
|
|
410
410
|
if (u.value = v, m.setValue(v?.uuid ?? null), v === null)
|
|
411
411
|
return;
|
|
412
|
-
const _ = await
|
|
412
|
+
const _ = await Re.getByUuid(v.uuid);
|
|
413
413
|
if (_.isErr())
|
|
414
414
|
return;
|
|
415
415
|
const b = _.value;
|
|
416
416
|
s.setValue(b.email), p.setValue(b.phone), f.setValue(b.mobilePhone);
|
|
417
417
|
}
|
|
418
|
-
return (v, _) => (d(), g(e(
|
|
419
|
-
default:
|
|
418
|
+
return (v, _) => (d(), g(e(ae), null, {
|
|
419
|
+
default: i(() => [
|
|
420
420
|
l(e(A), null, {
|
|
421
|
-
default:
|
|
421
|
+
default: i(() => [
|
|
422
422
|
l(je, {
|
|
423
423
|
modelValue: u.value,
|
|
424
424
|
"onUpdate:modelValue": [
|
|
@@ -426,20 +426,20 @@ const te = /* @__PURE__ */ x({
|
|
|
426
426
|
y
|
|
427
427
|
],
|
|
428
428
|
label: e(o).t("wise_crm.contact.create_dialog.form.fields.contact_person"),
|
|
429
|
-
onCreateNew: _[1] || (_[1] = (b) =>
|
|
429
|
+
onCreateNew: _[1] || (_[1] = (b) => r("createNewContactPerson"))
|
|
430
430
|
}, null, 8, ["modelValue", "label"])
|
|
431
431
|
]),
|
|
432
432
|
_: 1
|
|
433
433
|
}),
|
|
434
434
|
l(e(A), null, {
|
|
435
|
-
default:
|
|
435
|
+
default: i(() => [
|
|
436
436
|
l(e(B), {
|
|
437
437
|
sm: 1,
|
|
438
438
|
lg: 1,
|
|
439
439
|
variant: "card"
|
|
440
440
|
}, {
|
|
441
|
-
default:
|
|
442
|
-
l(
|
|
441
|
+
default: i(() => [
|
|
442
|
+
l(ne, {
|
|
443
443
|
email: e(s),
|
|
444
444
|
"mobile-phone": e(f),
|
|
445
445
|
phone: e(p)
|
|
@@ -462,12 +462,12 @@ const te = /* @__PURE__ */ x({
|
|
|
462
462
|
},
|
|
463
463
|
setup(t) {
|
|
464
464
|
const a = t, n = I();
|
|
465
|
-
return (
|
|
466
|
-
l(e(z),
|
|
465
|
+
return (r, o) => (d(), V(ee, null, [
|
|
466
|
+
l(e(z), q(e(O)(a.firstName), {
|
|
467
467
|
label: e(n).t("wise_crm.contact.create_dialog.form.fields.first_name"),
|
|
468
468
|
placeholder: e(n).t("wise_crm.contact.create_dialog.form.fields.first_name")
|
|
469
469
|
}), null, 16, ["label", "placeholder"]),
|
|
470
|
-
l(e(z),
|
|
470
|
+
l(e(z), q(e(O)(a.lastName), {
|
|
471
471
|
label: e(n).t("wise_crm.contact.create_dialog.form.fields.last_name"),
|
|
472
472
|
placeholder: e(n).t("wise_crm.contact.create_dialog.form.fields.last_name")
|
|
473
473
|
}), null, 16, ["label", "placeholder"])
|
|
@@ -479,19 +479,19 @@ const te = /* @__PURE__ */ x({
|
|
|
479
479
|
form: {}
|
|
480
480
|
},
|
|
481
481
|
setup(t) {
|
|
482
|
-
const a = t, n = a.form.register("firstName"),
|
|
483
|
-
return (f, m) => (d(), g(e(
|
|
484
|
-
default:
|
|
482
|
+
const a = t, n = a.form.register("firstName"), r = a.form.register("lastName"), o = a.form.register("email"), s = a.form.register("mobilePhone"), p = a.form.register("phone");
|
|
483
|
+
return (f, m) => (d(), g(e(ae), null, {
|
|
484
|
+
default: i(() => [
|
|
485
485
|
l(e(A), null, {
|
|
486
|
-
default:
|
|
486
|
+
default: i(() => [
|
|
487
487
|
l(e(B), {
|
|
488
488
|
sm: 1,
|
|
489
489
|
lg: 2
|
|
490
490
|
}, {
|
|
491
|
-
default:
|
|
491
|
+
default: i(() => [
|
|
492
492
|
l(Ce, {
|
|
493
493
|
"first-name": e(n),
|
|
494
|
-
"last-name": e(
|
|
494
|
+
"last-name": e(r)
|
|
495
495
|
}, null, 8, ["first-name", "last-name"])
|
|
496
496
|
]),
|
|
497
497
|
_: 1
|
|
@@ -500,14 +500,14 @@ const te = /* @__PURE__ */ x({
|
|
|
500
500
|
_: 1
|
|
501
501
|
}),
|
|
502
502
|
l(e(A), null, {
|
|
503
|
-
default:
|
|
503
|
+
default: i(() => [
|
|
504
504
|
l(e(B), {
|
|
505
505
|
sm: 1,
|
|
506
506
|
lg: 1,
|
|
507
507
|
variant: "card"
|
|
508
508
|
}, {
|
|
509
|
-
default:
|
|
510
|
-
l(
|
|
509
|
+
default: i(() => [
|
|
510
|
+
l(ne, {
|
|
511
511
|
email: e(o),
|
|
512
512
|
"mobile-phone": e(s),
|
|
513
513
|
phone: e(p)
|
|
@@ -515,7 +515,7 @@ const te = /* @__PURE__ */ x({
|
|
|
515
515
|
]),
|
|
516
516
|
_: 1
|
|
517
517
|
}),
|
|
518
|
-
l(
|
|
518
|
+
l(fe, {
|
|
519
519
|
form: a.form
|
|
520
520
|
}, null, 8, ["form"])
|
|
521
521
|
]),
|
|
@@ -525,23 +525,23 @@ const te = /* @__PURE__ */ x({
|
|
|
525
525
|
_: 1
|
|
526
526
|
}));
|
|
527
527
|
}
|
|
528
|
-
}),
|
|
529
|
-
email:
|
|
530
|
-
existingContactPerson:
|
|
528
|
+
}), Ha = Z.object({
|
|
529
|
+
email: Z.email().nullable(),
|
|
530
|
+
existingContactPerson: ze.nullable(),
|
|
531
531
|
mobile: Q.nullable(),
|
|
532
532
|
phone: Q.nullable()
|
|
533
|
-
}),
|
|
534
|
-
email:
|
|
535
|
-
firstName:
|
|
536
|
-
lastName:
|
|
533
|
+
}), Ja = N.object({
|
|
534
|
+
email: N.literal("").or(N.email()).nullable(),
|
|
535
|
+
firstName: N.string().min(1),
|
|
536
|
+
lastName: N.string().min(1),
|
|
537
537
|
mobilePhone: Q.nullable(),
|
|
538
538
|
phone: Q.nullable()
|
|
539
539
|
}).superRefine((t, a) => {
|
|
540
540
|
t.email !== null && t.email !== "" || t.mobilePhone !== null && t.mobilePhone !== "" || t.phone !== null && t.phone !== "" || a.addIssue({
|
|
541
|
-
code:
|
|
542
|
-
message:
|
|
541
|
+
code: N.ZodIssueCode.custom,
|
|
542
|
+
message: _e.global.t("wise_crm.form.errors.at_least_one")
|
|
543
543
|
});
|
|
544
|
-
}),
|
|
544
|
+
}), Xa = /* @__PURE__ */ x({
|
|
545
545
|
__name: "DealContactPersonCreateDialog",
|
|
546
546
|
props: {
|
|
547
547
|
dealUuid: {},
|
|
@@ -549,8 +549,8 @@ const te = /* @__PURE__ */ x({
|
|
|
549
549
|
},
|
|
550
550
|
emits: ["close", "createNewContactPerson"],
|
|
551
551
|
setup(t, { emit: a }) {
|
|
552
|
-
const n = t,
|
|
553
|
-
schema:
|
|
552
|
+
const n = t, r = a, o = I(), s = E(), p = Ca(), f = Ga(), m = Ge(), u = M(n.isCreatingNewContactPerson), y = G({
|
|
553
|
+
schema: Ja,
|
|
554
554
|
onSubmit: async (c) => {
|
|
555
555
|
try {
|
|
556
556
|
const P = await m.execute({
|
|
@@ -567,19 +567,26 @@ const te = /* @__PURE__ */ x({
|
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
569
569
|
const $ = P.value;
|
|
570
|
-
n.isCreatingNewContactPerson
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
570
|
+
if (!n.isCreatingNewContactPerson) {
|
|
571
|
+
const K = await f.execute({
|
|
572
|
+
body: {
|
|
573
|
+
contactPersonUuid: $,
|
|
574
|
+
contactInfo: {
|
|
575
|
+
email: c.email,
|
|
576
|
+
mobilePhone: c.mobilePhone,
|
|
577
|
+
phone: c.phone
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
params: {
|
|
581
|
+
dealUuid: n.dealUuid
|
|
577
582
|
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
|
|
583
|
+
});
|
|
584
|
+
if (K.isErr()) {
|
|
585
|
+
s.show(K.error);
|
|
586
|
+
return;
|
|
581
587
|
}
|
|
582
|
-
}
|
|
588
|
+
}
|
|
589
|
+
w({
|
|
583
590
|
label: `${c.firstName} ${c.lastName}`,
|
|
584
591
|
value: $
|
|
585
592
|
});
|
|
@@ -590,8 +597,8 @@ const te = /* @__PURE__ */ x({
|
|
|
590
597
|
onSubmitError: () => {
|
|
591
598
|
p.unableToSave();
|
|
592
599
|
}
|
|
593
|
-
}), v =
|
|
594
|
-
schema:
|
|
600
|
+
}), v = G({
|
|
601
|
+
schema: Ha,
|
|
595
602
|
onSubmit: async (c) => {
|
|
596
603
|
await h(
|
|
597
604
|
c.existingContactPerson,
|
|
@@ -605,7 +612,7 @@ const te = /* @__PURE__ */ x({
|
|
|
605
612
|
onSubmitError: () => {
|
|
606
613
|
p.unableToSave();
|
|
607
614
|
}
|
|
608
|
-
}), _ =
|
|
615
|
+
}), _ = C(
|
|
609
616
|
() => u.value ? y : v
|
|
610
617
|
);
|
|
611
618
|
function b() {
|
|
@@ -622,44 +629,44 @@ const te = /* @__PURE__ */ x({
|
|
|
622
629
|
params: {
|
|
623
630
|
dealUuid: n.dealUuid
|
|
624
631
|
}
|
|
625
|
-
}),
|
|
632
|
+
}), w();
|
|
626
633
|
} catch ($) {
|
|
627
634
|
s.show($);
|
|
628
635
|
}
|
|
629
636
|
}
|
|
630
|
-
function
|
|
637
|
+
function w(c) {
|
|
631
638
|
if (c === void 0) {
|
|
632
|
-
|
|
639
|
+
r("close");
|
|
633
640
|
return;
|
|
634
641
|
}
|
|
635
|
-
|
|
642
|
+
r("createNewContactPerson", c), r("close");
|
|
636
643
|
}
|
|
637
|
-
return (c, P) => (d(), g(e(
|
|
644
|
+
return (c, P) => (d(), g(e(ve), {
|
|
638
645
|
form: _.value,
|
|
639
646
|
size: "md",
|
|
640
647
|
"render-own-form-component": "",
|
|
641
|
-
onClose:
|
|
648
|
+
onClose: w
|
|
642
649
|
}, {
|
|
643
|
-
default:
|
|
644
|
-
l(e(
|
|
650
|
+
default: i(() => [
|
|
651
|
+
l(e(he), {
|
|
645
652
|
title: e(o).t("wise_crm.info_dialog.contact_person_create.title"),
|
|
646
653
|
description: e(o).t("wise_crm.info_dialog.contact_person_create.description")
|
|
647
654
|
}, null, 8, ["title", "description"]),
|
|
648
|
-
u.value ? (d(), g(e(
|
|
655
|
+
u.value ? (d(), g(e(ce), {
|
|
649
656
|
key: 0,
|
|
650
657
|
form: e(y),
|
|
651
658
|
"prompt-on-unsaved-changes": !1
|
|
652
659
|
}, {
|
|
653
|
-
default:
|
|
654
|
-
l(e(
|
|
655
|
-
default:
|
|
660
|
+
default: i(() => [
|
|
661
|
+
l(e(Y), null, {
|
|
662
|
+
default: i(() => [
|
|
656
663
|
l(Ya, { form: e(y) }, null, 8, ["form"])
|
|
657
664
|
]),
|
|
658
665
|
_: 1
|
|
659
666
|
}),
|
|
660
|
-
l(e(
|
|
661
|
-
right:
|
|
662
|
-
l(e(
|
|
667
|
+
l(e(H), null, {
|
|
668
|
+
right: i(() => [
|
|
669
|
+
l(e(J), {
|
|
663
670
|
"is-loading": e(y).isSubmitting.value,
|
|
664
671
|
label: e(o).t("wise_crm.shared.create")
|
|
665
672
|
}, null, 8, ["is-loading", "label"])
|
|
@@ -668,24 +675,24 @@ const te = /* @__PURE__ */ x({
|
|
|
668
675
|
})
|
|
669
676
|
]),
|
|
670
677
|
_: 1
|
|
671
|
-
}, 8, ["form"])) : (d(), g(e(
|
|
678
|
+
}, 8, ["form"])) : (d(), g(e(ce), {
|
|
672
679
|
key: 1,
|
|
673
680
|
form: e(v),
|
|
674
681
|
"prompt-on-unsaved-changes": !1
|
|
675
682
|
}, {
|
|
676
|
-
default:
|
|
677
|
-
l(e(
|
|
678
|
-
default:
|
|
679
|
-
l(
|
|
683
|
+
default: i(() => [
|
|
684
|
+
l(e(Y), null, {
|
|
685
|
+
default: i(() => [
|
|
686
|
+
l(Za, {
|
|
680
687
|
form: e(v),
|
|
681
688
|
onCreateNewContactPerson: b
|
|
682
689
|
}, null, 8, ["form"])
|
|
683
690
|
]),
|
|
684
691
|
_: 1
|
|
685
692
|
}),
|
|
686
|
-
l(e(
|
|
687
|
-
right:
|
|
688
|
-
l(e(
|
|
693
|
+
l(e(H), null, {
|
|
694
|
+
right: i(() => [
|
|
695
|
+
l(e(J), {
|
|
689
696
|
"is-loading": e(v).isSubmitting.value,
|
|
690
697
|
label: e(o).t("wise_crm.shared.create")
|
|
691
698
|
}, null, 8, ["is-loading", "label"])
|
|
@@ -719,7 +726,7 @@ function Wa() {
|
|
|
719
726
|
});
|
|
720
727
|
}
|
|
721
728
|
function et(t, a) {
|
|
722
|
-
return
|
|
729
|
+
return we("dealContactPersonDetail", {
|
|
723
730
|
params: {
|
|
724
731
|
contactPersonUuid: a,
|
|
725
732
|
dealUuid: t
|
|
@@ -727,16 +734,16 @@ function et(t, a) {
|
|
|
727
734
|
queryFn: () => k.getContactPerson(t.value, a.value)
|
|
728
735
|
});
|
|
729
736
|
}
|
|
730
|
-
const at =
|
|
731
|
-
email:
|
|
732
|
-
firstName:
|
|
733
|
-
lastName:
|
|
737
|
+
const at = N.object({
|
|
738
|
+
email: N.literal("").or(N.email()).nullable(),
|
|
739
|
+
firstName: N.string().min(1),
|
|
740
|
+
lastName: N.string().min(1),
|
|
734
741
|
mobilePhone: Q.nullable(),
|
|
735
742
|
phone: Q.nullable()
|
|
736
743
|
}).superRefine((t, a) => {
|
|
737
744
|
t.email !== null && t.email !== "" || t.mobilePhone !== null && t.mobilePhone !== "" || t.phone !== null && t.phone !== "" || a.addIssue({
|
|
738
|
-
code:
|
|
739
|
-
message:
|
|
745
|
+
code: N.ZodIssueCode.custom,
|
|
746
|
+
message: _e.global.t("wise_crm.form.errors.at_least_one")
|
|
740
747
|
});
|
|
741
748
|
}), tt = /* @__PURE__ */ x({
|
|
742
749
|
__name: "DealContactPersonUpdateDialog",
|
|
@@ -746,11 +753,11 @@ const at = S.object({
|
|
|
746
753
|
},
|
|
747
754
|
emits: ["close"],
|
|
748
755
|
setup(t, { emit: a }) {
|
|
749
|
-
const n = t,
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
), m =
|
|
753
|
-
initialState:
|
|
756
|
+
const n = t, r = a, o = I(), s = E(), p = Wa(), f = et(
|
|
757
|
+
C(() => n.dealUuid),
|
|
758
|
+
C(() => n.contactPersonUuid)
|
|
759
|
+
), m = C(() => f.result.value.isOk() ? f.result.value.getValue() : null), u = G({
|
|
760
|
+
initialState: C(() => m.value === null ? null : {
|
|
754
761
|
email: m.value.email,
|
|
755
762
|
firstName: m.value.firstName,
|
|
756
763
|
lastName: m.value.lastName,
|
|
@@ -759,10 +766,10 @@ const at = S.object({
|
|
|
759
766
|
}),
|
|
760
767
|
schema: at,
|
|
761
768
|
onSubmit: async (P) => {
|
|
762
|
-
await
|
|
769
|
+
await w(P);
|
|
763
770
|
}
|
|
764
771
|
}), y = u.register("firstName"), v = u.register("lastName"), _ = u.register("email"), b = u.register("mobilePhone"), h = u.register("phone");
|
|
765
|
-
async function
|
|
772
|
+
async function w(P) {
|
|
766
773
|
try {
|
|
767
774
|
await p.execute({
|
|
768
775
|
body: {
|
|
@@ -772,35 +779,35 @@ const at = S.object({
|
|
|
772
779
|
contactPersonUuid: n.contactPersonUuid,
|
|
773
780
|
dealUuid: n.dealUuid
|
|
774
781
|
}
|
|
775
|
-
}),
|
|
782
|
+
}), r("close");
|
|
776
783
|
} catch ($) {
|
|
777
784
|
s.show($);
|
|
778
785
|
}
|
|
779
786
|
}
|
|
780
787
|
function c() {
|
|
781
|
-
|
|
788
|
+
r("close");
|
|
782
789
|
}
|
|
783
|
-
return (P, $) => (d(), g(e(
|
|
790
|
+
return (P, $) => (d(), g(e(ve), {
|
|
784
791
|
form: e(u),
|
|
785
792
|
size: "md",
|
|
786
793
|
onClose: c
|
|
787
794
|
}, {
|
|
788
|
-
default:
|
|
789
|
-
l(e(
|
|
795
|
+
default: i(() => [
|
|
796
|
+
l(e(he), {
|
|
790
797
|
title: e(o).t("wise_crm.info_dialog.contact_person_update.title"),
|
|
791
798
|
description: e(o).t("wise_crm.info_dialog.contact_person_create.description")
|
|
792
799
|
}, null, 8, ["title", "description"]),
|
|
793
|
-
m.value !== null ? (d(), g(e(
|
|
794
|
-
default:
|
|
795
|
-
l(e(
|
|
796
|
-
default:
|
|
800
|
+
m.value !== null ? (d(), g(e(Y), { key: 0 }, {
|
|
801
|
+
default: i(() => [
|
|
802
|
+
l(e(ae), null, {
|
|
803
|
+
default: i(() => [
|
|
797
804
|
l(e(A), null, {
|
|
798
|
-
default:
|
|
805
|
+
default: i(() => [
|
|
799
806
|
l(e(B), {
|
|
800
807
|
sm: 1,
|
|
801
808
|
lg: 2
|
|
802
809
|
}, {
|
|
803
|
-
default:
|
|
810
|
+
default: i(() => [
|
|
804
811
|
l(Ce, {
|
|
805
812
|
"first-name": e(y),
|
|
806
813
|
"last-name": e(v)
|
|
@@ -811,17 +818,17 @@ const at = S.object({
|
|
|
811
818
|
]),
|
|
812
819
|
_: 1
|
|
813
820
|
}),
|
|
814
|
-
l(
|
|
821
|
+
l(Ze, {
|
|
815
822
|
title: e(o).t("wise_crm.shared.contact_info")
|
|
816
823
|
}, {
|
|
817
|
-
default:
|
|
824
|
+
default: i(() => [
|
|
818
825
|
l(e(B), {
|
|
819
826
|
sm: 1,
|
|
820
827
|
lg: 1,
|
|
821
828
|
variant: "card"
|
|
822
829
|
}, {
|
|
823
|
-
default:
|
|
824
|
-
l(
|
|
830
|
+
default: i(() => [
|
|
831
|
+
l(ne, {
|
|
825
832
|
email: e(_),
|
|
826
833
|
"mobile-phone": e(b),
|
|
827
834
|
phone: e(h)
|
|
@@ -829,7 +836,7 @@ const at = S.object({
|
|
|
829
836
|
]),
|
|
830
837
|
_: 1
|
|
831
838
|
}),
|
|
832
|
-
l(
|
|
839
|
+
l(fe, { form: e(u) }, null, 8, ["form"])
|
|
833
840
|
]),
|
|
834
841
|
_: 1
|
|
835
842
|
}, 8, ["title"])
|
|
@@ -838,10 +845,10 @@ const at = S.object({
|
|
|
838
845
|
})
|
|
839
846
|
]),
|
|
840
847
|
_: 1
|
|
841
|
-
})) :
|
|
842
|
-
l(e(
|
|
843
|
-
right:
|
|
844
|
-
l(e(
|
|
848
|
+
})) : S("", !0),
|
|
849
|
+
l(e(H), null, {
|
|
850
|
+
right: i(() => [
|
|
851
|
+
l(e(J), {
|
|
845
852
|
"is-loading": e(u).isSubmitting.value,
|
|
846
853
|
label: e(o).t("wise_crm.shared.save_changes")
|
|
847
854
|
}, null, 8, ["is-loading", "label"])
|
|
@@ -868,7 +875,7 @@ const lt = { class: "p-lg" }, ot = /* @__PURE__ */ x({
|
|
|
868
875
|
deal: {}
|
|
869
876
|
},
|
|
870
877
|
setup(t) {
|
|
871
|
-
const a = t, n = I(),
|
|
878
|
+
const a = t, n = I(), r = E(), o = $a(), s = Ta(), p = Ma(), f = He({
|
|
872
879
|
persistInUrl: !1
|
|
873
880
|
}), m = nt({
|
|
874
881
|
params: {
|
|
@@ -879,7 +886,7 @@ const lt = { class: "p-lg" }, ot = /* @__PURE__ */ x({
|
|
|
879
886
|
uuid: a.deal.owner.uuid,
|
|
880
887
|
name: a.deal.owner.name
|
|
881
888
|
} : null
|
|
882
|
-
), _ =
|
|
889
|
+
), _ = C(() => {
|
|
883
890
|
const U = (m.result.value.isOk() ? m.result.value.getValue().data : []).map((D) => ({
|
|
884
891
|
uuid: D.uuid,
|
|
885
892
|
name: `${D.firstName} ${D.lastName}`
|
|
@@ -892,11 +899,11 @@ const lt = { class: "p-lg" }, ot = /* @__PURE__ */ x({
|
|
|
892
899
|
function h(U) {
|
|
893
900
|
return n.t(aa.getI18nKey(U));
|
|
894
901
|
}
|
|
895
|
-
const
|
|
902
|
+
const w = X(Object.values($e)), c = X(Object.values(Te)), P = Je();
|
|
896
903
|
function $(U) {
|
|
897
904
|
f.updateSearch(U);
|
|
898
905
|
}
|
|
899
|
-
async function
|
|
906
|
+
async function K(U) {
|
|
900
907
|
if (u.value = U, U !== null)
|
|
901
908
|
try {
|
|
902
909
|
await o.execute({
|
|
@@ -908,7 +915,7 @@ const lt = { class: "p-lg" }, ot = /* @__PURE__ */ x({
|
|
|
908
915
|
}
|
|
909
916
|
});
|
|
910
917
|
} catch (D) {
|
|
911
|
-
|
|
918
|
+
r.show(D);
|
|
912
919
|
}
|
|
913
920
|
}
|
|
914
921
|
async function Pe(U) {
|
|
@@ -923,7 +930,7 @@ const lt = { class: "p-lg" }, ot = /* @__PURE__ */ x({
|
|
|
923
930
|
}
|
|
924
931
|
});
|
|
925
932
|
} catch (D) {
|
|
926
|
-
|
|
933
|
+
r.show(D);
|
|
927
934
|
}
|
|
928
935
|
}
|
|
929
936
|
async function De(U) {
|
|
@@ -938,15 +945,15 @@ const lt = { class: "p-lg" }, ot = /* @__PURE__ */ x({
|
|
|
938
945
|
}
|
|
939
946
|
});
|
|
940
947
|
} catch (D) {
|
|
941
|
-
|
|
948
|
+
r.show(D);
|
|
942
949
|
}
|
|
943
950
|
}
|
|
944
951
|
return (U, D) => (d(), V("div", null, [
|
|
945
|
-
l(
|
|
946
|
-
default:
|
|
952
|
+
l(pe, null, {
|
|
953
|
+
default: i(() => [
|
|
947
954
|
F("form", null, [
|
|
948
|
-
l(
|
|
949
|
-
default:
|
|
955
|
+
l(Xe, { cols: 1 }, {
|
|
956
|
+
default: i(() => [
|
|
950
957
|
l(e(Da), {
|
|
951
958
|
modelValue: v.value,
|
|
952
959
|
"onUpdate:modelValue": [
|
|
@@ -961,19 +968,19 @@ const lt = { class: "p-lg" }, ot = /* @__PURE__ */ x({
|
|
|
961
968
|
label: "Deal owner",
|
|
962
969
|
"onUpdate:search": $
|
|
963
970
|
}, null, 8, ["modelValue", "items", "display-fn", "is-loading"]),
|
|
964
|
-
l(e(
|
|
971
|
+
l(e(W), {
|
|
965
972
|
modelValue: u.value,
|
|
966
973
|
"onUpdate:modelValue": [
|
|
967
974
|
D[1] || (D[1] = (L) => u.value = L),
|
|
968
|
-
|
|
975
|
+
K
|
|
969
976
|
],
|
|
970
977
|
label: e(n).t("wise_crm.deal.form.fields.language"),
|
|
971
978
|
placeholder: e(n).t("wise_crm.deal.form.fields.language_placeholder"),
|
|
972
979
|
"display-fn": b,
|
|
973
980
|
"is-loading": e(o).isLoading.value,
|
|
974
|
-
items: e(
|
|
981
|
+
items: e(w)
|
|
975
982
|
}, null, 8, ["modelValue", "label", "placeholder", "is-loading", "items"]),
|
|
976
|
-
l(e(
|
|
983
|
+
l(e(W), {
|
|
977
984
|
modelValue: y.value,
|
|
978
985
|
"onUpdate:modelValue": [
|
|
979
986
|
D[2] || (D[2] = (L) => y.value = L),
|
|
@@ -993,7 +1000,7 @@ const lt = { class: "p-lg" }, ot = /* @__PURE__ */ x({
|
|
|
993
1000
|
_: 1
|
|
994
1001
|
}),
|
|
995
1002
|
F("div", lt, [
|
|
996
|
-
l(
|
|
1003
|
+
l(j, {
|
|
997
1004
|
label: e(n).t("wise_crm.deal.sidebar.created_at", {
|
|
998
1005
|
date: e(P).toDate(a.deal.createdAt.toPlainDate())
|
|
999
1006
|
}),
|
|
@@ -1004,13 +1011,13 @@ const lt = { class: "p-lg" }, ot = /* @__PURE__ */ x({
|
|
|
1004
1011
|
])
|
|
1005
1012
|
]));
|
|
1006
1013
|
}
|
|
1007
|
-
}),
|
|
1014
|
+
}), rt = /* @__PURE__ */ x({
|
|
1008
1015
|
__name: "DealDetailSidebarOverviewContent",
|
|
1009
1016
|
props: {
|
|
1010
1017
|
deal: {}
|
|
1011
1018
|
},
|
|
1012
1019
|
setup(t) {
|
|
1013
|
-
const a = t, n = I(),
|
|
1020
|
+
const a = t, n = I(), r = E(), o = Oa(), s = Qa(), p = te(), f = p.create(Xa), m = p.create(tt), u = C(() => a.deal.contactPersons.length > 0);
|
|
1014
1021
|
function y() {
|
|
1015
1022
|
f.open({
|
|
1016
1023
|
dealUuid: a.deal.uuid
|
|
@@ -1032,8 +1039,8 @@ const lt = { class: "p-lg" }, ot = /* @__PURE__ */ x({
|
|
|
1032
1039
|
dealUuid: a.deal.uuid
|
|
1033
1040
|
}
|
|
1034
1041
|
});
|
|
1035
|
-
} catch (
|
|
1036
|
-
|
|
1042
|
+
} catch (w) {
|
|
1043
|
+
r.show(w);
|
|
1037
1044
|
}
|
|
1038
1045
|
}
|
|
1039
1046
|
function b(h) {
|
|
@@ -1044,29 +1051,29 @@ const lt = { class: "p-lg" }, ot = /* @__PURE__ */ x({
|
|
|
1044
1051
|
}
|
|
1045
1052
|
});
|
|
1046
1053
|
}
|
|
1047
|
-
return (h,
|
|
1048
|
-
default:
|
|
1049
|
-
l(
|
|
1054
|
+
return (h, w) => (d(), g(ta, { "default-values": ["general-info", "contact-persons"] }, {
|
|
1055
|
+
default: i(() => [
|
|
1056
|
+
l(re, {
|
|
1050
1057
|
label: e(n).t("wise_crm.deal.detail.sidebar.accordion.general_info"),
|
|
1051
|
-
icon: e(
|
|
1058
|
+
icon: e(ge),
|
|
1052
1059
|
value: "general-info"
|
|
1053
1060
|
}, {
|
|
1054
|
-
default:
|
|
1061
|
+
default: i(() => [
|
|
1055
1062
|
l(ot, {
|
|
1056
1063
|
deal: a.deal
|
|
1057
1064
|
}, null, 8, ["deal"])
|
|
1058
1065
|
]),
|
|
1059
1066
|
_: 1
|
|
1060
1067
|
}, 8, ["label", "icon"]),
|
|
1061
|
-
l(
|
|
1068
|
+
l(re, {
|
|
1062
1069
|
"is-empty": !u.value,
|
|
1063
1070
|
label: e(n).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
|
|
1064
1071
|
icon: e(na),
|
|
1065
1072
|
value: "contact-persons",
|
|
1066
1073
|
onAdd: y
|
|
1067
1074
|
}, {
|
|
1068
|
-
actions:
|
|
1069
|
-
u.value ?
|
|
1075
|
+
actions: i(() => [
|
|
1076
|
+
u.value ? S("", !0) : (d(), g(la, {
|
|
1070
1077
|
key: 0,
|
|
1071
1078
|
label: e(n).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
|
|
1072
1079
|
icon: e(ie),
|
|
@@ -1074,13 +1081,13 @@ const lt = { class: "p-lg" }, ot = /* @__PURE__ */ x({
|
|
|
1074
1081
|
onClick: y
|
|
1075
1082
|
}, null, 8, ["label", "icon"]))
|
|
1076
1083
|
]),
|
|
1077
|
-
default:
|
|
1078
|
-
(d(!0), V(
|
|
1084
|
+
default: i(() => [
|
|
1085
|
+
(d(!0), V(ee, null, Ne(a.deal.contactPersons, (c) => (d(), g(e(Sa), {
|
|
1079
1086
|
key: c.uuid,
|
|
1080
1087
|
"layout-id": c.uuid
|
|
1081
1088
|
}, {
|
|
1082
|
-
default:
|
|
1083
|
-
l(
|
|
1089
|
+
default: i(() => [
|
|
1090
|
+
l(za, {
|
|
1084
1091
|
"contact-person": c,
|
|
1085
1092
|
"on-toggle-is-primary": () => b(c.uuid),
|
|
1086
1093
|
description: c.phone,
|
|
@@ -1097,7 +1104,7 @@ const lt = { class: "p-lg" }, ot = /* @__PURE__ */ x({
|
|
|
1097
1104
|
variant: "tertiary",
|
|
1098
1105
|
size: "sm",
|
|
1099
1106
|
onClick: y
|
|
1100
|
-
}, null, 8, ["icon-left", "label"])) :
|
|
1107
|
+
}, null, 8, ["icon-left", "label"])) : S("", !0)
|
|
1101
1108
|
]),
|
|
1102
1109
|
_: 1
|
|
1103
1110
|
}, 8, ["is-empty", "label", "icon"])
|
|
@@ -1106,7 +1113,7 @@ const lt = { class: "p-lg" }, ot = /* @__PURE__ */ x({
|
|
|
1106
1113
|
}));
|
|
1107
1114
|
}
|
|
1108
1115
|
});
|
|
1109
|
-
function
|
|
1116
|
+
function it() {
|
|
1110
1117
|
return T({
|
|
1111
1118
|
queryFn: async ({
|
|
1112
1119
|
body: t,
|
|
@@ -1121,7 +1128,7 @@ function rt() {
|
|
|
1121
1128
|
});
|
|
1122
1129
|
}
|
|
1123
1130
|
function st(t, a) {
|
|
1124
|
-
return
|
|
1131
|
+
return we("boardColumnsTransition", {
|
|
1125
1132
|
params: {
|
|
1126
1133
|
boardColumnUuid: t
|
|
1127
1134
|
},
|
|
@@ -1140,14 +1147,14 @@ const ut = /* @__PURE__ */ x({
|
|
|
1140
1147
|
}),
|
|
1141
1148
|
emits: ["update:modelValue"],
|
|
1142
1149
|
setup(t) {
|
|
1143
|
-
const a = t, n = I(),
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
), y =
|
|
1147
|
-
|
|
1148
|
-
] :
|
|
1149
|
-
...
|
|
1150
|
-
toColumnDisplayName:
|
|
1150
|
+
const a = t, n = I(), r = ra(), s = te().create(ia), p = Se(t, "modelValue"), f = E(), m = it(), u = st(
|
|
1151
|
+
C(() => p.value.toColumnUuid),
|
|
1152
|
+
C(() => r.getOptions().deals?.allowedTransitionTriggerTypes ?? [])
|
|
1153
|
+
), y = C(() => (u.result.value.isOk() ? u.result.value.getValue() : []).flatMap((w) => w.triggers.length === 0 ? [
|
|
1154
|
+
w
|
|
1155
|
+
] : w.triggers.map((c) => ({
|
|
1156
|
+
...w,
|
|
1157
|
+
toColumnDisplayName: w.toColumnDisplayName,
|
|
1151
1158
|
triggers: [
|
|
1152
1159
|
c
|
|
1153
1160
|
]
|
|
@@ -1155,7 +1162,7 @@ const ut = /* @__PURE__ */ x({
|
|
|
1155
1162
|
function v(h) {
|
|
1156
1163
|
return h?.toColumnDisplayName ?? "-";
|
|
1157
1164
|
}
|
|
1158
|
-
const _ =
|
|
1165
|
+
const _ = C(() => X(y.value));
|
|
1159
1166
|
async function b(h) {
|
|
1160
1167
|
if (h.triggers.length !== 0) {
|
|
1161
1168
|
if (h.triggers[0]?.triggerType === Me.EMAIL) {
|
|
@@ -1178,16 +1185,16 @@ const ut = /* @__PURE__ */ x({
|
|
|
1178
1185
|
dealUuid: a.deal.uuid
|
|
1179
1186
|
}
|
|
1180
1187
|
});
|
|
1181
|
-
} catch (
|
|
1182
|
-
f.show(
|
|
1188
|
+
} catch (w) {
|
|
1189
|
+
f.show(w);
|
|
1183
1190
|
}
|
|
1184
1191
|
}
|
|
1185
1192
|
}
|
|
1186
|
-
return (h,
|
|
1193
|
+
return (h, w) => (d(), g(sa, {
|
|
1187
1194
|
color: p.value?.toColumnColor ?? null
|
|
1188
1195
|
}, {
|
|
1189
|
-
default:
|
|
1190
|
-
y.value.length === 0 ? (d(), g(e(
|
|
1196
|
+
default: i(() => [
|
|
1197
|
+
y.value.length === 0 ? (d(), g(e(Ue), {
|
|
1191
1198
|
key: 0,
|
|
1192
1199
|
"class-config": {
|
|
1193
1200
|
root: "text-nowrap"
|
|
@@ -1195,7 +1202,7 @@ const ut = /* @__PURE__ */ x({
|
|
|
1195
1202
|
label: p.value.toColumnDisplayName,
|
|
1196
1203
|
variant: "translucent",
|
|
1197
1204
|
color: "brand"
|
|
1198
|
-
}, null, 8, ["label"])) : (d(), g(e(
|
|
1205
|
+
}, null, 8, ["label"])) : (d(), g(e(W), {
|
|
1199
1206
|
key: 1,
|
|
1200
1207
|
"model-value": p.value,
|
|
1201
1208
|
"is-loading": e(m).isLoading.value,
|
|
@@ -1218,7 +1225,7 @@ function ct() {
|
|
|
1218
1225
|
queryFn: async ({
|
|
1219
1226
|
body: t,
|
|
1220
1227
|
params: a
|
|
1221
|
-
}) => await
|
|
1228
|
+
}) => await be.create(t, {
|
|
1222
1229
|
dealUuid: a.dealUuid
|
|
1223
1230
|
}),
|
|
1224
1231
|
queryKeysToInvalidate: {
|
|
@@ -1231,7 +1238,7 @@ function dt(t, a) {
|
|
|
1231
1238
|
params: {
|
|
1232
1239
|
params: a?.params
|
|
1233
1240
|
},
|
|
1234
|
-
queryFn: (n) =>
|
|
1241
|
+
queryFn: (n) => be.getDealNotes({
|
|
1235
1242
|
pagination: n
|
|
1236
1243
|
}, t.value)
|
|
1237
1244
|
});
|
|
@@ -1242,9 +1249,9 @@ const mt = /* @__PURE__ */ x({
|
|
|
1242
1249
|
deal: {}
|
|
1243
1250
|
},
|
|
1244
1251
|
setup(t) {
|
|
1245
|
-
const a = t,
|
|
1246
|
-
|
|
1247
|
-
), m =
|
|
1252
|
+
const a = t, r = te().create(ua), o = E(), s = ct(), p = ca(), f = dt(
|
|
1253
|
+
C(() => a.deal.uuid)
|
|
1254
|
+
), m = C(() => f.result.value.isOk() ? f.result.value.getValue().data : []);
|
|
1248
1255
|
async function u(_) {
|
|
1249
1256
|
await s.execute({
|
|
1250
1257
|
body: _,
|
|
@@ -1265,7 +1272,7 @@ const mt = /* @__PURE__ */ x({
|
|
|
1265
1272
|
}
|
|
1266
1273
|
}
|
|
1267
1274
|
function v(_) {
|
|
1268
|
-
|
|
1275
|
+
r.open({
|
|
1269
1276
|
note: _
|
|
1270
1277
|
});
|
|
1271
1278
|
}
|
|
@@ -1285,7 +1292,7 @@ const mt = /* @__PURE__ */ x({
|
|
|
1285
1292
|
deal: {}
|
|
1286
1293
|
},
|
|
1287
1294
|
setup(t) {
|
|
1288
|
-
const a = t, n = I(),
|
|
1295
|
+
const a = t, n = I(), r = ma(), o = M(
|
|
1289
1296
|
"overview"
|
|
1290
1297
|
/* OVERVIEW */
|
|
1291
1298
|
), s = M({
|
|
@@ -1296,9 +1303,9 @@ const mt = /* @__PURE__ */ x({
|
|
|
1296
1303
|
toColumnDisplayName: a.deal.boardColumn.displayName,
|
|
1297
1304
|
toColumnKey: "",
|
|
1298
1305
|
triggers: []
|
|
1299
|
-
}), p =
|
|
1306
|
+
}), p = C(() => [
|
|
1300
1307
|
{
|
|
1301
|
-
icon:
|
|
1308
|
+
icon: ge,
|
|
1302
1309
|
label: n.t("wise_crm.shared.overview"),
|
|
1303
1310
|
value: "overview"
|
|
1304
1311
|
/* OVERVIEW */
|
|
@@ -1312,21 +1319,23 @@ const mt = /* @__PURE__ */ x({
|
|
|
1312
1319
|
]);
|
|
1313
1320
|
return (f, m) => (d(), V("div", pt, [
|
|
1314
1321
|
F("div", ft, [
|
|
1315
|
-
l(
|
|
1322
|
+
l(qa, {
|
|
1316
1323
|
deal: a.deal
|
|
1317
1324
|
}, null, 8, ["deal"]),
|
|
1318
1325
|
F("div", _t, [
|
|
1319
1326
|
l(fa, {
|
|
1320
|
-
|
|
1327
|
+
class: "max-w-full min-w-0",
|
|
1328
|
+
onClick: m[0] || (m[0] = (u) => e(r).openBusinessDetail(
|
|
1321
1329
|
a.deal.client.uuid
|
|
1322
1330
|
))
|
|
1323
1331
|
}, {
|
|
1324
|
-
default:
|
|
1325
|
-
l(e(
|
|
1332
|
+
default: i(() => [
|
|
1333
|
+
l(e(Ue), {
|
|
1326
1334
|
icon: e(_a),
|
|
1327
1335
|
label: a.deal.client.name,
|
|
1328
1336
|
variant: "translucent",
|
|
1329
|
-
color: "brand"
|
|
1337
|
+
color: "brand",
|
|
1338
|
+
class: "max-w-full"
|
|
1330
1339
|
}, null, 8, ["icon", "label"])
|
|
1331
1340
|
]),
|
|
1332
1341
|
_: 1
|
|
@@ -1343,14 +1352,14 @@ const mt = /* @__PURE__ */ x({
|
|
|
1343
1352
|
"onUpdate:modelValue": m[2] || (m[2] = (u) => o.value = u),
|
|
1344
1353
|
tabs: p.value
|
|
1345
1354
|
}, {
|
|
1346
|
-
default:
|
|
1347
|
-
o.value === "overview" ? (d(), g(
|
|
1355
|
+
default: i(() => [
|
|
1356
|
+
o.value === "overview" ? (d(), g(rt, {
|
|
1348
1357
|
key: 0,
|
|
1349
1358
|
deal: a.deal
|
|
1350
1359
|
}, null, 8, ["deal"])) : o.value === "notes" ? (d(), g(mt, {
|
|
1351
1360
|
key: 1,
|
|
1352
1361
|
deal: a.deal
|
|
1353
|
-
}, null, 8, ["deal"])) :
|
|
1362
|
+
}, null, 8, ["deal"])) : S("", !0)
|
|
1354
1363
|
]),
|
|
1355
1364
|
_: 1
|
|
1356
1365
|
}, 8, ["modelValue", "tabs"])
|
|
@@ -1363,21 +1372,21 @@ const mt = /* @__PURE__ */ x({
|
|
|
1363
1372
|
},
|
|
1364
1373
|
setup(t) {
|
|
1365
1374
|
const a = t, n = ba(
|
|
1366
|
-
|
|
1367
|
-
),
|
|
1375
|
+
C(() => a.dealUuid)
|
|
1376
|
+
), r = I();
|
|
1368
1377
|
return (o, s) => (d(), g(ya, null, {
|
|
1369
|
-
default:
|
|
1378
|
+
default: i(() => [
|
|
1370
1379
|
e(n).isError.value ? (d(), g(va, {
|
|
1371
1380
|
key: 0,
|
|
1372
|
-
message: e(
|
|
1373
|
-
title: e(
|
|
1381
|
+
message: e(r).t("error.deal_details.description"),
|
|
1382
|
+
title: e(r).t("error.deal_details.title")
|
|
1374
1383
|
}, null, 8, ["message", "title"])) : e(n).isLoading.value ? (d(), g(ha, {
|
|
1375
1384
|
key: 1,
|
|
1376
1385
|
class: "h-full"
|
|
1377
1386
|
})) : e(n).result.value.isOk() ? (d(), g(gt, {
|
|
1378
1387
|
key: e(n).result.value.getValue().boardColumn.uuid,
|
|
1379
1388
|
deal: e(n).result.value.getValue()
|
|
1380
|
-
}, null, 8, ["deal"])) :
|
|
1389
|
+
}, null, 8, ["deal"])) : S("", !0)
|
|
1381
1390
|
]),
|
|
1382
1391
|
_: 1
|
|
1383
1392
|
}));
|
|
@@ -1388,20 +1397,20 @@ const mt = /* @__PURE__ */ x({
|
|
|
1388
1397
|
tabs: {}
|
|
1389
1398
|
},
|
|
1390
1399
|
setup(t) {
|
|
1391
|
-
const a = t, n = I(),
|
|
1400
|
+
const a = t, n = I(), r = ke("dealUuid"), o = C(() => [
|
|
1392
1401
|
...a.tabs,
|
|
1393
1402
|
{
|
|
1394
|
-
label:
|
|
1403
|
+
label: C(() => n.t("wise_crm.deal.detail_view.communication_tab_label")),
|
|
1395
1404
|
to: "deal-communication"
|
|
1396
1405
|
}
|
|
1397
1406
|
]);
|
|
1398
1407
|
return (s, p) => (d(), g(Ve, {
|
|
1399
|
-
key: e(
|
|
1400
|
-
"entity-type": e(
|
|
1408
|
+
key: e(r),
|
|
1409
|
+
"entity-type": e(de).BUSINESS,
|
|
1401
1410
|
tabs: o.value
|
|
1402
1411
|
}, {
|
|
1403
|
-
sidebar:
|
|
1404
|
-
l(bt, { "deal-uuid": e(
|
|
1412
|
+
sidebar: i(() => [
|
|
1413
|
+
l(bt, { "deal-uuid": e(r) }, null, 8, ["deal-uuid"])
|
|
1405
1414
|
]),
|
|
1406
1415
|
_: 1
|
|
1407
1416
|
}, 8, ["entity-type", "tabs"]));
|