8627-devToTest #1421
|
@ -46,7 +46,11 @@ onBeforeMount(async () => {
|
||||||
if (!props.idInWhere) {
|
if (!props.idInWhere) {
|
||||||
onBeforeRouteUpdate(async (to, from) => {
|
onBeforeRouteUpdate(async (to, from) => {
|
||||||
if (to.params.id !== from.params.id) {
|
if (to.params.id !== from.params.id) {
|
||||||
arrayData.store.url = `${props.url}/${to.params.id}`;
|
const regex = /(\/\d+)/;
|
||||||
|
arrayData.store.url = !regex.test(props.url)
|
||||||
|
? `${props.url}/${to.params.id}`
|
||||||
|
: props.url.replace(regex, `/${to.params.id}`);
|
||||||
|
|
||||||
await arrayData.fetch({ append: false, updateRouter: false });
|
await arrayData.fetch({ append: false, updateRouter: false });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,7 +12,7 @@ const routeName = computed(() => route.name);
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCard
|
||||||
data-key="Client"
|
data-key="Client"
|
||||||
url="Clients"
|
:url="`Clients/${$route.params.id}/getCard`"
|
||||||
:descriptor="CustomerDescriptor"
|
:descriptor="CustomerDescriptor"
|
||||||
:filter-panel="routeName != 'CustomerConsumption' && CustomerFilter"
|
:filter-panel="routeName != 'CustomerConsumption' && CustomerFilter"
|
||||||
search-data-key="CustomerList"
|
search-data-key="CustomerList"
|
||||||
|
|
|
@ -47,7 +47,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
data-key="customer"
|
data-key="Client"
|
||||||
>
|
>
|
||||||
<template #menu="{ entity }">
|
<template #menu="{ entity }">
|
||||||
<CustomerDescriptorMenu :customer="entity" />
|
<CustomerDescriptorMenu :customer="entity" />
|
||||||
|
|
Loading…
Reference in New Issue