@wisemen/wise-crm-web 2.0.0-alpha.42 → 2.0.0-alpha.44
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 +26 -2
- package/dist/BusinessDetailView-CUqP54YS.js +1141 -0
- package/dist/CrmDetailSidebarMapCard.vue_vue_type_script_setup_true_lang-CeS10J7W.js +772 -0
- package/dist/CrmDetailView.vue_vue_type_script_setup_true_lang-CTukbqp5.js +898 -0
- package/dist/{DealCommunicationTabView-DLpKFEzi.js → DealCommunicationTabView-CioSYkKm.js} +32 -32
- package/dist/{DealDetailView-fnpBvgUj.js → DealDetailView-2iuxQ5Tc.js} +175 -175
- package/dist/IndividualDetailView-BdTovUI2.js +852 -0
- package/dist/{index-D0Wq9rrv.js → index-D4L5GVbr.js} +12597 -15976
- package/dist/index.d.ts +73 -109
- package/dist/index.js +22 -29
- package/dist/style.css +1 -1
- package/dist/testing.js +1 -1
- package/dist/{uuid.util-SYJY4Bt5.js → uuid.util-DUuuAgdg.js} +152 -152
- package/package.json +1 -1
- package/dist/BusinessDetailView-DCLbk1zs.js +0 -27
- package/dist/CrmDetailView.vue_vue_type_script_setup_true_lang-hKRJ0iTD.js +0 -90
- package/dist/IndividualDetailView-4OENIyX3.js +0 -27
|
@@ -0,0 +1,1141 @@
|
|
|
1
|
+
import { defineComponent as x, computed as f, openBlock as a, createBlock as m, unref as e, createElementBlock as k, renderSlot as se, withCtx as _, createVNode as u, mergeProps as pe, createTextVNode as _e, toDisplayString as O, createElementVNode as S, resolveDynamicComponent as V, ref as L, Fragment as T, createCommentVNode as D, normalizeClass as fe, renderList as K } from "vue";
|
|
2
|
+
import { useRouteParams as ve } from "@vueuse/router";
|
|
3
|
+
import { useI18n as N } from "vue-i18n";
|
|
4
|
+
import { B as $, u as q, _ as ye, a as ge, b as he, c as Ce, d as Ue, e as xe, f as we, l as Be, A as Pe, g as Se, h as ke, i as De, j as ne, S as W, k as Ne, m as $e, J as X, o as J, n as te, p as Ie, q as Ae, W as Fe, r as Ee, s as Me, V as Qe, Q as Ve, t as Te, v as ie, I as ae, w as qe, x as ze, y as Oe, z as Le, C as Ke, D as je, E as Re, F as Ge, G as He } from "./index-D4L5GVbr.js";
|
|
5
|
+
import { N as oe, _ as Je, u as We, a as Xe, b as Ye, c as Ze, d as ue, e as Q, C as re, f as F, g as es, h as ss, i as ns, j as ts, k as is } from "./CrmDetailView.vue_vue_type_script_setup_true_lang-CTukbqp5.js";
|
|
6
|
+
import { z as H } from "zod";
|
|
7
|
+
import { bs as E } from "./uuid.util-DUuuAgdg.js";
|
|
8
|
+
import { _ as as, c as os, a as us, b as Y, d as rs, e as ls, f as cs, u as ds, g as ms, h as bs, i as ps } from "./CrmDetailSidebarMapCard.vue_vue_type_script_setup_true_lang-CeS10J7W.js";
|
|
9
|
+
import { useKeysetInfiniteQuery as le, useMutation as z, useQuery as _s } from "@wisemen/vue-core-api-utils";
|
|
10
|
+
import { useOverlay as ce, UIButton as R, createAutocompleteOptions as fs, UIAutocomplete as vs, toFormField as ys, UIDialog as gs, UIFormDialog as de, UIDialogHeader as me, UIForm as Z, UIDialogFooter as hs, UIDialogFooterSubmit as Cs, UIIconButton as ee, UIPopover as Us, UIConfirmDialog as xs } from "@wisemen/vue-core-design-system";
|
|
11
|
+
import { Motion as ws } from "motion-v";
|
|
12
|
+
import { useQueryClient as Bs, useMutation as Ps } from "@tanstack/vue-query";
|
|
13
|
+
import { useForm as j } from "formango";
|
|
14
|
+
function Ss(n) {
|
|
15
|
+
return le("businessActivityIndex", {
|
|
16
|
+
queryFn: (s) => $.getActivity(n.value, s.key)
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const ks = /* @__PURE__ */ x({
|
|
20
|
+
__name: "BusinessDetailSidebarActivityContent",
|
|
21
|
+
props: {
|
|
22
|
+
business: {}
|
|
23
|
+
},
|
|
24
|
+
setup(n) {
|
|
25
|
+
const s = n, t = f(() => s.business.uuid), i = Ss(t), o = f(() => i.result.value.isOk() ? i.result.value.getValue().data : []);
|
|
26
|
+
async function l() {
|
|
27
|
+
await i.fetchNextPage();
|
|
28
|
+
}
|
|
29
|
+
return (r, b) => (a(), m(as, {
|
|
30
|
+
"on-next": l,
|
|
31
|
+
"is-loading": e(i).isLoading.value,
|
|
32
|
+
activities: o.value
|
|
33
|
+
}, null, 8, ["is-loading", "activities"]));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
function Ds() {
|
|
37
|
+
return z({
|
|
38
|
+
queryFn: async ({
|
|
39
|
+
body: n,
|
|
40
|
+
params: s
|
|
41
|
+
}) => await oe.create(n, {
|
|
42
|
+
businessUuid: s.businessUuid
|
|
43
|
+
}),
|
|
44
|
+
queryKeysToInvalidate: {
|
|
45
|
+
noteBusinessIndex: {}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function Ns(n, s) {
|
|
50
|
+
return le("noteBusinessIndex", {
|
|
51
|
+
params: {
|
|
52
|
+
params: s?.params
|
|
53
|
+
},
|
|
54
|
+
queryFn: (t) => oe.getBusinessNotes({
|
|
55
|
+
pagination: t
|
|
56
|
+
}, n.value)
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const $s = /* @__PURE__ */ x({
|
|
60
|
+
__name: "BusinessDetailSidebarNotesContent",
|
|
61
|
+
props: {
|
|
62
|
+
business: {}
|
|
63
|
+
},
|
|
64
|
+
setup(n) {
|
|
65
|
+
const s = n, i = ce().create(Je), o = q(), l = Ds(), r = We(), b = Ns(
|
|
66
|
+
f(() => s.business.uuid)
|
|
67
|
+
), p = f(() => b.result.value.isOk() ? b.result.value.getValue().data : []);
|
|
68
|
+
async function y(d) {
|
|
69
|
+
await l.execute({
|
|
70
|
+
body: d,
|
|
71
|
+
params: {
|
|
72
|
+
businessUuid: s.business.uuid
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
async function v(d) {
|
|
77
|
+
try {
|
|
78
|
+
await r.execute({
|
|
79
|
+
params: {
|
|
80
|
+
noteUuid: d
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
} catch (C) {
|
|
84
|
+
o.show(C);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function h(d) {
|
|
88
|
+
i.open({
|
|
89
|
+
note: d
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return (d, C) => (a(), m(Xe, {
|
|
93
|
+
"is-loading": e(b).isLoading.value,
|
|
94
|
+
notes: p.value,
|
|
95
|
+
"on-submit": y,
|
|
96
|
+
"has-next-page": e(b).hasNextPage.value,
|
|
97
|
+
onNext: C[0] || (C[0] = (w) => e(b).fetchNextPage()),
|
|
98
|
+
onDelete: v,
|
|
99
|
+
onUpdate: h
|
|
100
|
+
}, null, 8, ["is-loading", "notes", "has-next-page"]));
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
function Is() {
|
|
104
|
+
const n = Bs(), s = "wiseCrmBusinessDetail", t = Ps({
|
|
105
|
+
mutationFn: async (i) => {
|
|
106
|
+
const {
|
|
107
|
+
businessUuid: o,
|
|
108
|
+
contactPersonUuid: l
|
|
109
|
+
} = i, r = await $.setPrimaryContactPersonForBusiness(o, l);
|
|
110
|
+
if (r.isErr())
|
|
111
|
+
throw r.error;
|
|
112
|
+
},
|
|
113
|
+
onError: (i, o, l) => {
|
|
114
|
+
n.setQueryData(
|
|
115
|
+
[
|
|
116
|
+
s,
|
|
117
|
+
{
|
|
118
|
+
businessUuid: o.businessUuid
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
l?.previousData
|
|
122
|
+
);
|
|
123
|
+
},
|
|
124
|
+
onMutate: async (i) => {
|
|
125
|
+
await n.cancelQueries({
|
|
126
|
+
queryKey: [
|
|
127
|
+
s,
|
|
128
|
+
{
|
|
129
|
+
businessUuid: i.businessUuid
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
});
|
|
133
|
+
const o = n.getQueryData(
|
|
134
|
+
[
|
|
135
|
+
s,
|
|
136
|
+
{
|
|
137
|
+
businessUuid: i.businessUuid
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
);
|
|
141
|
+
return o === void 0 ? {} : (n.setQueryData(
|
|
142
|
+
[
|
|
143
|
+
s,
|
|
144
|
+
{
|
|
145
|
+
businessUuid: i.businessUuid
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
o.map((l) => ({
|
|
149
|
+
...l,
|
|
150
|
+
contactPersons: l.contactPersons.map((r) => r.uuid === i.contactPersonUuid ? {
|
|
151
|
+
...r,
|
|
152
|
+
isPrimary: !r.isPrimary
|
|
153
|
+
} : {
|
|
154
|
+
...r,
|
|
155
|
+
isPrimary: !1
|
|
156
|
+
})
|
|
157
|
+
}))
|
|
158
|
+
), {
|
|
159
|
+
previousData: o
|
|
160
|
+
});
|
|
161
|
+
},
|
|
162
|
+
onSettled: (i, o, l) => {
|
|
163
|
+
n.invalidateQueries({
|
|
164
|
+
queryKey: [
|
|
165
|
+
s,
|
|
166
|
+
{
|
|
167
|
+
businessUuid: l.businessUuid
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
return {
|
|
174
|
+
isLoading: f(() => t.isPending.value),
|
|
175
|
+
data: f(() => t.data.value),
|
|
176
|
+
execute: async (i) => await t.mutateAsync(i.params)
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
function As() {
|
|
180
|
+
return z({
|
|
181
|
+
queryFn: async ({
|
|
182
|
+
body: n,
|
|
183
|
+
params: s
|
|
184
|
+
}) => await $.unlinkContactPerson(s.businessUuid, n.contactPersonUuid),
|
|
185
|
+
queryKeysToInvalidate: {
|
|
186
|
+
businessIndex: {},
|
|
187
|
+
wiseCrmBusinessDetail: {
|
|
188
|
+
businessUuid: (n) => n.businessUuid
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
function Fs() {
|
|
194
|
+
return z({
|
|
195
|
+
queryFn: async ({
|
|
196
|
+
params: n
|
|
197
|
+
}) => await $.addChildBusiness(n.parentUuid, n.childUuid),
|
|
198
|
+
queryKeysToInvalidate: {
|
|
199
|
+
businessIndex: {},
|
|
200
|
+
wiseCrmBusinessDetail: {
|
|
201
|
+
businessUuid: (n) => n.parentUuid
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
const Es = {}, Ms = { class: "flex w-full justify-end gap-md pt-xl" };
|
|
207
|
+
function Qs(n, s) {
|
|
208
|
+
return a(), k("div", Ms, [
|
|
209
|
+
se(n.$slots, "default")
|
|
210
|
+
]);
|
|
211
|
+
}
|
|
212
|
+
const Vs = /* @__PURE__ */ ye(Es, [["render", Qs]]), Ts = /* @__PURE__ */ x({
|
|
213
|
+
__name: "AppSidebarFormSubmitButton",
|
|
214
|
+
props: {
|
|
215
|
+
isLoading: { type: Boolean },
|
|
216
|
+
label: {},
|
|
217
|
+
type: { default: "submit" }
|
|
218
|
+
},
|
|
219
|
+
emits: ["submit"],
|
|
220
|
+
setup(n, { emit: s }) {
|
|
221
|
+
const t = n, i = s;
|
|
222
|
+
function o() {
|
|
223
|
+
i("submit");
|
|
224
|
+
}
|
|
225
|
+
return (l, r) => (a(), m(e(R), {
|
|
226
|
+
"is-loading": t.isLoading,
|
|
227
|
+
label: t.label,
|
|
228
|
+
"icon-left": e(ge),
|
|
229
|
+
type: "submit",
|
|
230
|
+
size: "lg",
|
|
231
|
+
onClick: o
|
|
232
|
+
}, null, 8, ["is-loading", "label", "icon-left"]));
|
|
233
|
+
}
|
|
234
|
+
}), qs = /* @__PURE__ */ x({
|
|
235
|
+
__name: "BusinessAddExistingChildForm",
|
|
236
|
+
props: {
|
|
237
|
+
parentBusinessUuid: {},
|
|
238
|
+
onSubmit: { type: Function }
|
|
239
|
+
},
|
|
240
|
+
emits: ["createNew"],
|
|
241
|
+
setup(n, { emit: s }) {
|
|
242
|
+
const t = n, i = s, o = N(), l = he({
|
|
243
|
+
persistInUrl: !1
|
|
244
|
+
}), r = Ce({
|
|
245
|
+
params: {
|
|
246
|
+
search: l.debouncedSearch
|
|
247
|
+
}
|
|
248
|
+
}), b = j({
|
|
249
|
+
initialState: {
|
|
250
|
+
business: null
|
|
251
|
+
},
|
|
252
|
+
schema: H.object({
|
|
253
|
+
business: H.object({
|
|
254
|
+
uuid: Ue,
|
|
255
|
+
name: H.string()
|
|
256
|
+
})
|
|
257
|
+
}),
|
|
258
|
+
onSubmit: async (d) => {
|
|
259
|
+
await t.onSubmit(d.business.uuid);
|
|
260
|
+
}
|
|
261
|
+
}), p = b.register("business"), y = f(() => {
|
|
262
|
+
const w = (r.result.value.isOk() ? r.result.value.getValue().data : []).filter((c) => c.uuid !== t.parentBusinessUuid).map((c) => ({
|
|
263
|
+
uuid: c.uuid,
|
|
264
|
+
name: c.name
|
|
265
|
+
}));
|
|
266
|
+
return fs(w);
|
|
267
|
+
});
|
|
268
|
+
function v(d) {
|
|
269
|
+
l.updateSearch(d);
|
|
270
|
+
}
|
|
271
|
+
function h() {
|
|
272
|
+
i("createNew");
|
|
273
|
+
}
|
|
274
|
+
return (d, C) => (a(), m(xe, { form: e(b) }, {
|
|
275
|
+
default: _(() => [
|
|
276
|
+
u(we, { cols: 1 }, {
|
|
277
|
+
default: _(() => [
|
|
278
|
+
u(e(vs), pe(e(ys)(e(p)), {
|
|
279
|
+
items: y.value,
|
|
280
|
+
"display-fn": (w) => w.name,
|
|
281
|
+
"is-loading": e(r).isFetching.value,
|
|
282
|
+
label: e(o).t("wise_crm.info_dialog.search_an_existing_one"),
|
|
283
|
+
"icon-left": e(Be),
|
|
284
|
+
"search-mode": "remote",
|
|
285
|
+
"onUpdate:search": v
|
|
286
|
+
}), null, 16, ["items", "display-fn", "is-loading", "label", "icon-left"]),
|
|
287
|
+
u(Pe, null, {
|
|
288
|
+
default: _(() => [
|
|
289
|
+
_e(O(e(o).t("wise_crm.shared.or")), 1)
|
|
290
|
+
]),
|
|
291
|
+
_: 1
|
|
292
|
+
}),
|
|
293
|
+
u(e(R), {
|
|
294
|
+
label: e(o).t("wise_crm.info_dialog.add_business_child_dialog.create_a_new_one"),
|
|
295
|
+
class: "w-full",
|
|
296
|
+
size: "lg",
|
|
297
|
+
variant: "secondary",
|
|
298
|
+
onClick: h
|
|
299
|
+
}, null, 8, ["label"]),
|
|
300
|
+
u(Vs, null, {
|
|
301
|
+
default: _(() => [
|
|
302
|
+
u(Ts, {
|
|
303
|
+
"is-loading": e(b).isSubmitting.value,
|
|
304
|
+
label: e(o).t("wise_crm.shared.add")
|
|
305
|
+
}, null, 8, ["is-loading", "label"])
|
|
306
|
+
]),
|
|
307
|
+
_: 1
|
|
308
|
+
})
|
|
309
|
+
]),
|
|
310
|
+
_: 1
|
|
311
|
+
})
|
|
312
|
+
]),
|
|
313
|
+
_: 1
|
|
314
|
+
}, 8, ["form"]));
|
|
315
|
+
}
|
|
316
|
+
}), zs = { class: "grid grid-cols-[auto_2rem]" }, Os = { class: "flex items-center gap-xl" }, Ls = { class: "flex size-10 shrink-0 items-center justify-center rounded-full bg-brand-200" }, Ks = { class: "text-md font-semibold text-primary" }, js = { class: "text-sm text-tertiary" }, Rs = /* @__PURE__ */ x({
|
|
317
|
+
__name: "AppDialogHeader",
|
|
318
|
+
props: {
|
|
319
|
+
title: {},
|
|
320
|
+
description: {},
|
|
321
|
+
icon: {}
|
|
322
|
+
},
|
|
323
|
+
setup(n) {
|
|
324
|
+
const s = n;
|
|
325
|
+
return (t, i) => (a(), k("header", zs, [
|
|
326
|
+
S("div", Os, [
|
|
327
|
+
S("div", Ls, [
|
|
328
|
+
(a(), m(V(s.icon), { class: "size-5 shrink-0 text-brand-600" }))
|
|
329
|
+
]),
|
|
330
|
+
S("div", null, [
|
|
331
|
+
S("h1", Ks, O(s.title), 1),
|
|
332
|
+
S("p", js, O(s.description), 1)
|
|
333
|
+
])
|
|
334
|
+
]),
|
|
335
|
+
se(t.$slots, "closse-button")
|
|
336
|
+
]));
|
|
337
|
+
}
|
|
338
|
+
}), Gs = /* @__PURE__ */ x({
|
|
339
|
+
__name: "BusinessAddChildBusinessDialog",
|
|
340
|
+
props: {
|
|
341
|
+
businessUuid: {}
|
|
342
|
+
},
|
|
343
|
+
emits: ["close"],
|
|
344
|
+
setup(n, { emit: s }) {
|
|
345
|
+
const t = n, i = s, o = N(), l = q(), r = L(!1), b = L(null), p = Fs();
|
|
346
|
+
function y() {
|
|
347
|
+
i("close");
|
|
348
|
+
}
|
|
349
|
+
const {
|
|
350
|
+
isCheckingExistence: v,
|
|
351
|
+
isCheckingVatNumber: h,
|
|
352
|
+
isDataFromCbe: d,
|
|
353
|
+
checkVatNumberValidity: C,
|
|
354
|
+
form: w,
|
|
355
|
+
onCreateNewBusiness: c,
|
|
356
|
+
onUpdateCbeSearchItem: g
|
|
357
|
+
} = Se({
|
|
358
|
+
onClose: y,
|
|
359
|
+
onCreate: async (I) => {
|
|
360
|
+
try {
|
|
361
|
+
await p.execute({
|
|
362
|
+
params: {
|
|
363
|
+
childUuid: I,
|
|
364
|
+
parentUuid: t.businessUuid
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
} catch (U) {
|
|
368
|
+
l.show(U);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
async function P(I) {
|
|
373
|
+
try {
|
|
374
|
+
await p.execute({
|
|
375
|
+
params: {
|
|
376
|
+
childUuid: I,
|
|
377
|
+
parentUuid: t.businessUuid
|
|
378
|
+
}
|
|
379
|
+
}), i("close");
|
|
380
|
+
} catch (U) {
|
|
381
|
+
l.show(U);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
function M() {
|
|
385
|
+
r.value = !1;
|
|
386
|
+
}
|
|
387
|
+
function G() {
|
|
388
|
+
c(), r.value = !0;
|
|
389
|
+
}
|
|
390
|
+
return (I, U) => (a(), m(e(gs), { onClose: y }, {
|
|
391
|
+
default: _(() => [
|
|
392
|
+
r.value ? (a(), m(ke, {
|
|
393
|
+
key: 0,
|
|
394
|
+
"check-vat-number-validity": e(C),
|
|
395
|
+
form: e(w),
|
|
396
|
+
"is-checking-existence": e(v),
|
|
397
|
+
"is-checking-vat-number": e(h),
|
|
398
|
+
"is-data-from-cbe": e(d),
|
|
399
|
+
"on-update-cbe-search-item": e(g),
|
|
400
|
+
onBack: M
|
|
401
|
+
}, null, 8, ["check-vat-number-validity", "form", "is-checking-existence", "is-checking-vat-number", "is-data-from-cbe", "on-update-cbe-search-item"])) : (a(), m(De, {
|
|
402
|
+
key: 1,
|
|
403
|
+
class: "flex flex-1 flex-col gap-xl"
|
|
404
|
+
}, {
|
|
405
|
+
default: _(() => [
|
|
406
|
+
u(Rs, {
|
|
407
|
+
title: e(o).t("wise_crm.info_dialog.add_business_child_dialog.title"),
|
|
408
|
+
description: e(o).t("wise_crm.info_dialog.add_business_child_dialog.description"),
|
|
409
|
+
icon: e(ne)
|
|
410
|
+
}, null, 8, ["title", "description", "icon"]),
|
|
411
|
+
u(qs, {
|
|
412
|
+
modelValue: b.value,
|
|
413
|
+
"onUpdate:modelValue": U[0] || (U[0] = (A) => b.value = A),
|
|
414
|
+
"parent-business-uuid": t.businessUuid,
|
|
415
|
+
"on-submit": P,
|
|
416
|
+
onCreateNew: G
|
|
417
|
+
}, null, 8, ["modelValue", "parent-business-uuid"])
|
|
418
|
+
]),
|
|
419
|
+
_: 1
|
|
420
|
+
}))
|
|
421
|
+
]),
|
|
422
|
+
_: 1
|
|
423
|
+
}));
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
function Hs() {
|
|
427
|
+
return z({
|
|
428
|
+
queryFn: async ({
|
|
429
|
+
body: n,
|
|
430
|
+
params: s
|
|
431
|
+
}) => await $.linkContactPerson(
|
|
432
|
+
s.businessUuid,
|
|
433
|
+
n.contactPersonUuid,
|
|
434
|
+
n.position,
|
|
435
|
+
n.contactInfo
|
|
436
|
+
),
|
|
437
|
+
queryKeysToInvalidate: {
|
|
438
|
+
businessIndex: {},
|
|
439
|
+
wiseCrmBusinessDetail: {
|
|
440
|
+
businessUuid: (n) => n.businessUuid
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
const Js = /* @__PURE__ */ x({
|
|
446
|
+
__name: "BusinessContactPersonCreateDialog",
|
|
447
|
+
props: {
|
|
448
|
+
businessUuid: {},
|
|
449
|
+
isCreatingNewContactPerson: { type: Boolean, default: !1 }
|
|
450
|
+
},
|
|
451
|
+
emits: ["close", "createNewContactPerson"],
|
|
452
|
+
setup(n, { emit: s }) {
|
|
453
|
+
const t = n, i = s, o = N(), l = q(), r = Hs(), b = Ye(), p = L(t.isCreatingNewContactPerson), y = j({
|
|
454
|
+
schema: os,
|
|
455
|
+
onSubmit: async (c) => {
|
|
456
|
+
await d(c);
|
|
457
|
+
}
|
|
458
|
+
}), v = j({
|
|
459
|
+
initialState: {
|
|
460
|
+
email: null,
|
|
461
|
+
existingContactPerson: null,
|
|
462
|
+
mobile: null,
|
|
463
|
+
phone: null,
|
|
464
|
+
position: null
|
|
465
|
+
},
|
|
466
|
+
schema: us,
|
|
467
|
+
onSubmit: async (c) => {
|
|
468
|
+
await C(
|
|
469
|
+
c.existingContactPerson,
|
|
470
|
+
{
|
|
471
|
+
email: c.email,
|
|
472
|
+
mobilePhone: c.mobile,
|
|
473
|
+
phone: c.phone
|
|
474
|
+
},
|
|
475
|
+
c.position
|
|
476
|
+
);
|
|
477
|
+
}
|
|
478
|
+
}), h = f(() => p.value ? y : v);
|
|
479
|
+
async function d(c) {
|
|
480
|
+
try {
|
|
481
|
+
const g = await b.execute({
|
|
482
|
+
body: {
|
|
483
|
+
email: c.email,
|
|
484
|
+
firstName: c.firstName,
|
|
485
|
+
lastName: c.lastName,
|
|
486
|
+
mobilePhone: c.mobilePhone,
|
|
487
|
+
phone: c.phone
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
if (g.isErr()) {
|
|
491
|
+
l.show(g.error);
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
const P = g.value;
|
|
495
|
+
t.isCreatingNewContactPerson || await r.execute({
|
|
496
|
+
body: {
|
|
497
|
+
contactPersonUuid: P,
|
|
498
|
+
contactInfo: {
|
|
499
|
+
email: c.email,
|
|
500
|
+
mobilePhone: c.mobilePhone,
|
|
501
|
+
phone: c.phone
|
|
502
|
+
},
|
|
503
|
+
position: W.trimOrNull(c.position)
|
|
504
|
+
},
|
|
505
|
+
params: {
|
|
506
|
+
businessUuid: t.businessUuid
|
|
507
|
+
}
|
|
508
|
+
}), w({
|
|
509
|
+
label: `${c.firstName} ${c.lastName}`,
|
|
510
|
+
value: P
|
|
511
|
+
});
|
|
512
|
+
} catch (g) {
|
|
513
|
+
l.show(g);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
async function C(c, g, P) {
|
|
517
|
+
if (c !== null)
|
|
518
|
+
try {
|
|
519
|
+
await r.execute({
|
|
520
|
+
body: {
|
|
521
|
+
contactPersonUuid: c,
|
|
522
|
+
contactInfo: g,
|
|
523
|
+
position: W.trimOrNull(P)
|
|
524
|
+
},
|
|
525
|
+
params: {
|
|
526
|
+
businessUuid: t.businessUuid
|
|
527
|
+
}
|
|
528
|
+
}), w();
|
|
529
|
+
} catch (M) {
|
|
530
|
+
l.show(M);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
function w(c) {
|
|
534
|
+
if (c === void 0) {
|
|
535
|
+
i("close");
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
i("createNewContactPerson", c), i("close");
|
|
539
|
+
}
|
|
540
|
+
return (c, g) => (a(), m(e(de), {
|
|
541
|
+
form: h.value,
|
|
542
|
+
size: "md",
|
|
543
|
+
"render-own-form-component": "",
|
|
544
|
+
onClose: w
|
|
545
|
+
}, {
|
|
546
|
+
default: _(() => [
|
|
547
|
+
u(e(me), {
|
|
548
|
+
title: e(o).t("wise_crm.info_dialog.contact_person_create.title"),
|
|
549
|
+
description: e(o).t("wise_crm.info_dialog.contact_person_create.description")
|
|
550
|
+
}, null, 8, ["title", "description"]),
|
|
551
|
+
p.value ? (a(), m(e(Z), {
|
|
552
|
+
key: 0,
|
|
553
|
+
form: e(y),
|
|
554
|
+
"prompt-on-unsaved-changes": !1
|
|
555
|
+
}, {
|
|
556
|
+
default: _(() => [
|
|
557
|
+
u(Y, {
|
|
558
|
+
"is-new-mode": p.value,
|
|
559
|
+
"onUpdate:isNewMode": g[0] || (g[0] = (P) => p.value = P),
|
|
560
|
+
"create-form": e(y),
|
|
561
|
+
"existing-form": e(v)
|
|
562
|
+
}, null, 8, ["is-new-mode", "create-form", "existing-form"])
|
|
563
|
+
]),
|
|
564
|
+
_: 1
|
|
565
|
+
}, 8, ["form"])) : (a(), m(e(Z), {
|
|
566
|
+
key: 1,
|
|
567
|
+
form: e(v),
|
|
568
|
+
"prompt-on-unsaved-changes": !1
|
|
569
|
+
}, {
|
|
570
|
+
default: _(() => [
|
|
571
|
+
u(Y, {
|
|
572
|
+
"is-new-mode": p.value,
|
|
573
|
+
"onUpdate:isNewMode": g[1] || (g[1] = (P) => p.value = P),
|
|
574
|
+
"create-form": e(y),
|
|
575
|
+
"existing-form": e(v)
|
|
576
|
+
}, null, 8, ["is-new-mode", "create-form", "existing-form"])
|
|
577
|
+
]),
|
|
578
|
+
_: 1
|
|
579
|
+
}, 8, ["form"]))
|
|
580
|
+
]),
|
|
581
|
+
_: 1
|
|
582
|
+
}, 8, ["form"]));
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
function Ws() {
|
|
586
|
+
return z({
|
|
587
|
+
queryFn: async ({
|
|
588
|
+
body: n,
|
|
589
|
+
params: s
|
|
590
|
+
}) => await $.updateContactPerson(s.businessUuid, s.contactPersonUuid, n),
|
|
591
|
+
queryKeysToInvalidate: {
|
|
592
|
+
businessIndex: {},
|
|
593
|
+
contactPersonDetail: {
|
|
594
|
+
contactPersonUuid: (n) => n.contactPersonUuid
|
|
595
|
+
},
|
|
596
|
+
wiseCrmBusinessDetail: {
|
|
597
|
+
businessUuid: (n) => n.businessUuid
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
function Xs(n, s) {
|
|
603
|
+
return _s("contactPersonDetail", {
|
|
604
|
+
isEnabled: f(() => n.value !== null && s.value !== null),
|
|
605
|
+
params: {
|
|
606
|
+
contactPersonUuid: s
|
|
607
|
+
},
|
|
608
|
+
queryFn: () => {
|
|
609
|
+
if (n.value === null)
|
|
610
|
+
throw new Error("Business UUID is null");
|
|
611
|
+
if (s.value === null)
|
|
612
|
+
throw new Error("Contact Person UUID is null");
|
|
613
|
+
return $.getContactPerson(n.value, s.value);
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
const Ys = /* @__PURE__ */ x({
|
|
618
|
+
__name: "BusinessContactPersonUpdateForm",
|
|
619
|
+
props: {
|
|
620
|
+
contactPerson: {},
|
|
621
|
+
form: {}
|
|
622
|
+
},
|
|
623
|
+
setup(n) {
|
|
624
|
+
const s = n, t = N();
|
|
625
|
+
return (i, o) => (a(), k(T, null, [
|
|
626
|
+
u(rs, {
|
|
627
|
+
form: s.form
|
|
628
|
+
}, null, 8, ["form"]),
|
|
629
|
+
u(e(hs), null, {
|
|
630
|
+
right: _(() => [
|
|
631
|
+
u(e(Cs), {
|
|
632
|
+
"is-loading": s.form.isSubmitting.value,
|
|
633
|
+
label: e(t).t("wise_crm.shared.save_changes")
|
|
634
|
+
}, null, 8, ["is-loading", "label"])
|
|
635
|
+
]),
|
|
636
|
+
_: 1
|
|
637
|
+
})
|
|
638
|
+
], 64));
|
|
639
|
+
}
|
|
640
|
+
}), Zs = /* @__PURE__ */ x({
|
|
641
|
+
__name: "BusinessContactPersonUpdateDialog",
|
|
642
|
+
props: {
|
|
643
|
+
businessUuid: {},
|
|
644
|
+
contactPersonUuid: {}
|
|
645
|
+
},
|
|
646
|
+
emits: ["close"],
|
|
647
|
+
setup(n, { emit: s }) {
|
|
648
|
+
const t = n, i = s, o = N(), l = q(), r = Ws(), b = Xs(
|
|
649
|
+
f(() => t.businessUuid),
|
|
650
|
+
f(() => t.contactPersonUuid)
|
|
651
|
+
), p = f(() => b.result.value.isOk() ? b.result.value.getValue() : null), y = j({
|
|
652
|
+
initialState: f(() => p.value === null ? null : {
|
|
653
|
+
email: p.value.email,
|
|
654
|
+
firstName: p.value.firstName,
|
|
655
|
+
lastName: p.value.lastName,
|
|
656
|
+
mobilePhone: p.value.mobilePhone,
|
|
657
|
+
phone: p.value.phone,
|
|
658
|
+
position: p.value.position
|
|
659
|
+
}),
|
|
660
|
+
schema: ls,
|
|
661
|
+
onSubmit: async (d) => {
|
|
662
|
+
await v(d);
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
async function v(d) {
|
|
666
|
+
try {
|
|
667
|
+
await r.execute({
|
|
668
|
+
body: d,
|
|
669
|
+
params: {
|
|
670
|
+
businessUuid: t.businessUuid,
|
|
671
|
+
contactPersonUuid: t.contactPersonUuid
|
|
672
|
+
}
|
|
673
|
+
}), i("close");
|
|
674
|
+
} catch (C) {
|
|
675
|
+
l.show(C);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
function h() {
|
|
679
|
+
i("close");
|
|
680
|
+
}
|
|
681
|
+
return (d, C) => (a(), m(e(de), {
|
|
682
|
+
form: e(y),
|
|
683
|
+
size: "md",
|
|
684
|
+
onClose: h
|
|
685
|
+
}, {
|
|
686
|
+
default: _(() => [
|
|
687
|
+
u(e(me), {
|
|
688
|
+
title: e(o).t("wise_crm.info_dialog.contact_person_update.title"),
|
|
689
|
+
description: e(o).t("wise_crm.info_dialog.contact_person_create.description")
|
|
690
|
+
}, null, 8, ["title", "description"]),
|
|
691
|
+
p.value !== null ? (a(), m(Ys, {
|
|
692
|
+
key: 0,
|
|
693
|
+
"contact-person": p.value,
|
|
694
|
+
form: e(y)
|
|
695
|
+
}, null, 8, ["contact-person", "form"])) : D("", !0)
|
|
696
|
+
]),
|
|
697
|
+
_: 1
|
|
698
|
+
}, 8, ["form"]));
|
|
699
|
+
}
|
|
700
|
+
}), en = { class: "flex items-start gap-md" }, sn = { class: "flex-1" }, nn = {
|
|
701
|
+
key: 0,
|
|
702
|
+
class: "mt-xxs"
|
|
703
|
+
}, tn = { class: "flex flex-1 items-center justify-between text-secondary" }, an = { class: "flex items-center gap-sm" }, on = { class: "font-semibold" }, un = { class: "flex w-100 flex-col gap-md p-md" }, rn = /* @__PURE__ */ x({
|
|
704
|
+
__name: "BusinessDetailSidebarAccordionBusinessInfoChildren",
|
|
705
|
+
props: {
|
|
706
|
+
business: {}
|
|
707
|
+
},
|
|
708
|
+
emits: ["addChild"],
|
|
709
|
+
setup(n, { emit: s }) {
|
|
710
|
+
const t = n, i = s, o = N(), l = Ne(), r = f(() => t.business.children), b = f(() => r.value.length > 1 ? o.t("wise_crm.shared.departments_amount", {
|
|
711
|
+
value: r.value.length
|
|
712
|
+
}) : r.value[0]?.name ?? "");
|
|
713
|
+
function p() {
|
|
714
|
+
i("addChild");
|
|
715
|
+
}
|
|
716
|
+
function y(v) {
|
|
717
|
+
l.open(E.BUSINESS, v);
|
|
718
|
+
}
|
|
719
|
+
return (v, h) => (a(), k("div", en, [
|
|
720
|
+
(a(), m(V(e($e)), { class: "mt-xs size-4 shrink-0" })),
|
|
721
|
+
S("div", sn, [
|
|
722
|
+
t.business.parent !== null ? (a(), k("div", nn, [
|
|
723
|
+
u(Ze, {
|
|
724
|
+
label: t.business.parent.name,
|
|
725
|
+
"entity-type": e(E).BUSINESS,
|
|
726
|
+
uuid: t.business.parent.uuid
|
|
727
|
+
}, null, 8, ["label", "entity-type", "uuid"])
|
|
728
|
+
])) : D("", !0),
|
|
729
|
+
S("div", tn, [
|
|
730
|
+
S("div", an, [
|
|
731
|
+
t.business.parent !== null ? (a(), m(V(e(X)), {
|
|
732
|
+
key: 0,
|
|
733
|
+
class: "size-4 text-brand-500"
|
|
734
|
+
})) : D("", !0),
|
|
735
|
+
S("p", on, O(t.business.name), 1)
|
|
736
|
+
]),
|
|
737
|
+
u(e(ee), {
|
|
738
|
+
label: e(o).t("wise_crm.info_dialog.sidebar.business.add_icon"),
|
|
739
|
+
icon: e(J),
|
|
740
|
+
variant: "tertiary",
|
|
741
|
+
size: "sm",
|
|
742
|
+
onClick: p
|
|
743
|
+
}, null, 8, ["label", "icon"])
|
|
744
|
+
]),
|
|
745
|
+
r.value.length > 0 ? (a(), k("div", {
|
|
746
|
+
key: 1,
|
|
747
|
+
class: fe([{
|
|
748
|
+
"ml-2xl": t.business.parent !== null
|
|
749
|
+
}, "flex items-center gap-sm"])
|
|
750
|
+
}, [
|
|
751
|
+
(a(), m(V(e(X)), { class: "size-4 text-brand-500" })),
|
|
752
|
+
u(e(Us), {
|
|
753
|
+
"popover-align": "start",
|
|
754
|
+
"popover-side": "right"
|
|
755
|
+
}, {
|
|
756
|
+
trigger: _(() => [
|
|
757
|
+
u(e(R), {
|
|
758
|
+
label: b.value,
|
|
759
|
+
class: "font-normal h-auto rounded-none border-none bg-transparent p-0 text-sm text-primary underline shadow-none",
|
|
760
|
+
variant: "secondary"
|
|
761
|
+
}, null, 8, ["label"])
|
|
762
|
+
]),
|
|
763
|
+
content: _(() => [
|
|
764
|
+
S("div", un, [
|
|
765
|
+
u(ue, {
|
|
766
|
+
"default-values": r.value[0]?.uuid ?? "",
|
|
767
|
+
type: "single"
|
|
768
|
+
}, {
|
|
769
|
+
default: _(() => [
|
|
770
|
+
(a(!0), k(T, null, K(r.value, (d) => (a(), m(Q, {
|
|
771
|
+
key: d.uuid,
|
|
772
|
+
label: d.name,
|
|
773
|
+
value: d.uuid,
|
|
774
|
+
icon: e(ne)
|
|
775
|
+
}, {
|
|
776
|
+
actions: _(() => [
|
|
777
|
+
u(e(ee), {
|
|
778
|
+
label: e(o).t("wise_crm.info_dialog.sidebar.business.add_icon"),
|
|
779
|
+
icon: e(Me),
|
|
780
|
+
variant: "tertiary",
|
|
781
|
+
size: "sm",
|
|
782
|
+
onClick: (C) => y(d.uuid)
|
|
783
|
+
}, null, 8, ["label", "icon", "onClick"])
|
|
784
|
+
]),
|
|
785
|
+
default: _(() => [
|
|
786
|
+
u(re, { class: "flex flex-col gap-md" }, {
|
|
787
|
+
default: _(() => [
|
|
788
|
+
u(F, {
|
|
789
|
+
label: d.vatNumber ?? "-",
|
|
790
|
+
icon: e(te)
|
|
791
|
+
}, null, 8, ["label", "icon"]),
|
|
792
|
+
u(F, {
|
|
793
|
+
label: d.email ?? "-",
|
|
794
|
+
icon: e(Ie)
|
|
795
|
+
}, null, 8, ["label", "icon"]),
|
|
796
|
+
u(F, {
|
|
797
|
+
label: d.mobilePhone ?? d.phone ?? "-",
|
|
798
|
+
icon: e(Ae)
|
|
799
|
+
}, null, 8, ["label", "icon"]),
|
|
800
|
+
u(F, {
|
|
801
|
+
label: d.address ? e(Ee).formatShort(d.address) : "-",
|
|
802
|
+
icon: e(Fe)
|
|
803
|
+
}, null, 8, ["label", "icon"])
|
|
804
|
+
]),
|
|
805
|
+
_: 2
|
|
806
|
+
}, 1024)
|
|
807
|
+
]),
|
|
808
|
+
_: 2
|
|
809
|
+
}, 1032, ["label", "value", "icon"]))), 128))
|
|
810
|
+
]),
|
|
811
|
+
_: 1
|
|
812
|
+
}, 8, ["default-values"])
|
|
813
|
+
])
|
|
814
|
+
]),
|
|
815
|
+
_: 1
|
|
816
|
+
})
|
|
817
|
+
], 2)) : D("", !0)
|
|
818
|
+
])
|
|
819
|
+
]));
|
|
820
|
+
}
|
|
821
|
+
}), ln = { class: "flex flex-col gap-md" }, cn = { class: "flex flex-col gap-sm border-b border-secondary pb-sm" }, dn = { class: "pt-lg" }, mn = /* @__PURE__ */ x({
|
|
822
|
+
__name: "BusinessDetailSidebarAccordionBusinessInfo",
|
|
823
|
+
props: {
|
|
824
|
+
business: {}
|
|
825
|
+
},
|
|
826
|
+
emits: ["addChild"],
|
|
827
|
+
setup(n, { emit: s }) {
|
|
828
|
+
const t = n, i = s, o = N();
|
|
829
|
+
function l() {
|
|
830
|
+
i("addChild");
|
|
831
|
+
}
|
|
832
|
+
return (r, b) => (a(), k("div", ln, [
|
|
833
|
+
u(re, null, {
|
|
834
|
+
default: _(() => [
|
|
835
|
+
S("div", cn, [
|
|
836
|
+
u(F, {
|
|
837
|
+
label: t.business.vatNumber ? e(Qe).format(t.business.vatNumber) : "-",
|
|
838
|
+
icon: e(te)
|
|
839
|
+
}, null, 8, ["label", "icon"]),
|
|
840
|
+
u(rn, {
|
|
841
|
+
business: n.business,
|
|
842
|
+
onAddChild: l
|
|
843
|
+
}, null, 8, ["business"])
|
|
844
|
+
]),
|
|
845
|
+
S("div", dn, [
|
|
846
|
+
u(F, {
|
|
847
|
+
label: e(o).t("wise_crm.info_dialog.sidebar.overview.created_at_label", {
|
|
848
|
+
value: t.business.createdAt ? e(Te)().toDateTime(t.business.createdAt) : "-"
|
|
849
|
+
}),
|
|
850
|
+
icon: e(Ve)
|
|
851
|
+
}, null, 8, ["label", "icon"])
|
|
852
|
+
])
|
|
853
|
+
]),
|
|
854
|
+
_: 1
|
|
855
|
+
}),
|
|
856
|
+
u(cs, {
|
|
857
|
+
address: t.business.address
|
|
858
|
+
}, null, 8, ["address"])
|
|
859
|
+
]));
|
|
860
|
+
}
|
|
861
|
+
}), bn = /* @__PURE__ */ x({
|
|
862
|
+
__name: "BusinessDetailSidebarOverviewContent",
|
|
863
|
+
props: {
|
|
864
|
+
business: {}
|
|
865
|
+
},
|
|
866
|
+
setup(n) {
|
|
867
|
+
const s = n, t = N(), i = q(), o = ie(), l = f(
|
|
868
|
+
() => o.getOptions().business?.sidebarSections ?? []
|
|
869
|
+
), r = ds(
|
|
870
|
+
l,
|
|
871
|
+
f(() => ({
|
|
872
|
+
businessUuid: s.business.uuid
|
|
873
|
+
}))
|
|
874
|
+
), b = ce(), p = b.create(xs), y = Is(), v = As(), h = b.create(Js), d = b.create(Zs), C = b.create(Gs), w = f(() => s.business.contactPersons.length > 0), c = f(() => s.business.contactPersons.toSorted((U, A) => Number(A.isPrimary) - Number(U.isPrimary)));
|
|
875
|
+
function g() {
|
|
876
|
+
h.open({
|
|
877
|
+
businessUuid: s.business.uuid
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
function P(U) {
|
|
881
|
+
d.open({
|
|
882
|
+
businessUuid: s.business.uuid,
|
|
883
|
+
contactPersonUuid: U
|
|
884
|
+
});
|
|
885
|
+
}
|
|
886
|
+
function M(U) {
|
|
887
|
+
p.open({
|
|
888
|
+
title: t.t("wise_crm.info_dialog.sidebar.overview.delete_contact_person_title"),
|
|
889
|
+
isDestructive: !0,
|
|
890
|
+
confirmLabel: t.t("shared.delete"),
|
|
891
|
+
description: t.t("wise_crm.info_dialog.sidebar.overview.delete_contact_person_description"),
|
|
892
|
+
onConfirm: async () => {
|
|
893
|
+
try {
|
|
894
|
+
await v.execute({
|
|
895
|
+
body: {
|
|
896
|
+
contactPersonUuid: U
|
|
897
|
+
},
|
|
898
|
+
params: {
|
|
899
|
+
businessUuid: s.business.uuid
|
|
900
|
+
}
|
|
901
|
+
});
|
|
902
|
+
} catch (A) {
|
|
903
|
+
i.show(A);
|
|
904
|
+
} finally {
|
|
905
|
+
p.close();
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
function G(U) {
|
|
911
|
+
y.execute({
|
|
912
|
+
params: {
|
|
913
|
+
businessUuid: s.business.uuid,
|
|
914
|
+
contactPersonUuid: U
|
|
915
|
+
}
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
function I() {
|
|
919
|
+
C.open({
|
|
920
|
+
businessUuid: s.business.uuid
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
return (U, A) => (a(), m(ue, {
|
|
924
|
+
"default-values": ["business", "invoice", "contact-persons", ...l.value.map((B) => `custom-${B.key}`)]
|
|
925
|
+
}, {
|
|
926
|
+
default: _(() => [
|
|
927
|
+
u(Q, {
|
|
928
|
+
label: e(t).t("wise_crm.info_dialog.sidebar.overview.business_info"),
|
|
929
|
+
icon: e(ae),
|
|
930
|
+
value: "business"
|
|
931
|
+
}, {
|
|
932
|
+
default: _(() => [
|
|
933
|
+
u(mn, {
|
|
934
|
+
business: n.business,
|
|
935
|
+
onAddChild: I
|
|
936
|
+
}, null, 8, ["business"])
|
|
937
|
+
]),
|
|
938
|
+
_: 1
|
|
939
|
+
}, 8, ["label", "icon"]),
|
|
940
|
+
u(Q, {
|
|
941
|
+
"is-empty": s.business.billingInformation === null,
|
|
942
|
+
label: e(t).t("wise_crm.info_dialog.sidebar.overview.invoice_label"),
|
|
943
|
+
icon: e(qe),
|
|
944
|
+
value: "invoice"
|
|
945
|
+
}, {
|
|
946
|
+
default: _(() => [
|
|
947
|
+
s.business.billingInformation ? (a(), m(ms, {
|
|
948
|
+
key: 0,
|
|
949
|
+
"invoice-address": s.business.billingInformation?.location?.address ?? null,
|
|
950
|
+
"invoice-email": s.business.billingInformation?.invoiceEmail
|
|
951
|
+
}, null, 8, ["invoice-address", "invoice-email"])) : D("", !0)
|
|
952
|
+
]),
|
|
953
|
+
_: 1
|
|
954
|
+
}, 8, ["is-empty", "label", "icon"]),
|
|
955
|
+
u(Q, {
|
|
956
|
+
"is-empty": !w.value,
|
|
957
|
+
label: e(t).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
|
|
958
|
+
icon: e(ze),
|
|
959
|
+
value: "contact-persons",
|
|
960
|
+
onAdd: g
|
|
961
|
+
}, {
|
|
962
|
+
actions: _(() => [
|
|
963
|
+
w.value ? D("", !0) : (a(), m(es, {
|
|
964
|
+
key: 0,
|
|
965
|
+
label: e(t).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
|
|
966
|
+
icon: e(J),
|
|
967
|
+
class: "z-1",
|
|
968
|
+
onClick: g
|
|
969
|
+
}, null, 8, ["label", "icon"]))
|
|
970
|
+
]),
|
|
971
|
+
default: _(() => [
|
|
972
|
+
(a(!0), k(T, null, K(c.value, (B) => (a(), m(e(ws), {
|
|
973
|
+
key: B.uuid,
|
|
974
|
+
"layout-id": B.uuid
|
|
975
|
+
}, {
|
|
976
|
+
default: _(() => [
|
|
977
|
+
u(bs, {
|
|
978
|
+
"contact-person": B,
|
|
979
|
+
"on-toggle-is-primary": () => G(B.uuid),
|
|
980
|
+
onUpdate: (be) => P(B.uuid),
|
|
981
|
+
onDelete: (be) => M(B.uuid)
|
|
982
|
+
}, null, 8, ["contact-person", "on-toggle-is-primary", "onUpdate", "onDelete"])
|
|
983
|
+
]),
|
|
984
|
+
_: 2
|
|
985
|
+
}, 1032, ["layout-id"]))), 128)),
|
|
986
|
+
w.value ? (a(), m(e(R), {
|
|
987
|
+
key: 0,
|
|
988
|
+
"icon-left": e(J),
|
|
989
|
+
label: e(t).t("wise_crm.shared.add"),
|
|
990
|
+
variant: "tertiary",
|
|
991
|
+
size: "sm",
|
|
992
|
+
onClick: g
|
|
993
|
+
}, null, 8, ["icon-left", "label"])) : D("", !0)
|
|
994
|
+
]),
|
|
995
|
+
_: 1
|
|
996
|
+
}, 8, ["is-empty", "label", "icon"]),
|
|
997
|
+
(a(!0), k(T, null, K(e(r), (B) => (a(), m(Q, {
|
|
998
|
+
key: B.key,
|
|
999
|
+
label: B.label.value,
|
|
1000
|
+
icon: B.icon,
|
|
1001
|
+
value: `custom-${B.key}`
|
|
1002
|
+
}, {
|
|
1003
|
+
default: _(() => [
|
|
1004
|
+
(a(), m(V(B.component), {
|
|
1005
|
+
"business-uuid": s.business.uuid
|
|
1006
|
+
}, null, 8, ["business-uuid"]))
|
|
1007
|
+
]),
|
|
1008
|
+
_: 2
|
|
1009
|
+
}, 1032, ["label", "icon", "value"]))), 128))
|
|
1010
|
+
]),
|
|
1011
|
+
_: 1
|
|
1012
|
+
}, 8, ["default-values"]));
|
|
1013
|
+
}
|
|
1014
|
+
}), pn = /* @__PURE__ */ x({
|
|
1015
|
+
__name: "BusinessDetailSidebar",
|
|
1016
|
+
props: {
|
|
1017
|
+
business: {}
|
|
1018
|
+
},
|
|
1019
|
+
setup(n) {
|
|
1020
|
+
const s = n, t = N(), i = Oe(), o = ie(), l = f(() => i.getEntityConfig(E.BUSINESS)), r = f(
|
|
1021
|
+
() => o.getOptions().business?.headerBadges ?? []
|
|
1022
|
+
), b = L(
|
|
1023
|
+
"overview"
|
|
1024
|
+
/* OVERVIEW */
|
|
1025
|
+
), p = f(() => [
|
|
1026
|
+
{
|
|
1027
|
+
icon: ae,
|
|
1028
|
+
label: t.t("wise_crm.shared.overview"),
|
|
1029
|
+
value: "overview"
|
|
1030
|
+
/* OVERVIEW */
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
icon: Le,
|
|
1034
|
+
label: t.t("wise_crm.shared.activity"),
|
|
1035
|
+
value: "activity"
|
|
1036
|
+
/* ACTIVITY */
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
icon: Ke,
|
|
1040
|
+
label: t.t("wise_crm.shared.notes"),
|
|
1041
|
+
value: "notes"
|
|
1042
|
+
/* NOTES */
|
|
1043
|
+
}
|
|
1044
|
+
]);
|
|
1045
|
+
return (y, v) => (a(), m(je, {
|
|
1046
|
+
color: e(i).getEntityConfig(e(E).BUSINESS)?.color ?? null,
|
|
1047
|
+
class: "flex h-full flex-col"
|
|
1048
|
+
}, {
|
|
1049
|
+
default: _(() => [
|
|
1050
|
+
u(ps, {
|
|
1051
|
+
"entity-type": e(E).BUSINESS,
|
|
1052
|
+
name: s.business.name,
|
|
1053
|
+
address: s.business.address,
|
|
1054
|
+
email: s.business.email,
|
|
1055
|
+
"mobile-phone": s.business.mobilePhone,
|
|
1056
|
+
"entity-name": l.value?.name ?? null,
|
|
1057
|
+
phone: s.business.phone
|
|
1058
|
+
}, {
|
|
1059
|
+
badges: _(() => [
|
|
1060
|
+
(a(!0), k(T, null, K(r.value, (h) => (a(), m(ss, {
|
|
1061
|
+
key: h.key,
|
|
1062
|
+
badge: h,
|
|
1063
|
+
uuid: s.business.uuid,
|
|
1064
|
+
entity: "business"
|
|
1065
|
+
}, null, 8, ["badge", "uuid"]))), 128))
|
|
1066
|
+
]),
|
|
1067
|
+
_: 1
|
|
1068
|
+
}, 8, ["entity-type", "name", "address", "email", "mobile-phone", "entity-name", "phone"]),
|
|
1069
|
+
u(ns, {
|
|
1070
|
+
modelValue: b.value,
|
|
1071
|
+
"onUpdate:modelValue": v[0] || (v[0] = (h) => b.value = h),
|
|
1072
|
+
tabs: p.value
|
|
1073
|
+
}, {
|
|
1074
|
+
default: _(() => [
|
|
1075
|
+
b.value === "overview" ? (a(), m(bn, {
|
|
1076
|
+
key: 0,
|
|
1077
|
+
business: s.business
|
|
1078
|
+
}, null, 8, ["business"])) : D("", !0),
|
|
1079
|
+
b.value === "activity" ? (a(), m(ks, {
|
|
1080
|
+
key: 1,
|
|
1081
|
+
business: s.business
|
|
1082
|
+
}, null, 8, ["business"])) : D("", !0),
|
|
1083
|
+
b.value === "notes" ? (a(), m($s, {
|
|
1084
|
+
key: 2,
|
|
1085
|
+
business: s.business
|
|
1086
|
+
}, null, 8, ["business"])) : D("", !0)
|
|
1087
|
+
]),
|
|
1088
|
+
_: 1
|
|
1089
|
+
}, 8, ["modelValue", "tabs"])
|
|
1090
|
+
]),
|
|
1091
|
+
_: 1
|
|
1092
|
+
}, 8, ["color"]));
|
|
1093
|
+
}
|
|
1094
|
+
}), _n = /* @__PURE__ */ x({
|
|
1095
|
+
__name: "BusinessDetailSidebarProvider",
|
|
1096
|
+
props: {
|
|
1097
|
+
businessUuid: {}
|
|
1098
|
+
},
|
|
1099
|
+
setup(n) {
|
|
1100
|
+
const s = n, t = N(), i = Re(
|
|
1101
|
+
f(() => s.businessUuid)
|
|
1102
|
+
), o = f(() => i.result.value.isOk() ? i.result.value.getValue() : null);
|
|
1103
|
+
return (l, r) => (a(), m(ts, null, {
|
|
1104
|
+
default: _(() => [
|
|
1105
|
+
e(i).isError.value ? (a(), m(Ge, {
|
|
1106
|
+
key: 0,
|
|
1107
|
+
message: e(t).t("error.business_details.description"),
|
|
1108
|
+
title: e(t).t("error.business_details.title")
|
|
1109
|
+
}, null, 8, ["message", "title"])) : e(i).isLoading.value ? (a(), m(He, {
|
|
1110
|
+
key: 1,
|
|
1111
|
+
class: "h-full"
|
|
1112
|
+
})) : o.value ? (a(), m(pn, {
|
|
1113
|
+
key: 2,
|
|
1114
|
+
business: o.value
|
|
1115
|
+
}, null, 8, ["business"])) : D("", !0)
|
|
1116
|
+
]),
|
|
1117
|
+
_: 1
|
|
1118
|
+
}));
|
|
1119
|
+
}
|
|
1120
|
+
}), Dn = /* @__PURE__ */ x({
|
|
1121
|
+
__name: "BusinessDetailView",
|
|
1122
|
+
props: {
|
|
1123
|
+
tabs: {}
|
|
1124
|
+
},
|
|
1125
|
+
setup(n) {
|
|
1126
|
+
const s = n, t = ve("businessUuid");
|
|
1127
|
+
return (i, o) => (a(), m(is, {
|
|
1128
|
+
key: e(t),
|
|
1129
|
+
tabs: s.tabs,
|
|
1130
|
+
"entity-type": e(E).BUSINESS
|
|
1131
|
+
}, {
|
|
1132
|
+
sidebar: _(() => [
|
|
1133
|
+
u(_n, { "business-uuid": e(t) }, null, 8, ["business-uuid"])
|
|
1134
|
+
]),
|
|
1135
|
+
_: 1
|
|
1136
|
+
}, 8, ["tabs", "entity-type"]));
|
|
1137
|
+
}
|
|
1138
|
+
});
|
|
1139
|
+
export {
|
|
1140
|
+
Dn as default
|
|
1141
|
+
};
|