@wisemen/wise-crm-web 0.1.2-beta.0 → 0.1.3
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/{BusinessDetailSidebarProvider-CKT-MWzI.js → BusinessDetailSidebarProvider-B1qF3leV.js} +642 -567
- package/dist/{BusinessDetailView-Xjkq0gYI.js → BusinessDetailView-CSVCQCnn.js} +4 -4
- package/dist/{CrmDetailHeaderCard--ulW7CCz.js → CrmDetailHeaderCard-CD61YObi.js} +23 -11
- package/dist/{CrmDetailView-CZGjj8uf.js → CrmDetailView-U68c8FtU.js} +1 -1
- package/dist/{DealDetailView-ZItYEZ3_.js → DealDetailView-Cp_lb8gF.js} +3 -3
- package/dist/{DealSendMailDialog-XLd_jRsi.js → DealSendMailDialog-CJ80f8Dl.js} +548 -542
- package/dist/{Error-DEa9pg3N.js → Error-DIPflT5m.js} +5 -1
- package/dist/IndividualDetailSidebarProvider-BhD4t_q7.js +612 -0
- package/dist/{IndividualDetailView-DeXOrNc7.js → IndividualDetailView-CdVJykQm.js} +4 -4
- package/dist/api/mutations/business/businessBillingInformationUpsert.mutation.d.ts +1 -0
- package/dist/api/mutations/business/businessCreate.mutation.d.ts +1 -0
- package/dist/api/mutations/business/businessUpdate.mutation.d.ts +1 -0
- package/dist/api/mutations/individual/individualBillingInformationUpdate.mutation.d.ts +1 -0
- package/dist/api/mutations/individual/individualUpdate.mutation.d.ts +1 -0
- package/dist/composables/geocode/geocode.composable.d.ts +9 -0
- package/dist/index.js +103 -45
- package/dist/models/address/addressCreateForm.model.d.ts +1 -0
- package/dist/models/business/billing-information/update/businessBillingInformationForm.model.d.ts +1 -0
- package/dist/models/business/create/businessCreateForm.model.d.ts +2 -0
- package/dist/models/business/update/businessUpdateForm.model.d.ts +2 -0
- package/dist/models/global-search/globalSearchItem.model.d.ts +1 -0
- package/dist/models/individual/billing-information/update/individualBillingInformationForm.model.d.ts +1 -0
- package/dist/models/individual/create/individualCreateForm.model.d.ts +2 -0
- package/dist/models/individual/update/individualUpdateForm.model.d.ts +2 -0
- package/dist/testing/factories/individual.factory.d.ts +2 -1
- package/dist/testing.js +14 -0
- package/dist/utils/belgianSsn.util.d.ts +30 -0
- package/dist/widgets/WidgetBusinessStatistics.vue.d.ts +5 -1
- package/dist/widgets/WidgetIndividualStatistics.vue.d.ts +5 -1
- package/package.json +2 -1
- package/dist/IndividualDetailSidebarProvider-CZ53pmhG.js +0 -613
package/dist/{BusinessDetailSidebarProvider-CKT-MWzI.js → BusinessDetailSidebarProvider-B1qF3leV.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as useSearch, B as AppForm_default, E as useCrmConfig, F as useOffsetInfiniteQuery, H as AppConfirmDialog_default, I as NoteUpdateDialog_default, L as AppDialogHeader_default, M as AppSidebarFormSubmitButton_default, N as AppSidebarFormFooter_default, O as AppColorProvider_default, P as AppAndOrSeparator_default, Q as NoteService, R as CrmDetailSidebarNotesView_default, T as useEntityDetail, U as AppDialogContainer_default, V as i18nPlugin, W as AppDialogActions_default, X as useKeysetInfiniteQuery, Z as useNoteDeleteMutation, a as AppOpenEntityButton_default, at as ActivityIndexPaginationTransformer, b as AppGlobalFormError_default, c as CrmDetailAccordionRoot_default, g as IndividualAutocomplete_default, h as useContactPersonCreateMutation, i as CrmDetailSidebarAccordionHeaderIconButton_default, it as AddressTransformer, l as AppIconLabelPair_default, m as AppDialog_default, n as CrmDetailContainer_default, nt as ContactPersonUpdateTransformer, o as CrmDetailSidebarCard_default, ot as ActivityIndexTransformer, q as useApiErrorToast, r as CrmDetailSidebarTabs_default, rt as StringUtil, s as CrmDetailSidebarAccordionItem_default, st as individualUuidSchema, t as Error_default, tt as AppGrid_default, v as IndividualService, w as useCrm, x as EntityAutocomplete_default, z as toFormField } from "./Error-
|
|
2
|
-
import { a as contactPersonUpdateFormSchema, c as AddressUtil, i as CrmDetailSidebarMapCard_default, l as ActivityList_default, n as CrmDetailSidebarAccordionContactPersonInfo_default, o as ContactPersonCreateForm_default, r as CrmDetailSidebarAccordionBillingInformation_default, s as ContactPersonCreateNewForm_default, t as CrmDetailHeaderCard_default, u as assert } from "./CrmDetailHeaderCard
|
|
1
|
+
import { A as useSearch, B as AppForm_default, D as useGoogleMapsApiKey, E as useCrmConfig, F as useOffsetInfiniteQuery, H as AppConfirmDialog_default, I as NoteUpdateDialog_default, L as AppDialogHeader_default, M as AppSidebarFormSubmitButton_default, N as AppSidebarFormFooter_default, O as AppColorProvider_default, P as AppAndOrSeparator_default, Q as NoteService, R as CrmDetailSidebarNotesView_default, T as useEntityDetail, U as AppDialogContainer_default, V as i18nPlugin, W as AppDialogActions_default, X as useKeysetInfiniteQuery, Z as useNoteDeleteMutation, a as AppOpenEntityButton_default, at as ActivityIndexPaginationTransformer, b as AppGlobalFormError_default, c as CrmDetailAccordionRoot_default, g as IndividualAutocomplete_default, h as useContactPersonCreateMutation, i as CrmDetailSidebarAccordionHeaderIconButton_default, it as AddressTransformer, l as AppIconLabelPair_default, m as AppDialog_default, n as CrmDetailContainer_default, nt as ContactPersonUpdateTransformer, o as CrmDetailSidebarCard_default, ot as ActivityIndexTransformer, q as useApiErrorToast, r as CrmDetailSidebarTabs_default, rt as StringUtil, s as CrmDetailSidebarAccordionItem_default, st as individualUuidSchema, t as Error_default, tt as AppGrid_default, v as IndividualService, w as useCrm, x as EntityAutocomplete_default, z as toFormField } from "./Error-DIPflT5m.js";
|
|
2
|
+
import { a as contactPersonUpdateFormSchema, c as AddressUtil, i as CrmDetailSidebarMapCard_default, l as ActivityList_default, n as CrmDetailSidebarAccordionContactPersonInfo_default, o as ContactPersonCreateForm_default, r as CrmDetailSidebarAccordionBillingInformation_default, s as ContactPersonCreateNewForm_default, t as CrmDetailHeaderCard_default, u as assert } from "./CrmDetailHeaderCard-CD61YObi.js";
|
|
3
3
|
import { c as Be, i as plainDateSchema, l as He, n as useDateTimeFormat, s as ZonedDateTimeTransformer, t as AppSkeletonLoader_default, u as ze } from "./AppSkeletonLoader-BAhoOmFD.js";
|
|
4
4
|
import { E as updateBusinessV1, F as viewBusinessActivityLogIndexV1, I as viewBusinessBillingInformationDetailV1, L as viewBusinessContactPersonDetailV1, N as upsertBusinessBillingInformationV1, R as viewBusinessDetailV1, S as unlinkContactPersonFromBusinessV1, T as updateBusinessContactPersonV1, V as viewBusinessStatisticsV1, d as linkContactPersonToBusinessV1, ft as CountryCode, g as makeBusinessContactPersonPrimaryV1, ht as EntityType, n as createBusinessV1, u as linkBusinessAsChildV1, y as searchCbeEnterprisesV1, z as viewBusinessIndexV1 } from "./client-C1e--fRv.js";
|
|
5
5
|
import z$1, { z } from "zod";
|
|
@@ -211,106 +211,106 @@ var BusinessBillingInformationTransformer = class {
|
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
213
|
}, BusinessService = class {
|
|
214
|
-
static async addChildBusiness(e,
|
|
214
|
+
static async addChildBusiness(e, O) {
|
|
215
215
|
await linkBusinessAsChildV1({ path: {
|
|
216
216
|
businessUuid: e,
|
|
217
|
-
childUuid:
|
|
217
|
+
childUuid: O
|
|
218
218
|
} });
|
|
219
219
|
}
|
|
220
220
|
static async create(e) {
|
|
221
221
|
return (await createBusinessV1({ body: BusinessCreateTransformer.toDto(e) })).data.uuid;
|
|
222
222
|
}
|
|
223
223
|
static async findByName(e) {
|
|
224
|
-
let
|
|
224
|
+
let O = await viewBusinessIndexV1({ query: new PaginationParamsBuilder().withSearch(e).build() });
|
|
225
225
|
return {
|
|
226
|
-
data:
|
|
227
|
-
meta:
|
|
226
|
+
data: O.data.items.map(BusinessIndexTransformer.fromDto),
|
|
227
|
+
meta: O.data.meta
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
|
-
static async getActivity(e,
|
|
231
|
-
let
|
|
232
|
-
query: new PaginationParamsBuilder(
|
|
230
|
+
static async getActivity(e, O) {
|
|
231
|
+
let k = await viewBusinessActivityLogIndexV1({
|
|
232
|
+
query: new PaginationParamsBuilder(O).buildKeyset(ActivityIndexPaginationTransformer.toDto),
|
|
233
233
|
responseValidator: void 0,
|
|
234
234
|
path: { businessUuid: e }
|
|
235
235
|
});
|
|
236
236
|
return {
|
|
237
|
-
data:
|
|
237
|
+
data: k.data.items.map(ActivityIndexTransformer.fromDto),
|
|
238
238
|
meta: {
|
|
239
|
-
next:
|
|
240
|
-
total:
|
|
239
|
+
next: k.data.meta.next,
|
|
240
|
+
total: k.data.items.length
|
|
241
241
|
}
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
244
|
static async getAll(e) {
|
|
245
|
-
let
|
|
245
|
+
let O = await viewBusinessIndexV1({ query: businessIndexQueryParamsTransformer.toDto(e) });
|
|
246
246
|
return {
|
|
247
|
-
data:
|
|
248
|
-
meta:
|
|
247
|
+
data: O.data.items.map(BusinessIndexTransformer.fromDto),
|
|
248
|
+
meta: O.data.meta
|
|
249
249
|
};
|
|
250
250
|
}
|
|
251
251
|
static async getBillingInformation(e) {
|
|
252
|
-
let
|
|
253
|
-
return BusinessBillingInformationTransformer.fromDto(
|
|
252
|
+
let O = await viewBusinessBillingInformationDetailV1({ path: { businessUuid: e } });
|
|
253
|
+
return BusinessBillingInformationTransformer.fromDto(O.data);
|
|
254
254
|
}
|
|
255
255
|
static async getByUuid(e) {
|
|
256
|
-
let
|
|
257
|
-
return BusinessDetailTransformer.fromDto(
|
|
256
|
+
let O = await viewBusinessDetailV1({ path: { businessUuid: e } });
|
|
257
|
+
return BusinessDetailTransformer.fromDto(O.data);
|
|
258
258
|
}
|
|
259
|
-
static async getContactPerson(e,
|
|
260
|
-
let
|
|
259
|
+
static async getContactPerson(e, O) {
|
|
260
|
+
let k = await viewBusinessContactPersonDetailV1({ path: {
|
|
261
261
|
businessUuid: e,
|
|
262
|
-
contactPersonUuid:
|
|
262
|
+
contactPersonUuid: O
|
|
263
263
|
} });
|
|
264
|
-
return BusinessContactPersonTransformer.fromDto(
|
|
264
|
+
return BusinessContactPersonTransformer.fromDto(k.data);
|
|
265
265
|
}
|
|
266
266
|
static async getStatistics() {
|
|
267
267
|
let e = await viewBusinessStatisticsV1();
|
|
268
268
|
return BusinessStatisticsTransformer.fromDto(e.data);
|
|
269
269
|
}
|
|
270
|
-
static async linkContactPerson(e, k, A
|
|
270
|
+
static async linkContactPerson(e, O, k, A) {
|
|
271
271
|
await linkContactPersonToBusinessV1({
|
|
272
272
|
body: {
|
|
273
|
-
contactPersonUuid:
|
|
274
|
-
email: StringUtil.trimOrNull(
|
|
275
|
-
mobilePhone:
|
|
276
|
-
phone:
|
|
277
|
-
position:
|
|
273
|
+
contactPersonUuid: O,
|
|
274
|
+
email: StringUtil.trimOrNull(A.email),
|
|
275
|
+
mobilePhone: A.mobilePhone,
|
|
276
|
+
phone: A.phone,
|
|
277
|
+
position: k
|
|
278
278
|
},
|
|
279
279
|
responseValidator: void 0,
|
|
280
280
|
path: { businessUuid: e }
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
|
-
static async setPrimaryContactPersonForBusiness(e,
|
|
283
|
+
static async setPrimaryContactPersonForBusiness(e, O) {
|
|
284
284
|
await makeBusinessContactPersonPrimaryV1({ path: {
|
|
285
285
|
businessUuid: e,
|
|
286
|
-
contactPersonUuid:
|
|
286
|
+
contactPersonUuid: O
|
|
287
287
|
} });
|
|
288
288
|
}
|
|
289
|
-
static async unlinkContactPerson(e,
|
|
289
|
+
static async unlinkContactPerson(e, O) {
|
|
290
290
|
await unlinkContactPersonFromBusinessV1({
|
|
291
|
-
body: { contactPersonUuid:
|
|
291
|
+
body: { contactPersonUuid: O },
|
|
292
292
|
responseValidator: void 0,
|
|
293
293
|
path: { businessUuid: e }
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
|
-
static async update(e,
|
|
296
|
+
static async update(e, O) {
|
|
297
297
|
await updateBusinessV1({
|
|
298
|
-
body: BusinessUpdateTransformer.toDto(
|
|
298
|
+
body: BusinessUpdateTransformer.toDto(O),
|
|
299
299
|
path: { businessUuid: e }
|
|
300
300
|
});
|
|
301
301
|
}
|
|
302
|
-
static async updateContactPerson(e,
|
|
302
|
+
static async updateContactPerson(e, O, k) {
|
|
303
303
|
await updateBusinessContactPersonV1({
|
|
304
|
-
body: ContactPersonUpdateTransformer.toDto(
|
|
304
|
+
body: ContactPersonUpdateTransformer.toDto(k),
|
|
305
305
|
path: {
|
|
306
306
|
businessUuid: e,
|
|
307
|
-
contactPersonUuid:
|
|
307
|
+
contactPersonUuid: O
|
|
308
308
|
}
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
|
-
static async upsertBillingInformation(e,
|
|
311
|
+
static async upsertBillingInformation(e, O) {
|
|
312
312
|
await upsertBusinessBillingInformationV1({
|
|
313
|
-
body: BusinessBillingInformationUpdateTransformer.toDto(
|
|
313
|
+
body: BusinessBillingInformationUpdateTransformer.toDto(O),
|
|
314
314
|
path: { businessUuid: e }
|
|
315
315
|
});
|
|
316
316
|
}
|
|
@@ -322,72 +322,72 @@ function useBusinessDetailQuery(e) {
|
|
|
322
322
|
queryKey: { wiseCrmBusinessDetail: { businessUuid: e } }
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
|
-
function useBusinessActivityIndexQuery(e,
|
|
325
|
+
function useBusinessActivityIndexQuery(e, O) {
|
|
326
326
|
return Be({
|
|
327
|
-
paginationOptions:
|
|
328
|
-
queryFn: async (
|
|
329
|
-
queryKey: { businessActivityIndex: { paginationOptions:
|
|
327
|
+
paginationOptions: O,
|
|
328
|
+
queryFn: async (O) => await BusinessService.getActivity(e.value, O),
|
|
329
|
+
queryKey: { businessActivityIndex: { paginationOptions: O } }
|
|
330
330
|
});
|
|
331
331
|
}
|
|
332
332
|
var BusinessDetailSidebarActivityContent_default = /* @__PURE__ */ defineComponent({
|
|
333
333
|
__name: "BusinessDetailSidebarActivityContent",
|
|
334
334
|
props: { business: {} },
|
|
335
335
|
setup(e) {
|
|
336
|
-
let
|
|
336
|
+
let O = e, k = usePagination({
|
|
337
337
|
isRouteQueryEnabled: !1,
|
|
338
338
|
type: "keyset"
|
|
339
|
-
}),
|
|
340
|
-
async function
|
|
341
|
-
await
|
|
339
|
+
}), A = useBusinessActivityIndexQuery(computed(() => O.business.uuid), k.paginationOptions), j = computed(() => A.data.value.data ?? []);
|
|
340
|
+
async function M() {
|
|
341
|
+
await A.getNextPage();
|
|
342
342
|
}
|
|
343
|
-
return (e,
|
|
344
|
-
"on-next":
|
|
345
|
-
"is-loading": unref(
|
|
346
|
-
activities:
|
|
343
|
+
return (e, O) => (openBlock(), createBlock(ActivityList_default, {
|
|
344
|
+
"on-next": M,
|
|
345
|
+
"is-loading": unref(A).isLoading.value,
|
|
346
|
+
activities: j.value
|
|
347
347
|
}, null, 8, ["is-loading", "activities"]));
|
|
348
348
|
}
|
|
349
349
|
});
|
|
350
350
|
function useNoteBusinessCreateMutation() {
|
|
351
351
|
return ze({
|
|
352
|
-
queryFn: async ({ body: e, params:
|
|
352
|
+
queryFn: async ({ body: e, params: O }) => await NoteService.create(e, { businessUuid: O.businessUuid }),
|
|
353
353
|
queryKeysToInvalidate: { noteBusinessIndex: {} }
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
|
-
function useNoteBusinessIndexQuery(e,
|
|
356
|
+
function useNoteBusinessIndexQuery(e, O) {
|
|
357
357
|
return useKeysetInfiniteQuery({
|
|
358
|
-
queryFn: (
|
|
359
|
-
queryKey: { noteBusinessIndex: { params:
|
|
358
|
+
queryFn: (O) => NoteService.getBusinessNotes({ pagination: O }, e.value),
|
|
359
|
+
queryKey: { noteBusinessIndex: { params: O?.params } }
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
362
|
var BusinessDetailSidebarNotesContent_default = /* @__PURE__ */ defineComponent({
|
|
363
363
|
__name: "BusinessDetailSidebarNotesContent",
|
|
364
364
|
props: { business: {} },
|
|
365
365
|
setup(e) {
|
|
366
|
-
let
|
|
367
|
-
async function
|
|
368
|
-
await
|
|
366
|
+
let O = e, k = useDialog(NoteUpdateDialog_default), A = useApiErrorToast(), j = useNoteBusinessCreateMutation(), M = useNoteDeleteMutation(), P = useNoteBusinessIndexQuery(computed(() => O.business.uuid)), F = computed(() => P.data?.value?.data ?? []);
|
|
367
|
+
async function I(e) {
|
|
368
|
+
await j.execute({
|
|
369
369
|
body: e,
|
|
370
|
-
params: { businessUuid:
|
|
370
|
+
params: { businessUuid: O.business.uuid }
|
|
371
371
|
});
|
|
372
372
|
}
|
|
373
|
-
async function
|
|
373
|
+
async function L(e) {
|
|
374
374
|
try {
|
|
375
|
-
await
|
|
375
|
+
await M.execute({ params: { noteUuid: e } });
|
|
376
376
|
} catch (e) {
|
|
377
|
-
|
|
377
|
+
A.show(e);
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
|
|
380
|
+
function R(e) {
|
|
381
|
+
k.open({ note: e });
|
|
382
382
|
}
|
|
383
|
-
return (e,
|
|
384
|
-
"is-loading": unref(
|
|
385
|
-
notes:
|
|
386
|
-
"on-submit":
|
|
387
|
-
"has-next-page": unref(
|
|
388
|
-
onNext:
|
|
389
|
-
onDelete:
|
|
390
|
-
onUpdate:
|
|
383
|
+
return (e, O) => (openBlock(), createBlock(CrmDetailSidebarNotesView_default, {
|
|
384
|
+
"is-loading": unref(P).isLoading.value,
|
|
385
|
+
notes: F.value,
|
|
386
|
+
"on-submit": I,
|
|
387
|
+
"has-next-page": unref(P).hasNextPage.value,
|
|
388
|
+
onNext: O[0] ||= (e) => unref(P).fetchNextPage(),
|
|
389
|
+
onDelete: L,
|
|
390
|
+
onUpdate: R
|
|
391
391
|
}, null, 8, [
|
|
392
392
|
"is-loading",
|
|
393
393
|
"notes",
|
|
@@ -396,40 +396,40 @@ var BusinessDetailSidebarNotesContent_default = /* @__PURE__ */ defineComponent(
|
|
|
396
396
|
}
|
|
397
397
|
});
|
|
398
398
|
function useBusinessPrimaryContactPersonUpdateMutation() {
|
|
399
|
-
let e = useQueryClient(),
|
|
399
|
+
let e = useQueryClient(), O = "wiseCrmBusinessDetail", k = useMutation({
|
|
400
400
|
mutationFn: async (e) => {
|
|
401
401
|
await BusinessService.setPrimaryContactPersonForBusiness(e.businessUuid, e.contactPersonUuid);
|
|
402
402
|
},
|
|
403
|
-
onError: (A, j
|
|
404
|
-
e.setQueryData([
|
|
403
|
+
onError: (k, A, j) => {
|
|
404
|
+
e.setQueryData([O, { businessUuid: A.businessUuid }], j?.previousData);
|
|
405
405
|
},
|
|
406
|
-
onMutate: async (
|
|
407
|
-
await e.cancelQueries({ queryKey: [
|
|
408
|
-
let
|
|
409
|
-
return
|
|
410
|
-
...
|
|
411
|
-
contactPersons:
|
|
406
|
+
onMutate: async (k) => {
|
|
407
|
+
await e.cancelQueries({ queryKey: [O] });
|
|
408
|
+
let A = e.getQueryData([O, { businessUuid: k.businessUuid }]);
|
|
409
|
+
return A === void 0 ? {} : (e.setQueryData([O, { businessUuid: k.businessUuid }], {
|
|
410
|
+
...A,
|
|
411
|
+
contactPersons: A.contactPersons.map((e) => e.uuid === k.contactPersonUuid ? {
|
|
412
412
|
...e,
|
|
413
413
|
isPrimary: !e.isPrimary
|
|
414
414
|
} : {
|
|
415
415
|
...e,
|
|
416
416
|
isPrimary: !1
|
|
417
417
|
})
|
|
418
|
-
}), { previousData:
|
|
418
|
+
}), { previousData: A });
|
|
419
419
|
},
|
|
420
|
-
onSettled: (A, j
|
|
421
|
-
e.invalidateQueries({ queryKey: [
|
|
420
|
+
onSettled: (k, A, j) => {
|
|
421
|
+
e.invalidateQueries({ queryKey: [O, { businessUuid: j.businessUuid }] });
|
|
422
422
|
}
|
|
423
423
|
});
|
|
424
424
|
return {
|
|
425
|
-
isLoading: computed(() =>
|
|
426
|
-
data: computed(() =>
|
|
427
|
-
execute: async (e) => await
|
|
425
|
+
isLoading: computed(() => k.isPending.value),
|
|
426
|
+
data: computed(() => k.data.value),
|
|
427
|
+
execute: async (e) => await k.mutateAsync(e.params)
|
|
428
428
|
};
|
|
429
429
|
}
|
|
430
430
|
function useBusinessUnlinkContactPersonMutation() {
|
|
431
431
|
return ze({
|
|
432
|
-
queryFn: async ({ body: e, params:
|
|
432
|
+
queryFn: async ({ body: e, params: O }) => await BusinessService.unlinkContactPerson(O.businessUuid, e.contactPersonUuid),
|
|
433
433
|
queryKeysToInvalidate: {
|
|
434
434
|
businessIndex: {},
|
|
435
435
|
wiseCrmBusinessDetail: { businessUuid: (e) => e.businessUuid }
|
|
@@ -451,11 +451,11 @@ function useBusinessCreateMutation() {
|
|
|
451
451
|
queryKeysToInvalidate: { businessIndex: {} }
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
|
-
function useBusinessIndexQuery(e,
|
|
454
|
+
function useBusinessIndexQuery(e, O) {
|
|
455
455
|
return useOffsetInfiniteQuery({
|
|
456
|
-
isEnabled: computed(() =>
|
|
457
|
-
queryFn: (
|
|
458
|
-
pagination:
|
|
456
|
+
isEnabled: computed(() => O?.value ?? !0),
|
|
457
|
+
queryFn: (O) => BusinessService.getAll({
|
|
458
|
+
pagination: O,
|
|
459
459
|
search: e?.params?.search?.value
|
|
460
460
|
}),
|
|
461
461
|
queryKey: { businessIndex: { queryParams: e?.params } }
|
|
@@ -468,36 +468,36 @@ var BusinessAddExistingChildForm_default = /* @__PURE__ */ defineComponent({
|
|
|
468
468
|
onSubmit: { type: Function }
|
|
469
469
|
},
|
|
470
470
|
emits: ["createNew"],
|
|
471
|
-
setup(
|
|
472
|
-
let
|
|
471
|
+
setup(k, { emit: A }) {
|
|
472
|
+
let j = k, M = A, N = useI18n(), P = useSearch({ persistInUrl: !1 }), L = useBusinessIndexQuery({ params: { search: P.debouncedSearch } }), B = useForm({
|
|
473
473
|
initialState: { business: null },
|
|
474
474
|
schema: z.object({ business: z.object({
|
|
475
475
|
uuid: businessUuidSchema,
|
|
476
476
|
name: z.string()
|
|
477
477
|
}) }),
|
|
478
478
|
onSubmit: async (e) => {
|
|
479
|
-
await
|
|
479
|
+
await j.onSubmit(e.business.uuid);
|
|
480
480
|
}
|
|
481
|
-
}),
|
|
481
|
+
}), V = B.register("business"), H = computed(() => (L.data.value?.data.filter((e) => e.uuid !== j.parentBusinessUuid) ?? []).map((e) => ({
|
|
482
482
|
uuid: e.uuid,
|
|
483
483
|
name: e.name
|
|
484
484
|
})));
|
|
485
|
-
function
|
|
486
|
-
|
|
485
|
+
function U(e) {
|
|
486
|
+
P.updateSearch(e);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
489
|
-
|
|
488
|
+
function W() {
|
|
489
|
+
M("createNew");
|
|
490
490
|
}
|
|
491
|
-
return (e,
|
|
491
|
+
return (e, k) => (openBlock(), createBlock(AppForm_default, { form: unref(B) }, {
|
|
492
492
|
default: withCtx(() => [createVNode(AppGrid_default, { cols: 1 }, {
|
|
493
493
|
default: withCtx(() => [
|
|
494
|
-
createVNode(unref(VcAutocomplete), mergeProps(unref(toFormField)(unref(
|
|
495
|
-
items:
|
|
494
|
+
createVNode(unref(VcAutocomplete), mergeProps(unref(toFormField)(unref(V)), {
|
|
495
|
+
items: H.value,
|
|
496
496
|
"display-fn": (e) => e.name,
|
|
497
|
-
"is-loading": unref(
|
|
498
|
-
label: unref(
|
|
497
|
+
"is-loading": unref(L).isFetching.value,
|
|
498
|
+
label: unref(N).t("wise_crm.info_dialog.search_an_existing_one"),
|
|
499
499
|
"icon-left": "search",
|
|
500
|
-
onSearch:
|
|
500
|
+
onSearch: U
|
|
501
501
|
}), null, 16, [
|
|
502
502
|
"items",
|
|
503
503
|
"display-fn",
|
|
@@ -505,22 +505,22 @@ var BusinessAddExistingChildForm_default = /* @__PURE__ */ defineComponent({
|
|
|
505
505
|
"label"
|
|
506
506
|
]),
|
|
507
507
|
createVNode(AppAndOrSeparator_default, null, {
|
|
508
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(
|
|
508
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(N).t("wise_crm.shared.or")), 1)]),
|
|
509
509
|
_: 1
|
|
510
510
|
}),
|
|
511
511
|
createVNode(unref(VcButton), {
|
|
512
512
|
class: "w-full",
|
|
513
513
|
size: "lg",
|
|
514
514
|
variant: "secondary",
|
|
515
|
-
onClick:
|
|
515
|
+
onClick: W
|
|
516
516
|
}, {
|
|
517
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(
|
|
517
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(N).t("wise_crm.info_dialog.add_business_child_dialog.create_a_new_one")), 1)]),
|
|
518
518
|
_: 1
|
|
519
519
|
}),
|
|
520
520
|
createVNode(AppSidebarFormFooter_default, null, {
|
|
521
521
|
default: withCtx(() => [createVNode(AppSidebarFormSubmitButton_default, {
|
|
522
|
-
"is-loading": unref(
|
|
523
|
-
label: unref(
|
|
522
|
+
"is-loading": unref(B).isSubmitting.value,
|
|
523
|
+
label: unref(N).t("wise_crm.shared.add")
|
|
524
524
|
}, null, 8, ["is-loading", "label"])]),
|
|
525
525
|
_: 1
|
|
526
526
|
})
|
|
@@ -530,7 +530,73 @@ var BusinessAddExistingChildForm_default = /* @__PURE__ */ defineComponent({
|
|
|
530
530
|
_: 1
|
|
531
531
|
}, 8, ["form"]));
|
|
532
532
|
}
|
|
533
|
-
})
|
|
533
|
+
});
|
|
534
|
+
function setScriptSrc(e, O) {
|
|
535
|
+
e.src = O;
|
|
536
|
+
}
|
|
537
|
+
var bootstrap = (e) => {
|
|
538
|
+
var O, k, A, j = "The Google Maps JavaScript API", M = "google", N = "importLibrary", P = "__ib__", F = document, I = window, L = I[M] || (I[M] = {}), R = L.maps ||= {}, B = /* @__PURE__ */ new Set(), V = new URLSearchParams(), H = () => O ||= new Promise(async (N, I) => {
|
|
539
|
+
for (A in await (k = F.createElement("script")), V.set("libraries", [...B] + ""), e) V.set(A.replace(/[A-Z]/g, (e) => "_" + e[0].toLowerCase()), e[A]);
|
|
540
|
+
V.set("callback", M + ".maps." + P), setScriptSrc(k, "https://maps.googleapis.com/maps/api/js?" + V), R[P] = N, k.onerror = () => O = I(Error(j + " could not load.")), k.nonce = F.querySelector("script[nonce]")?.nonce || "", F.head.append(k);
|
|
541
|
+
});
|
|
542
|
+
R[N] ? console.warn(j + " only loads once. Ignoring:", e) : R[N] = (e, ...O) => B.add(e) && H().then(() => R[N](e, ...O));
|
|
543
|
+
}, MSG_REPEATED_SET_OPTIONS = (e) => `The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(e)}) will be ignored.`, MSG_IMPORT_LIBRARY_EXISTS = (e) => `The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(e)}) will be ignored.`, MSG_SET_OPTIONS_NOT_CALLED = "No options were set before calling importLibrary. Make sure to configure the loader using setOptions().", MSG_SCRIPT_ELEMENT_EXISTS = "There already is a script loading the Google Maps JavaScript API, and no google.maps.importLibrary function is defined. @googlemaps/js-api-loader will proceed to bootstrap the API with the specified options, but the existing script might cause problems using the API. Make sure to remove the script loading the API.", __DEV__$1 = process.env.NODE_ENV !== "production", logDevWarning = __DEV__$1 ? (e) => {
|
|
544
|
+
console.warn(`[@googlemaps/js-api-loader] ${e}`);
|
|
545
|
+
} : () => {}, logDevNotice = __DEV__$1 ? (e) => {
|
|
546
|
+
console.info(`[@googlemaps/js-api-loader] ${e}`);
|
|
547
|
+
} : () => {}, __DEV__ = process.env.NODE_ENV !== "production", setOptionsWasCalled_ = !1;
|
|
548
|
+
function setOptions(e) {
|
|
549
|
+
if (setOptionsWasCalled_) {
|
|
550
|
+
logDevWarning(MSG_REPEATED_SET_OPTIONS(e));
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
installImportLibrary_(e), setOptionsWasCalled_ = !0;
|
|
554
|
+
}
|
|
555
|
+
async function importLibrary(e) {
|
|
556
|
+
if (setOptionsWasCalled_ || logDevWarning(MSG_SET_OPTIONS_NOT_CALLED), !window?.google?.maps?.importLibrary) throw Error("google.maps.importLibrary is not installed.");
|
|
557
|
+
return await google.maps.importLibrary(e);
|
|
558
|
+
}
|
|
559
|
+
function installImportLibrary_(e) {
|
|
560
|
+
let O = !!window.google?.maps?.importLibrary;
|
|
561
|
+
O ? logDevNotice(MSG_IMPORT_LIBRARY_EXISTS(e)) : __DEV__ && document.querySelector("script[src*=\"maps.googleapis.com/maps/api/js\"]") && logDevWarning(MSG_SCRIPT_ELEMENT_EXISTS), O || bootstrap(e);
|
|
562
|
+
}
|
|
563
|
+
function useGeocode() {
|
|
564
|
+
let { getGoogleMapsApiKey: e } = useGoogleMapsApiKey();
|
|
565
|
+
async function O(O) {
|
|
566
|
+
let k = e();
|
|
567
|
+
if (k === null) return null;
|
|
568
|
+
let A = [
|
|
569
|
+
O.street,
|
|
570
|
+
O.streetNumber,
|
|
571
|
+
O.postalCode,
|
|
572
|
+
O.city,
|
|
573
|
+
O.country
|
|
574
|
+
].filter(Boolean).join(", ");
|
|
575
|
+
if (A === "") return null;
|
|
576
|
+
try {
|
|
577
|
+
setOptions({
|
|
578
|
+
key: k,
|
|
579
|
+
libraries: ["places"]
|
|
580
|
+
});
|
|
581
|
+
let { Place: e } = await importLibrary("places"), O = {
|
|
582
|
+
fields: ["location"],
|
|
583
|
+
textQuery: A
|
|
584
|
+
}, { places: j } = await e.searchByText(O);
|
|
585
|
+
if (j.length > 0 && j[0].location !== null) {
|
|
586
|
+
let e = j[0].location;
|
|
587
|
+
return {
|
|
588
|
+
lat: e.lat(),
|
|
589
|
+
lng: e.lng()
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
return null;
|
|
593
|
+
} catch {
|
|
594
|
+
return null;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
return { geocodeAddress: O };
|
|
598
|
+
}
|
|
599
|
+
var CbeEnterpriseSearchTransformer = class {
|
|
534
600
|
static fromDto(e) {
|
|
535
601
|
return {
|
|
536
602
|
uuid: e.enterpriseNumber,
|
|
@@ -547,7 +613,7 @@ var BusinessAddExistingChildForm_default = /* @__PURE__ */ defineComponent({
|
|
|
547
613
|
}
|
|
548
614
|
}, CbeService = class {
|
|
549
615
|
static async searchEnterprisesByTerm(e) {
|
|
550
|
-
let
|
|
616
|
+
let O = await searchCbeEnterprisesV1({ query: {
|
|
551
617
|
pagination: {
|
|
552
618
|
limit: 10,
|
|
553
619
|
offset: 0
|
|
@@ -555,8 +621,8 @@ var BusinessAddExistingChildForm_default = /* @__PURE__ */ defineComponent({
|
|
|
555
621
|
search: e
|
|
556
622
|
} });
|
|
557
623
|
return {
|
|
558
|
-
data:
|
|
559
|
-
meta:
|
|
624
|
+
data: O.data.items.map(CbeEnterpriseSearchTransformer.fromDto),
|
|
625
|
+
meta: O.data.meta
|
|
560
626
|
};
|
|
561
627
|
}
|
|
562
628
|
};
|
|
@@ -580,39 +646,39 @@ var _hoisted_1$4 = { class: "text-sm" }, _hoisted_2$3 = {
|
|
|
580
646
|
modelModifiers: {}
|
|
581
647
|
}),
|
|
582
648
|
emits: /* @__PURE__ */ mergeModels(["createNew"], ["update:modelValue"]),
|
|
583
|
-
setup(e, { emit:
|
|
584
|
-
let
|
|
585
|
-
e !== null && (
|
|
586
|
-
}, 300),
|
|
587
|
-
async function
|
|
588
|
-
await
|
|
649
|
+
setup(e, { emit: O }) {
|
|
650
|
+
let k = e, A = O, j = useModel(e, "modelValue"), M = ref(null), N = ref(null), P = useI18n(), F = ref(!0), I = useCbeEnterpriseSearchByTermQuery(computed(() => N.value ?? "")), L = useDebounceFn((e) => {
|
|
651
|
+
e !== null && (F.value = e.length === 0 || e.trim().length === 0, N.value = e);
|
|
652
|
+
}, 300), R = computed(() => I.data.value ?? []);
|
|
653
|
+
async function B(e) {
|
|
654
|
+
await L(e);
|
|
589
655
|
}
|
|
590
|
-
function
|
|
591
|
-
|
|
656
|
+
function V() {
|
|
657
|
+
A("createNew");
|
|
592
658
|
}
|
|
593
|
-
function
|
|
594
|
-
return
|
|
659
|
+
function H(e) {
|
|
660
|
+
return R.value.find((O) => O.uuid === e)?.name ?? "-";
|
|
595
661
|
}
|
|
596
|
-
function
|
|
662
|
+
function U(e) {
|
|
597
663
|
if (e === null) {
|
|
598
|
-
|
|
664
|
+
M.value = null;
|
|
599
665
|
return;
|
|
600
666
|
}
|
|
601
|
-
|
|
667
|
+
j.value = R.value.find((O) => O.uuid === e.value) ?? null, M.value = e;
|
|
602
668
|
}
|
|
603
|
-
return (e,
|
|
604
|
-
modelValue:
|
|
605
|
-
"onUpdate:modelValue": [
|
|
606
|
-
"is-required":
|
|
607
|
-
"display-fn":
|
|
608
|
-
label:
|
|
609
|
-
options:
|
|
610
|
-
"is-loading": unref(
|
|
611
|
-
placeholder: unref(
|
|
612
|
-
onCreateNew:
|
|
613
|
-
onSearch:
|
|
669
|
+
return (e, O) => (openBlock(), createBlock(EntityAutocomplete_default, {
|
|
670
|
+
modelValue: M.value,
|
|
671
|
+
"onUpdate:modelValue": [O[0] ||= (e) => M.value = e, U],
|
|
672
|
+
"is-required": k.isRequired,
|
|
673
|
+
"display-fn": H,
|
|
674
|
+
label: k.label,
|
|
675
|
+
options: R.value,
|
|
676
|
+
"is-loading": unref(I).isFetching.value,
|
|
677
|
+
placeholder: unref(P).t("component.select.search_placeholder"),
|
|
678
|
+
onCreateNew: V,
|
|
679
|
+
onSearch: B
|
|
614
680
|
}, {
|
|
615
|
-
option: withCtx(({ option: e, isHighlighted:
|
|
681
|
+
option: withCtx(({ option: e, isHighlighted: O }) => [createElementVNode("div", { class: normalizeClass([{ "bg-brand-50": O }, "p-md px-lg flex flex-col rounded-md"]) }, [createElementVNode("span", _hoisted_1$4, toDisplayString(e.name), 1), e.address ? (openBlock(), createElementBlock("span", _hoisted_2$3, toDisplayString(unref(AddressUtil).format(e.address)), 1)) : createCommentVNode("", !0)], 2)]),
|
|
616
682
|
_: 1
|
|
617
683
|
}, 8, [
|
|
618
684
|
"modelValue",
|
|
@@ -630,30 +696,30 @@ var _hoisted_1$4 = { class: "text-sm" }, _hoisted_2$3 = {
|
|
|
630
696
|
"createNew",
|
|
631
697
|
"updateCbeSearchItem"
|
|
632
698
|
],
|
|
633
|
-
setup(e, { emit:
|
|
634
|
-
let
|
|
635
|
-
function
|
|
636
|
-
|
|
699
|
+
setup(e, { emit: O }) {
|
|
700
|
+
let k = O, A = useI18n(), j = ref(null);
|
|
701
|
+
function M() {
|
|
702
|
+
k("createNew");
|
|
637
703
|
}
|
|
638
|
-
function
|
|
639
|
-
|
|
704
|
+
function N(e) {
|
|
705
|
+
j.value = e, k("updateCbeSearchItem", e);
|
|
640
706
|
}
|
|
641
|
-
function
|
|
642
|
-
|
|
707
|
+
function P() {
|
|
708
|
+
k("back");
|
|
643
709
|
}
|
|
644
|
-
return (e,
|
|
710
|
+
return (e, O) => (openBlock(), createBlock(AppGrid_default, { cols: 1 }, {
|
|
645
711
|
default: withCtx(() => [createVNode(CbeAutocomplete_default, {
|
|
646
|
-
modelValue:
|
|
647
|
-
"onUpdate:modelValue": [
|
|
648
|
-
label: unref(
|
|
649
|
-
onCreateNew:
|
|
712
|
+
modelValue: j.value,
|
|
713
|
+
"onUpdate:modelValue": [O[0] ||= (e) => j.value = e, N],
|
|
714
|
+
label: unref(A).t("wise_crm.contact.create_dialog.form.fields.cbe_search"),
|
|
715
|
+
onCreateNew: M
|
|
650
716
|
}, null, 8, ["modelValue", "label"]), createVNode(AppDialogActions_default, null, {
|
|
651
717
|
default: withCtx(() => [createVNode(unref(VcButton), {
|
|
652
718
|
variant: "secondary",
|
|
653
719
|
size: "lg",
|
|
654
|
-
onClick:
|
|
720
|
+
onClick: P
|
|
655
721
|
}, {
|
|
656
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(
|
|
722
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(A).t("wise_crm.shared.back")), 1)]),
|
|
657
723
|
_: 1
|
|
658
724
|
})]),
|
|
659
725
|
_: 1
|
|
@@ -672,15 +738,15 @@ function useProvideBaseFieldsetContext(e) {
|
|
|
672
738
|
var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */ defineComponent({
|
|
673
739
|
__name: "BaseFieldset",
|
|
674
740
|
setup(e) {
|
|
675
|
-
let
|
|
676
|
-
return useProvideBaseFieldsetContext({ id:
|
|
741
|
+
let O = useId();
|
|
742
|
+
return useProvideBaseFieldsetContext({ id: O }), (e, k) => (openBlock(), createElementBlock("fieldset", { "aria-describedby": unref(O) }, [renderSlot(e.$slots, "default")], 8, _hoisted_1$3));
|
|
677
743
|
}
|
|
678
744
|
}), BaseFieldsetLegend_default = /* @__PURE__ */ defineComponent({
|
|
679
745
|
__name: "BaseFieldsetLegend",
|
|
680
746
|
props: { as: {} },
|
|
681
747
|
setup(e) {
|
|
682
|
-
let
|
|
683
|
-
return (e,
|
|
748
|
+
let O = e, k = useInjectBaseFieldsetContext();
|
|
749
|
+
return (e, A) => (openBlock(), createBlock(resolveDynamicComponent(O.as), { id: unref(k).id }, {
|
|
684
750
|
default: withCtx(() => [renderSlot(e.$slots, "default")]),
|
|
685
751
|
_: 3
|
|
686
752
|
}, 8, ["id"]));
|
|
@@ -699,18 +765,18 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
699
765
|
description: { default: null }
|
|
700
766
|
},
|
|
701
767
|
setup(e) {
|
|
702
|
-
let
|
|
703
|
-
return (e,
|
|
704
|
-
default: withCtx(() => [createElementVNode("div", _hoisted_1$2, [(openBlock(), createBlock(resolveDynamicComponent(
|
|
768
|
+
let O = e;
|
|
769
|
+
return (e, k) => (openBlock(), createBlock(BaseFieldset_default, null, {
|
|
770
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1$2, [(openBlock(), createBlock(resolveDynamicComponent(O.isTitleHidden ? unref(VisuallyHidden) : "div"), null, {
|
|
705
771
|
default: withCtx(() => [createVNode(BaseFieldsetLegend_default, {
|
|
706
772
|
as: "h2",
|
|
707
773
|
class: "text-primary text-sm font-medium"
|
|
708
774
|
}, {
|
|
709
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
775
|
+
default: withCtx(() => [createTextVNode(toDisplayString(O.title), 1)]),
|
|
710
776
|
_: 1
|
|
711
777
|
})]),
|
|
712
778
|
_: 1
|
|
713
|
-
})),
|
|
779
|
+
})), O.description === null ? createCommentVNode("", !0) : (openBlock(), createElementBlock("p", _hoisted_2$2, toDisplayString(O.description), 1))]), createElementVNode("div", _hoisted_3$2, [renderSlot(e.$slots, "default")])]),
|
|
714
780
|
_: 3
|
|
715
781
|
}));
|
|
716
782
|
}
|
|
@@ -718,31 +784,31 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
718
784
|
__name: "ContactCreateDialogBusinessContactPerson",
|
|
719
785
|
props: { form: {} },
|
|
720
786
|
emits: ["back"],
|
|
721
|
-
setup(e, { emit:
|
|
722
|
-
let
|
|
723
|
-
function
|
|
724
|
-
|
|
787
|
+
setup(e, { emit: O }) {
|
|
788
|
+
let k = e, A = O, j = useI18n(), M = k.form.register("individual.firstName"), N = k.form.register("individual.lastName"), P = k.form.register("individualPosition"), F = k.form.register("individual.email"), I = k.form.register("individual.mobilePhone"), L = k.form.register("individual.phone");
|
|
789
|
+
function R() {
|
|
790
|
+
A("back");
|
|
725
791
|
}
|
|
726
|
-
return (
|
|
792
|
+
return (O, k) => (openBlock(), createBlock(AppGrid_default, { cols: 1 }, {
|
|
727
793
|
default: withCtx(() => [createVNode(AppGrid_default, { cols: 1 }, {
|
|
728
794
|
default: withCtx(() => [createVNode(AppGrid_default, { cols: 2 }, {
|
|
729
795
|
default: withCtx(() => [
|
|
730
796
|
createVNode(unref(VcTextField), mergeProps({
|
|
731
|
-
label: unref(
|
|
732
|
-
placeholder: unref(
|
|
733
|
-
}, unref(toFormField)(unref(
|
|
797
|
+
label: unref(j).t("wise_crm.contact.create_dialog.form.fields.first_name"),
|
|
798
|
+
placeholder: unref(j).t("wise_crm.contact.create_dialog.form.fields.first_name")
|
|
799
|
+
}, unref(toFormField)(unref(M))), null, 16, ["label", "placeholder"]),
|
|
734
800
|
createVNode(unref(VcTextField), mergeProps({
|
|
735
|
-
label: unref(
|
|
736
|
-
placeholder: unref(
|
|
737
|
-
}, unref(toFormField)(unref(
|
|
801
|
+
label: unref(j).t("wise_crm.contact.create_dialog.form.fields.last_name"),
|
|
802
|
+
placeholder: unref(j).t("wise_crm.contact.create_dialog.form.fields.last_name")
|
|
803
|
+
}, unref(toFormField)(unref(N))), null, 16, ["label", "placeholder"]),
|
|
738
804
|
createVNode(unref(VcTextField), mergeProps({
|
|
739
|
-
label: unref(
|
|
740
|
-
placeholder: unref(
|
|
741
|
-
}, unref(toFormField)(unref(
|
|
805
|
+
label: unref(j).t("wise_crm.contact.create_dialog.form.fields.position"),
|
|
806
|
+
placeholder: unref(j).t("wise_crm.contact.create_dialog.form.fields.position")
|
|
807
|
+
}, unref(toFormField)(unref(P))), null, 16, ["label", "placeholder"])
|
|
742
808
|
]),
|
|
743
809
|
_: 1
|
|
744
810
|
}), createVNode(FormFieldset_default, {
|
|
745
|
-
title: unref(
|
|
811
|
+
title: unref(j).t("wise_crm.shared.contact_info"),
|
|
746
812
|
class: "col-span-2"
|
|
747
813
|
}, {
|
|
748
814
|
default: withCtx(() => [createVNode(AppGrid_default, {
|
|
@@ -750,17 +816,17 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
750
816
|
class: "mt-sm bg-secondary p-lg rounded-xl"
|
|
751
817
|
}, {
|
|
752
818
|
default: withCtx(() => [
|
|
753
|
-
createVNode(unref(VcTextField), mergeProps(unref(toFormField)(unref(
|
|
754
|
-
label: unref(
|
|
755
|
-
placeholder: unref(
|
|
819
|
+
createVNode(unref(VcTextField), mergeProps(unref(toFormField)(unref(F)), {
|
|
820
|
+
label: unref(j).t("wise_crm.contact.create_dialog.form.fields.email"),
|
|
821
|
+
placeholder: unref(j).t("wise_crm.contact.create_dialog.form.fields.email")
|
|
756
822
|
}), null, 16, ["label", "placeholder"]),
|
|
757
|
-
createVNode(unref(VcPhoneNumberField), mergeProps(unref(toFormField)(unref(
|
|
758
|
-
label: unref(
|
|
759
|
-
placeholder: unref(
|
|
823
|
+
createVNode(unref(VcPhoneNumberField), mergeProps(unref(toFormField)(unref(I)), {
|
|
824
|
+
label: unref(j).t("wise_crm.contact.create_dialog.form.fields.mobile_phone"),
|
|
825
|
+
placeholder: unref(j).t("wise_crm.contact.create_dialog.form.fields.mobile_phone")
|
|
760
826
|
}), null, 16, ["label", "placeholder"]),
|
|
761
|
-
createVNode(unref(VcPhoneNumberField), mergeProps(unref(toFormField)(unref(
|
|
762
|
-
label: unref(
|
|
763
|
-
placeholder: unref(
|
|
827
|
+
createVNode(unref(VcPhoneNumberField), mergeProps(unref(toFormField)(unref(L)), {
|
|
828
|
+
label: unref(j).t("wise_crm.contact.create_dialog.form.fields.phone"),
|
|
829
|
+
placeholder: unref(j).t("wise_crm.contact.create_dialog.form.fields.phone")
|
|
764
830
|
}), null, 16, ["label", "placeholder"])
|
|
765
831
|
]),
|
|
766
832
|
_: 1
|
|
@@ -772,16 +838,16 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
772
838
|
default: withCtx(() => [createVNode(unref(VcButton), {
|
|
773
839
|
size: "lg",
|
|
774
840
|
variant: "secondary",
|
|
775
|
-
onClick:
|
|
841
|
+
onClick: R
|
|
776
842
|
}, {
|
|
777
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(
|
|
843
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(j).t("wise_crm.shared.back")), 1)]),
|
|
778
844
|
_: 1
|
|
779
845
|
}), createVNode(unref(VcButton), {
|
|
780
846
|
"is-loading": e.form.isSubmitting.value,
|
|
781
847
|
size: "lg",
|
|
782
848
|
type: "submit"
|
|
783
849
|
}, {
|
|
784
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(
|
|
850
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(j).t("wise_crm.shared.create")), 1)]),
|
|
785
851
|
_: 1
|
|
786
852
|
}, 8, ["is-loading"])]),
|
|
787
853
|
_: 1
|
|
@@ -797,44 +863,44 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
797
863
|
"createNew",
|
|
798
864
|
"next"
|
|
799
865
|
],
|
|
800
|
-
setup(e, { emit:
|
|
801
|
-
let
|
|
802
|
-
async function
|
|
803
|
-
if (
|
|
804
|
-
|
|
866
|
+
setup(e, { emit: O }) {
|
|
867
|
+
let k = e, A = O, j = useI18n(), M = useApiErrorToast(), N = ref(null), P = k.form.register("individualUuid"), F = k.form.register("individual");
|
|
868
|
+
async function I(e) {
|
|
869
|
+
if (N.value = e, e !== null) {
|
|
870
|
+
P.setValue(e ? e.value : null);
|
|
805
871
|
try {
|
|
806
|
-
let
|
|
807
|
-
|
|
808
|
-
email:
|
|
809
|
-
firstName:
|
|
810
|
-
lastName:
|
|
811
|
-
mobilePhone:
|
|
812
|
-
phone:
|
|
813
|
-
}),
|
|
872
|
+
let O = await IndividualService.getByUuid(e.value);
|
|
873
|
+
F.setValue({
|
|
874
|
+
email: O.email,
|
|
875
|
+
firstName: O.firstName,
|
|
876
|
+
lastName: O.lastName,
|
|
877
|
+
mobilePhone: O.mobilePhone,
|
|
878
|
+
phone: O.phone
|
|
879
|
+
}), A("next");
|
|
814
880
|
} catch (e) {
|
|
815
|
-
|
|
881
|
+
M.show(e);
|
|
816
882
|
}
|
|
817
883
|
}
|
|
818
884
|
}
|
|
819
|
-
function
|
|
820
|
-
|
|
885
|
+
function L() {
|
|
886
|
+
A("back");
|
|
821
887
|
}
|
|
822
|
-
function
|
|
823
|
-
|
|
888
|
+
function R() {
|
|
889
|
+
P.setValue(null), F.setValue(null), A("next");
|
|
824
890
|
}
|
|
825
|
-
return (e,
|
|
891
|
+
return (e, O) => (openBlock(), createBlock(AppGrid_default, { cols: 1 }, {
|
|
826
892
|
default: withCtx(() => [createVNode(IndividualAutocomplete_default, {
|
|
827
|
-
"model-value":
|
|
828
|
-
label: unref(
|
|
829
|
-
"onUpdate:modelValue":
|
|
830
|
-
onCreateNew:
|
|
893
|
+
"model-value": N.value,
|
|
894
|
+
label: unref(j).t("wise_crm.contact.create_dialog.form.contact_person"),
|
|
895
|
+
"onUpdate:modelValue": I,
|
|
896
|
+
onCreateNew: R
|
|
831
897
|
}, null, 8, ["model-value", "label"]), createVNode(AppDialogActions_default, null, {
|
|
832
898
|
default: withCtx(() => [createVNode(unref(VcButton), {
|
|
833
899
|
variant: "secondary",
|
|
834
900
|
size: "lg",
|
|
835
|
-
onClick:
|
|
901
|
+
onClick: L
|
|
836
902
|
}, {
|
|
837
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(
|
|
903
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(j).t("wise_crm.shared.back")), 1)]),
|
|
838
904
|
_: 1
|
|
839
905
|
})]),
|
|
840
906
|
_: 1
|
|
@@ -868,31 +934,31 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
868
934
|
}),
|
|
869
935
|
emits: ["update:modelValue"],
|
|
870
936
|
setup(e) {
|
|
871
|
-
let
|
|
872
|
-
get: () =>
|
|
937
|
+
let O = e, k = useModel(e, "modelValue"), A = computed({
|
|
938
|
+
get: () => k.value ? `${k.value.countryCode}${k.value.number}` : null,
|
|
873
939
|
set: (e) => {
|
|
874
940
|
if (e === null) {
|
|
875
|
-
|
|
941
|
+
k.value = null;
|
|
876
942
|
return;
|
|
877
943
|
}
|
|
878
|
-
|
|
944
|
+
k.value = {
|
|
879
945
|
countryCode: e.slice(0, 2).toUpperCase(),
|
|
880
946
|
number: e.slice(2)
|
|
881
947
|
};
|
|
882
948
|
}
|
|
883
949
|
});
|
|
884
|
-
function
|
|
950
|
+
function j(e) {
|
|
885
951
|
e.key.length === 1 && /[a-z0-9]/i.test(e.key) || e.key === "Backspace" || e.key === "Delete" || e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Tab" || e.preventDefault();
|
|
886
952
|
}
|
|
887
|
-
function
|
|
888
|
-
let
|
|
889
|
-
|
|
953
|
+
function M(e) {
|
|
954
|
+
let O = (e.clipboardData?.getData("text"))?.replace(/[^a-z0-9]/gi, "");
|
|
955
|
+
O && (A.value = O);
|
|
890
956
|
}
|
|
891
|
-
return (e,
|
|
892
|
-
modelValue:
|
|
893
|
-
"onUpdate:modelValue":
|
|
894
|
-
onKeydown:
|
|
895
|
-
onPaste: withModifiers(
|
|
957
|
+
return (e, k) => (openBlock(), createBlock(unref(VcTextField), mergeProps(O, {
|
|
958
|
+
modelValue: A.value,
|
|
959
|
+
"onUpdate:modelValue": k[0] ||= (e) => A.value = e,
|
|
960
|
+
onKeydown: j,
|
|
961
|
+
onPaste: withModifiers(M, ["prevent"])
|
|
896
962
|
}), null, 16, ["modelValue"]));
|
|
897
963
|
}
|
|
898
964
|
}), CustomFieldCheckbox_default = /* @__PURE__ */ defineComponent({
|
|
@@ -902,8 +968,8 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
902
968
|
form: {}
|
|
903
969
|
},
|
|
904
970
|
setup(e) {
|
|
905
|
-
let
|
|
906
|
-
return (e,
|
|
971
|
+
let O = e, k = O.form.register(`customFields.${O.definition.key}`, O.definition.defaultValue);
|
|
972
|
+
return (e, A) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcCheckbox), mergeProps({ label: O.definition.displayName }, unref(toFormField)(unref(k))), null, 16, ["label"])]));
|
|
907
973
|
}
|
|
908
974
|
}), CustomFieldDate_default = /* @__PURE__ */ defineComponent({
|
|
909
975
|
__name: "CustomFieldDate",
|
|
@@ -912,12 +978,12 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
912
978
|
form: {}
|
|
913
979
|
},
|
|
914
980
|
setup(e) {
|
|
915
|
-
let
|
|
916
|
-
return (e,
|
|
917
|
-
"min-date":
|
|
918
|
-
"max-date":
|
|
919
|
-
label:
|
|
920
|
-
}, unref(toFormField)(unref(
|
|
981
|
+
let O = e, k = O.form.register(`customFields.${O.definition.key}`);
|
|
982
|
+
return (e, A) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcDateField), mergeProps({
|
|
983
|
+
"min-date": O.definition.minDate,
|
|
984
|
+
"max-date": O.definition.maxDate,
|
|
985
|
+
label: O.definition.displayName
|
|
986
|
+
}, unref(toFormField)(unref(k))), null, 16, [
|
|
921
987
|
"min-date",
|
|
922
988
|
"max-date",
|
|
923
989
|
"label"
|
|
@@ -930,16 +996,16 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
930
996
|
form: {}
|
|
931
997
|
},
|
|
932
998
|
setup(e) {
|
|
933
|
-
let
|
|
934
|
-
function
|
|
935
|
-
return
|
|
999
|
+
let O = e, k = O.form.register(`customFields.${O.definition.key}`, []);
|
|
1000
|
+
function A(e) {
|
|
1001
|
+
return O.definition.options.find((O) => O.key === e)?.value ?? e;
|
|
936
1002
|
}
|
|
937
|
-
return (e,
|
|
938
|
-
"display-fn":
|
|
939
|
-
label:
|
|
940
|
-
placeholder:
|
|
1003
|
+
return (e, j) => (openBlock(), createBlock(unref(VcSelect), mergeProps(unref(toFormField)(unref(k)), {
|
|
1004
|
+
"display-fn": A,
|
|
1005
|
+
label: O.definition.displayName,
|
|
1006
|
+
placeholder: O.definition.displayName
|
|
941
1007
|
}), {
|
|
942
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1008
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(O.definition.options, (e) => (openBlock(), createBlock(unref(VcSelectItem), {
|
|
943
1009
|
key: e.key,
|
|
944
1010
|
value: e.key
|
|
945
1011
|
}, {
|
|
@@ -956,14 +1022,14 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
956
1022
|
form: {}
|
|
957
1023
|
},
|
|
958
1024
|
setup(e) {
|
|
959
|
-
let
|
|
960
|
-
return (e,
|
|
961
|
-
min:
|
|
962
|
-
max:
|
|
963
|
-
label:
|
|
964
|
-
placeholder:
|
|
1025
|
+
let O = e, k = O.form.register(`customFields.${O.definition.key}`);
|
|
1026
|
+
return (e, A) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcNumberField), mergeProps({
|
|
1027
|
+
min: O.definition.minValue,
|
|
1028
|
+
max: O.definition.maxValue,
|
|
1029
|
+
label: O.definition.displayName,
|
|
1030
|
+
placeholder: O.definition.displayName,
|
|
965
1031
|
"hide-controls": !0
|
|
966
|
-
}, unref(toFormField)(unref(
|
|
1032
|
+
}, unref(toFormField)(unref(k))), null, 16, [
|
|
967
1033
|
"min",
|
|
968
1034
|
"max",
|
|
969
1035
|
"label",
|
|
@@ -977,9 +1043,9 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
977
1043
|
form: {}
|
|
978
1044
|
},
|
|
979
1045
|
setup(e) {
|
|
980
|
-
let
|
|
981
|
-
return (e,
|
|
982
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1046
|
+
let O = e, k = O.form.register(`customFields.${O.definition.key}`);
|
|
1047
|
+
return (e, A) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcRadioGroup), mergeProps({ label: O.definition.displayName }, unref(toFormField)(unref(k))), {
|
|
1048
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(O.definition.options, (e) => (openBlock(), createBlock(unref(VcRadioGroupItem), {
|
|
983
1049
|
key: e.key,
|
|
984
1050
|
label: e.value,
|
|
985
1051
|
value: e.key
|
|
@@ -994,17 +1060,17 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
994
1060
|
form: {}
|
|
995
1061
|
},
|
|
996
1062
|
setup(e) {
|
|
997
|
-
let
|
|
998
|
-
function
|
|
999
|
-
let
|
|
1000
|
-
return
|
|
1063
|
+
let O = e, k = O.form.register(`customFields.${O.definition.key}`);
|
|
1064
|
+
function A(e) {
|
|
1065
|
+
let k = O.definition.options.find((O) => O.key === e);
|
|
1066
|
+
return k ? k.value : e;
|
|
1001
1067
|
}
|
|
1002
|
-
return (e,
|
|
1003
|
-
"display-fn":
|
|
1004
|
-
label:
|
|
1005
|
-
placeholder:
|
|
1006
|
-
}, unref(toFormField)(unref(
|
|
1007
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1068
|
+
return (e, j) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcSelect), mergeProps({
|
|
1069
|
+
"display-fn": A,
|
|
1070
|
+
label: O.definition.displayName,
|
|
1071
|
+
placeholder: O.definition.displayName
|
|
1072
|
+
}, unref(toFormField)(unref(k))), {
|
|
1073
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(O.definition.options, (e) => (openBlock(), createBlock(unref(VcSelectItem), {
|
|
1008
1074
|
key: e.key,
|
|
1009
1075
|
value: e.key
|
|
1010
1076
|
}, {
|
|
@@ -1021,11 +1087,11 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
1021
1087
|
form: {}
|
|
1022
1088
|
},
|
|
1023
1089
|
setup(e) {
|
|
1024
|
-
let
|
|
1025
|
-
return (e,
|
|
1026
|
-
label:
|
|
1027
|
-
placeholder:
|
|
1028
|
-
}, unref(toFormField)(unref(
|
|
1090
|
+
let O = e, k = O.form.register(`customFields.${O.definition.key}`);
|
|
1091
|
+
return (e, A) => (openBlock(), createElementBlock("div", null, [createVNode(unref(VcTextField), mergeProps({
|
|
1092
|
+
label: O.definition.displayName,
|
|
1093
|
+
placeholder: O.definition.displayName
|
|
1094
|
+
}, unref(toFormField)(unref(k))), null, 16, ["label", "placeholder"])]));
|
|
1029
1095
|
}
|
|
1030
1096
|
}), CustomFieldDefinitionForm_default = /* @__PURE__ */ defineComponent({
|
|
1031
1097
|
__name: "CustomFieldDefinitionForm",
|
|
@@ -1034,77 +1100,77 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
1034
1100
|
form: {}
|
|
1035
1101
|
},
|
|
1036
1102
|
setup(e) {
|
|
1037
|
-
let
|
|
1038
|
-
function
|
|
1103
|
+
let O = e;
|
|
1104
|
+
function k(e) {
|
|
1039
1105
|
return e === "full" ? "col-span-2" : "col-span-1";
|
|
1040
1106
|
}
|
|
1041
|
-
return (
|
|
1042
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1043
|
-
|
|
1107
|
+
return (A, j) => (openBlock(), createBlock(AppGrid_default, { cols: 2 }, {
|
|
1108
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(O.customFieldDefinitions, (A) => (openBlock(), createElementBlock(Fragment, { key: A.uuid }, [
|
|
1109
|
+
A.type === "string" ? (openBlock(), createBlock(CustomFieldString_default, {
|
|
1044
1110
|
key: 0,
|
|
1045
|
-
class: normalizeClass(A
|
|
1111
|
+
class: normalizeClass(k(A.width)),
|
|
1046
1112
|
form: e.form,
|
|
1047
|
-
definition:
|
|
1113
|
+
definition: A
|
|
1048
1114
|
}, null, 8, [
|
|
1049
1115
|
"class",
|
|
1050
1116
|
"form",
|
|
1051
1117
|
"definition"
|
|
1052
1118
|
])) : createCommentVNode("", !0),
|
|
1053
|
-
|
|
1119
|
+
A.type === "select" ? (openBlock(), createBlock(CustomFieldSelect_default, {
|
|
1054
1120
|
key: 1,
|
|
1055
|
-
class: normalizeClass(A
|
|
1121
|
+
class: normalizeClass(k(A.width)),
|
|
1056
1122
|
form: e.form,
|
|
1057
|
-
definition:
|
|
1123
|
+
definition: A
|
|
1058
1124
|
}, null, 8, [
|
|
1059
1125
|
"class",
|
|
1060
1126
|
"form",
|
|
1061
1127
|
"definition"
|
|
1062
1128
|
])) : createCommentVNode("", !0),
|
|
1063
|
-
|
|
1129
|
+
A.type === "radio" ? (openBlock(), createBlock(CustomFieldRadio_default, {
|
|
1064
1130
|
key: 2,
|
|
1065
|
-
class: normalizeClass(A
|
|
1131
|
+
class: normalizeClass(k(A.width)),
|
|
1066
1132
|
form: e.form,
|
|
1067
|
-
definition:
|
|
1133
|
+
definition: A
|
|
1068
1134
|
}, null, 8, [
|
|
1069
1135
|
"class",
|
|
1070
1136
|
"form",
|
|
1071
1137
|
"definition"
|
|
1072
1138
|
])) : createCommentVNode("", !0),
|
|
1073
|
-
|
|
1139
|
+
A.type === "date" ? (openBlock(), createBlock(CustomFieldDate_default, {
|
|
1074
1140
|
key: 3,
|
|
1075
|
-
class: normalizeClass(A
|
|
1141
|
+
class: normalizeClass(k(A.width)),
|
|
1076
1142
|
form: e.form,
|
|
1077
|
-
definition:
|
|
1143
|
+
definition: A
|
|
1078
1144
|
}, null, 8, [
|
|
1079
1145
|
"class",
|
|
1080
1146
|
"form",
|
|
1081
1147
|
"definition"
|
|
1082
1148
|
])) : createCommentVNode("", !0),
|
|
1083
|
-
|
|
1149
|
+
A.type === "number" ? (openBlock(), createBlock(CustomFieldNumberField_default, {
|
|
1084
1150
|
key: 4,
|
|
1085
|
-
definition:
|
|
1086
|
-
class: normalizeClass(A
|
|
1087
|
-
form:
|
|
1151
|
+
definition: A,
|
|
1152
|
+
class: normalizeClass(k(A.width)),
|
|
1153
|
+
form: O.form
|
|
1088
1154
|
}, null, 8, [
|
|
1089
1155
|
"definition",
|
|
1090
1156
|
"class",
|
|
1091
1157
|
"form"
|
|
1092
1158
|
])) : createCommentVNode("", !0),
|
|
1093
|
-
|
|
1159
|
+
A.type === "checkbox" ? (openBlock(), createBlock(CustomFieldCheckbox_default, {
|
|
1094
1160
|
key: 5,
|
|
1095
|
-
definition:
|
|
1096
|
-
form:
|
|
1097
|
-
class: normalizeClass(A
|
|
1161
|
+
definition: A,
|
|
1162
|
+
form: O.form,
|
|
1163
|
+
class: normalizeClass(k(A.width))
|
|
1098
1164
|
}, null, 8, [
|
|
1099
1165
|
"definition",
|
|
1100
1166
|
"form",
|
|
1101
1167
|
"class"
|
|
1102
1168
|
])) : createCommentVNode("", !0),
|
|
1103
|
-
|
|
1169
|
+
A.type === "multiselect" ? (openBlock(), createBlock(CustomFieldMultiSelect_default, {
|
|
1104
1170
|
key: 6,
|
|
1105
|
-
form:
|
|
1106
|
-
class: normalizeClass(A
|
|
1107
|
-
definition:
|
|
1171
|
+
form: O.form,
|
|
1172
|
+
class: normalizeClass(k(A.width)),
|
|
1173
|
+
definition: A
|
|
1108
1174
|
}, null, 8, [
|
|
1109
1175
|
"form",
|
|
1110
1176
|
"class",
|
|
@@ -1121,52 +1187,52 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
1121
1187
|
form: {}
|
|
1122
1188
|
},
|
|
1123
1189
|
emits: ["back", "next"],
|
|
1124
|
-
setup(e, { emit:
|
|
1125
|
-
let
|
|
1126
|
-
function
|
|
1127
|
-
|
|
1190
|
+
setup(e, { emit: O }) {
|
|
1191
|
+
let k = e, j = O, M = useI18n(), N = useCrmConfig(), P = computed(() => N.getCustomFieldDefinitionForEntity(EntityType.BUSINESS).filter((e) => e.isDisplayedOnCreate)), F = k.form.register("name"), I = k.form.register("address"), L = k.form.register("companyNumber"), R = k.form.register("vatNumber");
|
|
1192
|
+
function B() {
|
|
1193
|
+
j("back");
|
|
1128
1194
|
}
|
|
1129
|
-
function
|
|
1130
|
-
|
|
1195
|
+
function V() {
|
|
1196
|
+
k.form.blurAll(), F.isValid.value && I.isValid.value && R.isValid.value && L.isValid.value && j("next");
|
|
1131
1197
|
}
|
|
1132
|
-
return (
|
|
1198
|
+
return (O, A) => (openBlock(), createBlock(AppGrid_default, { cols: 1 }, {
|
|
1133
1199
|
default: withCtx(() => [createVNode(AppGrid_default, { cols: 2 }, {
|
|
1134
1200
|
default: withCtx(() => [
|
|
1135
1201
|
createVNode(unref(VcTextField), mergeProps({
|
|
1136
|
-
"is-disabled":
|
|
1202
|
+
"is-disabled": k.isDataFromCbe,
|
|
1137
1203
|
"is-required": !0
|
|
1138
|
-
}, unref(toFormField)(unref(
|
|
1139
|
-
label: unref(
|
|
1140
|
-
placeholder: unref(
|
|
1204
|
+
}, unref(toFormField)(unref(F)), {
|
|
1205
|
+
label: unref(M).t("wise_crm.contact.create_dialog.form.name"),
|
|
1206
|
+
placeholder: unref(M).t("wise_crm.contact.create_dialog.form.name")
|
|
1141
1207
|
}), null, 16, [
|
|
1142
1208
|
"is-disabled",
|
|
1143
1209
|
"label",
|
|
1144
1210
|
"placeholder"
|
|
1145
1211
|
]),
|
|
1146
|
-
createVNode(AppVatNumberField_default, mergeProps({ "is-disabled":
|
|
1147
|
-
label: unref(
|
|
1148
|
-
placeholder: unref(
|
|
1212
|
+
createVNode(AppVatNumberField_default, mergeProps({ "is-disabled": k.isDataFromCbe }, unref(toFormField)(unref(R)), {
|
|
1213
|
+
label: unref(M).t("wise_crm.contact.create_dialog.form.vat_number"),
|
|
1214
|
+
placeholder: unref(M).t("wise_crm.contact.create_dialog.form.vat_number")
|
|
1149
1215
|
}), null, 16, [
|
|
1150
1216
|
"is-disabled",
|
|
1151
1217
|
"label",
|
|
1152
1218
|
"placeholder"
|
|
1153
1219
|
]),
|
|
1154
1220
|
createVNode(unref(VcAddressAutocomplete), mergeProps({
|
|
1155
|
-
"is-disabled":
|
|
1221
|
+
"is-disabled": k.isDataFromCbe,
|
|
1156
1222
|
"is-required": !0,
|
|
1157
|
-
label: unref(
|
|
1158
|
-
placeholder: unref(
|
|
1159
|
-
}, unref(toFormField)(unref(
|
|
1223
|
+
label: unref(M).t("wise_crm.contact.create_dialog.form.fields.address"),
|
|
1224
|
+
placeholder: unref(M).t("wise_crm.contact.create_dialog.form.fields.address")
|
|
1225
|
+
}, unref(toFormField)(unref(I))), null, 16, [
|
|
1160
1226
|
"is-disabled",
|
|
1161
1227
|
"label",
|
|
1162
1228
|
"placeholder"
|
|
1163
1229
|
]),
|
|
1164
1230
|
createVNode(unref(VcTextField), mergeProps({
|
|
1165
|
-
label: unref(
|
|
1166
|
-
placeholder: unref(
|
|
1167
|
-
}, unref(toFormField)(unref(
|
|
1231
|
+
label: unref(M).t("wise_crm.contact.create_dialog.form.company_number"),
|
|
1232
|
+
placeholder: unref(M).t("wise_crm.contact.create_dialog.form.company_number")
|
|
1233
|
+
}, unref(toFormField)(unref(L))), null, 16, ["label", "placeholder"]),
|
|
1168
1234
|
createVNode(CustomFieldDefinitionForm_default, {
|
|
1169
|
-
"custom-field-definitions":
|
|
1235
|
+
"custom-field-definitions": P.value,
|
|
1170
1236
|
form: e.form
|
|
1171
1237
|
}, null, 8, ["custom-field-definitions", "form"])
|
|
1172
1238
|
]),
|
|
@@ -1175,15 +1241,15 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
1175
1241
|
default: withCtx(() => [createVNode(unref(VcButton), {
|
|
1176
1242
|
variant: "secondary",
|
|
1177
1243
|
size: "lg",
|
|
1178
|
-
onClick:
|
|
1244
|
+
onClick: B
|
|
1179
1245
|
}, {
|
|
1180
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(
|
|
1246
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(M).t("wise_crm.shared.back")), 1)]),
|
|
1181
1247
|
_: 1
|
|
1182
1248
|
}), createVNode(unref(VcButton), {
|
|
1183
1249
|
size: "lg",
|
|
1184
|
-
onClick:
|
|
1250
|
+
onClick: V
|
|
1185
1251
|
}, {
|
|
1186
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(
|
|
1252
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(M).t("wise_crm.shared.next")), 1)]),
|
|
1187
1253
|
_: 1
|
|
1188
1254
|
})]),
|
|
1189
1255
|
_: 1
|
|
@@ -1193,6 +1259,7 @@ var _hoisted_1$3 = ["aria-describedby"], BaseFieldset_default = /* @__PURE__ */
|
|
|
1193
1259
|
}
|
|
1194
1260
|
});
|
|
1195
1261
|
const addressFormSchema = z.object({
|
|
1262
|
+
placeId: z.string().nullable().optional(),
|
|
1196
1263
|
bus: z.string(),
|
|
1197
1264
|
city: z.string().min(1),
|
|
1198
1265
|
coordinates: z.object({
|
|
@@ -1209,56 +1276,56 @@ const addressFormSchema = z.object({
|
|
|
1209
1276
|
});
|
|
1210
1277
|
var CustomFieldDefinitionUtil = class {
|
|
1211
1278
|
static getZodType(e) {
|
|
1212
|
-
return e.reduce((e,
|
|
1213
|
-
switch (
|
|
1279
|
+
return e.reduce((e, O) => {
|
|
1280
|
+
switch (O.type) {
|
|
1214
1281
|
case "multiselect":
|
|
1215
|
-
e[
|
|
1216
|
-
|
|
1282
|
+
e[O.key] = z.string().array().default([]).superRefine((e, k) => {
|
|
1283
|
+
O.minSelections !== void 0 && e.length < O.minSelections && k.addIssue({
|
|
1217
1284
|
code: z.ZodIssueCode.custom,
|
|
1218
|
-
message: `At least ${
|
|
1219
|
-
}),
|
|
1285
|
+
message: `At least ${O.minSelections} selections are required`
|
|
1286
|
+
}), O.maxSelections !== void 0 && e.length > O.maxSelections && k.addIssue({
|
|
1220
1287
|
code: z.ZodIssueCode.custom,
|
|
1221
|
-
message: `At most ${
|
|
1288
|
+
message: `At most ${O.maxSelections} selections are allowed`
|
|
1222
1289
|
});
|
|
1223
1290
|
});
|
|
1224
1291
|
break;
|
|
1225
1292
|
case "checkbox":
|
|
1226
|
-
e[
|
|
1293
|
+
e[O.key] = z.boolean();
|
|
1227
1294
|
break;
|
|
1228
1295
|
case "radio":
|
|
1229
|
-
e[
|
|
1296
|
+
e[O.key] = z.string().nullable();
|
|
1230
1297
|
break;
|
|
1231
1298
|
case "select":
|
|
1232
|
-
e[
|
|
1233
|
-
e === "" &&
|
|
1299
|
+
e[O.key] = z.string().nullable().superRefine((e, O) => {
|
|
1300
|
+
e === "" && O.addIssue({
|
|
1234
1301
|
code: z.ZodIssueCode.custom,
|
|
1235
1302
|
message: "Selection is required"
|
|
1236
1303
|
});
|
|
1237
1304
|
});
|
|
1238
1305
|
break;
|
|
1239
1306
|
case "number":
|
|
1240
|
-
e[
|
|
1241
|
-
e !== null &&
|
|
1307
|
+
e[O.key] = z.number().nullable().superRefine((e, k) => {
|
|
1308
|
+
e !== null && O.minValue !== void 0 && e < O.minValue && k.addIssue({
|
|
1242
1309
|
code: z.ZodIssueCode.custom,
|
|
1243
|
-
message: `Minimum value is ${
|
|
1244
|
-
}), e !== null &&
|
|
1310
|
+
message: `Minimum value is ${O.minValue}`
|
|
1311
|
+
}), e !== null && O.maxValue !== void 0 && e > O.maxValue && k.addIssue({
|
|
1245
1312
|
code: z.ZodIssueCode.custom,
|
|
1246
|
-
message: `Maximum value is ${
|
|
1313
|
+
message: `Maximum value is ${O.maxValue}`
|
|
1247
1314
|
});
|
|
1248
1315
|
});
|
|
1249
1316
|
break;
|
|
1250
1317
|
case "date":
|
|
1251
|
-
e[
|
|
1252
|
-
e !== null &&
|
|
1318
|
+
e[O.key] = plainDateSchema.nullable().superRefine((e, k) => {
|
|
1319
|
+
e !== null && O.minDate !== void 0 && e < O.minDate && k.addIssue({
|
|
1253
1320
|
code: z.ZodIssueCode.custom,
|
|
1254
|
-
message: `Minimum date is ${
|
|
1255
|
-
}), e !== null &&
|
|
1321
|
+
message: `Minimum date is ${O.minDate}`
|
|
1322
|
+
}), e !== null && O.maxDate !== void 0 && e > O.maxDate && k.addIssue({
|
|
1256
1323
|
code: z.ZodIssueCode.custom,
|
|
1257
|
-
message: `Maximum date is ${
|
|
1324
|
+
message: `Maximum date is ${O.maxDate}`
|
|
1258
1325
|
});
|
|
1259
1326
|
});
|
|
1260
1327
|
break;
|
|
1261
|
-
default: e[
|
|
1328
|
+
default: e[O.key] = z.string().nullable();
|
|
1262
1329
|
}
|
|
1263
1330
|
return e;
|
|
1264
1331
|
}, {});
|
|
@@ -1303,8 +1370,8 @@ var Step = /* @__PURE__ */ function(e) {
|
|
|
1303
1370
|
__name: "ContactCreateDialogBusinessForm",
|
|
1304
1371
|
props: { onSubmit: { type: Function } },
|
|
1305
1372
|
emits: ["back"],
|
|
1306
|
-
setup(e, { emit:
|
|
1307
|
-
let
|
|
1373
|
+
setup(e, { emit: k }) {
|
|
1374
|
+
let j = e, M = k, N = useI18n(), F = useCrm(), I = useCrmConfig(), { geocodeAddress: R } = useGeocode(), B = computed(() => F.getEntityConfig(EntityType.BUSINESS)), V = ref(!1), H = ref(Step.SEARCH_BUSINESS), W = computed(() => H.value === Step.MANUAL_CONTACT_PERSON || H.value === Step.SEARCH_CONTACT_PERSON ? N.t("wise_crm.contact.create_dialog.form.contact_person_title") : N.t("wise_crm.contact.create_dialog.form.title", { value: B.value?.name ?? "-" })), G = computed(() => H.value === Step.MANUAL_CONTACT_PERSON || H.value === Step.SEARCH_CONTACT_PERSON ? N.t("wise_crm.contact.create_dialog.form.contact_person_description") : N.t("wise_crm.contact.create_dialog.form.description")), K = useForm({
|
|
1308
1375
|
initialState: {
|
|
1309
1376
|
childUuid: null,
|
|
1310
1377
|
individualUuid: null,
|
|
@@ -1317,14 +1384,14 @@ var Step = /* @__PURE__ */ function(e) {
|
|
|
1317
1384
|
individualPosition: null,
|
|
1318
1385
|
vatNumber: null
|
|
1319
1386
|
},
|
|
1320
|
-
schema: getBusinessCreateFormSchema(computed(() =>
|
|
1387
|
+
schema: getBusinessCreateFormSchema(computed(() => I.getCustomFieldDefinitionForEntity(EntityType.BUSINESS).filter((e) => e.isDisplayedOnCreate)).value),
|
|
1321
1388
|
onSubmit: async (e) => {
|
|
1322
|
-
await
|
|
1389
|
+
await j.onSubmit(e);
|
|
1323
1390
|
}
|
|
1324
1391
|
}), q = K.register("name"), J = K.register("address"), Y = K.register("companyNumber"), X = K.register("vatNumber");
|
|
1325
1392
|
function Z(e) {
|
|
1326
1393
|
if (e === Step.SEARCH_BUSINESS) {
|
|
1327
|
-
|
|
1394
|
+
M("back");
|
|
1328
1395
|
return;
|
|
1329
1396
|
}
|
|
1330
1397
|
if (e === Step.MANUAL_BUSINESS) {
|
|
@@ -1338,22 +1405,30 @@ var Step = /* @__PURE__ */ function(e) {
|
|
|
1338
1405
|
e === Step.MANUAL_CONTACT_PERSON && (H.value = Step.SEARCH_CONTACT_PERSON);
|
|
1339
1406
|
}
|
|
1340
1407
|
function Q() {
|
|
1341
|
-
H.value = Step.MANUAL_BUSINESS;
|
|
1408
|
+
q.setValue(null), J.setValue(null), Y.setValue(null), X.setValue(null), V.value = !1, H.value = Step.MANUAL_BUSINESS;
|
|
1342
1409
|
}
|
|
1343
|
-
function $(e) {
|
|
1410
|
+
async function $(e) {
|
|
1344
1411
|
if (e === null) return;
|
|
1345
1412
|
H.value = Step.MANUAL_BUSINESS, V.value = !0;
|
|
1346
|
-
let
|
|
1347
|
-
q.setValue(e.name),
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1413
|
+
let O = e.uuid.replace(/\./g, "");
|
|
1414
|
+
if (q.setValue(e.name), e.address !== null) {
|
|
1415
|
+
let O = await R(e.address);
|
|
1416
|
+
J.setValue({
|
|
1417
|
+
...e.address,
|
|
1418
|
+
coordinates: O ?? {
|
|
1419
|
+
lat: null,
|
|
1420
|
+
lng: null
|
|
1421
|
+
},
|
|
1422
|
+
country: CountryCode.BE
|
|
1423
|
+
});
|
|
1424
|
+
} else J.setValue(null);
|
|
1425
|
+
X.setValue({
|
|
1351
1426
|
countryCode: CountryCode.BE,
|
|
1352
|
-
number:
|
|
1353
|
-
}), Y.setValue(
|
|
1427
|
+
number: O
|
|
1428
|
+
}), Y.setValue(O);
|
|
1354
1429
|
}
|
|
1355
|
-
return (e,
|
|
1356
|
-
default: withCtx(() => [createVNode(AppColorProvider_default, { color: unref(
|
|
1430
|
+
return (e, k) => (openBlock(), createBlock(AppDialogContainer_default, { class: "gap-xl flex flex-1 flex-col overflow-hidden" }, {
|
|
1431
|
+
default: withCtx(() => [createVNode(AppColorProvider_default, { color: unref(F).getEntityConfig(unref(EntityType).BUSINESS)?.color ?? null }, {
|
|
1357
1432
|
default: withCtx(() => [createVNode(AppDialogHeader_default, {
|
|
1358
1433
|
title: W.value,
|
|
1359
1434
|
description: G.value,
|
|
@@ -1373,25 +1448,25 @@ var Step = /* @__PURE__ */ function(e) {
|
|
|
1373
1448
|
key: 0,
|
|
1374
1449
|
onCreateNew: Q,
|
|
1375
1450
|
onUpdateCbeSearchItem: $,
|
|
1376
|
-
onBack:
|
|
1451
|
+
onBack: k[0] ||= (e) => Z(Step.SEARCH_BUSINESS)
|
|
1377
1452
|
})) : createCommentVNode("", !0),
|
|
1378
1453
|
H.value === Step.MANUAL_BUSINESS ? (openBlock(), createBlock(ContactCreateDialogBusinessGeneralInfo_default, {
|
|
1379
1454
|
key: 1,
|
|
1380
1455
|
form: unref(K),
|
|
1381
1456
|
"is-data-from-cbe": V.value,
|
|
1382
|
-
onBack:
|
|
1383
|
-
onNext:
|
|
1457
|
+
onBack: k[1] ||= (e) => Z(Step.MANUAL_BUSINESS),
|
|
1458
|
+
onNext: k[2] ||= (e) => H.value = Step.SEARCH_CONTACT_PERSON
|
|
1384
1459
|
}, null, 8, ["form", "is-data-from-cbe"])) : createCommentVNode("", !0),
|
|
1385
1460
|
H.value === Step.SEARCH_CONTACT_PERSON ? (openBlock(), createBlock(ContactCreateDialogBusinessContactPersonSearch_default, {
|
|
1386
1461
|
key: 2,
|
|
1387
1462
|
form: unref(K),
|
|
1388
|
-
onBack:
|
|
1389
|
-
onNext:
|
|
1463
|
+
onBack: k[3] ||= (e) => Z(Step.SEARCH_CONTACT_PERSON),
|
|
1464
|
+
onNext: k[4] ||= (e) => H.value = Step.MANUAL_CONTACT_PERSON
|
|
1390
1465
|
}, null, 8, ["form"])) : createCommentVNode("", !0),
|
|
1391
1466
|
H.value === Step.MANUAL_CONTACT_PERSON ? (openBlock(), createBlock(ContactCreateDialogBusinessContactPerson_default, {
|
|
1392
1467
|
key: 3,
|
|
1393
1468
|
form: unref(K),
|
|
1394
|
-
onBack:
|
|
1469
|
+
onBack: k[5] ||= (e) => Z(Step.MANUAL_CONTACT_PERSON)
|
|
1395
1470
|
}, null, 8, ["form"])) : createCommentVNode("", !0)
|
|
1396
1471
|
]),
|
|
1397
1472
|
_: 1
|
|
@@ -1403,63 +1478,63 @@ var Step = /* @__PURE__ */ function(e) {
|
|
|
1403
1478
|
__name: "BusinessAddChildBusinessDialog",
|
|
1404
1479
|
props: { businessUuid: {} },
|
|
1405
1480
|
emits: ["close"],
|
|
1406
|
-
setup(e, { emit:
|
|
1407
|
-
let
|
|
1408
|
-
function
|
|
1409
|
-
|
|
1481
|
+
setup(e, { emit: O }) {
|
|
1482
|
+
let k = e, A = O, j = useI18n(), M = useApiErrorToast(), N = ref(!1), F = ref(null), I = useBusinessCreateMutation(), L = useBusinessAddChildBusinessMutation();
|
|
1483
|
+
function R() {
|
|
1484
|
+
A("close");
|
|
1410
1485
|
}
|
|
1411
|
-
async function
|
|
1486
|
+
async function B(e) {
|
|
1412
1487
|
try {
|
|
1413
|
-
let
|
|
1414
|
-
await
|
|
1415
|
-
childUuid:
|
|
1416
|
-
parentUuid:
|
|
1417
|
-
} }),
|
|
1488
|
+
let O = await I.execute({ body: e });
|
|
1489
|
+
await L.execute({ params: {
|
|
1490
|
+
childUuid: O,
|
|
1491
|
+
parentUuid: k.businessUuid
|
|
1492
|
+
} }), A("close");
|
|
1418
1493
|
} catch (e) {
|
|
1419
|
-
|
|
1494
|
+
M.show(e);
|
|
1420
1495
|
}
|
|
1421
1496
|
}
|
|
1422
|
-
async function
|
|
1497
|
+
async function V(e) {
|
|
1423
1498
|
try {
|
|
1424
|
-
await
|
|
1499
|
+
await L.execute({ params: {
|
|
1425
1500
|
childUuid: e,
|
|
1426
|
-
parentUuid:
|
|
1427
|
-
} }),
|
|
1501
|
+
parentUuid: k.businessUuid
|
|
1502
|
+
} }), A("close");
|
|
1428
1503
|
} catch (e) {
|
|
1429
|
-
|
|
1504
|
+
M.show(e);
|
|
1430
1505
|
}
|
|
1431
1506
|
}
|
|
1432
|
-
function
|
|
1433
|
-
|
|
1507
|
+
function H() {
|
|
1508
|
+
N.value = !1;
|
|
1434
1509
|
}
|
|
1435
|
-
function
|
|
1436
|
-
|
|
1510
|
+
function W() {
|
|
1511
|
+
N.value = !0;
|
|
1437
1512
|
}
|
|
1438
|
-
return (e,
|
|
1513
|
+
return (e, O) => (openBlock(), createBlock(unref(VcDialog), {
|
|
1439
1514
|
"class-config": { content: "max-w-xl w-full" },
|
|
1440
|
-
onClose:
|
|
1515
|
+
onClose: R
|
|
1441
1516
|
}, {
|
|
1442
|
-
default: withCtx(() => [
|
|
1517
|
+
default: withCtx(() => [N.value ? (openBlock(), createBlock(ContactCreateDialogBusinessForm_default, {
|
|
1443
1518
|
key: 0,
|
|
1444
|
-
"on-submit":
|
|
1445
|
-
onBack:
|
|
1519
|
+
"on-submit": B,
|
|
1520
|
+
onBack: H
|
|
1446
1521
|
})) : (openBlock(), createBlock(AppDialogContainer_default, {
|
|
1447
1522
|
key: 1,
|
|
1448
1523
|
class: "gap-xl flex flex-1 flex-col"
|
|
1449
1524
|
}, {
|
|
1450
1525
|
default: withCtx(() => [createVNode(AppDialogHeader_default, {
|
|
1451
|
-
title: unref(
|
|
1452
|
-
description: unref(
|
|
1526
|
+
title: unref(j).t("wise_crm.info_dialog.add_business_child_dialog.title"),
|
|
1527
|
+
description: unref(j).t("wise_crm.info_dialog.add_business_child_dialog.description"),
|
|
1453
1528
|
icon: "building"
|
|
1454
1529
|
}, {
|
|
1455
1530
|
"closse-button": withCtx(() => [createVNode(unref(VcDialogCloseButton))]),
|
|
1456
1531
|
_: 1
|
|
1457
1532
|
}, 8, ["title", "description"]), createVNode(BusinessAddExistingChildForm_default, {
|
|
1458
|
-
modelValue:
|
|
1459
|
-
"onUpdate:modelValue":
|
|
1460
|
-
"parent-business-uuid":
|
|
1461
|
-
"on-submit":
|
|
1462
|
-
onCreateNew:
|
|
1533
|
+
modelValue: F.value,
|
|
1534
|
+
"onUpdate:modelValue": O[0] ||= (e) => F.value = e,
|
|
1535
|
+
"parent-business-uuid": k.businessUuid,
|
|
1536
|
+
"on-submit": V,
|
|
1537
|
+
onCreateNew: W
|
|
1463
1538
|
}, null, 8, ["modelValue", "parent-business-uuid"])]),
|
|
1464
1539
|
_: 1
|
|
1465
1540
|
}))]),
|
|
@@ -1469,7 +1544,7 @@ var Step = /* @__PURE__ */ function(e) {
|
|
|
1469
1544
|
});
|
|
1470
1545
|
function useBusinessLinkContactPersonMutation() {
|
|
1471
1546
|
return ze({
|
|
1472
|
-
queryFn: async ({ body: e, params:
|
|
1547
|
+
queryFn: async ({ body: e, params: O }) => await BusinessService.linkContactPerson(O.businessUuid, e.contactPersonUuid, e.position, e.contactInfo),
|
|
1473
1548
|
queryKeysToInvalidate: {
|
|
1474
1549
|
businessIndex: {},
|
|
1475
1550
|
wiseCrmBusinessDetail: { businessUuid: (e) => e.businessUuid }
|
|
@@ -1486,20 +1561,20 @@ var BusinessContactPersonCreateDialog_default = /* @__PURE__ */ defineComponent(
|
|
|
1486
1561
|
}
|
|
1487
1562
|
},
|
|
1488
1563
|
emits: ["close", "createNewContactPerson"],
|
|
1489
|
-
setup(e, { emit:
|
|
1490
|
-
let
|
|
1491
|
-
async function
|
|
1564
|
+
setup(e, { emit: O }) {
|
|
1565
|
+
let k = e, A = O, j = useI18n(), M = useApiErrorToast(), N = useBusinessLinkContactPersonMutation(), P = useContactPersonCreateMutation();
|
|
1566
|
+
async function F(e) {
|
|
1492
1567
|
try {
|
|
1493
|
-
let
|
|
1568
|
+
let O = await P.execute({ body: {
|
|
1494
1569
|
email: e.email,
|
|
1495
1570
|
firstName: e.firstName,
|
|
1496
1571
|
lastName: e.lastName,
|
|
1497
1572
|
mobilePhone: e.mobilePhone,
|
|
1498
1573
|
phone: e.phone
|
|
1499
1574
|
} });
|
|
1500
|
-
|
|
1575
|
+
k.isCreatingNewContactPerson || await N.execute({
|
|
1501
1576
|
body: {
|
|
1502
|
-
contactPersonUuid:
|
|
1577
|
+
contactPersonUuid: O,
|
|
1503
1578
|
contactInfo: {
|
|
1504
1579
|
email: e.email,
|
|
1505
1580
|
mobilePhone: e.mobilePhone,
|
|
@@ -1507,45 +1582,45 @@ var BusinessContactPersonCreateDialog_default = /* @__PURE__ */ defineComponent(
|
|
|
1507
1582
|
},
|
|
1508
1583
|
position: e.position
|
|
1509
1584
|
},
|
|
1510
|
-
params: { businessUuid:
|
|
1511
|
-
}),
|
|
1585
|
+
params: { businessUuid: k.businessUuid }
|
|
1586
|
+
}), L({
|
|
1512
1587
|
label: `${e.firstName} ${e.lastName}`,
|
|
1513
|
-
value:
|
|
1588
|
+
value: O
|
|
1514
1589
|
});
|
|
1515
1590
|
} catch (e) {
|
|
1516
|
-
|
|
1591
|
+
M.show(e);
|
|
1517
1592
|
}
|
|
1518
1593
|
}
|
|
1519
|
-
async function
|
|
1594
|
+
async function I(e, O, A) {
|
|
1520
1595
|
if (e !== null) try {
|
|
1521
|
-
await
|
|
1596
|
+
await N.execute({
|
|
1522
1597
|
body: {
|
|
1523
1598
|
contactPersonUuid: e,
|
|
1524
|
-
contactInfo:
|
|
1525
|
-
position:
|
|
1599
|
+
contactInfo: O,
|
|
1600
|
+
position: A
|
|
1526
1601
|
},
|
|
1527
|
-
params: { businessUuid:
|
|
1528
|
-
}),
|
|
1602
|
+
params: { businessUuid: k.businessUuid }
|
|
1603
|
+
}), L();
|
|
1529
1604
|
} catch (e) {
|
|
1530
|
-
|
|
1605
|
+
M.show(e);
|
|
1531
1606
|
}
|
|
1532
1607
|
}
|
|
1533
|
-
function
|
|
1608
|
+
function L(e) {
|
|
1534
1609
|
if (e === void 0) {
|
|
1535
|
-
|
|
1610
|
+
A("close");
|
|
1536
1611
|
return;
|
|
1537
1612
|
}
|
|
1538
|
-
|
|
1613
|
+
A("createNewContactPerson", e), A("close");
|
|
1539
1614
|
}
|
|
1540
|
-
return (e,
|
|
1541
|
-
title: unref(
|
|
1542
|
-
description: unref(
|
|
1543
|
-
onClose:
|
|
1615
|
+
return (e, O) => (openBlock(), createBlock(AppDialog_default, {
|
|
1616
|
+
title: unref(j).t("wise_crm.info_dialog.contact_person_create.title"),
|
|
1617
|
+
description: unref(j).t("wise_crm.info_dialog.contact_person_create.description"),
|
|
1618
|
+
onClose: L
|
|
1544
1619
|
}, {
|
|
1545
1620
|
default: withCtx(() => [createVNode(ContactPersonCreateForm_default, {
|
|
1546
|
-
"on-submit":
|
|
1547
|
-
"on-link-contact-person":
|
|
1548
|
-
onClose:
|
|
1621
|
+
"on-submit": F,
|
|
1622
|
+
"on-link-contact-person": I,
|
|
1623
|
+
onClose: L
|
|
1549
1624
|
})]),
|
|
1550
1625
|
_: 1
|
|
1551
1626
|
}, 8, ["title", "description"]));
|
|
@@ -1553,7 +1628,7 @@ var BusinessContactPersonCreateDialog_default = /* @__PURE__ */ defineComponent(
|
|
|
1553
1628
|
});
|
|
1554
1629
|
function useBusinessContactPersonUpdateMutation() {
|
|
1555
1630
|
return ze({
|
|
1556
|
-
queryFn: async ({ body: e, params:
|
|
1631
|
+
queryFn: async ({ body: e, params: O }) => await BusinessService.updateContactPerson(O.businessUuid, O.contactPersonUuid, e),
|
|
1557
1632
|
queryKeysToInvalidate: {
|
|
1558
1633
|
businessIndex: {},
|
|
1559
1634
|
contactPersonDetail: { contactPersonUuid: (e) => e.contactPersonUuid },
|
|
@@ -1561,15 +1636,15 @@ function useBusinessContactPersonUpdateMutation() {
|
|
|
1561
1636
|
}
|
|
1562
1637
|
});
|
|
1563
1638
|
}
|
|
1564
|
-
function useBusinessContactPersonDetailQuery(e,
|
|
1639
|
+
function useBusinessContactPersonDetailQuery(e, O) {
|
|
1565
1640
|
return He({
|
|
1566
|
-
isEnabled: computed(() => e.value !== null &&
|
|
1641
|
+
isEnabled: computed(() => e.value !== null && O.value !== null),
|
|
1567
1642
|
queryFn: () => {
|
|
1568
1643
|
if (e.value === null) throw Error("Individual UUID is null");
|
|
1569
|
-
if (
|
|
1570
|
-
return BusinessService.getContactPerson(e.value,
|
|
1644
|
+
if (O.value === null) throw Error("Contact Person UUID is null");
|
|
1645
|
+
return BusinessService.getContactPerson(e.value, O.value);
|
|
1571
1646
|
},
|
|
1572
|
-
queryKey: { contactPersonDetail: { contactPersonUuid:
|
|
1647
|
+
queryKey: { contactPersonDetail: { contactPersonUuid: O } }
|
|
1573
1648
|
});
|
|
1574
1649
|
}
|
|
1575
1650
|
var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
|
|
@@ -1579,25 +1654,25 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
|
|
|
1579
1654
|
onSubmit: { type: Function }
|
|
1580
1655
|
},
|
|
1581
1656
|
setup(e) {
|
|
1582
|
-
let
|
|
1657
|
+
let O = e, k = useI18n(), A = useForm({
|
|
1583
1658
|
initialState: {
|
|
1584
|
-
email:
|
|
1585
|
-
firstName:
|
|
1586
|
-
lastName:
|
|
1587
|
-
mobilePhone:
|
|
1588
|
-
phone:
|
|
1589
|
-
position:
|
|
1659
|
+
email: O.contactPerson.email,
|
|
1660
|
+
firstName: O.contactPerson.firstName,
|
|
1661
|
+
lastName: O.contactPerson.lastName,
|
|
1662
|
+
mobilePhone: O.contactPerson.mobilePhone,
|
|
1663
|
+
phone: O.contactPerson.phone,
|
|
1664
|
+
position: O.contactPerson.position
|
|
1590
1665
|
},
|
|
1591
1666
|
schema: contactPersonUpdateFormSchema,
|
|
1592
1667
|
onSubmit: async (e) => {
|
|
1593
|
-
await
|
|
1668
|
+
await O.onSubmit(e);
|
|
1594
1669
|
}
|
|
1595
1670
|
});
|
|
1596
|
-
return (e,
|
|
1671
|
+
return (e, O) => (openBlock(), createBlock(ContactPersonCreateNewForm_default, { form: unref(A) }, {
|
|
1597
1672
|
actions: withCtx(() => [createVNode(AppSidebarFormFooter_default, null, {
|
|
1598
1673
|
default: withCtx(() => [createVNode(AppSidebarFormSubmitButton_default, {
|
|
1599
|
-
"is-loading": unref(
|
|
1600
|
-
label: unref(
|
|
1674
|
+
"is-loading": unref(A).isSubmitting.value,
|
|
1675
|
+
label: unref(k).t("wise_crm.shared.save_changes")
|
|
1601
1676
|
}, null, 8, ["is-loading", "label"])]),
|
|
1602
1677
|
_: 1
|
|
1603
1678
|
})]),
|
|
@@ -1611,35 +1686,35 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
|
|
|
1611
1686
|
contactPersonUuid: {}
|
|
1612
1687
|
},
|
|
1613
1688
|
emits: ["close"],
|
|
1614
|
-
setup(e, { emit:
|
|
1615
|
-
let
|
|
1616
|
-
async function
|
|
1689
|
+
setup(e, { emit: O }) {
|
|
1690
|
+
let k = e, A = O, j = useI18n(), M = useApiErrorToast(), N = useBusinessContactPersonUpdateMutation(), P = useBusinessContactPersonDetailQuery(computed(() => k.businessUuid), computed(() => k.contactPersonUuid));
|
|
1691
|
+
async function F(e) {
|
|
1617
1692
|
try {
|
|
1618
|
-
await
|
|
1693
|
+
await N.execute({
|
|
1619
1694
|
body: e,
|
|
1620
1695
|
params: {
|
|
1621
|
-
businessUuid:
|
|
1622
|
-
contactPersonUuid:
|
|
1696
|
+
businessUuid: k.businessUuid,
|
|
1697
|
+
contactPersonUuid: k.contactPersonUuid
|
|
1623
1698
|
}
|
|
1624
|
-
}),
|
|
1699
|
+
}), A("close");
|
|
1625
1700
|
} catch (e) {
|
|
1626
|
-
|
|
1701
|
+
M.show(e);
|
|
1627
1702
|
}
|
|
1628
1703
|
}
|
|
1629
|
-
function
|
|
1630
|
-
|
|
1704
|
+
function I() {
|
|
1705
|
+
A("close");
|
|
1631
1706
|
}
|
|
1632
|
-
return (e,
|
|
1633
|
-
title: unref(
|
|
1634
|
-
description: unref(
|
|
1635
|
-
onClose:
|
|
1707
|
+
return (e, O) => (openBlock(), createBlock(AppDialog_default, {
|
|
1708
|
+
title: unref(j).t("wise_crm.info_dialog.contact_person_update.title"),
|
|
1709
|
+
description: unref(j).t("wise_crm.info_dialog.contact_person_create.description"),
|
|
1710
|
+
onClose: I
|
|
1636
1711
|
}, {
|
|
1637
|
-
default: withCtx(() => [unref(
|
|
1712
|
+
default: withCtx(() => [unref(P).data.value ? (openBlock(), createBlock(BusinessContactPersonUpdateForm_default, {
|
|
1638
1713
|
key: 0,
|
|
1639
|
-
"business-uuid":
|
|
1640
|
-
"on-submit":
|
|
1641
|
-
"contact-person": unref(
|
|
1642
|
-
onClose:
|
|
1714
|
+
"business-uuid": k.businessUuid,
|
|
1715
|
+
"on-submit": F,
|
|
1716
|
+
"contact-person": unref(P).data.value,
|
|
1717
|
+
onClose: I
|
|
1643
1718
|
}, null, 8, ["business-uuid", "contact-person"])) : createCommentVNode("", !0)]),
|
|
1644
1719
|
_: 1
|
|
1645
1720
|
}, 8, ["title", "description"]));
|
|
@@ -1651,42 +1726,42 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
|
|
|
1651
1726
|
__name: "BusinessDetailSidebarAccordionBusinessInfoChildren",
|
|
1652
1727
|
props: { business: {} },
|
|
1653
1728
|
emits: ["addChild"],
|
|
1654
|
-
setup(e, { emit:
|
|
1655
|
-
let
|
|
1656
|
-
function
|
|
1657
|
-
|
|
1729
|
+
setup(e, { emit: O }) {
|
|
1730
|
+
let k = e, A = O, j = useI18n(), M = useEntityDetail(), N = computed(() => k.business.children), P = computed(() => N.value.length > 1 ? j.t("wise_crm.shared.departments_amount", { value: N.value.length }) : N.value[0]?.name ?? "");
|
|
1731
|
+
function F() {
|
|
1732
|
+
A("addChild");
|
|
1658
1733
|
}
|
|
1659
|
-
function
|
|
1660
|
-
|
|
1734
|
+
function I(e) {
|
|
1735
|
+
M.open(EntityType.BUSINESS, e);
|
|
1661
1736
|
}
|
|
1662
|
-
return (e,
|
|
1737
|
+
return (e, O) => (openBlock(), createElementBlock("div", _hoisted_1$1, [createVNode(unref(VcIcon), {
|
|
1663
1738
|
icon: "layersTree",
|
|
1664
1739
|
class: "mt-xs size-4 shrink-0"
|
|
1665
1740
|
}), createElementVNode("div", _hoisted_2$1, [
|
|
1666
|
-
|
|
1741
|
+
k.business.parent === null ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_3$1, [createVNode(AppOpenEntityButton_default, {
|
|
1667
1742
|
"class-config": { root: "bg-transparent w-min border-none text-primary shadow-none h-auto hover:underline p-0 font-regular" },
|
|
1668
1743
|
"entity-type": unref(EntityType).BUSINESS,
|
|
1669
|
-
uuid:
|
|
1744
|
+
uuid: k.business.parent.uuid
|
|
1670
1745
|
}, {
|
|
1671
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
1746
|
+
default: withCtx(() => [createTextVNode(toDisplayString(k.business.parent.name), 1)]),
|
|
1672
1747
|
_: 1
|
|
1673
1748
|
}, 8, ["entity-type", "uuid"])])),
|
|
1674
|
-
createElementVNode("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [
|
|
1749
|
+
createElementVNode("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [k.business.parent === null ? createCommentVNode("", !0) : (openBlock(), createBlock(unref(VcIcon), {
|
|
1675
1750
|
key: 0,
|
|
1676
1751
|
icon: "timeLineMarker",
|
|
1677
1752
|
class: "text-brand-500 size-4"
|
|
1678
|
-
})), createElementVNode("p", _hoisted_6, toDisplayString(
|
|
1753
|
+
})), createElementVNode("p", _hoisted_6, toDisplayString(k.business.name), 1)]), createVNode(unref(VcIconButton), {
|
|
1679
1754
|
"class-config": {
|
|
1680
1755
|
root: "bg-transparent border-none h-auto w-auto p-xs shadow-none rounded-sm data-[loading=false]:not-disabled:hover:bg-secondary/50 duration-300",
|
|
1681
1756
|
icon: "text-quaternary size-4"
|
|
1682
1757
|
},
|
|
1683
|
-
label: unref(
|
|
1758
|
+
label: unref(j).t("wise_crm.info_dialog.sidebar.business.add_icon"),
|
|
1684
1759
|
icon: "plus",
|
|
1685
|
-
onClick:
|
|
1760
|
+
onClick: F
|
|
1686
1761
|
}, null, 8, ["label"])]),
|
|
1687
|
-
|
|
1762
|
+
N.value.length > 0 ? (openBlock(), createElementBlock("div", {
|
|
1688
1763
|
key: 1,
|
|
1689
|
-
class: normalizeClass([{ "ml-2xl":
|
|
1764
|
+
class: normalizeClass([{ "ml-2xl": k.business.parent !== null }, "gap-sm flex items-center"])
|
|
1690
1765
|
}, [createVNode(unref(VcIcon), {
|
|
1691
1766
|
icon: "timeLineMarker",
|
|
1692
1767
|
class: "text-brand-500 size-4"
|
|
@@ -1701,14 +1776,14 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
|
|
|
1701
1776
|
variant: "secondary",
|
|
1702
1777
|
class: "underline"
|
|
1703
1778
|
}, {
|
|
1704
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
1779
|
+
default: withCtx(() => [createTextVNode(toDisplayString(P.value), 1)]),
|
|
1705
1780
|
_: 1
|
|
1706
1781
|
})]),
|
|
1707
1782
|
content: withCtx(() => [createElementVNode("div", _hoisted_7, [createVNode(CrmDetailAccordionRoot_default, {
|
|
1708
|
-
"default-values":
|
|
1783
|
+
"default-values": N.value[0]?.uuid ?? "",
|
|
1709
1784
|
type: "single"
|
|
1710
1785
|
}, {
|
|
1711
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1786
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(N.value, (e) => (openBlock(), createBlock(CrmDetailSidebarAccordionItem_default, {
|
|
1712
1787
|
key: e.uuid,
|
|
1713
1788
|
label: e.name,
|
|
1714
1789
|
value: e.uuid,
|
|
@@ -1719,9 +1794,9 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
|
|
|
1719
1794
|
root: "bg-transparent border-none h-auto w-auto p-xs shadow-none rounded-sm data-[loading=false]:not-disabled:hover:bg-secondary/50 duration-300",
|
|
1720
1795
|
icon: "text-quaternary size-4"
|
|
1721
1796
|
},
|
|
1722
|
-
label: unref(
|
|
1797
|
+
label: unref(j).t("wise_crm.info_dialog.sidebar.business.add_icon"),
|
|
1723
1798
|
icon: "linkExternal",
|
|
1724
|
-
onClick: (
|
|
1799
|
+
onClick: (O) => I(e.uuid)
|
|
1725
1800
|
}, null, 8, ["label", "onClick"])]),
|
|
1726
1801
|
default: withCtx(() => [createVNode(CrmDetailSidebarCard_default, { class: "gap-md flex flex-col" }, {
|
|
1727
1802
|
default: withCtx(() => [
|
|
@@ -1760,122 +1835,122 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
|
|
|
1760
1835
|
__name: "BusinessDetailSidebarAccordionBusinessInfo",
|
|
1761
1836
|
props: { business: {} },
|
|
1762
1837
|
emits: ["addChild"],
|
|
1763
|
-
setup(e, { emit:
|
|
1764
|
-
let
|
|
1765
|
-
function
|
|
1766
|
-
|
|
1838
|
+
setup(e, { emit: O }) {
|
|
1839
|
+
let k = e, A = O, j = useI18n();
|
|
1840
|
+
function M() {
|
|
1841
|
+
A("addChild");
|
|
1767
1842
|
}
|
|
1768
|
-
return (
|
|
1843
|
+
return (O, A) => (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(CrmDetailSidebarCard_default, null, {
|
|
1769
1844
|
default: withCtx(() => [createElementVNode("div", _hoisted_2, [createVNode(AppIconLabelPair_default, {
|
|
1770
|
-
label:
|
|
1845
|
+
label: k.business.vatNumber ? unref(VatNumberUtil).format(k.business.vatNumber) : "-",
|
|
1771
1846
|
icon: "buildings"
|
|
1772
1847
|
}, null, 8, ["label"]), createVNode(BusinessDetailSidebarAccordionBusinessInfoChildren_default, {
|
|
1773
1848
|
business: e.business,
|
|
1774
|
-
onAddChild:
|
|
1849
|
+
onAddChild: M
|
|
1775
1850
|
}, null, 8, ["business"])]), createElementVNode("div", _hoisted_3, [createVNode(AppIconLabelPair_default, {
|
|
1776
|
-
label: unref(
|
|
1851
|
+
label: unref(j).t("wise_crm.info_dialog.sidebar.overview.created_at_label", { value: k.business.createdAt ? unref(useDateTimeFormat)().toDateTime(k.business.createdAt) : "-" }),
|
|
1777
1852
|
icon: "clockPlus"
|
|
1778
1853
|
}, null, 8, ["label"])])]),
|
|
1779
1854
|
_: 1
|
|
1780
|
-
}), createVNode(CrmDetailSidebarMapCard_default, { address:
|
|
1855
|
+
}), createVNode(CrmDetailSidebarMapCard_default, { address: k.business.address }, null, 8, ["address"])]));
|
|
1781
1856
|
}
|
|
1782
1857
|
}), BusinessDetailSidebarOverviewContent_default = /* @__PURE__ */ defineComponent({
|
|
1783
1858
|
__name: "BusinessDetailSidebarOverviewContent",
|
|
1784
1859
|
props: { business: {} },
|
|
1785
1860
|
setup(e) {
|
|
1786
|
-
let
|
|
1787
|
-
function
|
|
1788
|
-
|
|
1861
|
+
let O = e, k = useI18n(), A = useApiErrorToast(), j = useDialog(AppConfirmDialog_default), N = useBusinessPrimaryContactPersonUpdateMutation(), P = useBusinessUnlinkContactPersonMutation(), F = useDialog(BusinessContactPersonCreateDialog_default), I = useDialog(BusinessContactPersonUpdateDialog_default), L = useDialog(BusinessAddChildBusinessDialog_default), R = computed(() => O.business.contactPersons.length > 0);
|
|
1862
|
+
function B() {
|
|
1863
|
+
F.open({ businessUuid: O.business.uuid });
|
|
1789
1864
|
}
|
|
1790
|
-
function
|
|
1791
|
-
|
|
1792
|
-
businessUuid:
|
|
1865
|
+
function V(e) {
|
|
1866
|
+
I.open({
|
|
1867
|
+
businessUuid: O.business.uuid,
|
|
1793
1868
|
contactPersonUuid: e
|
|
1794
1869
|
});
|
|
1795
1870
|
}
|
|
1796
|
-
function
|
|
1797
|
-
|
|
1798
|
-
title:
|
|
1871
|
+
function H(e) {
|
|
1872
|
+
j.open({
|
|
1873
|
+
title: k.t("wise_crm.info_dialog.sidebar.overview.delete_contact_person_title"),
|
|
1799
1874
|
isDestructive: !0,
|
|
1800
|
-
isLoading:
|
|
1801
|
-
confirmText:
|
|
1802
|
-
description:
|
|
1875
|
+
isLoading: P.isLoading.value,
|
|
1876
|
+
confirmText: k.t("shared.delete"),
|
|
1877
|
+
description: k.t("wise_crm.info_dialog.sidebar.overview.delete_contact_person_description"),
|
|
1803
1878
|
onConfirm: async () => {
|
|
1804
1879
|
try {
|
|
1805
|
-
await
|
|
1880
|
+
await P.execute({
|
|
1806
1881
|
body: { contactPersonUuid: e },
|
|
1807
|
-
params: { businessUuid:
|
|
1882
|
+
params: { businessUuid: O.business.uuid }
|
|
1808
1883
|
});
|
|
1809
1884
|
} catch (e) {
|
|
1810
|
-
|
|
1885
|
+
A.show(e);
|
|
1811
1886
|
} finally {
|
|
1812
|
-
|
|
1887
|
+
j.close();
|
|
1813
1888
|
}
|
|
1814
1889
|
}
|
|
1815
1890
|
});
|
|
1816
1891
|
}
|
|
1817
|
-
function
|
|
1818
|
-
|
|
1819
|
-
businessUuid:
|
|
1892
|
+
function U(e) {
|
|
1893
|
+
N.execute({ params: {
|
|
1894
|
+
businessUuid: O.business.uuid,
|
|
1820
1895
|
contactPersonUuid: e
|
|
1821
1896
|
} });
|
|
1822
1897
|
}
|
|
1823
|
-
function
|
|
1824
|
-
|
|
1898
|
+
function W() {
|
|
1899
|
+
L.open({ businessUuid: O.business.uuid });
|
|
1825
1900
|
}
|
|
1826
|
-
return (
|
|
1901
|
+
return (A, j) => (openBlock(), createBlock(CrmDetailAccordionRoot_default, { "default-values": [
|
|
1827
1902
|
"business",
|
|
1828
1903
|
"invoice",
|
|
1829
1904
|
"contact-persons"
|
|
1830
1905
|
] }, {
|
|
1831
1906
|
default: withCtx(() => [
|
|
1832
1907
|
createVNode(CrmDetailSidebarAccordionItem_default, {
|
|
1833
|
-
label: unref(
|
|
1908
|
+
label: unref(k).t("wise_crm.info_dialog.sidebar.overview.business_info"),
|
|
1834
1909
|
value: "business",
|
|
1835
1910
|
icon: "infoCircle"
|
|
1836
1911
|
}, {
|
|
1837
1912
|
default: withCtx(() => [createVNode(BusinessDetailSidebarAccordionBusinessInfo_default, {
|
|
1838
1913
|
business: e.business,
|
|
1839
|
-
onAddChild:
|
|
1914
|
+
onAddChild: W
|
|
1840
1915
|
}, null, 8, ["business"])]),
|
|
1841
1916
|
_: 1
|
|
1842
1917
|
}, 8, ["label"]),
|
|
1843
1918
|
createVNode(CrmDetailSidebarAccordionItem_default, {
|
|
1844
|
-
"is-empty":
|
|
1845
|
-
label: unref(
|
|
1919
|
+
"is-empty": O.business.billingInformation === null,
|
|
1920
|
+
label: unref(k).t("wise_crm.info_dialog.sidebar.overview.invoice_label"),
|
|
1846
1921
|
value: "invoice",
|
|
1847
1922
|
icon: "wallet"
|
|
1848
1923
|
}, {
|
|
1849
|
-
default: withCtx(() => [
|
|
1924
|
+
default: withCtx(() => [O.business.billingInformation ? (openBlock(), createBlock(CrmDetailSidebarAccordionBillingInformation_default, {
|
|
1850
1925
|
key: 0,
|
|
1851
|
-
"invoice-address":
|
|
1852
|
-
"invoice-email":
|
|
1926
|
+
"invoice-address": O.business.billingInformation?.location.address,
|
|
1927
|
+
"invoice-email": O.business.billingInformation?.invoiceEmail
|
|
1853
1928
|
}, null, 8, ["invoice-address", "invoice-email"])) : createCommentVNode("", !0)]),
|
|
1854
1929
|
_: 1
|
|
1855
1930
|
}, 8, ["is-empty", "label"]),
|
|
1856
1931
|
createVNode(CrmDetailSidebarAccordionItem_default, {
|
|
1857
|
-
"is-empty": !
|
|
1858
|
-
label: unref(
|
|
1932
|
+
"is-empty": !R.value,
|
|
1933
|
+
label: unref(k).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
|
|
1859
1934
|
value: "contact-persons",
|
|
1860
1935
|
icon: "userCircle",
|
|
1861
|
-
onAdd:
|
|
1936
|
+
onAdd: B
|
|
1862
1937
|
}, {
|
|
1863
|
-
actions: withCtx(() => [
|
|
1938
|
+
actions: withCtx(() => [R.value ? createCommentVNode("", !0) : (openBlock(), createBlock(CrmDetailSidebarAccordionHeaderIconButton_default, {
|
|
1864
1939
|
key: 0,
|
|
1865
|
-
label: unref(
|
|
1940
|
+
label: unref(k).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
|
|
1866
1941
|
class: "z-1",
|
|
1867
1942
|
icon: "plus",
|
|
1868
|
-
onClick:
|
|
1943
|
+
onClick: B
|
|
1869
1944
|
}, null, 8, ["label"]))]),
|
|
1870
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1945
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(O.business.contactPersons, (e) => (openBlock(), createBlock(unref(Motion), {
|
|
1871
1946
|
key: e.uuid,
|
|
1872
1947
|
"layout-id": e.uuid
|
|
1873
1948
|
}, {
|
|
1874
1949
|
default: withCtx(() => [createVNode(CrmDetailSidebarAccordionContactPersonInfo_default, {
|
|
1875
1950
|
"contact-person": e,
|
|
1876
|
-
"on-toggle-is-primary": () =>
|
|
1877
|
-
onUpdate: (
|
|
1878
|
-
onDelete: (
|
|
1951
|
+
"on-toggle-is-primary": () => U(e.uuid),
|
|
1952
|
+
onUpdate: (O) => V(e.uuid),
|
|
1953
|
+
onDelete: (O) => H(e.uuid)
|
|
1879
1954
|
}, null, 8, [
|
|
1880
1955
|
"contact-person",
|
|
1881
1956
|
"on-toggle-is-primary",
|
|
@@ -1883,14 +1958,14 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
|
|
|
1883
1958
|
"onDelete"
|
|
1884
1959
|
])]),
|
|
1885
1960
|
_: 2
|
|
1886
|
-
}, 1032, ["layout-id"]))), 128)),
|
|
1961
|
+
}, 1032, ["layout-id"]))), 128)), R.value ? (openBlock(), createBlock(unref(VcButton), {
|
|
1887
1962
|
key: 0,
|
|
1888
1963
|
variant: "tertiary",
|
|
1889
1964
|
size: "sm",
|
|
1890
1965
|
"icon-left": "plus",
|
|
1891
|
-
onClick:
|
|
1966
|
+
onClick: B
|
|
1892
1967
|
}, {
|
|
1893
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(
|
|
1968
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(k).t("wise_crm.shared.add")), 1)]),
|
|
1894
1969
|
_: 1
|
|
1895
1970
|
})) : createCommentVNode("", !0)]),
|
|
1896
1971
|
_: 1
|
|
@@ -1905,34 +1980,34 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
|
|
|
1905
1980
|
__name: "BusinessDetailSidebar",
|
|
1906
1981
|
props: { business: {} },
|
|
1907
1982
|
setup(e) {
|
|
1908
|
-
let
|
|
1983
|
+
let O = e, k = useI18n(), A = useCrm(), j = computed(() => A.getEntityConfig(EntityType.BUSINESS)), M = ref(InfoTab.OVERVIEW), N = computed(() => [
|
|
1909
1984
|
{
|
|
1910
1985
|
icon: "infoCircle",
|
|
1911
|
-
label:
|
|
1986
|
+
label: k.t("wise_crm.shared.overview"),
|
|
1912
1987
|
value: InfoTab.OVERVIEW
|
|
1913
1988
|
},
|
|
1914
1989
|
{
|
|
1915
1990
|
icon: "activity",
|
|
1916
|
-
label:
|
|
1991
|
+
label: k.t("wise_crm.shared.activity"),
|
|
1917
1992
|
value: InfoTab.ACTIVITY
|
|
1918
1993
|
},
|
|
1919
1994
|
{
|
|
1920
1995
|
icon: "book",
|
|
1921
|
-
label:
|
|
1996
|
+
label: k.t("wise_crm.shared.notes"),
|
|
1922
1997
|
value: InfoTab.NOTES
|
|
1923
1998
|
}
|
|
1924
1999
|
]);
|
|
1925
|
-
return (e,
|
|
1926
|
-
color: unref(
|
|
2000
|
+
return (e, k) => (openBlock(), createBlock(AppColorProvider_default, {
|
|
2001
|
+
color: unref(A).getEntityConfig(unref(EntityType).BUSINESS)?.color ?? null,
|
|
1927
2002
|
class: "flex h-full flex-col"
|
|
1928
2003
|
}, {
|
|
1929
2004
|
default: withCtx(() => [createVNode(CrmDetailHeaderCard_default, {
|
|
1930
|
-
name:
|
|
1931
|
-
address:
|
|
1932
|
-
email:
|
|
1933
|
-
"mobile-phone":
|
|
1934
|
-
"entity-name":
|
|
1935
|
-
phone:
|
|
2005
|
+
name: O.business.name,
|
|
2006
|
+
address: O.business.address,
|
|
2007
|
+
email: O.business.email,
|
|
2008
|
+
"mobile-phone": O.business.mobilePhone,
|
|
2009
|
+
"entity-name": j.value?.name ?? null,
|
|
2010
|
+
phone: O.business.phone
|
|
1936
2011
|
}, null, 8, [
|
|
1937
2012
|
"name",
|
|
1938
2013
|
"address",
|
|
@@ -1941,22 +2016,22 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
|
|
|
1941
2016
|
"entity-name",
|
|
1942
2017
|
"phone"
|
|
1943
2018
|
]), createVNode(CrmDetailSidebarTabs_default, {
|
|
1944
|
-
modelValue:
|
|
1945
|
-
"onUpdate:modelValue":
|
|
1946
|
-
tabs:
|
|
2019
|
+
modelValue: M.value,
|
|
2020
|
+
"onUpdate:modelValue": k[0] ||= (e) => M.value = e,
|
|
2021
|
+
tabs: N.value
|
|
1947
2022
|
}, {
|
|
1948
2023
|
default: withCtx(() => [
|
|
1949
|
-
|
|
2024
|
+
M.value === InfoTab.OVERVIEW ? (openBlock(), createBlock(BusinessDetailSidebarOverviewContent_default, {
|
|
1950
2025
|
key: 0,
|
|
1951
|
-
business:
|
|
2026
|
+
business: O.business
|
|
1952
2027
|
}, null, 8, ["business"])) : createCommentVNode("", !0),
|
|
1953
|
-
|
|
2028
|
+
M.value === InfoTab.ACTIVITY ? (openBlock(), createBlock(BusinessDetailSidebarActivityContent_default, {
|
|
1954
2029
|
key: 1,
|
|
1955
|
-
business:
|
|
2030
|
+
business: O.business
|
|
1956
2031
|
}, null, 8, ["business"])) : createCommentVNode("", !0),
|
|
1957
|
-
|
|
2032
|
+
M.value === InfoTab.NOTES ? (openBlock(), createBlock(BusinessDetailSidebarNotesContent_default, {
|
|
1958
2033
|
key: 2,
|
|
1959
|
-
business:
|
|
2034
|
+
business: O.business
|
|
1960
2035
|
}, null, 8, ["business"])) : createCommentVNode("", !0)
|
|
1961
2036
|
]),
|
|
1962
2037
|
_: 1
|
|
@@ -1968,18 +2043,18 @@ var BusinessContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
|
|
|
1968
2043
|
__name: "BusinessDetailSidebarProvider",
|
|
1969
2044
|
props: { businessUuid: {} },
|
|
1970
2045
|
setup(e) {
|
|
1971
|
-
let
|
|
1972
|
-
return (e,
|
|
1973
|
-
default: withCtx(() => [unref(
|
|
2046
|
+
let O = e, k = useI18n(), A = useBusinessDetailQuery(computed(() => O.businessUuid)), j = computed(() => A.data.value ?? null);
|
|
2047
|
+
return (e, O) => (openBlock(), createBlock(CrmDetailContainer_default, null, {
|
|
2048
|
+
default: withCtx(() => [unref(A).isError.value ? (openBlock(), createBlock(Error_default, {
|
|
1974
2049
|
key: 0,
|
|
1975
|
-
message: unref(
|
|
1976
|
-
title: unref(
|
|
1977
|
-
}, null, 8, ["message", "title"])) : unref(
|
|
2050
|
+
message: unref(k).t("error.business_details.description"),
|
|
2051
|
+
title: unref(k).t("error.business_details.title")
|
|
2052
|
+
}, null, 8, ["message", "title"])) : unref(A).isLoading.value ? (openBlock(), createBlock(AppSkeletonLoader_default, {
|
|
1978
2053
|
key: 1,
|
|
1979
2054
|
class: "h-full"
|
|
1980
|
-
})) :
|
|
2055
|
+
})) : j.value ? (openBlock(), createBlock(BusinessDetailSidebar_default, {
|
|
1981
2056
|
key: 2,
|
|
1982
|
-
business:
|
|
2057
|
+
business: j.value
|
|
1983
2058
|
}, null, 8, ["business"])) : createCommentVNode("", !0)]),
|
|
1984
2059
|
_: 1
|
|
1985
2060
|
}));
|