Se corrigen comentarios de PR

This commit is contained in:
carlosfonseca 2024-02-06 11:04:37 -05:00
parent 01ffe3adb7
commit fd3eea70de
18 changed files with 113 additions and 179 deletions

View File

@ -48,6 +48,10 @@ body.body--dark {
background-color: var(--vn-dark); background-color: var(--vn-dark);
} }
.color-vn-label {
color: var(--vn-label);
}
.color-vn-text { .color-vn-text {
color: var(--vn-text); color: var(--vn-text);
} }

View File

@ -27,7 +27,6 @@ const companiesOptions = ref([]);
const companyId = ref(null); const companyId = ref(null);
const receiptsRef = ref(null); const receiptsRef = ref(null);
const rows = ref([]); const rows = ref([]);
const workerId = ref(null);
const filterCompanies = { order: ['code'] }; const filterCompanies = { order: ['code'] };
const params = { const params = {
@ -44,42 +43,42 @@ const tableColumnComponents = {
payed: { payed: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
created: { created: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
userName: { userName: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue' }),
event: ({ row }) => (workerId.value = row.clientFk), event: () => {},
}, },
description: { description: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
bankFk: { bankFk: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
debit: { debit: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
credit: { credit: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
balance: { balance: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
isConciliate: { isConciliate: {
component: QCheckbox, component: QCheckbox,
@ -87,7 +86,7 @@ const tableColumnComponents = {
disable: true, disable: true,
'model-value': Boolean(prop.value), 'model-value': Boolean(prop.value),
}), }),
event: () => (workerId.value = null), event: () => {},
}, },
}; };
@ -207,11 +206,11 @@ const updateCompanyId = (id) => {
<QTable <QTable
:columns="columns" :columns="columns"
:no-data-label="t('globals.noResults')"
:pagination="{ rowsPerPage: 12 }" :pagination="{ rowsPerPage: 12 }"
:rows="rows" :rows="rows"
class="full-width q-mt-md" class="full-width q-mt-md"
row-key="id" row-key="id"
v-if="rows?.length"
> >
<template #body-cell="props"> <template #body-cell="props">
<QTd :props="props"> <QTd :props="props">
@ -225,17 +224,16 @@ const updateCompanyId = (id) => {
<template v-if="props.col.name !== 'isConciliate'"> <template v-if="props.col.name !== 'isConciliate'">
{{ props.value }} {{ props.value }}
</template> </template>
<WorkerDescriptorProxy :id="workerId" /> <WorkerDescriptorProxy
:id="props.row.clientFk"
v-if="props.col.name === 'userName'"
/>
</component> </component>
</QTr> </QTr>
</QTd> </QTd>
</template> </template>
</QTable> </QTable>
<h5 class="flex justify-center label-color" v-else>
{{ t('globals.noResults') }}
</h5>
<QDrawer :width="256" show-if-above side="right" v-model="stateStore.rightDrawer"> <QDrawer :width="256" show-if-above side="right" v-model="stateStore.rightDrawer">
<div class="q-mt-xl q-px-md"> <div class="q-mt-xl q-px-md">
<VnSelectFilter <VnSelectFilter

View File

@ -5,17 +5,11 @@ const { t } = useI18n();
</script> </script>
<template> <template>
<h5 class="flex justify-center label-color"> <h5 class="flex justify-center color-vn-label">
{{ t('Enter a new search') }} {{ t('Enter a new search') }}
</h5> </h5>
</template> </template>
<style lang="scss">
.label-color {
color: var(--vn-label);
}
</style>
<i18n> <i18n>
es: es:
Enter a new search: Introduce una nueva búsqueda Enter a new search: Introduce una nueva búsqueda

View File

@ -108,7 +108,7 @@ const updateData = () => {
<div class="q-ml-lg"> <div class="q-ml-lg">
<div class="flex q-mb-xs"> <div class="flex q-mb-xs">
<div class="q-mr-sm label-color"> <div class="q-mr-sm color-vn-label">
{{ t('Since') }}: {{ t('Since') }}:
</div> </div>
<div class="text-weight-bold"> <div class="text-weight-bold">
@ -116,7 +116,9 @@ const updateData = () => {
</div> </div>
</div> </div>
<div class="flex"> <div class="flex">
<div class="q-mr-sm label-color">{{ t('To') }}:</div> <div class="q-mr-sm color-vn-label">
{{ t('To') }}:
</div>
<div class="text-weight-bold"> <div class="text-weight-bold">
{{ toDate(item.finished) }} {{ toDate(item.finished) }}
</div> </div>
@ -129,7 +131,7 @@ const updateData = () => {
<div class="flex"> <div class="flex">
<div class="flex items-center"> <div class="flex items-center">
<div class="flex q-mr-xl"> <div class="flex q-mr-xl">
<div class="q-mr-sm label-color"> <div class="q-mr-sm color-vn-label">
{{ t('Credit') }}: {{ t('Credit') }}:
</div> </div>
<div class="text-weight-bold"> <div class="text-weight-bold">
@ -137,7 +139,7 @@ const updateData = () => {
</div> </div>
</div> </div>
<div class="flex q-mr-xl"> <div class="flex q-mr-xl">
<div class="q-mr-sm label-color"> <div class="q-mr-sm color-vn-label">
{{ t('Grade') }}: {{ t('Grade') }}:
</div> </div>
<div class="text-weight-bold"> <div class="text-weight-bold">
@ -145,7 +147,7 @@ const updateData = () => {
</div> </div>
</div> </div>
<div class="flex"> <div class="flex">
<div class="q-mr-sm label-color"> <div class="q-mr-sm color-vn-label">
{{ t('Date') }}: {{ t('Date') }}:
</div> </div>
<div class="text-weight-bold"> <div class="text-weight-bold">
@ -167,7 +169,7 @@ const updateData = () => {
</div> </div>
</QCard> </QCard>
</div> </div>
<h5 class="flex justify-center label-color" v-else> <h5 class="flex justify-center color-vn-label" v-else>
{{ t('globals.noResults') }} {{ t('globals.noResults') }}
</h5> </h5>
</template> </template>
@ -188,9 +190,6 @@ const updateData = () => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.label-color {
color: var(--vn-label);
}
.customer-card { .customer-card {
border: 2px solid var(--vn-light-gray); border: 2px solid var(--vn-light-gray);
border-radius: 10px; border-radius: 10px;

View File

@ -14,7 +14,6 @@ const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const workerId = ref(null);
const rows = ref([]); const rows = ref([]);
const filter = { const filter = {
@ -36,17 +35,17 @@ const tableColumnComponents = {
created: { created: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
employee: { employee: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue' }),
event: ({ row }) => (workerId.value = row.clientFk), event: () => {},
}, },
amount: { amount: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
}; };
@ -105,7 +104,10 @@ const toCustomerCreditCreate = () => {
v-bind="tableColumnComponents[props.col.name].props(props)" v-bind="tableColumnComponents[props.col.name].props(props)"
> >
{{ props.value }} {{ props.value }}
<WorkerDescriptorProxy :id="workerId" /> <WorkerDescriptorProxy
:id="props.row.clientFk"
v-if="props.col.name === 'employee'"
/>
</component> </component>
</QTr> </QTr>
</QTd> </QTd>

View File

@ -16,7 +16,6 @@ const router = useRouter();
const ClientDmsRef = ref(null); const ClientDmsRef = ref(null);
const rows = ref([]); const rows = ref([]);
const workerId = ref(null);
const filter = { const filter = {
include: { include: {
@ -53,27 +52,27 @@ const tableColumnComponents = {
id: { id: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
type: { type: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
order: { order: {
component: QBadge, component: QBadge,
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
reference: { reference: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
description: { description: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
original: { original: {
component: QCheckbox, component: QCheckbox,
@ -81,24 +80,22 @@ const tableColumnComponents = {
disable: true, disable: true,
'model-value': Boolean(prop.value), 'model-value': Boolean(prop.value),
}), }),
event: () => (workerId.value = null), event: () => {},
}, },
file: { file: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue' }),
event: ({ row }) => { event: ({ row }) => downloadFile(row.dmsFk),
setDownloadFile(row);
},
}, },
employee: { employee: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue' }),
event: ({ row }) => (workerId.value = row.clientFk), event: () => {},
}, },
created: { created: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
actions: { actions: {
component: CustomerFileManagementActions, component: CustomerFileManagementActions,
@ -106,7 +103,7 @@ const tableColumnComponents = {
id: prop.row.dmsFk, id: prop.row.dmsFk,
promise: setData, promise: setData,
}), }),
event: () => (workerId.value = null), event: () => {},
}, },
}; };
@ -174,11 +171,6 @@ const columns = computed(() => [
}, },
]); ]);
const setDownloadFile = (row) => {
downloadFile(row.dmsFk);
workerId.value = null;
};
const setData = () => { const setData = () => {
ClientDmsRef.value.fetch(); ClientDmsRef.value.fetch();
}; };
@ -222,7 +214,10 @@ const toCustomerFileManagementCreate = () => {
<template v-if="props.col.name !== 'original'"> <template v-if="props.col.name !== 'original'">
{{ props.value }} {{ props.value }}
</template> </template>
<WorkerDescriptorProxy :id="workerId" /> <WorkerDescriptorProxy
:id="props.row.clientFk"
v-if="props.col.name === 'employee'"
/>
</component> </component>
</QTr> </QTr>
</QTd> </QTd>

View File

@ -16,7 +16,6 @@ const router = useRouter();
const rows = ref([]); const rows = ref([]);
const totalAmount = ref(0); const totalAmount = ref(0);
const workerId = ref(null);
const filter = { const filter = {
include: [ include: [
@ -44,27 +43,27 @@ const tableColumnComponents = {
date: { date: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
createdBy: { createdBy: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue' }),
event: ({ row }) => (workerId.value = row.clientFk), event: () => {},
}, },
comment: { comment: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
type: { type: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
amount: { amount: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
}; };
@ -121,18 +120,18 @@ const toCustomerGreugeCreate = () => {
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<QCard class="full-width" v-if="totalAmount"> <QCard class="full-width" v-if="totalAmount">
<h6 class="flex justify-end q-my-lg q-pr-lg"> <h6 class="flex justify-end q-my-lg q-pr-lg">
<span class="label-color q-mr-md">{{ t('Total') }}:</span> <span class="color-vn-label q-mr-md">{{ t('Total') }}:</span>
{{ toCurrency(totalAmount) }} {{ toCurrency(totalAmount) }}
</h6> </h6>
</QCard> </QCard>
<QTable <QTable
:columns="columns" :columns="columns"
:no-data-label="t('globals.noResults')"
:pagination="{ rowsPerPage: 12 }" :pagination="{ rowsPerPage: 12 }"
:rows="rows" :rows="rows"
class="full-width q-mt-md" class="full-width q-mt-md"
row-key="id" row-key="id"
v-if="rows?.length"
> >
<template #body-cell="props"> <template #body-cell="props">
<QTd :props="props"> <QTd :props="props">
@ -144,18 +143,15 @@ const toCustomerGreugeCreate = () => {
@click="tableColumnComponents[props.col.name].event(props)" @click="tableColumnComponents[props.col.name].event(props)"
> >
{{ props.value }} {{ props.value }}
<WorkerDescriptorProxy :id="workerId" /> <WorkerDescriptorProxy
:id="props.row.clientFk"
v-if="props.col.name === 'createdBy'"
/>
</component> </component>
</QTr> </QTr>
</QTd> </QTd>
</template> </template>
</QTable> </QTable>
<QCard class="full-width" v-else>
<h5 class="flex justify-center label-color">
{{ t('globals.noResults') }}
</h5>
</QCard>
</QPage> </QPage>
<QPageSticky :offset="[18, 18]"> <QPageSticky :offset="[18, 18]">
@ -172,10 +168,6 @@ const toCustomerGreugeCreate = () => {
border-radius: 10px; border-radius: 10px;
padding: 10px; padding: 10px;
} }
.label-color {
color: var(--vn-label);
}
</style> </style>
<i18n> <i18n>

View File

@ -124,7 +124,7 @@ const setInq = (value, status) => {
:url="urlClientLogsModels" :url="urlClientLogsModels"
/> />
<h5 class="flex justify-center label-color"> <h5 class="flex justify-center color-vn-label">
{{ t('globals.noResults') }} {{ t('globals.noResults') }}
</h5> </h5>

View File

@ -5,13 +5,7 @@ const { t } = useI18n();
</script> </script>
<template> <template>
<h5 class="flex justify-center label-color"> <h5 class="flex justify-center color-vn-label">
{{ t('globals.noResults') }} {{ t('globals.noResults') }}
</h5> </h5>
</template> </template>
<style lang="scss">
.label-color {
color: var(--vn-label);
}
</style>

View File

@ -43,8 +43,8 @@ const toCustomerNoteCreate = () => {
}" }"
> >
<div class="flex justify-between"> <div class="flex justify-between">
<p class="label-color">{{ item.worker.user.nickname }}</p> <p class="color-vn-label">{{ item.worker.user.nickname }}</p>
<p class="label-color"> <p class="color-vn-label">
{{ {{
date.formatDate(item?.created, 'DD-MM-YYYY HH:mm:ss') date.formatDate(item?.created, 'DD-MM-YYYY HH:mm:ss')
}} }}
@ -55,7 +55,7 @@ const toCustomerNoteCreate = () => {
</div> </div>
<div v-else> <div v-else>
<h5 class="flex justify-center label-color"> <h5 class="flex justify-center color-vn-label">
{{ t('globals.noResults') }} {{ t('globals.noResults') }}
</h5> </h5>
</div> </div>
@ -89,8 +89,4 @@ const toCustomerNoteCreate = () => {
border-radius: 10px; border-radius: 10px;
padding: 10px; padding: 10px;
} }
.label-color {
color: var(--vn-label);
}
</style> </style>

View File

@ -89,11 +89,11 @@ const toCustomerRecoverieCreate = () => {
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<QTable <QTable
:columns="columns" :columns="columns"
:no-data-label="t('globals.noResults')"
:pagination="{ rowsPerPage: 12 }" :pagination="{ rowsPerPage: 12 }"
:rows="rows" :rows="rows"
class="full-width q-mt-md" class="full-width q-mt-md"
row-key="id" row-key="id"
v-if="rows?.length"
> >
<template #body-cell="props"> <template #body-cell="props">
<QTd :props="props"> <QTd :props="props">
@ -110,12 +110,6 @@ const toCustomerRecoverieCreate = () => {
</QTd> </QTd>
</template> </template>
</QTable> </QTable>
<QCard class="full-width" v-else>
<h5 class="flex justify-center label-color">
{{ t('globals.noResults') }}
</h5>
</QCard>
</QPage> </QPage>
<QPageSticky :offset="[18, 18]"> <QPageSticky :offset="[18, 18]">
@ -132,10 +126,6 @@ const toCustomerRecoverieCreate = () => {
border-radius: 10px; border-radius: 10px;
padding: 10px; padding: 10px;
} }
.label-color {
color: var(--vn-label);
}
</style> </style>
<i18n> <i18n>

View File

@ -12,7 +12,6 @@ const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const workerId = ref(null);
const rows = ref([]); const rows = ref([]);
const filter = { const filter = {
@ -30,22 +29,22 @@ const tableColumnComponents = {
sent: { sent: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
description: { description: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
worker: { worker: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue' }),
event: ({ row }) => (workerId.value = row.clientFk), event: () => {},
}, },
company: { company: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => (workerId.value = null), event: () => {},
}, },
}; };
@ -97,7 +96,7 @@ const toCustomerSamplesCreate = () => {
:rows="rows" :rows="rows"
class="full-width q-mt-md" class="full-width q-mt-md"
row-key="id" row-key="id"
v-if="rows?.length" :no-data-label="t('globals.noResults')"
> >
<template #body-cell="props"> <template #body-cell="props">
<QTd :props="props"> <QTd :props="props">
@ -109,18 +108,15 @@ const toCustomerSamplesCreate = () => {
@click="tableColumnComponents[props.col.name].event(props)" @click="tableColumnComponents[props.col.name].event(props)"
> >
{{ props.value }} {{ props.value }}
<WorkerDescriptorProxy :id="workerId" /> <WorkerDescriptorProxy
:id="props.row.clientFk"
v-if="props.col.name === 'worker'"
/>
</component> </component>
</QTr> </QTr>
</QTd> </QTd>
</template> </template>
</QTable> </QTable>
<QCard class="full-width" v-else>
<h5 class="flex justify-center label-color">
{{ t('globals.noResults') }}
</h5>
</QCard>
</QPage> </QPage>
<QPageSticky :offset="[18, 18]"> <QPageSticky :offset="[18, 18]">
@ -137,10 +133,6 @@ const toCustomerSamplesCreate = () => {
border-radius: 10px; border-radius: 10px;
padding: 10px; padding: 10px;
} }
.label-color {
color: var(--vn-label);
}
</style> </style>
<i18n> <i18n>

View File

@ -5,13 +5,7 @@ const { t } = useI18n();
</script> </script>
<template> <template>
<h5 class="flex justify-center label-color"> <h5 class="flex justify-center color-vn-label">
{{ t('globals.noResults') }} {{ t('globals.noResults') }}
</h5> </h5>
</template> </template>
<style lang="scss">
.label-color {
color: var(--vn-label);
}
</style>

View File

@ -17,7 +17,6 @@ const { t } = useI18n();
const quasar = useQuasar(); const quasar = useQuasar();
const balanceDueTotal = ref(0); const balanceDueTotal = ref(0);
const customerId = ref(0);
const selected = ref([]); const selected = ref([]);
const workerId = ref(0); const workerId = ref(0);
const rows = ref([]); const rows = ref([]);
@ -26,7 +25,7 @@ const tableColumnComponents = {
client: { client: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue' }),
event: ({ row }) => selectCustomerId(row.clientFk), event: () => {},
}, },
isWorker: { isWorker: {
component: QCheckbox, component: QCheckbox,
@ -35,10 +34,10 @@ const tableColumnComponents = {
'model-value': Boolean(row.selected), 'model-value': Boolean(row.selected),
}), }),
}, },
salesperson: { salesPerson: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue' }),
event: ({ row }) => selectWorkerId(row.salesPersonFk), event: () => {},
}, },
country: { country: {
component: 'span', component: 'span',
@ -58,7 +57,7 @@ const tableColumnComponents = {
author: { author: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue' }),
event: ({ row }) => selectWorkerId(row.workerFk), event: () => {},
}, },
lastObservation: { lastObservation: {
component: 'span', component: 'span',
@ -99,7 +98,7 @@ const columns = computed(() => [
align: 'left', align: 'left',
field: 'salesPersonName', field: 'salesPersonName',
label: t('Salesperson'), label: t('Salesperson'),
name: 'salesperson', name: 'salesPerson',
}, },
{ {
align: 'left', align: 'left',
@ -158,16 +157,6 @@ const setRows = (data) => {
}, 0); }, 0);
}; };
const selectCustomerId = (id) => {
workerId.value = 0;
customerId.value = id;
};
const selectWorkerId = (id) => {
customerId.value = 0;
workerId.value = id;
};
const viewAddObservation = (rowsSelected) => { const viewAddObservation = (rowsSelected) => {
quasar.dialog({ quasar.dialog({
component: CustomerDefaulterAddObservation, component: CustomerDefaulterAddObservation,
@ -233,8 +222,18 @@ const refreshData = () => {
> >
{{ props.value }} {{ props.value }}
<WorkerDescriptorProxy v-if="workerId" :id="workerId" /> <WorkerDescriptorProxy
<CustomerDescriptorProxy v-else :id="customerId" /> :id="props.row.salesPersonFk"
v-if="props.col.name === 'salesPerson'"
/>
<WorkerDescriptorProxy
:id="props.row.workerFk"
v-if="props.col.name === 'author'"
/>
<CustomerDescriptorProxy
:id="props.row.clientFk"
v-if="props.col.name === 'client'"
/>
</component> </component>
</QTr> </QTr>
</QTd> </QTd>

View File

@ -3,7 +3,9 @@ import { ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import axios from 'axios'; import axios from 'axios';
import { useDialogPluginComponent, useQuasar } from 'quasar'; import { useDialogPluginComponent } from 'quasar';
import useNotify from 'src/composables/useNotify';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
@ -19,8 +21,8 @@ const $props = defineProps({
}); });
const { dialogRef } = useDialogPluginComponent(); const { dialogRef } = useDialogPluginComponent();
const { notify } = useNotify();
const { t } = useI18n(); const { t } = useI18n();
const quasar = useQuasar();
const newObservation = ref(null); const newObservation = ref(null);
@ -39,15 +41,9 @@ const onSubmit = async () => {
await $props.promise(); await $props.promise();
quasar.notify({ notify('globals.dataSaved', 'positive');
message: t('globals.dataSaved'),
type: 'positive',
});
} catch (error) { } catch (error) {
quasar.notify({ notify(error.message, 'negative');
message: t(`${error.message}`),
type: 'negative',
});
} }
}; };
</script> </script>

View File

@ -4,17 +4,17 @@ import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import axios from 'axios'; import axios from 'axios';
import { useQuasar } from 'quasar';
import { useState } from 'src/composables/useState'; import { useState } from 'src/composables/useState';
import useNotify from 'src/composables/useNotify';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
const { notify } = useNotify();
const { t } = useI18n(); const { t } = useI18n();
const quasar = useQuasar();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const state = useState(); const state = useState();
@ -64,16 +64,10 @@ const saveData = async () => {
await axios.post(url, formData, { await axios.post(url, formData, {
params: dms.value, params: dms.value,
}); });
quasar.notify({ notify('globals.dataSaved', 'positive');
message: t('globals.dataSaved'),
type: 'positive',
});
router.push({ name: 'CustomerFileManagement' }); router.push({ name: 'CustomerFileManagement' });
} catch (error) { } catch (error) {
quasar.notify({ notify(error.message, 'negative');
message: t(`${error.message}`),
type: 'negative',
});
} }
}; };

View File

@ -2,9 +2,11 @@
import { ref } from 'vue'; import { ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useDialogPluginComponent, useQuasar } from 'quasar'; import { useDialogPluginComponent } from 'quasar';
import axios from 'axios'; import axios from 'axios';
import useNotify from 'src/composables/useNotify';
const $props = defineProps({ const $props = defineProps({
id: { id: {
type: Number, type: Number,
@ -17,8 +19,8 @@ const $props = defineProps({
}); });
const { dialogRef } = useDialogPluginComponent(); const { dialogRef } = useDialogPluginComponent();
const { notify } = useNotify();
const { t } = useI18n(); const { t } = useI18n();
const quasar = useQuasar();
const closeButton = ref(null); const closeButton = ref(null);
const isLoading = ref(false); const isLoading = ref(false);
@ -28,11 +30,9 @@ const deleteDms = async () => {
try { try {
await axios.post(`ClientDms/${$props.id}/removeFile`); await axios.post(`ClientDms/${$props.id}/removeFile`);
if ($props.promise) await $props.promise(); if ($props.promise) await $props.promise();
notify('globals.dataDeleted', 'positive');
} catch (error) { } catch (error) {
quasar.notify({ notify(error.message, 'negative');
message: t(`${error.message}`),
type: 'negative',
});
} finally { } finally {
closeButton.value.click(); closeButton.value.click();
isLoading.value = false; isLoading.value = false;

View File

@ -4,15 +4,16 @@ import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import axios from 'axios'; import axios from 'axios';
import { useQuasar } from 'quasar';
import useNotify from 'src/composables/useNotify';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
const { notify } = useNotify();
const { t } = useI18n(); const { t } = useI18n();
const quasar = useQuasar();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
@ -51,16 +52,10 @@ const saveData = async () => {
params: dms.value, params: dms.value,
}); });
quasar.notify({ notify('globals.dataSaved', 'positive');
message: t('globals.dataSaved'),
type: 'positive',
});
router.push({ name: 'CustomerFileManagement' }); router.push({ name: 'CustomerFileManagement' });
} catch (error) { } catch (error) {
quasar.notify({ notify(error.message, 'negative');
message: t(`${error.message}`),
type: 'negative',
});
} }
}; };