0
0
Fork 0

fix: refs #7553 requested changes

This commit is contained in:
Jon Elias 2024-09-20 09:04:31 +02:00
parent 34f70d026e
commit 44d98865fe
14 changed files with 157 additions and 77 deletions

View File

@ -63,7 +63,7 @@ globals:
shipped: F. envío shipped: F. envío
totalEntries: Ent. totales totalEntries: Ent. totales
amount: Importe amount: Importe
packages: Bultos packages: Embalajes
download: Descargar download: Descargar
downloadPdf: Descargar PDF downloadPdf: Descargar PDF
selectRows: 'Seleccionar las { numberRows } filas(s)' selectRows: 'Seleccionar las { numberRows } filas(s)'
@ -265,7 +265,7 @@ globals:
tracking: Estados tracking: Estados
components: Componentes components: Componentes
pictures: Fotos pictures: Fotos
packages: Bultos packages: Embalajes
ldap: LDAP ldap: LDAP
samba: Samba samba: Samba
twoFactor: Doble factor twoFactor: Doble factor
@ -484,7 +484,7 @@ ticket:
tracking: Estados tracking: Estados
components: Componentes components: Componentes
pictures: Fotos pictures: Fotos
packages: Bultos packages: Embalajes
list: list:
nickname: Alias nickname: Alias
state: Estado state: Estado

View File

@ -20,7 +20,6 @@ const { viewSummary } = useSummaryDialog();
const tableRef = ref(); const tableRef = ref();
const agencyList = ref([]); const agencyList = ref([]);
const addressesList = ref([]); const addressesList = ref([]);
const clientId = ref();
const columns = computed(() => [ const columns = computed(() => [
{ {
@ -191,6 +190,7 @@ const getDateColor = (date) => {
formInitialData: { formInitialData: {
active: true, active: true,
addressId: null, addressId: null,
clientFk: null,
}, },
}" }"
:user-params="{ showEmpty: false }" :user-params="{ showEmpty: false }"
@ -221,7 +221,7 @@ const getDateColor = (date) => {
<VnSelect <VnSelect
url="Clients" url="Clients"
:include="{ relation: 'addresses' }" :include="{ relation: 'addresses' }"
v-model="clientId" v-model="data.clientFk"
:label="t('module.customer')" :label="t('module.customer')"
@update:model-value="(id) => fetchClientAddress(id, data)" @update:model-value="(id) => fetchClientAddress(id, data)"
/> />

View File

@ -12,6 +12,7 @@ import VnInputTime from 'components/common/VnInputTime.vue';
import axios from 'axios'; import axios from 'axios';
import useNotify from 'src/composables/useNotify.js'; import useNotify from 'src/composables/useNotify.js';
import { useValidator } from 'src/composables/useValidator';
import { toTimeFormat } from 'filters/date.js'; import { toTimeFormat } from 'filters/date.js';
const $props = defineProps({ const $props = defineProps({
@ -23,7 +24,7 @@ const $props = defineProps({
}); });
const emit = defineEmits(['updateForm']); const emit = defineEmits(['updateForm']);
const { validate } = useValidator();
const { notify } = useNotify(); const { notify } = useNotify();
const router = useRouter(); const router = useRouter();
const { t } = useI18n(); const { t } = useI18n();
@ -306,6 +307,7 @@ onMounted(() => onFormModelInit());
hide-selected hide-selected
map-options map-options
:required="true" :required="true"
:rules="validate('basicData.client')"
> >
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
@ -326,6 +328,7 @@ onMounted(() => onFormModelInit());
hide-selected hide-selected
map-options map-options
:required="true" :required="true"
:rules="validate('basicData.warehouse')"
/> />
</VnRow> </VnRow>
<VnRow> <VnRow>
@ -338,6 +341,7 @@ onMounted(() => onFormModelInit());
hide-selected hide-selected
map-options map-options
:required="true" :required="true"
:rules="validate('basicData.address')"
> >
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
@ -385,6 +389,7 @@ onMounted(() => onFormModelInit());
:label="t('basicData.alias')" :label="t('basicData.alias')"
v-model="formData.nickname" v-model="formData.nickname"
:required="true" :required="true"
:rules="validate('basicData.alias')"
/> />
</VnRow> </VnRow>
<VnRow class="row q-gutter-md q-mb-md no-wrap"> <VnRow class="row q-gutter-md q-mb-md no-wrap">
@ -397,6 +402,7 @@ onMounted(() => onFormModelInit());
hide-selected hide-selected
map-options map-options
:required="true" :required="true"
:rules="validate('basicData.company')"
/> />
<VnSelect <VnSelect
:label="t('basicData.agency')" :label="t('basicData.agency')"
@ -407,6 +413,7 @@ onMounted(() => onFormModelInit());
hide-selected hide-selected
map-options map-options
@focus="agencyFetchRef.fetch()" @focus="agencyFetchRef.fetch()"
:rules="validate('basicData.agency')"
/> />
<VnSelect <VnSelect
:label="t('basicData.zone')" :label="t('basicData.zone')"
@ -421,6 +428,7 @@ onMounted(() => onFormModelInit());
map-options map-options
:required="true" :required="true"
@focus="zonesFetchRef.fetch()" @focus="zonesFetchRef.fetch()"
:rules="validate('basicData.zone')"
> >
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
@ -440,16 +448,19 @@ onMounted(() => onFormModelInit());
:label="t('basicData.shipped')" :label="t('basicData.shipped')"
v-model="formData.shipped" v-model="formData.shipped"
:required="true" :required="true"
:rules="validate('basicData.shipped')"
/> />
<VnInputTime <VnInputTime
:label="t('basicData.shippedHour')" :label="t('basicData.shippedHour')"
v-model="formData.shipped" v-model="formData.shipped"
:required="true" :required="true"
:rules="validate('basicData.shippedHour')"
/> />
<VnInputDate <VnInputDate
:label="t('basicData.landed')" :label="t('basicData.landed')"
v-model="formData.landed" v-model="formData.landed"
:required="true" :required="true"
:rules="validate('basicData.landed')"
/> />
</VnRow> </VnRow>
</QForm> </QForm>

View File

@ -221,7 +221,12 @@ function ticketFilter(ticket) {
size="md" size="md"
icon="vn:basketadd" icon="vn:basketadd"
color="primary" color="primary"
:to="{ name: 'OrderList' }" :to="{
name: 'OrderList',
query: {
createForm: JSON.stringify({}),
},
}"
> >
<QTooltip>{{ t('ticket.card.newOrder') }}</QTooltip> <QTooltip>{{ t('ticket.card.newOrder') }}</QTooltip>
</QBtn> </QBtn>

View File

@ -100,10 +100,14 @@ const actions = {
function openDeliveryNote(type = 'deliveryNote', documentType = 'pdf') { function openDeliveryNote(type = 'deliveryNote', documentType = 'pdf') {
const path = `Tickets/${ticket.value.id}/delivery-note-${documentType}`; const path = `Tickets/${ticket.value.id}/delivery-note-${documentType}`;
openReport(path, { openReport(
path,
{
recipientId: ticket.value.clientFk, recipientId: ticket.value.clientFk,
type: type, type: type,
}); },
'_blank'
);
} }
function sendDeliveryNoteConfirmation(type = 'deliveryNote', documentType = 'pdf') { function sendDeliveryNoteConfirmation(type = 'deliveryNote', documentType = 'pdf') {

View File

@ -685,7 +685,9 @@ watch(
<template #column-itemFk="{ row }"> <template #column-itemFk="{ row }">
<VnSelect <VnSelect
v-if="row.isNew" v-if="row.isNew"
url="Items" url="Items/WithName"
:fields="['id', 'name']"
:sort-by="['id DESC']"
:options="items" :options="items"
option-label="name" option-label="name"
option-value="id" option-value="id"

View File

@ -104,7 +104,21 @@ const columns = computed(() => [
sortable: true, sortable: true,
align: 'left', align: 'left',
}, },
{
label: '',
name: 'actions',
align: 'left',
columnFilter: null,
},
]); ]);
async function deleteService(row) {
const serviceId = row.id;
const { data } = await axios.delete(`TicketServices/${serviceId}`);
if (data) notify('Service deleted successfully', 'positive');
ticketServiceCrudRef.value.reload();
}
</script> </script>
<template> <template>
@ -123,6 +137,8 @@ const columns = computed(() => [
:data-required="crudModelRequiredData" :data-required="crudModelRequiredData"
auto-load auto-load
v-model:selected="selected" v-model:selected="selected"
:order="['description ASC']"
:default-remove="false"
> >
<template #moreBeforeActions> <template #moreBeforeActions>
<QBtn <QBtn
@ -180,6 +196,21 @@ const columns = computed(() => [
/> />
</QTd> </QTd>
</template> </template>
<template #body-cell-actions="{ row }">
<QTd auto-width>
<QIcon
color="primary"
name="delete"
class="cursor-pointer"
size="sm"
@click.stop="deleteService(row)"
>
<QTooltip class="text-no-wrap">
{{ t('globals.delete') }}
</QTooltip>
</QIcon>
</QTd>
</template>
</QTable> </QTable>
</template> </template>
</CrudModel> </CrudModel>
@ -187,3 +218,4 @@ const columns = computed(() => [
<QBtn fab color="primary" icon="add" @click="ticketServiceCrudRef.insert()" /> <QBtn fab color="primary" icon="add" @click="ticketServiceCrudRef.insert()" />
</QPageSticky> </QPageSticky>
</template> </template>
ñ

View File

@ -260,15 +260,6 @@ function toTicketUrl(section) {
</VnLv> </VnLv>
<VnLv <VnLv
:label="t('ticket.summary.consignee')" :label="t('ticket.summary.consignee')"
:value="
entity.client.salesPersonUser.nickname +
' #' +
entity.client.salesPersonUser.id
"
>
</VnLv>
<VnLv
:label="t('ticket.summary.consigneeAddress')"
:value="formattedAddress()" :value="formattedAddress()"
/> />
</QCard> </QCard>

View File

@ -59,6 +59,7 @@ const arrayData = useArrayData('AdvanceTickets', {
exprBuilder: exprBuilder, exprBuilder: exprBuilder,
limit: 0, limit: 0,
}); });
console.log('arrayData: ', arrayData);
const { store } = arrayData; const { store } = arrayData;
const tickets = computed(() => const tickets = computed(() =>
(store.data || []).map((ticket, index) => ({ ...ticket, index: index })) (store.data || []).map((ticket, index) => ({ ...ticket, index: index }))
@ -461,6 +462,7 @@ onMounted(async () => {
tomorrow.setDate(tomorrow.getDate() + 1); tomorrow.setDate(tomorrow.getDate() + 1);
userParams.dateFuture = tomorrow; userParams.dateFuture = tomorrow;
userParams.dateToAdvance = today; userParams.dateToAdvance = today;
userParams.scopeDays = 1;
userParams.warehouseFk = user.value.warehouseFk; userParams.warehouseFk = user.value.warehouseFk;
const filter = { limit: 0 }; const filter = { limit: 0 };
await arrayData.addFilter({ filter, userParams }); await arrayData.addFilter({ filter, userParams });
@ -550,6 +552,7 @@ onMounted(async () => {
style="max-width: 99%" style="max-width: 99%"
> >
<template #header="props"> <template #header="props">
{{ userParams.scopeDays }}
<QTr :props="props"> <QTr :props="props">
<QTh <QTh
class="horizontal-separator text-uppercase color-vn-label" class="horizontal-separator text-uppercase color-vn-label"

View File

@ -9,6 +9,7 @@ import VnInputDate from 'src/components/common/VnInputDate.vue';
import axios from 'axios'; import axios from 'axios';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
const { t } = useI18n(); const { t } = useI18n();
const props = defineProps({ const props = defineProps({
@ -116,6 +117,15 @@ onMounted(async () => await getItemPackingTypes());
</VnSelect> </VnSelect>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem>
<QItemSection>
<VnInputNumber
v-model="params.scopeDays"
:label="t('Days onward')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<QCheckbox <QCheckbox

View File

@ -5,7 +5,7 @@ import { useRoute } from 'vue-router';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import { toDate, toCurrency } from 'src/filters/index'; import { toDate, toCurrency, dashIfEmpty } from 'src/filters/index';
import useNotify from 'src/composables/useNotify'; import useNotify from 'src/composables/useNotify';
import TicketSummary from './Card/TicketSummary.vue'; import TicketSummary from './Card/TicketSummary.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
@ -21,6 +21,7 @@ import FetchData from 'src/components/FetchData.vue';
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
import ZoneDescriptorProxy from '../Zone/Card/ZoneDescriptorProxy.vue'; import ZoneDescriptorProxy from '../Zone/Card/ZoneDescriptorProxy.vue';
import { toTimeFormat } from 'src/filters/date'; import { toTimeFormat } from 'src/filters/date';
import InvoiceOutDescriptorProxy from '../InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -150,6 +151,11 @@ const columns = computed(() => [
}, },
columnClass: 'expand', columnClass: 'expand',
}, },
{
align: 'left',
name: 'refFk',
label: t('ticketList.ref'),
},
{ {
align: 'left', align: 'left',
name: 'zoneFk', name: 'zoneFk',
@ -477,6 +483,7 @@ function setReference(data) {
}" }"
> >
<template #column-statusIcons="{ row }"> <template #column-statusIcons="{ row }">
<div class="q-gutter-x-xs">
<QIcon <QIcon
v-if="row.isTaxDataChecked === 0" v-if="row.isTaxDataChecked === 0"
color="primary" color="primary"
@ -487,7 +494,12 @@ function setReference(data) {
{{ t('No verified data') }} {{ t('No verified data') }}
</QTooltip> </QTooltip>
</QIcon> </QIcon>
<QIcon v-if="row.hasTicketRequest" color="primary" name="vn:claims" size="xs"> <QIcon
v-if="row.hasTicketRequest"
color="primary"
name="vn:buyrequest"
size="xs"
>
<QTooltip> <QTooltip>
{{ t('Purchase request') }} {{ t('Purchase request') }}
</QTooltip> </QTooltip>
@ -523,13 +535,14 @@ function setReference(data) {
<QIcon <QIcon
v-if="row.hasRounding" v-if="row.hasRounding"
color="primary" color="primary"
name="vn:sync_problem" name="sync_problem"
size="xs" size="xs"
> >
<QTooltip> <QTooltip>
{{ t('Rounding') }} {{ t('Rounding') }}
</QTooltip> </QTooltip>
</QIcon> </QIcon>
</div>
</template> </template>
<template #column-salesPersonFk="{ row }"> <template #column-salesPersonFk="{ row }">
<span class="link" @click.stop> <span class="link" @click.stop>
@ -566,9 +579,15 @@ function setReference(data) {
{{ row.state }} {{ row.state }}
</span> </span>
</template> </template>
<template #column-refFk="{ row }">
<span class="link" @click.stop>
{{ dashIfEmpty(row.refFk) }}
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
</span>
</template>
<template #column-zoneFk="{ row }"> <template #column-zoneFk="{ row }">
<span class="link" @click.stop> <span class="link" @click.stop>
{{ row.zoneName }} {{ dashIfEmpty(row.zoneName) }}
<ZoneDescriptorProxy :id="row.zoneFk" /> <ZoneDescriptorProxy :id="row.zoneFk" />
</span> </span>
</template> </template>
@ -586,6 +605,7 @@ function setReference(data) {
<VnRow> <VnRow>
<VnSelect <VnSelect
url="Clients" url="Clients"
:fields="['id', 'name']"
:label="t('ticketList.client')" :label="t('ticketList.client')"
v-model="data.clientId" v-model="data.clientId"
:options="clientsOptions" :options="clientsOptions"

View File

@ -270,3 +270,4 @@ ticketList:
closure: Closure closure: Closure
toLines: Go to lines toLines: Go to lines
addressNickname: Address nickname addressNickname: Address nickname
ref: Reference

View File

@ -273,3 +273,4 @@ ticketList:
closure: Cierre closure: Cierre
toLines: Ir a lineas toLines: Ir a lineas
addressNickname: Alias consignatario addressNickname: Alias consignatario
ref: Referencia

View File

@ -198,7 +198,7 @@ export default {
name: 'TicketPackage', name: 'TicketPackage',
meta: { meta: {
title: 'packages', title: 'packages',
icon: 'vn:bin', icon: 'vn:bucket',
}, },
component: () => import('src/pages/Ticket/Card/TicketPackage.vue'), component: () => import('src/pages/Ticket/Card/TicketPackage.vue'),
}, },