6822-createEntryTransferOption #1267
|
@ -75,6 +75,7 @@ const focus = () => {
|
|||
|
||||
defineExpose({
|
||||
focus,
|
||||
vnInputRef,
|
||||
});
|
||||
|
||||
const mixinRules = [
|
||||
|
|
|
@ -804,7 +804,7 @@ watch(
|
|||
<QItem class="q-mt-sm">
|
||||
<QInput
|
||||
class="full-width"
|
||||
:label="t('to')"
|
||||
:label="t('globals.to')"
|
||||
@click="dateToDialog = true"
|
||||
@focus="(evt) => evt.target.blur()"
|
||||
@clear="selectFilter('date', 'from')"
|
||||
|
@ -1059,9 +1059,9 @@ en:
|
|||
Deletes: Deletes
|
||||
Accesses: Accesses
|
||||
Users:
|
||||
User: Usuario
|
||||
All: Todo
|
||||
System: Sistema
|
||||
User: User
|
||||
All: All
|
||||
System: System
|
||||
properties:
|
||||
id: ID
|
||||
claimFk: Claim ID
|
||||
|
|
|
@ -94,8 +94,8 @@ function checkIsMain() {
|
|||
/>
|
||||
<div :id="searchbarId"></div>
|
||||
</slot>
|
||||
<RightAdvancedMenu :is-main-section="isMainSection">
|
||||
<template #advanced-menu v-if="$slots[advancedMenuSlot] || rightFilter">
|
||||
<RightAdvancedMenu :is-main-section="isMainSection && rightFilter">
|
||||
<template #advanced-menu v-if="$slots[advancedMenuSlot]">
|
||||
<slot :name="advancedMenuSlot">
|
||||
<VnTableFilter
|
||||
v-if="rightFilter && columns"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import { onBeforeMount, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
import { useQuasar } from 'quasar';
|
||||
import axios from 'axios';
|
||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
|
@ -13,11 +13,12 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
|||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||
import CustomerNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue';
|
||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const quasar = useQuasar();
|
||||
const urlUpdate = ref('');
|
||||
const agencyModes = ref([]);
|
||||
const incoterms = ref([]);
|
||||
|
@ -83,8 +84,26 @@ const deleteNote = (id, index) => {
|
|||
notes.value.splice(index, 1);
|
||||
};
|
||||
|
||||
const onDataSaved = async () => {
|
||||
let payload = {
|
||||
const updateAddress = async (data) => {
|
||||
await axios.patch(urlUpdate.value, data);
|
||||
};
|
||||
|
||||
const updateAddressTicket = async () => {
|
||||
urlUpdate.value += '?updateObservations=true';
|
||||
};
|
||||
|
||||
const updateObservations = async (payload) => {
|
||||
await axios.post('AddressObservations/crud', payload);
|
||||
notes.value = [];
|
||||
deletes.value = [];
|
||||
toCustomerAddress();
|
||||
};
|
||||
async function updateAll({ data, payload }) {
|
||||
await updateObservations(payload);
|
||||
await updateAddress(data);
|
||||
}
|
||||
function getPayload() {
|
||||
return {
|
||||
creates: notes.value.filter((note) => note.$isNew),
|
||||
deletes: deletes.value,
|
||||
updates: notes.value
|
||||
|
@ -101,14 +120,40 @@ const onDataSaved = async () => {
|
|||
where: { id: note.id },
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
await axios.post('AddressObservations/crud', payload);
|
||||
notes.value = [];
|
||||
deletes.value = [];
|
||||
toCustomerAddress();
|
||||
};
|
||||
async function handleDialog(data) {
|
||||
const payload = getPayload();
|
||||
const body = { data, payload };
|
||||
if (payload.updates.length) {
|
||||
quasar
|
||||
.dialog({
|
||||
component: VnConfirm,
|
||||
componentProps: {
|
||||
title: t(
|
||||
'confirmTicket'
|
||||
),
|
||||
message: t('confirmDeletionMessage'),
|
||||
},
|
||||
})
|
||||
.onOk(async () => {
|
||||
await updateAddressTicket();
|
||||
await updateAll(body);
|
||||
toCustomerAddress();
|
||||
})
|
||||
.onCancel(async () => {
|
||||
await updateAll(body);
|
||||
toCustomerAddress();
|
||||
});
|
||||
} else {
|
||||
updateAll(body);
|
||||
toCustomerAddress();
|
||||
}
|
||||
}
|
||||
|
||||
const toCustomerAddress = () => {
|
||||
notes.value = [];
|
||||
deletes.value = [];
|
||||
router.push({
|
||||
name: 'CustomerAddress',
|
||||
params: {
|
||||
|
@ -143,7 +188,7 @@ function handleLocation(data, location) {
|
|||
:observe-form-changes="false"
|
||||
:url-update="urlUpdate"
|
||||
:url="`Addresses/${route.params.addressId}`"
|
||||
@on-data-saved="onDataSaved()"
|
||||
:save-fn="handleDialog"
|
||||
auto-load
|
||||
>
|
||||
<template #moreActions>
|
||||
|
@ -336,4 +381,9 @@ es:
|
|||
Remove note: Eliminar nota
|
||||
Longitude: Longitud
|
||||
Latitude: Latitud
|
||||
confirmTicket: ¿Desea modificar también los estados de todos los tickets que están a punto de ser servidos?
|
||||
confirmDeletionMessage: Si le das a aceptar, se modificaran todas las notas de los ticket a futuro
|
||||
en:
|
||||
confirmTicket: Do you also want to modify the states of all the tickets that are about to be served?
|
||||
confirmDeletionMessage: If you click accept, all the notes of the future tickets will be modified
|
||||
</i18n>
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
import { describe, it, expect, vi, afterEach } from 'vitest';
|
||||
import axios from 'axios';
|
||||
import { getAddresses } from 'src/pages/Customer/composables/getAddresses';
|
||||
|
||||
vi.mock('axios');
|
||||
|
||||
describe('getAddresses', () => {
|
||||
afterEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it('should fetch addresses with correct parameters for a valid clientId', async () => {
|
||||
const clientId = '12345';
|
||||
|
||||
await getAddresses(clientId);
|
||||
|
||||
expect(axios.get).toHaveBeenCalledWith(`Clients/${clientId}/addresses`, {
|
||||
params: {
|
||||
filter: JSON.stringify({
|
||||
fields: ['nickname', 'street', 'city', 'id'],
|
||||
where: { isActive: true },
|
||||
order: 'nickname ASC',
|
||||
}),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('should return undefined when clientId is not provided', async () => {
|
||||
await getAddresses(undefined);
|
||||
|
||||
expect(axios.get).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,41 @@
|
|||
import { describe, it, expect, vi, afterEach } from 'vitest';
|
||||
import axios from 'axios';
|
||||
import { getClient } from 'src/pages/Customer/composables/getClient';
|
||||
|
||||
vi.mock('axios');
|
||||
|
||||
describe('getClient', () => {
|
||||
afterEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
const generateParams = (clientId) => ({
|
||||
params: {
|
||||
filter: JSON.stringify({
|
||||
include: {
|
||||
relation: 'defaultAddress',
|
||||
scope: {
|
||||
fields: ['id', 'agencyModeFk'],
|
||||
},
|
||||
},
|
||||
where: { id: clientId },
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
it('should fetch client data with correct parameters for a valid clientId', async () => {
|
||||
const clientId = '12345';
|
||||
|
||||
await getClient(clientId);
|
||||
|
||||
expect(axios.get).toHaveBeenCalledWith('Clients', generateParams(clientId));
|
||||
});
|
||||
|
||||
it('should return undefined when clientId is not provided', async () => {
|
||||
const clientId = undefined;
|
||||
|
||||
await getClient(clientId);
|
||||
|
||||
expect(axios.get).toHaveBeenCalledWith('Clients', generateParams(clientId));
|
||||
});
|
||||
});
|
|
@ -0,0 +1,14 @@
|
|||
import axios from 'axios';
|
||||
|
||||
export async function getAddresses(clientId) {
|
||||
if (!clientId) return;
|
||||
const filter = {
|
||||
fields: ['nickname', 'street', 'city', 'id'],
|
||||
where: { isActive: true },
|
||||
order: 'nickname ASC',
|
||||
};
|
||||
const params = { filter: JSON.stringify(filter) };
|
||||
return await axios.get(`Clients/${clientId}/addresses`, {
|
||||
params,
|
||||
});
|
||||
};
|
|
@ -0,0 +1,15 @@
|
|||
import axios from 'axios';
|
||||
|
||||
export async function getClient(clientId) {
|
||||
const filter = {
|
||||
include: {
|
||||
relation: 'defaultAddress',
|
||||
scope: {
|
||||
fields: ['id', 'agencyModeFk'],
|
||||
},
|
||||
},
|
||||
where: { id: clientId },
|
||||
};
|
||||
const params = { filter: JSON.stringify(filter) };
|
||||
return await axios.get('Clients', { params });
|
||||
};
|
|
@ -268,7 +268,7 @@ function deleteFile(dmsFk) {
|
|||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('invoicein.summary.sage')"
|
||||
:label="t('invoiceIn.summary.sage')"
|
||||
v-model="data.withholdingSageFk"
|
||||
:options="sageWithholdings"
|
||||
option-value="id"
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
<script setup>
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import InvoiceInDescriptor from './InvoiceInDescriptor.vue';
|
||||
import InvoiceInFilter from '../InvoiceInFilter.vue';
|
||||
import InvoiceInSearchbar from '../InvoiceInSearchbar.vue';
|
||||
import { onBeforeRouteUpdate } from 'vue-router';
|
||||
import { setRectificative } from '../composables/setRectificative';
|
||||
|
||||
const filter = {
|
||||
include: [
|
||||
|
@ -39,20 +35,13 @@ const filter = {
|
|||
},
|
||||
],
|
||||
};
|
||||
|
||||
onBeforeRouteUpdate(async (to) => await setRectificative(to));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnCard
|
||||
<VnCardBeta
|
||||
data-key="InvoiceIn"
|
||||
base-url="InvoiceIns"
|
||||
:filter="filter"
|
||||
:descriptor="InvoiceInDescriptor"
|
||||
:filter-panel="InvoiceInFilter"
|
||||
search-data-key="InvoiceInList"
|
||||
>
|
||||
<template #searchbar>
|
||||
<InvoiceInSearchbar />
|
||||
</template>
|
||||
</VnCard>
|
||||
:user-filter="filter"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -105,7 +105,7 @@ async function setInvoiceCorrection(id) {
|
|||
if (correctingData[0]) invoiceInCorrection.corrected = correctingData[0].correctedFk;
|
||||
|
||||
invoiceInCorrection.correcting = correctedData.map(
|
||||
(corrected) => corrected.correctingFk
|
||||
(corrected) => corrected.correctingFk,
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
@ -122,13 +122,13 @@ async function setInvoiceCorrection(id) {
|
|||
<InvoiceInDescriptorMenu :invoice="entity" />
|
||||
</template>
|
||||
<template #body="{ entity }">
|
||||
<VnLv :label="t('invoicein.list.issued')" :value="toDate(entity.issued)" />
|
||||
<VnLv :label="t('invoiceIn.list.issued')" :value="toDate(entity.issued)" />
|
||||
<VnLv
|
||||
:label="t('invoicein.summary.bookedDate')"
|
||||
:label="t('invoiceIn.summary.bookedDate')"
|
||||
:value="toDate(entity.booked)"
|
||||
/>
|
||||
<VnLv :label="t('invoicein.list.amount')" :value="toCurrency(totalAmount)" />
|
||||
<VnLv :label="t('invoicein.list.supplier')">
|
||||
<VnLv :label="t('invoiceIn.list.amount')" :value="toCurrency(totalAmount)" />
|
||||
<VnLv :label="t('invoiceIn.list.supplier')">
|
||||
<template #value>
|
||||
<span class="link">
|
||||
{{ entity?.supplier?.nickname }}
|
||||
|
@ -145,7 +145,7 @@ async function setInvoiceCorrection(id) {
|
|||
color="primary"
|
||||
:to="routes.getSupplier(entity.supplierFk)"
|
||||
>
|
||||
<QTooltip>{{ t('invoicein.list.supplier') }}</QTooltip>
|
||||
<QTooltip>{{ t('globals.supplier') }}</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn
|
||||
size="md"
|
||||
|
@ -153,7 +153,7 @@ async function setInvoiceCorrection(id) {
|
|||
color="primary"
|
||||
:to="routes.getEntry(entity.entryFk)"
|
||||
>
|
||||
<QTooltip>{{ t('Entry') }}</QTooltip>
|
||||
<QTooltip>{{ t('globals.entry') }}</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn
|
||||
size="md"
|
||||
|
@ -161,7 +161,7 @@ async function setInvoiceCorrection(id) {
|
|||
color="primary"
|
||||
:to="routes.getTickets(entity.supplierFk)"
|
||||
>
|
||||
<QTooltip>{{ t('InvoiceOut.card.ticketList') }}</QTooltip>
|
||||
<QTooltip>{{ t('globals.ticketList') }}</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn
|
||||
v-if="
|
||||
|
|
|
@ -40,15 +40,15 @@ const cplusRectificationTypes = ref([]);
|
|||
const siiTypeInvoiceIns = ref([]);
|
||||
const actions = {
|
||||
unbook: {
|
||||
title: t('assertAction', { action: t('invoicein.descriptorMenu.unbook') }),
|
||||
title: t('assertAction', { action: t('invoiceIn.descriptorMenu.unbook') }),
|
||||
action: toUnbook,
|
||||
},
|
||||
delete: {
|
||||
title: t('assertAction', { action: t('invoicein.descriptorMenu.delete') }),
|
||||
title: t('assertAction', { action: t('invoiceIn.descriptorMenu.delete') }),
|
||||
action: deleteInvoice,
|
||||
},
|
||||
clone: {
|
||||
title: t('assertAction', { action: t('invoicein.descriptorMenu.clone') }),
|
||||
title: t('assertAction', { action: t('invoiceIn.descriptorMenu.clone') }),
|
||||
action: cloneInvoice,
|
||||
},
|
||||
showPdf: { cb: showPdfInvoice },
|
||||
|
@ -96,7 +96,7 @@ async function deleteInvoice() {
|
|||
await axios.delete(`InvoiceIns/${entityId.value}`);
|
||||
quasar.notify({
|
||||
type: 'positive',
|
||||
message: t('invoicein.descriptorMenu.invoiceDeleted'),
|
||||
message: t('invoiceIn.descriptorMenu.invoiceDeleted'),
|
||||
});
|
||||
push({ path: '/invoice-in' });
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ async function cloneInvoice() {
|
|||
const { data } = await axios.post(`InvoiceIns/${entityId.value}/clone`);
|
||||
quasar.notify({
|
||||
type: 'positive',
|
||||
message: t('invoicein.descriptorMenu.invoiceCloned'),
|
||||
message: t('invoiceIn.descriptorMenu.invoiceCloned'),
|
||||
});
|
||||
push({ path: `/invoice-in/${data.id}/summary` });
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ function sendPdfInvoice({ address }) {
|
|||
const createInvoiceInCorrection = async () => {
|
||||
const { data: correctingId } = await axios.post(
|
||||
'InvoiceIns/corrective',
|
||||
Object.assign(correctionFormData, { id: entityId.value })
|
||||
Object.assign(correctionFormData, { id: entityId.value }),
|
||||
);
|
||||
push({ path: `/invoice-in/${correctingId}/summary` });
|
||||
};
|
||||
|
@ -186,7 +186,7 @@ const createInvoiceInCorrection = async () => {
|
|||
clickable
|
||||
@click="book(entityId)"
|
||||
>
|
||||
<QItemSection>{{ t('invoicein.descriptorMenu.toBook') }}</QItemSection>
|
||||
<QItemSection>{{ t('invoiceIn.descriptorMenu.toBook') }}</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</InvoiceInToBook>
|
||||
|
@ -197,7 +197,7 @@ const createInvoiceInCorrection = async () => {
|
|||
@click="triggerMenu('unbook')"
|
||||
>
|
||||
<QItemSection>
|
||||
{{ t('invoicein.descriptorMenu.toUnbook') }}
|
||||
{{ t('invoiceIn.descriptorMenu.toUnbook') }}
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem
|
||||
|
@ -206,19 +206,19 @@ const createInvoiceInCorrection = async () => {
|
|||
clickable
|
||||
@click="triggerMenu('delete')"
|
||||
>
|
||||
<QItemSection>{{ t('invoicein.descriptorMenu.deleteInvoice') }}</QItemSection>
|
||||
<QItemSection>{{ t('invoiceIn.descriptorMenu.deleteInvoice') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-if="canEditProp('clone')" v-ripple clickable @click="triggerMenu('clone')">
|
||||
<QItemSection>{{ t('invoicein.descriptorMenu.cloneInvoice') }}</QItemSection>
|
||||
<QItemSection>{{ t('invoiceIn.descriptorMenu.cloneInvoice') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('showPdf')">
|
||||
<QItemSection>{{
|
||||
t('invoicein.descriptorMenu.showAgriculturalPdf')
|
||||
t('invoiceIn.descriptorMenu.showAgriculturalPdf')
|
||||
}}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('sendPdf')">
|
||||
<QItemSection
|
||||
>{{ t('invoicein.descriptorMenu.sendAgriculturalPdf') }}...</QItemSection
|
||||
>{{ t('invoiceIn.descriptorMenu.sendAgriculturalPdf') }}...</QItemSection
|
||||
>
|
||||
</QItem>
|
||||
<QItem
|
||||
|
@ -228,7 +228,7 @@ const createInvoiceInCorrection = async () => {
|
|||
@click="triggerMenu('correct')"
|
||||
>
|
||||
<QItemSection
|
||||
>{{ t('invoicein.descriptorMenu.createCorrective') }}...</QItemSection
|
||||
>{{ t('invoiceIn.descriptorMenu.createCorrective') }}...</QItemSection
|
||||
>
|
||||
</QItem>
|
||||
<QItem v-if="invoice.dmsFk" v-ripple clickable @click="downloadFile(invoice.dmsFk)">
|
||||
|
@ -272,7 +272,6 @@ const createInvoiceInCorrection = async () => {
|
|||
>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
{{ console.log('opt: ', opt) }}
|
||||
<QItemSection>
|
||||
<QItemLabel
|
||||
>{{ opt.id }} -
|
||||
|
|
|
@ -27,14 +27,14 @@ const intrastatTotals = ref({ amount: 0, net: 0, stems: 0 });
|
|||
const vatColumns = ref([
|
||||
{
|
||||
name: 'expense',
|
||||
label: 'invoicein.summary.expense',
|
||||
label: 'invoiceIn.summary.expense',
|
||||
field: (row) => row.expenseFk,
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'landed',
|
||||
label: 'invoicein.summary.taxableBase',
|
||||
label: 'invoiceIn.summary.taxableBase',
|
||||
field: (row) => row.taxableBase,
|
||||
format: (value) => toCurrency(value),
|
||||
sortable: true,
|
||||
|
@ -42,7 +42,7 @@ const vatColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'vat',
|
||||
label: 'invoicein.summary.sageVat',
|
||||
label: 'invoiceIn.summary.sageVat',
|
||||
field: (row) => {
|
||||
if (row.taxTypeSage) return `#${row.taxTypeSage.id} : ${row.taxTypeSage.vat}`;
|
||||
},
|
||||
|
@ -52,7 +52,7 @@ const vatColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'transaction',
|
||||
label: 'invoicein.summary.sageTransaction',
|
||||
label: 'invoiceIn.summary.sageTransaction',
|
||||
field: (row) => {
|
||||
if (row.transactionTypeSage)
|
||||
return `#${row.transactionTypeSage.id} : ${row.transactionTypeSage?.transaction}`;
|
||||
|
@ -63,7 +63,7 @@ const vatColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'rate',
|
||||
label: 'invoicein.summary.rate',
|
||||
label: 'invoiceIn.summary.rate',
|
||||
field: (row) => taxRate(row.taxableBase, row.taxTypeSage?.rate),
|
||||
format: (value) => toCurrency(value),
|
||||
sortable: true,
|
||||
|
@ -71,7 +71,7 @@ const vatColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'currency',
|
||||
label: 'invoicein.summary.currency',
|
||||
label: 'invoiceIn.summary.currency',
|
||||
field: (row) => row.foreignValue,
|
||||
format: (val) => val && toCurrency(val, currency.value),
|
||||
sortable: true,
|
||||
|
@ -82,21 +82,21 @@ const vatColumns = ref([
|
|||
const dueDayColumns = ref([
|
||||
{
|
||||
name: 'date',
|
||||
label: 'invoicein.summary.dueDay',
|
||||
label: 'invoiceIn.summary.dueDay',
|
||||
field: (row) => toDate(row.dueDated),
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'bank',
|
||||
label: 'invoicein.summary.bank',
|
||||
label: 'invoiceIn.summary.bank',
|
||||
field: (row) => row.bank.bank,
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'amount',
|
||||
label: 'invoicein.list.amount',
|
||||
label: 'invoiceIn.list.amount',
|
||||
field: (row) => row.amount,
|
||||
format: (value) => toCurrency(value),
|
||||
sortable: true,
|
||||
|
@ -104,7 +104,7 @@ const dueDayColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'landed',
|
||||
label: 'invoicein.summary.foreignValue',
|
||||
label: 'invoiceIn.summary.foreignValue',
|
||||
field: (row) => row.foreignValue,
|
||||
format: (val) => val && toCurrency(val, currency.value),
|
||||
sortable: true,
|
||||
|
@ -115,7 +115,7 @@ const dueDayColumns = ref([
|
|||
const intrastatColumns = ref([
|
||||
{
|
||||
name: 'code',
|
||||
label: 'invoicein.summary.code',
|
||||
label: 'invoiceIn.summary.code',
|
||||
field: (row) => {
|
||||
return `${row.intrastat.id}: ${row.intrastat?.description}`;
|
||||
},
|
||||
|
@ -124,21 +124,21 @@ const intrastatColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'amount',
|
||||
label: 'invoicein.list.amount',
|
||||
label: 'invoiceIn.list.amount',
|
||||
field: (row) => toCurrency(row.amount),
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'net',
|
||||
label: 'invoicein.summary.net',
|
||||
label: 'invoiceIn.summary.net',
|
||||
field: (row) => row.net,
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'stems',
|
||||
label: 'invoicein.summary.stems',
|
||||
label: 'invoiceIn.summary.stems',
|
||||
field: (row) => row.stems,
|
||||
format: (value) => value,
|
||||
sortable: true,
|
||||
|
@ -146,7 +146,7 @@ const intrastatColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'landed',
|
||||
label: 'invoicein.summary.country',
|
||||
label: 'invoiceIn.summary.country',
|
||||
field: (row) => row.country?.code,
|
||||
format: (value) => value,
|
||||
sortable: true,
|
||||
|
@ -214,7 +214,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
/>
|
||||
</QCardSection>
|
||||
<VnLv
|
||||
:label="t('invoicein.list.supplier')"
|
||||
:label="t('invoiceIn.list.supplier')"
|
||||
:value="entity.supplier?.name"
|
||||
>
|
||||
<template #value>
|
||||
|
@ -225,14 +225,14 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
</template>
|
||||
</VnLv>
|
||||
<VnLv
|
||||
:label="t('invoicein.list.supplierRef')"
|
||||
:label="t('invoiceIn.list.supplierRef')"
|
||||
:value="entity.supplierRef"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('invoicein.summary.currency')"
|
||||
:label="t('invoiceIn.summary.currency')"
|
||||
:value="entity.currency?.code"
|
||||
/>
|
||||
<VnLv :label="t('invoicein.serial')" :value="`${entity.serial}`" />
|
||||
<VnLv :label="t('invoiceIn.serial')" :value="`${entity.serial}`" />
|
||||
<VnLv
|
||||
:label="t('globals.country')"
|
||||
:value="entity.supplier?.country?.code"
|
||||
|
@ -247,19 +247,19 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
</QCardSection>
|
||||
<VnLv
|
||||
:ellipsis-value="false"
|
||||
:label="t('invoicein.summary.issued')"
|
||||
:label="t('invoiceIn.summary.issued')"
|
||||
:value="toDate(entity.issued)"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('invoicein.summary.operated')"
|
||||
:label="t('invoiceIn.summary.operated')"
|
||||
:value="toDate(entity.operated)"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('invoicein.summary.bookEntried')"
|
||||
:label="t('invoiceIn.summary.bookEntried')"
|
||||
:value="toDate(entity.bookEntried)"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('invoicein.summary.bookedDate')"
|
||||
:label="t('invoiceIn.summary.bookedDate')"
|
||||
:value="toDate(entity.booked)"
|
||||
/>
|
||||
<VnLv :label="t('globals.isVies')" :value="entity.supplier?.isVies" />
|
||||
|
@ -272,18 +272,18 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
/>
|
||||
</QCardSection>
|
||||
<VnLv
|
||||
:label="t('invoicein.summary.sage')"
|
||||
:label="t('invoiceIn.summary.sage')"
|
||||
:value="entity.sageWithholding?.withholding"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('invoicein.summary.vat')"
|
||||
:label="t('invoiceIn.summary.vat')"
|
||||
:value="entity.expenseDeductible?.name"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('invoicein.card.company')"
|
||||
:label="t('invoiceIn.card.company')"
|
||||
:value="entity.company?.code"
|
||||
/>
|
||||
<VnLv :label="t('invoicein.isBooked')" :value="invoiceIn?.isBooked" />
|
||||
<VnLv :label="t('invoiceIn.isBooked')" :value="invoiceIn?.isBooked" />
|
||||
</QCard>
|
||||
<QCard class="vn-one">
|
||||
<QCardSection class="q-pa-none">
|
||||
|
@ -294,11 +294,11 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
</QCardSection>
|
||||
<QCardSection class="q-pa-none">
|
||||
<VnLv
|
||||
:label="t('invoicein.summary.taxableBase')"
|
||||
:label="t('invoiceIn.summary.taxableBase')"
|
||||
:value="toCurrency(entity.totals.totalTaxableBase)"
|
||||
/>
|
||||
<VnLv label="Total" :value="toCurrency(entity.totals.totalVat)" />
|
||||
<VnLv :label="t('invoicein.summary.dueTotal')">
|
||||
<VnLv :label="t('invoiceIn.summary.dueTotal')">
|
||||
<template #value>
|
||||
<QChip
|
||||
dense
|
||||
|
@ -306,8 +306,8 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
:color="amountsNotMatch ? 'negative' : 'transparent'"
|
||||
:title="
|
||||
amountsNotMatch
|
||||
? t('invoicein.summary.noMatch')
|
||||
: t('invoicein.summary.dueTotal')
|
||||
? t('invoiceIn.summary.noMatch')
|
||||
: t('invoiceIn.summary.dueTotal')
|
||||
"
|
||||
>
|
||||
{{ toCurrency(entity.totals.totalDueDay) }}
|
||||
|
@ -318,7 +318,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
</QCard>
|
||||
<!--Vat-->
|
||||
<QCard v-if="entity.invoiceInTax.length" class="vat">
|
||||
<VnTitle :url="getLink('vat')" :text="t('invoicein.card.vat')" />
|
||||
<VnTitle :url="getLink('vat')" :text="t('invoiceIn.card.vat')" />
|
||||
<QTable
|
||||
:columns="vatColumns"
|
||||
:rows="entity.invoiceInTax"
|
||||
|
@ -366,7 +366,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
</QCard>
|
||||
<!--Due Day-->
|
||||
<QCard v-if="entity.invoiceInDueDay.length" class="due-day">
|
||||
<VnTitle :url="getLink('due-day')" :text="t('invoicein.card.dueDay')" />
|
||||
<VnTitle :url="getLink('due-day')" :text="t('invoiceIn.card.dueDay')" />
|
||||
<QTable :columns="dueDayColumns" :rows="entity.invoiceInDueDay" flat>
|
||||
<template #header="dueDayProps">
|
||||
<QTr :props="dueDayProps" class="bg">
|
||||
|
@ -404,7 +404,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
<QCard v-if="entity.invoiceInIntrastat.length">
|
||||
<VnTitle
|
||||
:url="getLink('intrastat')"
|
||||
:text="t('invoicein.card.intrastat')"
|
||||
:text="t('invoiceIn.card.intrastat')"
|
||||
/>
|
||||
<QTable
|
||||
:columns="intrastatColumns"
|
||||
|
|
|
@ -83,7 +83,7 @@ const redirectToInvoiceInBasicData = (__, { id }) => {
|
|||
</template>
|
||||
</VnSelect>
|
||||
<VnInput
|
||||
:label="t('invoicein.list.supplierRef')"
|
||||
:label="t('invoiceIn.list.supplierRef')"
|
||||
v-model="data.supplierRef"
|
||||
/>
|
||||
</VnRow>
|
||||
|
@ -97,10 +97,10 @@ const redirectToInvoiceInBasicData = (__, { id }) => {
|
|||
map-options
|
||||
hide-selected
|
||||
:required="true"
|
||||
:rules="validate('invoicein.companyFk')"
|
||||
:rules="validate('invoiceIn.companyFk')"
|
||||
/>
|
||||
<VnInputDate
|
||||
:label="t('invoicein.summary.issued')"
|
||||
:label="t('invoiceIn.summary.issued')"
|
||||
v-model="data.issued"
|
||||
/>
|
||||
</VnRow>
|
||||
|
|
|
@ -164,7 +164,7 @@ function handleDaysAgo(params, daysAgo) {
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="$t('invoicein.isBooked')"
|
||||
:label="$t('invoiceIn.isBooked')"
|
||||
v-model="params.isBooked"
|
||||
@update:model-value="searchFn()"
|
||||
toggle-indeterminate
|
||||
|
|
|
@ -8,17 +8,17 @@ import InvoiceInFilter from './InvoiceInFilter.vue';
|
|||
import InvoiceInSummary from './Card/InvoiceInSummary.vue';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import InvoiceInSearchbar from 'src/pages/InvoiceIn/InvoiceInSearchbar.vue';
|
||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
|
||||
const user = useState().getUser();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const { t } = useI18n();
|
||||
const dataKey = 'InvoiceInList';
|
||||
|
||||
const tableRef = ref();
|
||||
const companies = ref([]);
|
||||
|
@ -26,7 +26,7 @@ const cols = computed(() => [
|
|||
{
|
||||
align: 'left',
|
||||
name: 'isBooked',
|
||||
label: t('invoicein.isBooked'),
|
||||
label: t('invoiceIn.isBooked'),
|
||||
columnFilter: false,
|
||||
},
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ const cols = computed(() => [
|
|||
{
|
||||
align: 'left',
|
||||
name: 'supplierFk',
|
||||
label: t('invoicein.list.supplier'),
|
||||
label: t('invoiceIn.list.supplier'),
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
attrs: {
|
||||
|
@ -55,16 +55,16 @@ const cols = computed(() => [
|
|||
{
|
||||
align: 'left',
|
||||
name: 'supplierRef',
|
||||
label: t('invoicein.list.supplierRef'),
|
||||
label: t('invoiceIn.list.supplierRef'),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'serial',
|
||||
label: t('invoicein.serial'),
|
||||
label: t('invoiceIn.serial'),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('invoicein.list.issued'),
|
||||
label: t('invoiceIn.list.issued'),
|
||||
name: 'issued',
|
||||
component: null,
|
||||
columnFilter: {
|
||||
|
@ -74,7 +74,7 @@ const cols = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('invoicein.list.dueDated'),
|
||||
label: t('invoiceIn.list.dueDated'),
|
||||
name: 'dueDated',
|
||||
component: null,
|
||||
columnFilter: {
|
||||
|
@ -86,12 +86,12 @@ const cols = computed(() => [
|
|||
{
|
||||
align: 'left',
|
||||
name: 'awbCode',
|
||||
label: t('invoicein.list.awb'),
|
||||
label: t('invoiceIn.list.awb'),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'amount',
|
||||
label: t('invoicein.list.amount'),
|
||||
label: t('invoiceIn.list.amount'),
|
||||
format: ({ amount }) => toCurrency(amount),
|
||||
cardVisible: true,
|
||||
},
|
||||
|
@ -130,71 +130,84 @@ const cols = computed(() => [
|
|||
},
|
||||
]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData url="Companies" @on-fetch="(data) => (companies = data)" auto-load />
|
||||
<InvoiceInSearchbar />
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
<InvoiceInFilter data-key="InvoiceInList" />
|
||||
</template>
|
||||
</RightMenu>
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="InvoiceInList"
|
||||
url="InvoiceIns/filter"
|
||||
:order="['issued DESC', 'id DESC']"
|
||||
:create="{
|
||||
urlCreate: 'InvoiceIns',
|
||||
title: t('globals.createInvoiceIn'),
|
||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||
formInitialData: { companyFk: user.companyFk, issued: Date.vnNew() },
|
||||
}"
|
||||
redirect="invoice-in"
|
||||
<VnSection
|
||||
:data-key
|
||||
:columns="cols"
|
||||
:right-search="false"
|
||||
:disable-option="{ card: true }"
|
||||
:auto-load="!!$route.query.table"
|
||||
prefix="invoiceIn"
|
||||
:array-data-props="{
|
||||
url: 'InvoiceIns/filter',
|
||||
order: ['issued DESC', 'id DESC'],
|
||||
}"
|
||||
>
|
||||
<template #column-supplierFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.supplierName }}
|
||||
<SupplierDescriptorProxy :id="row.supplierFk" />
|
||||
</span>
|
||||
<template #advanced-menu>
|
||||
<InvoiceInFilter :data-key />
|
||||
</template>
|
||||
<template #more-create-dialog="{ data }">
|
||||
<VnSelect
|
||||
v-model="data.supplierFk"
|
||||
url="Suppliers"
|
||||
:fields="['id', 'nickname', 'name']"
|
||||
:label="t('globals.supplier')"
|
||||
option-value="id"
|
||||
option-label="nickname"
|
||||
:filter-options="['id', 'name', 'nickname']"
|
||||
:required="true"
|
||||
<template #body>
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
:data-key
|
||||
:create="{
|
||||
urlCreate: 'InvoiceIns',
|
||||
title: t('globals.createInvoiceIn'),
|
||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||
formInitialData: { companyFk: user.companyFk, issued: Date.vnNew() },
|
||||
}"
|
||||
redirect="invoice-in"
|
||||
:columns="cols"
|
||||
:right-search="false"
|
||||
:disable-option="{ card: true }"
|
||||
:auto-load="!!$route.query.table"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
|
||||
<QItemLabel caption> #{{ scope.opt?.id }}, {{ scope.opt?.name }} </QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<template #column-supplierFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.supplierName }}
|
||||
<SupplierDescriptorProxy :id="row.supplierFk" />
|
||||
</span>
|
||||
</template>
|
||||
</VnSelect>
|
||||
<VnInput
|
||||
:label="t('invoicein.list.supplierRef')"
|
||||
v-model="data.supplierRef"
|
||||
/>
|
||||
<VnSelect
|
||||
url="Companies"
|
||||
:label="t('globals.company')"
|
||||
:fields="['id', 'code']"
|
||||
v-model="data.companyFk"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
:required="true"
|
||||
/>
|
||||
<VnInputDate :label="t('invoicein.summary.issued')" v-model="data.issued" />
|
||||
<template #more-create-dialog="{ data }">
|
||||
<VnSelect
|
||||
v-model="data.supplierFk"
|
||||
url="Suppliers"
|
||||
:fields="['id', 'name', 'nickname']"
|
||||
:label="t('globals.supplier')"
|
||||
option-value="id"
|
||||
option-label="nickname"
|
||||
:filter-options="['id', 'name', 'nickname']"
|
||||
:required="true"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
#{{ scope.opt?.id }}, {{ scope.opt?.name }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
<VnInput
|
||||
:label="t('invoiceIn.list.supplierRef')"
|
||||
v-model="data.supplierRef"
|
||||
/>
|
||||
<VnSelect
|
||||
url="Companies"
|
||||
:label="t('globals.company')"
|
||||
:fields="['id', 'code']"
|
||||
v-model="data.companyFk"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
:required="true"
|
||||
/>
|
||||
<VnInputDate
|
||||
:label="t('invoiceIn.summary.issued')"
|
||||
v-model="data.issued"
|
||||
/>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
</VnTable>
|
||||
</VnSection>
|
||||
</template>
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
<script setup>
|
||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
const { t } = useI18n();
|
||||
</script>
|
||||
<template>
|
||||
<VnSearchbar
|
||||
data-key="InvoiceInList"
|
||||
:label="t('Search invoice')"
|
||||
:info="t('Search invoices in by id or supplier fiscal name')"
|
||||
url="InvoiceIns/filter"
|
||||
/>
|
||||
</template>
|
||||
<i18n>
|
||||
es:
|
||||
Search invoice: Buscar factura recibida
|
||||
Search invoices in by id or supplier fiscal name: Buscar facturas recibidas por id o por nombre fiscal del proveedor
|
||||
</i18n>
|
|
@ -1,4 +1,6 @@
|
|||
invoicein:
|
||||
invoiceIn:
|
||||
search: Search invoice
|
||||
searchInfo: Search incoming invoices by ID or supplier fiscal name
|
||||
serial: Serial
|
||||
isBooked: Is booked
|
||||
list:
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
invoicein:
|
||||
invoiceIn:
|
||||
search: Buscar factura recibida
|
||||
searchInfo: Buscar facturas recibidas por ID o nombre fiscal del proveedor
|
||||
serial: Serie
|
||||
isBooked: Contabilizada
|
||||
list:
|
||||
|
@ -63,6 +65,7 @@ invoicein:
|
|||
params:
|
||||
search: Id o nombre proveedor
|
||||
correctedFk: Rectificada
|
||||
isBooked: Contabilizada
|
||||
account: Cuenta contable
|
||||
correctingFk: Rectificativa
|
||||
|
||||
|
|
|
@ -272,11 +272,12 @@ const onDenyAccept = (_, responseData) => {
|
|||
<template #column-achieved="{ row }">
|
||||
<span>
|
||||
<VnInput
|
||||
ref="achievedRef"
|
||||
type="number"
|
||||
v-model.number="row.saleQuantity"
|
||||
:disable="!row.itemFk || row.isOk != null"
|
||||
@blur="changeQuantity(row)"
|
||||
@keyup.enter="changeQuantity(row)"
|
||||
@keyup.enter="$refs.achievedRef.vnInputRef.blur()"
|
||||
dense
|
||||
/>
|
||||
</span>
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
import { computed } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const dataKey = 'AgencyList';
|
||||
function navigate(id) {
|
||||
router.push({ path: `/agency/${id}` });
|
||||
}
|
||||
|
@ -67,26 +68,28 @@ const columns = computed(() => [
|
|||
]);
|
||||
</script>
|
||||
<template>
|
||||
<VnSearchbar
|
||||
:info="t('You can search by name')"
|
||||
:label="t('Search agency')"
|
||||
data-key="AgencyList"
|
||||
:expr-builder="exprBuilder"
|
||||
/>
|
||||
<div class="list-container">
|
||||
<div class="list">
|
||||
<VnSection
|
||||
:data-key
|
||||
:columns="columns"
|
||||
prefix="agency"
|
||||
:right-filter="false"
|
||||
:array-data-props="{
|
||||
url: 'Agencies',
|
||||
order: 'name',
|
||||
exprBuilder,
|
||||
}"
|
||||
>
|
||||
<template #body>
|
||||
<VnTable
|
||||
data-key="AgencyList"
|
||||
url="Agencies"
|
||||
order="name"
|
||||
:data-key
|
||||
:columns="columns"
|
||||
:right-search="false"
|
||||
:use-model="true"
|
||||
redirect="agency"
|
||||
redirect="route/agency"
|
||||
default-mode="card"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</VnSection>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.list {
|
||||
|
@ -104,8 +107,6 @@ const columns = computed(() => [
|
|||
es:
|
||||
isOwn: Tiene propietario
|
||||
isAnyVolumeAllowed: Permite cualquier volumen
|
||||
Search agency: Buscar agencia
|
||||
You can search by name: Puedes buscar por nombre
|
||||
en:
|
||||
isOwn: Has owner
|
||||
isAnyVolumeAllowed: Allows any volume
|
||||
|
|
|
@ -1,17 +1,7 @@
|
|||
<script setup>
|
||||
import AgencyDescriptor from 'pages/Route/Agency/Card/AgencyDescriptor.vue';
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import VnCardBeta from 'src/components/common/VnCardBeta.vue';
|
||||
</script>
|
||||
<template>
|
||||
<VnCard
|
||||
data-key="Agency"
|
||||
base-url="Agencies"
|
||||
:descriptor="AgencyDescriptor"
|
||||
search-data-key="AgencyList"
|
||||
:searchbar-props="{
|
||||
url: 'Agencies',
|
||||
label: 'agency.searchBar.label',
|
||||
info: 'agency.searchBar.info',
|
||||
}"
|
||||
/>
|
||||
<VnCardBeta data-key="Agency" base-url="Agencies" :descriptor="AgencyDescriptor" />
|
||||
</template>
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
import { describe, it, expect, vi, afterEach } from 'vitest';
|
||||
import axios from 'axios';
|
||||
import { getAgencies } from 'src/pages/Route/Agency/composables/getAgencies';
|
||||
|
||||
vi.mock('axios');
|
||||
|
||||
describe('getAgencies', () => {
|
||||
afterEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
const generateParams = (formData) => ({
|
||||
params: {
|
||||
warehouseFk: formData.warehouseId,
|
||||
addressFk: formData.addressId,
|
||||
landed: formData.landed,
|
||||
},
|
||||
});
|
||||
|
||||
it('should fetch agencies data with correct parameters for valid formData', async () => {
|
||||
const formData = {
|
||||
warehouseId: '123',
|
||||
addressId: '456',
|
||||
landed: 'true',
|
||||
};
|
||||
|
||||
await getAgencies(formData);
|
||||
|
||||
expect(axios.get).toHaveBeenCalledWith('Agencies/getAgenciesWithWarehouse', generateParams(formData));
|
||||
});
|
||||
|
||||
it('should not call API when formData is missing required landed field', async () => {
|
||||
const formData = { warehouseId: '123', addressId: '456' };
|
||||
|
||||
await getAgencies(formData);
|
||||
|
||||
expect(axios.get).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should not call API when formData is missing required addressId field', async () => {
|
||||
const formData = { warehouseId: '123', landed: 'true' };
|
||||
|
||||
await getAgencies(formData);
|
||||
|
||||
expect(axios.get).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should not call API when formData is missing required warehouseId field', async () => {
|
||||
const formData = { addressId: '456', landed: 'true' };
|
||||
|
||||
await getAgencies(formData);
|
||||
|
||||
expect(axios.get).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,12 @@
|
|||
import axios from 'axios';
|
||||
|
||||
export async function getAgencies(formData) {
|
||||
if (!formData.warehouseId || !formData.addressId || !formData.landed) return;
|
||||
let params = {
|
||||
warehouseFk: formData.warehouseId,
|
||||
addressFk: formData.addressId,
|
||||
landed: formData.landed,
|
||||
};
|
||||
|
||||
return await axios.get('Agencies/getAgenciesWithWarehouse', { params });
|
||||
}
|
|
@ -1,4 +1,6 @@
|
|||
agency:
|
||||
search: Search agency
|
||||
searchInfo: You can search by name
|
||||
isOwn: Own
|
||||
isAnyVolumeAllowed: Any volume allowed
|
||||
notification:
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
agency:
|
||||
search: Buscar agencia
|
||||
searchInfo: Puedes buscar por nombre
|
||||
isOwn: Propio
|
||||
isAnyVolumeAllowed: Cualquier volumen
|
||||
removeItem: Agencia eliminada correctamente
|
||||
|
|
|
@ -1,19 +1,8 @@
|
|||
<script setup>
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import RouteDescriptor from 'pages/Route/Card/RouteDescriptor.vue';
|
||||
import RouteFilter from './RouteFilter.vue';
|
||||
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
|
||||
import VnCardBeta from 'src/components/common/VnCardBeta.vue';
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<VnCard
|
||||
data-key="Route"
|
||||
base-url="Routes"
|
||||
:descriptor="RouteDescriptor"
|
||||
:filter-panel="RouteFilter"
|
||||
search-data-key="RouteList"
|
||||
>
|
||||
<template #searchbar>
|
||||
<RouteSearchbar />
|
||||
</template>
|
||||
</VnCard>
|
||||
<VnCardBeta data-key="Route" base-url="Routes" :descriptor="RouteDescriptor" />
|
||||
</template>
|
||||
|
|
|
@ -1,19 +1,7 @@
|
|||
<script setup>
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import RoadmapDescriptor from 'pages/Route/Roadmap/RoadmapDescriptor.vue';
|
||||
import RoadmapFilter from 'pages/Route/Roadmap/RoadmapFilter.vue';
|
||||
</script>
|
||||
<template>
|
||||
<VnCard
|
||||
data-key="Roadmap"
|
||||
base-url="Roadmaps"
|
||||
:descriptor="RoadmapDescriptor"
|
||||
:filter-panel="RoadmapFilter"
|
||||
search-data-key="RoadmapList"
|
||||
:searchbar-props="{
|
||||
url: 'Roadmaps',
|
||||
label: 'Search roadmap',
|
||||
info: 'You can search by roadmap id or customer name',
|
||||
}"
|
||||
/>
|
||||
<VnCardBeta data-key="Roadmap" base-url="Roadmaps" :descriptor="RoadmapDescriptor" />
|
||||
</template>
|
||||
|
|
|
@ -18,22 +18,6 @@ const props = defineProps({
|
|||
const emit = defineEmits(['search']);
|
||||
|
||||
const supplierList = ref([]);
|
||||
const exprBuilder = (param, value) => {
|
||||
switch (param) {
|
||||
case 'tractorPlate':
|
||||
case 'trailerPlate':
|
||||
case 'driverName':
|
||||
case 'phone':
|
||||
return { [param]: { like: `%${value}%` } };
|
||||
case 'supplierFk':
|
||||
case 'price':
|
||||
return { [param]: value };
|
||||
case 'from':
|
||||
return { etd: { gte: value } };
|
||||
case 'to':
|
||||
return { etd: { lte: value } };
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -48,7 +32,6 @@ const exprBuilder = (param, value) => {
|
|||
<VnFilterPanel
|
||||
:data-key="props.dataKey"
|
||||
:search-button="true"
|
||||
:expr-builder="exprBuilder"
|
||||
@search="emit('search')"
|
||||
>
|
||||
<template #tags="{ tag, formatFn }">
|
||||
|
|
|
@ -3,17 +3,16 @@ import { computed, ref } from 'vue';
|
|||
import { useI18n } from 'vue-i18n';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import { toHour } from 'src/filters';
|
||||
|
||||
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
|
||||
import RouteSummary from 'pages/Route/Card/RouteSummary.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const tableRef = ref([]);
|
||||
const dataKey = 'RouteList';
|
||||
const routeFilter = {
|
||||
include: [
|
||||
{
|
||||
|
@ -110,32 +109,39 @@ const columns = computed(() => [
|
|||
]);
|
||||
</script>
|
||||
<template>
|
||||
<RouteSearchbar />
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
<RouteFilter data-key="RouteList" />
|
||||
</template>
|
||||
</RightMenu>
|
||||
<VnTable
|
||||
data-key="RouteList"
|
||||
url="Routes/filter"
|
||||
<VnSection
|
||||
:data-key
|
||||
:columns="columns"
|
||||
:right-search="false"
|
||||
:filter="routeFilter"
|
||||
redirect="route"
|
||||
:create="{
|
||||
urlCreate: 'Routes',
|
||||
title: t('route.createRoute'),
|
||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||
formInitialData: {},
|
||||
prefix="route"
|
||||
:array-data-props="{
|
||||
url: 'Routes/filter',
|
||||
userFilter: routeFilter,
|
||||
}"
|
||||
table-height="85vh"
|
||||
>
|
||||
<template #column-workerFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row?.workerUserName }}
|
||||
<WorkerDescriptorProxy :id="row?.workerFk" v-if="row?.workerFk" />
|
||||
</span>
|
||||
<template #advanced-menu>
|
||||
<RouteFilter :data-key />
|
||||
</template>
|
||||
</VnTable>
|
||||
<template #body>
|
||||
<VnTable
|
||||
:data-key
|
||||
:columns="columns"
|
||||
:right-search="false"
|
||||
redirect="route"
|
||||
:create="{
|
||||
urlCreate: 'Routes',
|
||||
title: t('route.createRoute'),
|
||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||
formInitialData: {},
|
||||
}"
|
||||
table-height="85vh"
|
||||
>
|
||||
<template #column-workerFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row?.workerUserName }}
|
||||
<WorkerDescriptorProxy :id="row?.workerFk" v-if="row?.workerFk" />
|
||||
</span>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
</VnSection>
|
||||
</template>
|
||||
|
|
|
@ -15,11 +15,14 @@ import RoadmapSummary from 'pages/Route/Roadmap/RoadmapSummary.vue';
|
|||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||
import VnInputTime from 'src/components/common/VnInputTime.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
import RoadmapFilter from './Roadmap/RoadmapFilter.vue';
|
||||
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const { t } = useI18n();
|
||||
const quasar = useQuasar();
|
||||
const selectedRows = ref([]);
|
||||
const dataKey = 'RoadmapList';
|
||||
const columns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -128,14 +131,28 @@ function confirmRemove() {
|
|||
})
|
||||
.onOk(() => tableRef.value++);
|
||||
}
|
||||
|
||||
function exprBuilder(param, value) {
|
||||
switch (param) {
|
||||
case 'search':
|
||||
return /^\d+$/.test(value) ? { id: value } : { name: { like: `%${value}%` } };
|
||||
case 'tractorPlate':
|
||||
case 'trailerPlate':
|
||||
case 'driverName':
|
||||
case 'phone':
|
||||
return { [param]: { like: `%${value}%` } };
|
||||
case 'supplierFk':
|
||||
case 'price':
|
||||
return { [param]: value };
|
||||
case 'from':
|
||||
return { etd: { gte: value } };
|
||||
case 'to':
|
||||
return { etd: { lte: value } };
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnSearchbar
|
||||
data-key="RoadmapList"
|
||||
:label="t('Search roadmaps')"
|
||||
:info="t('You can search by roadmap reference')"
|
||||
/>
|
||||
<QDialog v-model="isCloneDialogOpen">
|
||||
<QCard style="min-width: 350px">
|
||||
<QCardSection>
|
||||
|
@ -177,39 +194,53 @@ function confirmRemove() {
|
|||
</QBtn>
|
||||
</template>
|
||||
</VnSubToolbar>
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="RoadmapList"
|
||||
url="roadmaps"
|
||||
<VnSection
|
||||
:data-key
|
||||
:columns="columns"
|
||||
:right-search="true"
|
||||
:use-model="true"
|
||||
default-mode="table"
|
||||
v-model:selected="selectedRows"
|
||||
table-height="85vh"
|
||||
:table="{
|
||||
selection: 'multiple',
|
||||
prefix="route.roadmap"
|
||||
:array-data-props="{
|
||||
url: 'roadmaps',
|
||||
exprBuilder,
|
||||
}"
|
||||
redirect="route/roadmap"
|
||||
:create="{
|
||||
urlCreate: 'Roadmaps',
|
||||
title: t('Create routemap'),
|
||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||
formInitialData: {},
|
||||
}"
|
||||
:disable-option="{ card: true }"
|
||||
>
|
||||
<template #column-etd="{ row }">
|
||||
{{ toDateHourMin(row.etd) }}
|
||||
<template #advanced-menu>
|
||||
<RoadmapFilter :dataKey />
|
||||
</template>
|
||||
<template #column-supplierFk="{ row }">
|
||||
{{ row.supplierFk }}
|
||||
<template #body>
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
:data-key
|
||||
:columns="columns"
|
||||
:right-search="false"
|
||||
:use-model="true"
|
||||
default-mode="table"
|
||||
v-model:selected="selectedRows"
|
||||
table-height="85vh"
|
||||
:table="{
|
||||
selection: 'multiple',
|
||||
}"
|
||||
redirect="route/roadmap"
|
||||
:create="{
|
||||
urlCreate: 'Roadmaps',
|
||||
title: t('Create routemap'),
|
||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||
formInitialData: {},
|
||||
}"
|
||||
:disable-option="{ card: true }"
|
||||
>
|
||||
<template #column-etd="{ row }">
|
||||
{{ toDateHourMin(row.etd) }}
|
||||
</template>
|
||||
<template #column-supplierFk="{ row }">
|
||||
{{ row.supplierFk }}
|
||||
</template>
|
||||
<template #more-create-dialog="{ data }">
|
||||
<VnInputDate v-model="data.etd" />
|
||||
<VnInputTime v-model="data.etd" />
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
<template #more-create-dialog="{ data }">
|
||||
<VnInputDate v-model="data.etd" />
|
||||
<VnInputTime v-model="data.etd" />
|
||||
</template>
|
||||
</VnTable>
|
||||
</VnSection>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
route:
|
||||
roadmap:
|
||||
search: Search roadmap
|
||||
searchInfo: You can search by roadmap reference
|
||||
params:
|
||||
etd: ETD
|
||||
tractorPlate: Plate
|
||||
|
@ -36,6 +39,8 @@ route:
|
|||
Summary: Summary
|
||||
Route is closed: Route is closed
|
||||
Route is not served: Route is not served
|
||||
search: Search route
|
||||
searchInfo: You can search by route reference
|
||||
cmr:
|
||||
list:
|
||||
results: results
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
route:
|
||||
roadmap:
|
||||
search: Buscar troncales
|
||||
searchInfo: Puedes buscar por referencia del troncal
|
||||
params:
|
||||
agencyModeName: Agencia Ruta
|
||||
agencyAgreement: Agencia Acuerdo
|
||||
|
@ -37,6 +40,8 @@ route:
|
|||
Summary: Resumen
|
||||
Route is closed: La ruta está cerrada
|
||||
Route is not served: La ruta no está servida
|
||||
search: Buscar rutas
|
||||
searchInfo: Puedes buscar por referencia de la ruta
|
||||
cmr:
|
||||
list:
|
||||
results: resultados
|
||||
|
|
|
@ -16,6 +16,8 @@ import VnInputTime from 'src/components/common/VnInputTime.vue';
|
|||
import { useAcl } from 'src/composables/useAcl';
|
||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { getAddresses } from 'src/pages/Customer/composables/getAddresses';
|
||||
import { getClient } from 'src/pages/Customer/composables/getClient';
|
||||
|
||||
const props = defineProps({
|
||||
ticket: {
|
||||
|
@ -40,7 +42,10 @@ const { openReport, sendEmail } = usePrintService();
|
|||
const ticketSummary = useArrayData('TicketSummary');
|
||||
const { ticket } = toRefs(props);
|
||||
const ticketId = computed(() => props.ticket.id ?? currentRoute.value.params.id);
|
||||
const client = ref();
|
||||
const client = ref(null);
|
||||
const address = ref(null);
|
||||
const addressesOptions = ref([]);
|
||||
const selectedClient = ref();
|
||||
const showTransferDialog = ref(false);
|
||||
const showTurnDialog = ref(false);
|
||||
const showChangeTimeDialog = ref(false);
|
||||
|
@ -52,6 +57,31 @@ const weight = ref();
|
|||
const hasDocuwareFile = ref();
|
||||
const quasar = useQuasar();
|
||||
const canRestoreTicket = ref(false);
|
||||
|
||||
const onClientSelected = async(clientId) =>{
|
||||
client.value = clientId;
|
||||
await fetchClient();
|
||||
await fetchAddresses();
|
||||
};
|
||||
|
||||
const onAddressSelected = (addressId) => {
|
||||
address.value = addressId;
|
||||
}
|
||||
|
||||
const fetchClient = async () => {
|
||||
const { data } = await getClient(client.value)
|
||||
const [retrievedClient] = data;
|
||||
selectedClient.value = retrievedClient;
|
||||
};
|
||||
|
||||
const fetchAddresses = async () => {
|
||||
const { data } = await getAddresses(client.value);
|
||||
addressesOptions.value = data;
|
||||
|
||||
const { defaultAddress } = selectedClient.value;
|
||||
address.value = defaultAddress.id;
|
||||
};
|
||||
|
||||
const actions = {
|
||||
clone: async () => {
|
||||
const opts = { message: t('Ticket cloned'), type: 'positive' };
|
||||
|
@ -260,17 +290,14 @@ async function makeInvoice() {
|
|||
window.location.reload();
|
||||
}
|
||||
|
||||
async function transferClient(client) {
|
||||
async function transferClient() {
|
||||
const params = {
|
||||
clientFk: client,
|
||||
clientFk: client.value,
|
||||
addressFk: address.value,
|
||||
};
|
||||
|
||||
const { data } = await axios.patch(
|
||||
`Tickets/${ticketId.value}/transferClient`,
|
||||
params
|
||||
);
|
||||
|
||||
if (data) window.location.reload();
|
||||
await axios.patch( `Tickets/${ticketId.value}/transferClient`, params );
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
async function addTurn(day) {
|
||||
|
@ -446,7 +473,7 @@ async function ticketToRestore() {
|
|||
</QItem>
|
||||
<QDialog ref="dialogRef" v-model="showTransferDialog">
|
||||
<FormPopup
|
||||
@on-submit="transferClient(client)"
|
||||
@on-submit="transferClient()"
|
||||
:title="t('Transfer client')"
|
||||
:custom-submit-button-label="t('Transfer client')"
|
||||
:default-cancel-button="false"
|
||||
|
@ -454,10 +481,11 @@ async function ticketToRestore() {
|
|||
<template #form-inputs>
|
||||
<VnSelect
|
||||
url="Clients"
|
||||
:fields="['id', 'name']"
|
||||
:fields="['id', 'name', 'defaultAddressFk']"
|
||||
v-model="client"
|
||||
:label="t('Client')"
|
||||
auto-load
|
||||
@update:model-value="() => onClientSelected(client)"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
|
@ -470,6 +498,29 @@ async function ticketToRestore() {
|
|||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
<VnSelect
|
||||
:disable="!client"
|
||||
:options="addressesOptions"
|
||||
:fields="['id', 'nickname']"
|
||||
option-value="id"
|
||||
option-label="nickname"
|
||||
v-model="address"
|
||||
:label="t('ticketList.addressNickname')"
|
||||
auto-load
|
||||
:hint="!client ? t('Select a client to enable') : ''"
|
||||
@update:model-value="() => onAddressSelected(address)"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>
|
||||
{{ `#${scope.opt.id} - ` }}
|
||||
{{ scope.opt.nickname }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
</template>
|
||||
</FormPopup>
|
||||
</QDialog>
|
||||
|
@ -814,4 +865,5 @@ es:
|
|||
Are you sure you want to restore the ticket?: ¿Seguro que quieres restaurar el ticket?
|
||||
You are going to restore this ticket: Vas a restaurar este ticket
|
||||
Ticket restored: Ticket restaurado
|
||||
Select a client to enable: Selecciona un cliente para habilitar
|
||||
</i18n>
|
||||
|
|
|
@ -9,9 +9,11 @@ import VnRow from 'components/ui/VnRow.vue';
|
|||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||
import { getClient } from 'src/pages/Customer/composables/getClient';
|
||||
import { getAddresses } from 'src/pages/Customer/composables/getAddresses';
|
||||
import { getAgencies } from 'src/pages/Route/Agency/composables/getAgencies';
|
||||
|
||||
import { useState } from 'composables/useState';
|
||||
import axios from 'axios';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
@ -37,33 +39,13 @@ onBeforeMount(async () => {
|
|||
});
|
||||
|
||||
const fetchClient = async (formData) => {
|
||||
const filter = {
|
||||
include: {
|
||||
relation: 'defaultAddress',
|
||||
scope: {
|
||||
fields: ['id', 'agencyModeFk'],
|
||||
},
|
||||
},
|
||||
where: { id: formData.clientId },
|
||||
};
|
||||
const params = { filter: JSON.stringify(filter) };
|
||||
const { data } = await axios.get('Clients', { params });
|
||||
const { data } = await getClient(formData.clientId);
|
||||
const [client] = data;
|
||||
selectedClient.value = client;
|
||||
};
|
||||
|
||||
const fetchAddresses = async (formData) => {
|
||||
if (!formData.clientId) return;
|
||||
|
||||
const filter = {
|
||||
fields: ['nickname', 'street', 'city', 'id'],
|
||||
where: { isActive: true },
|
||||
order: 'nickname ASC',
|
||||
};
|
||||
const params = { filter: JSON.stringify(filter) };
|
||||
const { data } = await axios.get(`Clients/${formData.clientId}/addresses`, {
|
||||
params,
|
||||
});
|
||||
const { data } = await getAddresses(formData.clientId);
|
||||
addressesOptions.value = data;
|
||||
|
||||
const { defaultAddress } = selectedClient.value;
|
||||
|
@ -76,15 +58,7 @@ const onClientSelected = async (formData) => {
|
|||
};
|
||||
|
||||
const fetchAvailableAgencies = async (formData) => {
|
||||
if (!formData.warehouseId || !formData.addressId || !formData.landed) return;
|
||||
let params = {
|
||||
warehouseFk: formData.warehouseId,
|
||||
addressFk: formData.addressId,
|
||||
landed: formData.landed,
|
||||
};
|
||||
|
||||
const { data } = await axios.get('Agencies/getAgenciesWithWarehouse', { params });
|
||||
|
||||
const { data } = await getAgencies(formData);
|
||||
agenciesOptions.value = data;
|
||||
|
||||
const defaultAgency = agenciesOptions.value.find(
|
||||
|
|
|
@ -9,9 +9,11 @@ import FetchData from 'components/FetchData.vue';
|
|||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||
import { getClient } from 'src/pages/Customer/composables/getClient';
|
||||
import { getAddresses } from 'src/pages/Customer/composables/getAddresses';
|
||||
import { getAgencies } from 'src/pages/Route/Agency/composables/getAgencies';
|
||||
|
||||
import { useState } from 'composables/useState';
|
||||
import axios from 'axios';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
@ -37,33 +39,13 @@ onBeforeMount(async () => {
|
|||
});
|
||||
|
||||
const fetchClient = async (formData) => {
|
||||
const filter = {
|
||||
include: {
|
||||
relation: 'defaultAddress',
|
||||
scope: {
|
||||
fields: ['id', 'agencyModeFk'],
|
||||
},
|
||||
},
|
||||
where: { id: formData.clientId },
|
||||
};
|
||||
const params = { filter: JSON.stringify(filter) };
|
||||
const { data } = await axios.get('Clients', { params });
|
||||
const { data } = await getClient(formData.clientId);
|
||||
const [client] = data;
|
||||
selectedClient.value = client;
|
||||
};
|
||||
|
||||
const fetchAddresses = async (formData) => {
|
||||
if (!formData.clientId) return;
|
||||
|
||||
const filter = {
|
||||
fields: ['nickname', 'street', 'city', 'id'],
|
||||
where: { isActive: true },
|
||||
order: 'nickname ASC',
|
||||
};
|
||||
const params = { filter: JSON.stringify(filter) };
|
||||
const { data } = await axios.get(`Clients/${formData.clientId}/addresses`, {
|
||||
params,
|
||||
});
|
||||
const { data } = await getAddresses(formData.clientId);
|
||||
addressesOptions.value = data;
|
||||
|
||||
const { defaultAddress } = selectedClient.value;
|
||||
|
@ -76,15 +58,7 @@ const onClientSelected = async (formData) => {
|
|||
};
|
||||
|
||||
const fetchAvailableAgencies = async (formData) => {
|
||||
if (!formData.warehouseId || !formData.addressId || !formData.landed) return;
|
||||
let params = {
|
||||
warehouseFk: formData.warehouseId,
|
||||
addressFk: formData.addressId,
|
||||
landed: formData.landed,
|
||||
};
|
||||
|
||||
const { data } = await axios.get('Agencies/getAgenciesWithWarehouse', { params });
|
||||
|
||||
const { data } = await getAgencies(formData);
|
||||
agenciesOptions.value = data;
|
||||
|
||||
const defaultAgency = agenciesOptions.value.find(
|
||||
|
|
|
@ -22,6 +22,9 @@ import { toTimeFormat } from 'src/filters/date';
|
|||
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
||||
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
import { getClient } from 'src/pages/Customer/composables/getClient';
|
||||
import { getAddresses } from 'src/pages/Customer/composables/getAddresses';
|
||||
import { getAgencies } from 'src/pages/Route/Agency/composables/getAgencies';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
@ -237,15 +240,7 @@ const onClientSelected = async (formData) => {
|
|||
};
|
||||
|
||||
const fetchAvailableAgencies = async (formData) => {
|
||||
if (!formData.warehouseId || !formData.addressId || !formData.landed) return;
|
||||
let params = {
|
||||
warehouseFk: formData.warehouseId,
|
||||
addressFk: formData.addressId,
|
||||
landed: formData.landed,
|
||||
};
|
||||
|
||||
const { data } = await axios.get('Agencies/getAgenciesWithWarehouse', { params });
|
||||
|
||||
const { data } = await getAgencies(formData);
|
||||
agenciesOptions.value = data;
|
||||
|
||||
const defaultAgency = agenciesOptions.value.find(
|
||||
|
@ -257,34 +252,13 @@ const fetchAvailableAgencies = async (formData) => {
|
|||
};
|
||||
|
||||
const fetchClient = async (formData) => {
|
||||
const filter = {
|
||||
include: {
|
||||
relation: 'defaultAddress',
|
||||
scope: {
|
||||
fields: ['id', 'agencyModeFk'],
|
||||
},
|
||||
},
|
||||
where: { id: formData.clientId },
|
||||
};
|
||||
const params = { filter: JSON.stringify(filter) };
|
||||
const { data } = await axios.get('Clients', { params });
|
||||
const { data } = await getClient(formData.clientId);
|
||||
const [client] = data;
|
||||
selectedClient.value = client;
|
||||
};
|
||||
|
||||
const fetchAddresses = async (formData) => {
|
||||
if (!formData.clientId) return;
|
||||
|
||||
const filter = {
|
||||
fields: ['nickname', 'street', 'city', 'id', 'isActive'],
|
||||
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
|
||||
};
|
||||
const params = { filter: JSON.stringify(filter) };
|
||||
const { data } = await axios.get(`Clients/${formData.clientId}/addresses`, {
|
||||
params,
|
||||
});
|
||||
addressesOptions.value = data;
|
||||
|
||||
const { data } = await getAddresses(formData.clientId);
|
||||
addressesOptions.value = data;
|
||||
|
||||
const { defaultAddress } = selectedClient.value;
|
||||
|
|
|
@ -1,91 +1,112 @@
|
|||
import { RouterView } from 'vue-router';
|
||||
|
||||
const agencyCard = {
|
||||
path: ':id',
|
||||
name: 'AgencyCard',
|
||||
component: () => import('src/pages/Route/Agency/Card/AgencyCard.vue'),
|
||||
redirect: { name: 'AgencySummary' },
|
||||
meta: {
|
||||
menu: ['AgencyBasicData', 'AgencyModes', 'AgencyWorkCenters', 'AgencyLog'],
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'AgencySummary',
|
||||
path: 'summary',
|
||||
meta: {
|
||||
title: 'summary',
|
||||
icon: 'view_list',
|
||||
},
|
||||
component: () => import('src/pages/Route/Agency/Card/AgencySummary.vue'),
|
||||
},
|
||||
{
|
||||
name: 'AgencyBasicData',
|
||||
path: 'basic-data',
|
||||
meta: {
|
||||
title: 'basicData',
|
||||
icon: 'vn:settings',
|
||||
},
|
||||
component: () => import('pages/Route/Agency/Card/AgencyBasicData.vue'),
|
||||
},
|
||||
{
|
||||
path: 'workCenter',
|
||||
name: 'AgencyWorkCenterCard',
|
||||
redirect: { name: 'AgencyWorkCenters' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'AgencyWorkCenters',
|
||||
meta: {
|
||||
icon: 'apartment',
|
||||
title: 'workCenters',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/Route/Agency/Card/AgencyWorkcenter.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'modes',
|
||||
name: 'AgencyModesCard',
|
||||
redirect: { name: 'AgencyModes' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'AgencyModes',
|
||||
meta: {
|
||||
icon: 'format_list_bulleted',
|
||||
title: 'modes',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/Route/Agency/Card/AgencyModes.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'AgencyLog',
|
||||
path: 'log',
|
||||
meta: {
|
||||
title: 'log',
|
||||
icon: 'history',
|
||||
},
|
||||
component: () => import('src/pages/Route/Agency/Card/AgencyLog.vue'),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default {
|
||||
path: '/agency',
|
||||
name: 'Agency',
|
||||
path: '/agency',
|
||||
meta: {
|
||||
title: 'agency',
|
||||
icon: 'garage_home',
|
||||
moduleName: 'Agency',
|
||||
},
|
||||
component: RouterView,
|
||||
redirect: { name: 'AgencyCard' },
|
||||
menus: {
|
||||
main: [],
|
||||
card: ['AgencyBasicData', 'AgencyModes', 'AgencyWorkCenters', 'AgencyLog'],
|
||||
},
|
||||
redirect: { name: 'RouteMain' },
|
||||
children: [
|
||||
{
|
||||
path: '/agency/:id',
|
||||
name: 'AgencyCard',
|
||||
component: () => import('src/pages/Route/Agency/Card/AgencyCard.vue'),
|
||||
redirect: { name: 'AgencySummary' },
|
||||
name: 'AgencyMain',
|
||||
path: '',
|
||||
component: () => import('src/components/common/VnModule.vue'),
|
||||
redirect: { name: 'AgencyIndexMain' },
|
||||
children: [
|
||||
{
|
||||
name: 'AgencySummary',
|
||||
path: 'summary',
|
||||
meta: {
|
||||
title: 'summary',
|
||||
icon: 'view_list',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/Route/Agency/Card/AgencySummary.vue'),
|
||||
},
|
||||
{
|
||||
name: 'AgencyBasicData',
|
||||
path: 'basic-data',
|
||||
meta: {
|
||||
title: 'basicData',
|
||||
icon: 'vn:settings',
|
||||
},
|
||||
component: () =>
|
||||
import('pages/Route/Agency/Card/AgencyBasicData.vue'),
|
||||
},
|
||||
{
|
||||
path: 'workCenter',
|
||||
name: 'AgencyWorkCenterCard',
|
||||
redirect: { name: 'AgencyWorkCenters' },
|
||||
name: 'AgencyIndexMain',
|
||||
path: '',
|
||||
redirect: { name: 'AgencyList' },
|
||||
component: () => import('src/pages/Route/Agency/AgencyList.vue'),
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'AgencyWorkCenters',
|
||||
name: 'AgencyList',
|
||||
path: 'list',
|
||||
meta: {
|
||||
icon: 'apartment',
|
||||
title: 'workCenters',
|
||||
title: 'list',
|
||||
icon: 'view_list',
|
||||
},
|
||||
component: () =>
|
||||
import(
|
||||
'src/pages/Route/Agency/Card/AgencyWorkcenter.vue'
|
||||
),
|
||||
},
|
||||
agencyCard,
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'modes',
|
||||
name: 'AgencyModesCard',
|
||||
redirect: { name: 'AgencyModes' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'AgencyModes',
|
||||
meta: {
|
||||
icon: 'format_list_bulleted',
|
||||
title: 'modes',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/Route/Agency/Card/AgencyModes.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'AgencyLog',
|
||||
path: 'log',
|
||||
meta: {
|
||||
title: 'log',
|
||||
icon: 'history',
|
||||
},
|
||||
component: () => import('src/pages/Route/Agency/Card/AgencyLog.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
|
@ -12,8 +12,6 @@ import Supplier from './supplier';
|
|||
import Travel from './travel';
|
||||
import Order from './order';
|
||||
import Entry from './entry';
|
||||
import roadmap from './roadmap';
|
||||
import Agency from './agency';
|
||||
import Zone from './zone';
|
||||
import Account from './account';
|
||||
import Monitor from './monitor';
|
||||
|
@ -33,8 +31,6 @@ export default [
|
|||
Order,
|
||||
invoiceIn,
|
||||
Entry,
|
||||
roadmap,
|
||||
Agency,
|
||||
Zone,
|
||||
Account,
|
||||
Monitor,
|
||||
|
|
|
@ -1,18 +1,12 @@
|
|||
import { RouterView } from 'vue-router';
|
||||
import { setRectificative } from 'src/pages/InvoiceIn/composables/setRectificative';
|
||||
export default {
|
||||
path: '/invoice-in',
|
||||
name: 'InvoiceIn',
|
||||
|
||||
const invoiceInCard = {
|
||||
name: 'InvoiceInCard',
|
||||
path: ':id',
|
||||
component: () => import('src/pages/InvoiceIn/Card/InvoiceInCard.vue'),
|
||||
redirect: { name: 'InvoiceInSummary' },
|
||||
meta: {
|
||||
title: 'invoiceIns',
|
||||
icon: 'vn:invoice-in',
|
||||
moduleName: 'InvoiceIn',
|
||||
},
|
||||
component: RouterView,
|
||||
redirect: { name: 'InvoiceInMain' },
|
||||
menus: {
|
||||
main: ['InvoiceInList', 'InvoiceInSerial'],
|
||||
card: [
|
||||
menu: [
|
||||
'InvoiceInBasicData',
|
||||
'InvoiceInVat',
|
||||
'InvoiceInDueDay',
|
||||
|
@ -23,29 +17,109 @@ export default {
|
|||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
path: 'summary',
|
||||
name: 'InvoiceInSummary',
|
||||
meta: {
|
||||
title: 'summary',
|
||||
icon: 'view_list',
|
||||
},
|
||||
component: () => import('src/pages/InvoiceIn/Card/InvoiceInSummary.vue'),
|
||||
},
|
||||
{
|
||||
name: 'InvoiceInBasicData',
|
||||
path: 'basic-data',
|
||||
meta: {
|
||||
title: 'basicData',
|
||||
icon: 'vn:settings',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/InvoiceIn/Card/InvoiceInBasicData.vue'),
|
||||
},
|
||||
{
|
||||
name: 'InvoiceInVat',
|
||||
path: 'vat',
|
||||
meta: {
|
||||
title: 'vat',
|
||||
icon: 'vn:tax',
|
||||
},
|
||||
component: () => import('src/pages/InvoiceIn/Card/InvoiceInVat.vue'),
|
||||
},
|
||||
{
|
||||
name: 'InvoiceInDueDay',
|
||||
path: 'due-day',
|
||||
meta: {
|
||||
title: 'dueDay',
|
||||
icon: 'vn:calendar',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/InvoiceIn/Card/InvoiceInDueDay.vue'),
|
||||
},
|
||||
{
|
||||
name: 'InvoiceInIntrastat',
|
||||
path: 'intrastat',
|
||||
meta: {
|
||||
title: 'intrastat',
|
||||
icon: 'vn:lines',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue'),
|
||||
},
|
||||
{
|
||||
name: 'InvoiceInCorrective',
|
||||
path: 'corrective',
|
||||
meta: {
|
||||
title: 'corrective',
|
||||
icon: 'attachment',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/InvoiceIn/Card/InvoiceInCorrective.vue'),
|
||||
},
|
||||
{
|
||||
name: 'InvoiceInLog',
|
||||
path: 'log',
|
||||
meta: {
|
||||
title: 'log',
|
||||
icon: 'history',
|
||||
},
|
||||
component: () => import('src/pages/InvoiceIn/Card/InvoiceInLog.vue'),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'InvoiceIn',
|
||||
path: '/invoice-in',
|
||||
meta: {
|
||||
title: 'invoiceIns',
|
||||
icon: 'vn:invoice-in',
|
||||
moduleName: 'InvoiceIn',
|
||||
menu: ['InvoiceInList', 'InvoiceInSerial'],
|
||||
},
|
||||
component: RouterView,
|
||||
redirect: { name: 'InvoiceInMain' },
|
||||
children: [
|
||||
{
|
||||
name: 'InvoiceInMain',
|
||||
path: '',
|
||||
component: () => import('src/components/common/VnModule.vue'),
|
||||
redirect: { name: 'InvoiceInList' },
|
||||
redirect: { name: 'InvoiceInIndexMain' },
|
||||
children: [
|
||||
{
|
||||
path: 'list',
|
||||
name: 'InvoiceInList',
|
||||
meta: {
|
||||
title: 'list',
|
||||
icon: 'view_list',
|
||||
},
|
||||
path: '',
|
||||
name: 'InvoiceInIndexMain',
|
||||
redirect: { name: 'InvoiceInList' },
|
||||
component: () => import('src/pages/InvoiceIn/InvoiceInList.vue'),
|
||||
},
|
||||
{
|
||||
path: 'serial',
|
||||
name: 'InvoiceInSerial',
|
||||
meta: {
|
||||
title: 'serial',
|
||||
icon: 'view_list',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/InvoiceIn/Serial/InvoiceInSerial.vue'),
|
||||
children: [
|
||||
{
|
||||
name: 'InvoiceInList',
|
||||
path: 'list',
|
||||
meta: {
|
||||
title: 'list',
|
||||
icon: 'view_list',
|
||||
},
|
||||
},
|
||||
invoiceInCard,
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'create',
|
||||
|
@ -56,85 +130,14 @@ export default {
|
|||
},
|
||||
component: () => import('src/pages/InvoiceIn/InvoiceInCreate.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'InvoiceInCard',
|
||||
path: ':id',
|
||||
component: () => import('src/pages/InvoiceIn/Card/InvoiceInCard.vue'),
|
||||
redirect: { name: 'InvoiceInSummary' },
|
||||
beforeEnter: async (to, from, next) => {
|
||||
await setRectificative(to);
|
||||
next();
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'InvoiceInSummary',
|
||||
path: 'summary',
|
||||
path: 'serial',
|
||||
name: 'InvoiceInSerial',
|
||||
meta: {
|
||||
title: 'summary',
|
||||
title: 'serial',
|
||||
icon: 'view_list',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/InvoiceIn/Card/InvoiceInSummary.vue'),
|
||||
},
|
||||
{
|
||||
name: 'InvoiceInBasicData',
|
||||
path: 'basic-data',
|
||||
meta: {
|
||||
title: 'basicData',
|
||||
icon: 'vn:settings',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/InvoiceIn/Card/InvoiceInBasicData.vue'),
|
||||
},
|
||||
{
|
||||
name: 'InvoiceInVat',
|
||||
path: 'vat',
|
||||
meta: {
|
||||
title: 'vat',
|
||||
icon: 'vn:tax',
|
||||
},
|
||||
component: () => import('src/pages/InvoiceIn/Card/InvoiceInVat.vue'),
|
||||
},
|
||||
{
|
||||
name: 'InvoiceInDueDay',
|
||||
path: 'due-day',
|
||||
meta: {
|
||||
title: 'dueDay',
|
||||
icon: 'vn:calendar',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/InvoiceIn/Card/InvoiceInDueDay.vue'),
|
||||
},
|
||||
{
|
||||
name: 'InvoiceInIntrastat',
|
||||
path: 'intrastat',
|
||||
meta: {
|
||||
title: 'intrastat',
|
||||
icon: 'vn:lines',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue'),
|
||||
},
|
||||
{
|
||||
name: 'InvoiceInLog',
|
||||
path: 'log',
|
||||
meta: {
|
||||
title: 'log',
|
||||
icon: 'history',
|
||||
},
|
||||
component: () => import('src/pages/InvoiceIn/Card/InvoiceInLog.vue'),
|
||||
},
|
||||
{
|
||||
name: 'InvoiceInCorrective',
|
||||
path: 'corrective',
|
||||
meta: {
|
||||
title: 'corrective',
|
||||
icon: 'attachment',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/InvoiceIn/Card/InvoiceInCorrective.vue'),
|
||||
component: () => import('src/pages/InvoiceIn/Serial/InvoiceInSerial.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
import { RouterView } from 'vue-router';
|
||||
|
||||
export default {
|
||||
path: '/route/roadmap',
|
||||
name: 'Roadmap',
|
||||
meta: {
|
||||
title: 'roadmap',
|
||||
icon: 'vn:troncales',
|
||||
moduleName: 'Roadmap',
|
||||
},
|
||||
component: RouterView,
|
||||
redirect: { name: 'RouteMain' },
|
||||
menus: {
|
||||
card: ['RoadmapBasicData', 'RoadmapStops'],
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'RouteRoadmapCard',
|
||||
path: ':id',
|
||||
component: () => import('src/pages/Route/Roadmap/RoadmapCard.vue'),
|
||||
redirect: { name: 'RoadmapSummary' },
|
||||
children: [
|
||||
{
|
||||
name: 'RoadmapSummary',
|
||||
path: 'summary',
|
||||
meta: {
|
||||
title: 'summary',
|
||||
icon: 'open_in_new',
|
||||
},
|
||||
component: () => import('pages/Route/Roadmap/RoadmapSummary.vue'),
|
||||
},
|
||||
{
|
||||
name: 'RoadmapBasicData',
|
||||
path: 'basic-data',
|
||||
meta: {
|
||||
title: 'basicData',
|
||||
icon: 'vn:settings',
|
||||
},
|
||||
component: () => import('pages/Route/Roadmap/RoadmapBasicData.vue'),
|
||||
},
|
||||
{
|
||||
name: 'RoadmapStops',
|
||||
path: 'stops',
|
||||
meta: {
|
||||
title: 'stops',
|
||||
icon: 'vn:lines',
|
||||
},
|
||||
component: () => import('pages/Route/Roadmap/RoadmapStops.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
|
@ -1,17 +1,173 @@
|
|||
import { RouterView } from 'vue-router';
|
||||
|
||||
const routeCard = {
|
||||
name: 'RouteCard',
|
||||
path: ':id',
|
||||
component: () => import('src/pages/Route/Card/RouteCard.vue'),
|
||||
redirect: { name: 'RouteSummary' },
|
||||
meta: {
|
||||
menu: ['RouteBasicData', 'RouteTickets', 'RouteLog'],
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'RouteBasicData',
|
||||
path: 'basic-data',
|
||||
meta: {
|
||||
title: 'basicData',
|
||||
icon: 'vn:settings',
|
||||
},
|
||||
component: () => import('pages/Route/Card/RouteForm.vue'),
|
||||
},
|
||||
{
|
||||
name: 'RouteSummary',
|
||||
path: 'summary',
|
||||
meta: {
|
||||
title: 'summary',
|
||||
icon: 'open_in_new',
|
||||
},
|
||||
component: () => import('pages/Route/Card/RouteSummary.vue'),
|
||||
},
|
||||
{
|
||||
path: 'tickets',
|
||||
name: 'RouteTickets',
|
||||
meta: {
|
||||
title: 'tickets',
|
||||
icon: 'vn:ticket',
|
||||
},
|
||||
component: () => import('src/pages/Route/RouteTickets.vue'),
|
||||
},
|
||||
{
|
||||
path: 'log',
|
||||
name: 'RouteLog',
|
||||
meta: {
|
||||
title: 'log',
|
||||
icon: 'vn:History',
|
||||
},
|
||||
component: () => import('src/pages/Route/RouteLog.vue'),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const agencyCard = {
|
||||
path: ':id',
|
||||
name: 'AgencyCard',
|
||||
component: () => import('src/pages/Route/Agency/Card/AgencyCard.vue'),
|
||||
redirect: { name: 'AgencySummary' },
|
||||
meta: {
|
||||
menu: ['AgencyBasicData', 'AgencyModes', 'AgencyWorkCenters', 'AgencyLog'],
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'AgencySummary',
|
||||
path: 'summary',
|
||||
meta: {
|
||||
title: 'summary',
|
||||
icon: 'view_list',
|
||||
},
|
||||
component: () => import('src/pages/Route/Agency/Card/AgencySummary.vue'),
|
||||
},
|
||||
{
|
||||
name: 'AgencyBasicData',
|
||||
path: 'basic-data',
|
||||
meta: {
|
||||
title: 'basicData',
|
||||
icon: 'vn:settings',
|
||||
},
|
||||
component: () => import('pages/Route/Agency/Card/AgencyBasicData.vue'),
|
||||
},
|
||||
{
|
||||
path: 'workCenter',
|
||||
name: 'AgencyWorkCenterCard',
|
||||
redirect: { name: 'AgencyWorkCenters' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'AgencyWorkCenters',
|
||||
meta: {
|
||||
icon: 'apartment',
|
||||
title: 'workCenters',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/Route/Agency/Card/AgencyWorkcenter.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'modes',
|
||||
name: 'AgencyModesCard',
|
||||
redirect: { name: 'AgencyModes' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'AgencyModes',
|
||||
meta: {
|
||||
icon: 'format_list_bulleted',
|
||||
title: 'modes',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/Route/Agency/Card/AgencyModes.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'AgencyLog',
|
||||
path: 'log',
|
||||
meta: {
|
||||
title: 'log',
|
||||
icon: 'history',
|
||||
},
|
||||
component: () => import('src/pages/Route/Agency/Card/AgencyLog.vue'),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const roadmapCard = {
|
||||
path: ':id',
|
||||
name: 'RoadmapCard',
|
||||
component: () => import('src/pages/Route/Roadmap/RoadmapCard.vue'),
|
||||
redirect: { name: 'RoadmapSummary' },
|
||||
meta: {
|
||||
menu: ['RoadmapBasicData', 'RoadmapStops'],
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'RoadmapSummary',
|
||||
path: 'summary',
|
||||
meta: {
|
||||
title: 'summary',
|
||||
icon: 'open_in_new',
|
||||
},
|
||||
component: () => import('pages/Route/Roadmap/RoadmapSummary.vue'),
|
||||
},
|
||||
{
|
||||
name: 'RoadmapBasicData',
|
||||
path: 'basic-data',
|
||||
meta: {
|
||||
title: 'basicData',
|
||||
icon: 'vn:settings',
|
||||
},
|
||||
component: () => import('pages/Route/Roadmap/RoadmapBasicData.vue'),
|
||||
},
|
||||
{
|
||||
name: 'RoadmapStops',
|
||||
path: 'stops',
|
||||
meta: {
|
||||
title: 'stops',
|
||||
icon: 'vn:lines',
|
||||
},
|
||||
component: () => import('pages/Route/Roadmap/RoadmapStops.vue'),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default {
|
||||
path: '/route',
|
||||
name: 'Route',
|
||||
path: '/route',
|
||||
meta: {
|
||||
title: 'routes',
|
||||
icon: 'vn:delivery',
|
||||
moduleName: 'Route',
|
||||
},
|
||||
component: RouterView,
|
||||
redirect: { name: 'RouteMain' },
|
||||
menus: {
|
||||
main: [
|
||||
menu: [
|
||||
'RouteList',
|
||||
'RouteExtendedList',
|
||||
'RouteAutonomous',
|
||||
|
@ -19,23 +175,32 @@ export default {
|
|||
'CmrList',
|
||||
'AgencyList',
|
||||
],
|
||||
card: ['RouteBasicData', 'RouteTickets', 'RouteLog'],
|
||||
},
|
||||
component: RouterView,
|
||||
redirect: { name: 'RouteMain' },
|
||||
children: [
|
||||
{
|
||||
path: '/route',
|
||||
name: 'RouteMain',
|
||||
path: '',
|
||||
component: () => import('src/components/common/VnModule.vue'),
|
||||
redirect: { name: 'RouteList' },
|
||||
redirect: { name: 'RouteIndexMain' },
|
||||
children: [
|
||||
{
|
||||
path: 'list',
|
||||
name: 'RouteList',
|
||||
meta: {
|
||||
title: 'RouteList',
|
||||
icon: 'view_list',
|
||||
},
|
||||
path: '',
|
||||
name: 'RouteIndexMain',
|
||||
redirect: { name: 'RouteList' },
|
||||
component: () => import('src/pages/Route/RouteList.vue'),
|
||||
children: [
|
||||
{
|
||||
name: 'RouteList',
|
||||
path: 'list',
|
||||
meta: {
|
||||
title: 'list',
|
||||
icon: 'view_list',
|
||||
},
|
||||
},
|
||||
routeCard,
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'extended-list',
|
||||
|
@ -67,11 +232,23 @@ export default {
|
|||
{
|
||||
path: 'roadmap',
|
||||
name: 'RouteRoadmap',
|
||||
redirect: { name: 'RoadmapList' },
|
||||
meta: {
|
||||
title: 'RouteRoadmap',
|
||||
icon: 'vn:troncales',
|
||||
},
|
||||
component: () => import('src/pages/Route/RouteRoadmap.vue'),
|
||||
children: [
|
||||
{
|
||||
name: 'RoadmapList',
|
||||
path: 'list',
|
||||
meta: {
|
||||
title: 'list',
|
||||
icon: 'view_list',
|
||||
},
|
||||
},
|
||||
roadmapCard,
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'cmr',
|
||||
|
@ -83,66 +260,27 @@ export default {
|
|||
component: () => import('src/pages/Route/Cmr/CmrList.vue'),
|
||||
},
|
||||
{
|
||||
path: '/agency',
|
||||
path: 'agency',
|
||||
name: 'RouteAgency',
|
||||
redirect: { name: 'AgencyList' },
|
||||
meta: {
|
||||
title: 'agency',
|
||||
icon: 'garage_home',
|
||||
},
|
||||
component: () => import('src/pages/Route/Agency/AgencyList.vue'),
|
||||
children: [
|
||||
{
|
||||
path: 'list',
|
||||
name: 'AgencyList',
|
||||
path: 'list',
|
||||
meta: {
|
||||
title: 'agencyList',
|
||||
icon: 'list',
|
||||
title: 'list',
|
||||
icon: 'view_list',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/Route/Agency/AgencyList.vue'),
|
||||
},
|
||||
agencyCard,
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'RouteCard',
|
||||
path: ':id',
|
||||
component: () => import('src/pages/Route/Card/RouteCard.vue'),
|
||||
redirect: { name: 'RouteSummary' },
|
||||
children: [
|
||||
{
|
||||
name: 'RouteBasicData',
|
||||
path: 'basic-data',
|
||||
meta: {
|
||||
title: 'basicData',
|
||||
icon: 'vn:settings',
|
||||
},
|
||||
component: () => import('pages/Route/Card/RouteForm.vue'),
|
||||
},
|
||||
{
|
||||
name: 'RouteSummary',
|
||||
path: 'summary',
|
||||
meta: {
|
||||
title: 'summary',
|
||||
icon: 'open_in_new',
|
||||
},
|
||||
component: () => import('pages/Route/Card/RouteSummary.vue'),
|
||||
},
|
||||
{
|
||||
path: 'tickets',
|
||||
name: 'RouteTickets',
|
||||
meta: {
|
||||
title: 'tickets',
|
||||
icon: 'vn:ticket',
|
||||
},
|
||||
component: () => import('src/pages/Route/RouteTickets.vue'),
|
||||
},
|
||||
{
|
||||
path: 'log',
|
||||
name: 'RouteLog',
|
||||
meta: {
|
||||
title: 'log',
|
||||
icon: 'vn:History',
|
||||
},
|
||||
component: () => import('src/pages/Route/RouteLog.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -12,8 +12,6 @@ import travel from './modules/travel';
|
|||
import shelving from 'src/router/modules/shelving';
|
||||
import order from 'src/router/modules/order';
|
||||
import entry from 'src/router/modules/entry';
|
||||
import roadmap from 'src/router/modules/roadmap';
|
||||
import agency from 'src/router/modules/agency';
|
||||
import zone from 'src/router/modules/zone';
|
||||
import account from './modules/account';
|
||||
import monitor from 'src/router/modules/monitor';
|
||||
|
@ -82,9 +80,7 @@ const routes = [
|
|||
route,
|
||||
supplier,
|
||||
travel,
|
||||
roadmap,
|
||||
entry,
|
||||
agency,
|
||||
zone,
|
||||
account,
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@ describe('AgencyWorkCenter', () => {
|
|||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/agency/11/workCenter`);
|
||||
cy.visit(`/#/route/agency/11/workCenter`);
|
||||
});
|
||||
const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon';
|
||||
const workCenterCombobox = 'input[role="combobox"]';
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
describe('RoadMap', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/route/roadmap`);
|
||||
});
|
||||
it('Route list create roadmap and redirect', () => {
|
||||
cy.addBtnClick();
|
||||
cy.get('input[name="name"]').eq(1).type('roadMapTestOne{enter}');
|
||||
cy.get('input[name="name"]').type('roadMapTestOne{enter}');
|
||||
cy.get('.q-notification__message').should('have.text', 'Data created');
|
||||
cy.url().should('include', '/summary');
|
||||
});
|
||||
|
|
|
@ -30,14 +30,15 @@ describe('TicketList', () => {
|
|||
cy.get(firstRow).find('.q-btn:first').click();
|
||||
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
|
||||
});
|
||||
// https://redmine.verdnatura.es/issues/8424
|
||||
it.skip('should open ticket summary', () => {
|
||||
|
||||
it('should open ticket summary', () => {
|
||||
searchResults();
|
||||
cy.get(firstRow).find('.q-btn:last').click();
|
||||
cy.dataCy('ticketSummary').should('exist');
|
||||
cy.get('.summaryHeader').should('exist');
|
||||
cy.get('.summaryBody').should('exist');
|
||||
});
|
||||
|
||||
it.skip('Client list create new client', () => {
|
||||
it('Client list create new client', () => {
|
||||
cy.dataCy('vnTableCreateBtn').should('exist');
|
||||
cy.dataCy('vnTableCreateBtn').click();
|
||||
const data = {
|
||||
|
@ -45,9 +46,9 @@ describe('TicketList', () => {
|
|||
Warehouse: { val: 'Warehouse One', type: 'select' },
|
||||
Address: { val: 'employee', type: 'select' },
|
||||
Landed: { val: '01-01-2024', type: 'date' },
|
||||
Agency: { val: 'Other agency', type: 'select' },
|
||||
};
|
||||
cy.fillInForm(data);
|
||||
cy.dataCy('Agency_select').click();
|
||||
cy.dataCy('FormModelPopup_save').click();
|
||||
cy.checkNotification('Data created');
|
||||
cy.url().should('match', /\/ticket\/\d+\/summary/);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('TicketRequest', () => {
|
||||
describe('TicketNotes', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
|
@ -13,7 +13,7 @@ describe('TicketRequest', () => {
|
|||
cy.selectOption('[data-cy="ticketNotesObservationType"]:last', 'Weight');
|
||||
cy.dataCy('ticketNotesDescription').should('exist');
|
||||
cy.get('[data-cy="ticketNotesDescription"]:last').type(
|
||||
'This is a note description'
|
||||
'This is a note description',
|
||||
);
|
||||
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||
cy.checkNotification('Data saved');
|
||||
|
|
|
@ -6,7 +6,7 @@ describe('TicketRequest', () => {
|
|||
cy.visit('/#/ticket/31/request');
|
||||
});
|
||||
|
||||
it.skip('Creates a new request', () => {
|
||||
it('Creates a new request', () => {
|
||||
cy.dataCy('vnTableCreateBtn').should('exist');
|
||||
cy.dataCy('vnTableCreateBtn').click();
|
||||
const data = {
|
||||
|
|
Loading…
Reference in New Issue