forked from verdnatura/salix-front
Merge branch 'dev' into 7710-cloneWithTicketPackaging
This commit is contained in:
commit
b82449b174
|
@ -202,7 +202,7 @@ function formatValue(value) {
|
|||
|
||||
function sanitizer(params) {
|
||||
for (const [key, value] of Object.entries(params)) {
|
||||
if (typeof value == 'object') {
|
||||
if (value && typeof value === 'object') {
|
||||
const param = Object.values(value)[0];
|
||||
if (typeof param == 'string') params[key] = param.replaceAll('%', '');
|
||||
}
|
||||
|
|
|
@ -103,10 +103,6 @@ select:-webkit-autofill {
|
|||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.card-width {
|
||||
width: 770px;
|
||||
}
|
||||
|
||||
.vn-card-list {
|
||||
width: 100%;
|
||||
max-width: 60em;
|
||||
|
@ -268,3 +264,10 @@ input::-webkit-inner-spin-button {
|
|||
max-width: 400px;
|
||||
}
|
||||
}
|
||||
.edit-photo-btn {
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
bottom: 12px;
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
|
@ -690,6 +690,7 @@ invoiceOut:
|
|||
chooseValidClient: Choose a valid client
|
||||
chooseValidCompany: Choose a valid company
|
||||
chooseValidPrinter: Choose a valid printer
|
||||
chooseValidSerialType: Choose a serial type
|
||||
fillDates: Invoice date and the max date should be filled
|
||||
invoiceDateLessThanMaxDate: Invoice date can not be less than max date
|
||||
invoiceWithFutureDate: Exists an invoice with a future date
|
||||
|
|
|
@ -696,6 +696,7 @@ invoiceOut:
|
|||
chooseValidClient: Selecciona un cliente válido
|
||||
chooseValidCompany: Selecciona una empresa válida
|
||||
chooseValidPrinter: Selecciona una impresora válida
|
||||
chooseValidSerialType: Selecciona una tipo de serie válida
|
||||
fillDates: La fecha de la factura y la fecha máxima deben estar completas
|
||||
invoiceDateLessThanMaxDate: La fecha de la factura no puede ser menor que la fecha máxima
|
||||
invoiceWithFutureDate: Existe una factura con una fecha futura
|
||||
|
|
|
@ -42,7 +42,7 @@ claim:
|
|||
pickup: Recoger
|
||||
null: No
|
||||
agency: Agencia
|
||||
delivery: Entrega
|
||||
delivery: Reparto
|
||||
fileDescription: 'ID de reclamación {claimId} del cliente {clientName} con ID {clientId}'
|
||||
noData: 'No hay imágenes/videos, haz clic aquí o arrastra y suelta el archivo'
|
||||
dragDrop: Arrastra y suelta aquí
|
||||
|
|
|
@ -222,7 +222,7 @@ const showTransferInvoiceForm = async () => {
|
|||
<QItemSection>{{ t('Generate PDF invoice') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable>
|
||||
<QItemSection>{{ t('Refund...') }}</QItemSection>
|
||||
<QItemSection>{{ t('Refund') }}</QItemSection>
|
||||
<QItemSection side>
|
||||
<QIcon name="keyboard_arrow_right" />
|
||||
</QItemSection>
|
||||
|
@ -250,7 +250,7 @@ es:
|
|||
Delete invoice: Eliminar factura
|
||||
Book invoice: Asentar factura
|
||||
Generate PDF invoice: Generar PDF factura
|
||||
Refund...: Abono
|
||||
Refund: Abono
|
||||
As PDF: como PDF
|
||||
As CSV: como CSV
|
||||
Send PDF: Enviar PDF
|
||||
|
|
|
@ -94,11 +94,13 @@ const selectCustomerId = (id) => {
|
|||
};
|
||||
|
||||
const statusText = computed(() => {
|
||||
return status.value === 'invoicing'
|
||||
? `${t(`status.${status.value}`)} ${
|
||||
addresses.value[getAddressNumber.value]?.clientId
|
||||
}`
|
||||
: t(`status.${status.value}`);
|
||||
const baseStatus = t(`status.${status.value}`);
|
||||
const clientId =
|
||||
status.value === 'invoicing'
|
||||
? addresses.value[getAddressNumber.value]?.clientId || ''
|
||||
: '';
|
||||
|
||||
return clientId ? `${baseStatus} ${clientId}`.trim() : baseStatus;
|
||||
});
|
||||
|
||||
onMounted(() => (stateStore.rightDrawer = true));
|
||||
|
|
|
@ -20,21 +20,25 @@ const { initialDataLoading, formInitialData, invoicing, status } =
|
|||
const { makeInvoice, setStatusValue } = invoiceOutGlobalStore;
|
||||
|
||||
const clientsToInvoice = ref('all');
|
||||
|
||||
const companiesOptions = ref([]);
|
||||
|
||||
const printersOptions = ref([]);
|
||||
const serialTypesOptions = ref([]);
|
||||
|
||||
const clientsOptions = ref([]);
|
||||
const handleInvoiceOutSerialsFetch = (data) => {
|
||||
serialTypesOptions.value = Array.from(
|
||||
new Set(data.map((item) => item.type).filter((type) => type))
|
||||
);
|
||||
};
|
||||
|
||||
const formData = ref({});
|
||||
|
||||
const optionsInitialData = computed(() => {
|
||||
return (
|
||||
companiesOptions.value.length > 0 &&
|
||||
printersOptions.value.length > 0 &&
|
||||
clientsOptions.value.length > 0
|
||||
);
|
||||
const optionsArrays = [
|
||||
companiesOptions.value,
|
||||
printersOptions.value,
|
||||
serialTypesOptions.value,
|
||||
];
|
||||
return optionsArrays.every((arr) => arr.length > 0);
|
||||
});
|
||||
|
||||
const getStatus = computed({
|
||||
|
@ -59,8 +63,11 @@ onMounted(async () => {
|
|||
auto-load
|
||||
/>
|
||||
<FetchData url="Printers" @on-fetch="(data) => (printersOptions = data)" auto-load />
|
||||
<FetchData url="Clients" @on-fetch="(data) => (clientsOptions = data)" auto-load />
|
||||
|
||||
<FetchData
|
||||
url="invoiceOutSerials"
|
||||
@on-fetch="handleInvoiceOutSerialsFetch"
|
||||
auto-load
|
||||
/>
|
||||
<QForm
|
||||
v-if="!initialDataLoading && optionsInitialData"
|
||||
@submit="makeInvoice(formData, clientsToInvoice)"
|
||||
|
@ -87,7 +94,7 @@ onMounted(async () => {
|
|||
v-if="clientsToInvoice === 'one'"
|
||||
:label="t('client')"
|
||||
v-model="formData.clientId"
|
||||
:options="clientsOptions"
|
||||
url="Clients"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
hide-selected
|
||||
|
@ -95,6 +102,17 @@ onMounted(async () => {
|
|||
outlined
|
||||
rounded
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('invoiceOutSerialType')"
|
||||
v-model="formData.serialType"
|
||||
:options="serialTypesOptions"
|
||||
option-value="type"
|
||||
option-label="type"
|
||||
hide-selected
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
<VnInputDate
|
||||
v-model="formData.invoiceDate"
|
||||
:label="t('invoiceDate')"
|
||||
|
@ -168,6 +186,7 @@ en:
|
|||
printer: Printer
|
||||
invoiceOut: Invoice out
|
||||
client: Client
|
||||
invoiceOutSerialType: Serial Type
|
||||
stop: Stop
|
||||
|
||||
es:
|
||||
|
@ -179,5 +198,6 @@ es:
|
|||
printer: Impresora
|
||||
invoiceOut: Facturar
|
||||
client: Cliente
|
||||
invoiceOutSerialType: Tipo de Serie
|
||||
stop: Parar
|
||||
</i18n>
|
||||
|
|
|
@ -198,7 +198,7 @@ watchEffect(selectedRows);
|
|||
:url="`${MODEL}/filter`"
|
||||
:create="{
|
||||
urlCreate: 'InvoiceOuts/createManualInvoice',
|
||||
title: t('Create Manual Invoice'),
|
||||
title: t('Create manual invoice'),
|
||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||
formInitialData: {
|
||||
active: true,
|
||||
|
@ -275,10 +275,12 @@ en:
|
|||
fileAllowed: Successful download of CSV file
|
||||
youCanSearchByInvoiceReference: You can search by invoice reference
|
||||
createInvoice: Make invoice
|
||||
Create manual invoice: Create manual invoice
|
||||
es:
|
||||
searchInvoice: Buscar factura emitida
|
||||
fileDenied: El navegador denegó la descarga de archivos...
|
||||
fileAllowed: Descarga exitosa de archivo CSV
|
||||
youCanSearchByInvoiceReference: Puedes buscar por referencia de la factura
|
||||
createInvoice: Crear factura
|
||||
Create manual invoice: Crear factura manual
|
||||
</i18n>
|
||||
|
|
|
@ -138,14 +138,6 @@ en:
|
|||
</i18n>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.edit-photo-btn {
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
bottom: 12px;
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.separation-borders {
|
||||
border-left: 1px solid $white;
|
||||
border-right: 1px solid $white;
|
||||
|
|
|
@ -252,7 +252,7 @@ const createRefund = async (withWarehouse) => {
|
|||
</QItem>
|
||||
<QItem clickable v-ripple>
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ t('Refund...') }}</QItemLabel>
|
||||
<QItemLabel>{{ t('Refund') }}</QItemLabel>
|
||||
</QItemSection>
|
||||
<QItemSection side>
|
||||
<QIcon name="keyboard_arrow_right" />
|
||||
|
@ -287,7 +287,7 @@ es:
|
|||
Add claim: Crear reclamación
|
||||
Mark as reserved: Marcar como reservado
|
||||
Unmark as reserved: Desmarcar como reservado
|
||||
Refund...: Abono...
|
||||
Refund: Abono
|
||||
with warehouse: con almacén
|
||||
without warehouse: sin almacén
|
||||
Claim out of time: Reclamación fuera de plazo
|
||||
|
|
|
@ -448,7 +448,7 @@ const handleCloseProgressDialog = () => {
|
|||
const handleCancelProgress = () => (cancelProgress.value = true);
|
||||
|
||||
onMounted(async () => {
|
||||
let today = Date.vnNew();
|
||||
let today = Date.vnNew().toISOString();
|
||||
const tomorrow = new Date(today);
|
||||
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||
userParams.dateFuture = tomorrow;
|
||||
|
|
|
@ -55,7 +55,7 @@ onMounted(async () => await getItemPackingTypes());
|
|||
:data-key="props.dataKey"
|
||||
:search-button="true"
|
||||
:hidden-tags="['search']"
|
||||
:unremovable-params="['warehouseFk', 'dateFuture', 'dateToAdvance']"
|
||||
:un-removable-params="['warehouseFk', 'dateFuture', 'dateToAdvance']"
|
||||
>
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<div class="q-gutter-x-xs">
|
||||
|
@ -70,7 +70,6 @@ onMounted(async () => await getItemPackingTypes());
|
|||
v-model="params.dateFuture"
|
||||
:label="t('params.dateFuture')"
|
||||
is-outlined
|
||||
@update:model-value="searchFn()"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
@ -80,7 +79,6 @@ onMounted(async () => await getItemPackingTypes());
|
|||
v-model="params.dateToAdvance"
|
||||
:label="t('params.dateToAdvance')"
|
||||
is-outlined
|
||||
@update:model-value="searchFn()"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
|
|
@ -8,6 +8,8 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
|||
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import TicketFutureFilter from './TicketFutureFilter.vue';
|
||||
|
||||
import { dashIfEmpty, toCurrency } from 'src/filters';
|
||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||
|
@ -37,9 +39,9 @@ const exprBuilder = (param, value) => {
|
|||
return { liters: value };
|
||||
case 'lines':
|
||||
return { lines: value };
|
||||
case 'ipt':
|
||||
case 'iptColFilter':
|
||||
return { ipt: { like: `%${value}%` } };
|
||||
case 'futureIpt':
|
||||
case 'futureIptColFilter':
|
||||
return { futureIpt: { like: `%${value}%` } };
|
||||
case 'totalWithVat':
|
||||
return { totalWithVat: value };
|
||||
|
@ -47,8 +49,8 @@ const exprBuilder = (param, value) => {
|
|||
};
|
||||
|
||||
const userParams = reactive({
|
||||
futureDated: Date.vnNew(),
|
||||
originDated: Date.vnNew(),
|
||||
futureDated: Date.vnNew().toISOString(),
|
||||
originDated: Date.vnNew().toISOString(),
|
||||
warehouseFk: user.value.warehouseFk,
|
||||
});
|
||||
|
||||
|
@ -83,6 +85,8 @@ const getInputEvents = (col) => {
|
|||
};
|
||||
};
|
||||
|
||||
const tickets = computed(() => store.data);
|
||||
|
||||
const ticketColumns = computed(() => [
|
||||
{
|
||||
label: t('futureTickets.problems'),
|
||||
|
@ -121,7 +125,7 @@ const ticketColumns = computed(() => [
|
|||
sortable: true,
|
||||
columnFilter: {
|
||||
component: VnSelect,
|
||||
filterParamKey: 'ipt',
|
||||
filterParamKey: 'iptColFilter',
|
||||
type: 'select',
|
||||
filterValue: null,
|
||||
event: getInputEvents,
|
||||
|
@ -214,7 +218,7 @@ const ticketColumns = computed(() => [
|
|||
sortable: true,
|
||||
columnFilter: {
|
||||
component: VnSelect,
|
||||
filterParamKey: 'futureIpt',
|
||||
filterParamKey: 'futureIptColFilter',
|
||||
type: 'select',
|
||||
filterValue: null,
|
||||
event: getInputEvents,
|
||||
|
@ -305,9 +309,14 @@ onMounted(async () => {
|
|||
</QBtn>
|
||||
</template>
|
||||
</VnSubToolbar>
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
<TicketFutureFilter data-key="FutureTickets" />
|
||||
</template>
|
||||
</RightMenu>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
<QTable
|
||||
:rows="store.data"
|
||||
:rows="tickets"
|
||||
:columns="ticketColumns"
|
||||
row-key="id"
|
||||
selection="multiple"
|
||||
|
|
|
@ -0,0 +1,242 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
||||
import axios from 'axios';
|
||||
import { onMounted } from 'vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const props = defineProps({
|
||||
dataKey: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const warehousesOptions = ref([]);
|
||||
const itemPackingTypes = ref([]);
|
||||
const stateOptions = ref([]);
|
||||
|
||||
const getItemPackingTypes = async () => {
|
||||
try {
|
||||
const filter = {
|
||||
where: { isActive: true },
|
||||
};
|
||||
const { data } = await axios.get('ItemPackingTypes', {
|
||||
params: { filter: JSON.stringify(filter) },
|
||||
});
|
||||
itemPackingTypes.value = data.map((ipt) => ({
|
||||
description: t(ipt.description),
|
||||
code: ipt.code,
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
|
||||
const getGroupedStates = async () => {
|
||||
try {
|
||||
const { data } = await axios.get('AlertLevels');
|
||||
stateOptions.value = data.map((state) => ({
|
||||
id: state.id,
|
||||
name: t(`futureTickets.${state.code}`),
|
||||
code: state.code,
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
getItemPackingTypes();
|
||||
getGroupedStates();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
url="Warehouses"
|
||||
@on-fetch="(data) => (warehousesOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
<VnFilterPanel
|
||||
:data-key="props.dataKey"
|
||||
:hidden-tags="['search']"
|
||||
:un-removable-params="['warehouseFk', 'originDated', 'futureDated']"
|
||||
>
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<div class="q-gutter-x-xs">
|
||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||
<span>{{ formatFn(tag.value) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #body="{ params, searchFn }">
|
||||
<QItem class="q-my-sm">
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
v-model="params.originDated"
|
||||
:label="t('params.originDated')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-my-sm">
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
v-model="params.futureDated"
|
||||
:label="t('params.futureDated')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-my-sm">
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('params.litersMax')"
|
||||
v-model="params.litersMax"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-my-sm">
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('params.linesMax')"
|
||||
v-model="params.linesMax"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('params.ipt')"
|
||||
v-model="params.ipt"
|
||||
:options="itemPackingTypes"
|
||||
option-value="code"
|
||||
option-label="description"
|
||||
:info="t('iptInfo')"
|
||||
@update:model-value="searchFn()"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
>
|
||||
</VnSelect>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('params.futureIpt')"
|
||||
v-model="params.futureIpt"
|
||||
:options="itemPackingTypes"
|
||||
option-value="code"
|
||||
option-label="description"
|
||||
:info="t('iptInfo')"
|
||||
@update:model-value="searchFn()"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
>
|
||||
</VnSelect>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('params.state')"
|
||||
v-model="params.state"
|
||||
:options="stateOptions"
|
||||
option-value="code"
|
||||
option-label="name"
|
||||
@update:model-value="searchFn()"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
>
|
||||
</VnSelect>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('params.futureState')"
|
||||
v-model="params.futureState"
|
||||
:options="stateOptions"
|
||||
option-value="code"
|
||||
option-label="name"
|
||||
@update:model-value="searchFn()"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
>
|
||||
</VnSelect>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="t('params.problems')"
|
||||
v-model="params.problems"
|
||||
:toggle-indeterminate="false"
|
||||
@update:model-value="searchFn()"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('params.warehouseFk')"
|
||||
v-model="params.warehouseFk"
|
||||
:options="warehousesOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
@update:model-value="searchFn()"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
>
|
||||
</VnSelect>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnFilterPanel>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
en:
|
||||
iptInfo: IPT
|
||||
params:
|
||||
originDated: Origin date
|
||||
futureDated: Destination date
|
||||
futureIpt: Destination IPT
|
||||
ipt: Origin IPT
|
||||
warehouseFk: Warehouse
|
||||
litersMax: Max liters
|
||||
linesMax: Max lines
|
||||
state: Origin grouped state
|
||||
futureState: Destination grouped state
|
||||
problems: With problems
|
||||
es:
|
||||
Horizontal: Horizontal
|
||||
Vertical: Vertical
|
||||
iptInfo: Encajado
|
||||
params:
|
||||
originDated: Fecha origen
|
||||
futureDated: Fecha destino
|
||||
futureIpt: IPT destino
|
||||
ipt: IPT Origen
|
||||
warehouseFk: Almacén
|
||||
litersMax: Litros máx.
|
||||
linesMax: Líneas máx.
|
||||
state: Estado agrupado origen
|
||||
futureState: Estado agrupado destino
|
||||
problems: Con problemas
|
||||
</i18n>
|
|
@ -93,6 +93,11 @@ futureTickets:
|
|||
moveTicketSuccess: Tickets moved successfully!
|
||||
searchInfo: Search future tickets by date
|
||||
futureTicket: Future tickets
|
||||
FREE: Free
|
||||
ON_PREVIOUS: ON_PREVIOUS
|
||||
ON_PREPARATION: On preparation
|
||||
PACKED: Packed
|
||||
DELIVERED: Delivered
|
||||
expedition:
|
||||
id: Expedition
|
||||
item: Item
|
||||
|
|
|
@ -140,6 +140,11 @@ futureTickets:
|
|||
moveTicketSuccess: Tickets movidos correctamente
|
||||
searchInfo: Buscar tickets por fecha
|
||||
futureTicket: Tickets a futuro
|
||||
FREE: Libre
|
||||
ON_PREVIOUS: ON_PREVIOUS
|
||||
ON_PREPARATION: En preparación
|
||||
PACKED: Encajado
|
||||
DELIVERED: Servido
|
||||
ticketSale:
|
||||
id: Id
|
||||
visible: Visible
|
||||
|
|
|
@ -10,6 +10,7 @@ import useCardDescription from 'src/composables/useCardDescription';
|
|||
import { useState } from 'src/composables/useState';
|
||||
import axios from 'axios';
|
||||
import VnImg from 'src/components/ui/VnImg.vue';
|
||||
import EditPictureForm from 'components/EditPictureForm.vue';
|
||||
|
||||
const $props = defineProps({
|
||||
id: {
|
||||
|
@ -18,6 +19,7 @@ const $props = defineProps({
|
|||
default: null,
|
||||
},
|
||||
});
|
||||
const image = ref(null);
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
@ -25,6 +27,10 @@ const state = useState();
|
|||
const user = state.getUser();
|
||||
const changePasswordFormDialog = ref(null);
|
||||
const cardDescriptorRef = ref(null);
|
||||
const showEditPhotoForm = ref(false);
|
||||
const toggleEditPictureForm = () => {
|
||||
showEditPhotoForm.value = !showEditPhotoForm.value;
|
||||
};
|
||||
|
||||
const entityId = computed(() => {
|
||||
return $props.id || route.params.id;
|
||||
|
@ -99,7 +105,9 @@ const handleExcluded = async () => {
|
|||
|
||||
workerExcluded.value = !workerExcluded.value;
|
||||
};
|
||||
|
||||
const handlePhotoUpdated = (evt = false) => {
|
||||
image.value.reload(evt);
|
||||
};
|
||||
const refetch = async () => await cardDescriptorRef.value.getData();
|
||||
</script>
|
||||
<template>
|
||||
|
@ -144,27 +152,49 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
|||
</QItem>
|
||||
</template>
|
||||
<template #before>
|
||||
<VnImg
|
||||
:id="parseInt(entityId)"
|
||||
collection="user"
|
||||
resolution="520x520"
|
||||
class="photo"
|
||||
>
|
||||
<template #error>
|
||||
<div
|
||||
class="absolute-full picture text-center q-pa-md flex flex-center"
|
||||
>
|
||||
<div>
|
||||
<div class="text-grey-5" style="opacity: 0.4; font-size: 5vh">
|
||||
<QIcon name="vn:claims" />
|
||||
</div>
|
||||
<div class="text-grey-5" style="opacity: 0.4">
|
||||
{{ t('worker.imageNotFound') }}
|
||||
<div class="relative-position">
|
||||
<VnImg
|
||||
ref="image"
|
||||
:id="parseInt(entityId)"
|
||||
collection="user"
|
||||
resolution="520x520"
|
||||
class="photo"
|
||||
>
|
||||
<template #error>
|
||||
<div
|
||||
class="absolute-full picture text-center q-pa-md flex flex-center"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="text-grey-5"
|
||||
style="opacity: 0.4; font-size: 5vh"
|
||||
>
|
||||
<QIcon name="vn:claims" />
|
||||
</div>
|
||||
<div class="text-grey-5" style="opacity: 0.4">
|
||||
{{ t('worker.imageNotFound') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</VnImg>
|
||||
</template> </VnImg
|
||||
><QBtn
|
||||
color="primary"
|
||||
size="lg"
|
||||
round
|
||||
class="edit-photo-btn"
|
||||
@click="toggleEditPictureForm()"
|
||||
>
|
||||
<QIcon name="edit" size="sm" />
|
||||
<QDialog ref="editPhotoFormDialog" v-model="showEditPhotoForm">
|
||||
<EditPictureForm
|
||||
collection="user"
|
||||
:id="entityId"
|
||||
@close-form="toggleEditPictureForm()"
|
||||
@on-photo-uploaded="handlePhotoUpdated"
|
||||
/>
|
||||
</QDialog>
|
||||
</QBtn>
|
||||
</div>
|
||||
</template>
|
||||
<template #body="{ entity }">
|
||||
<VnLv :label="t('worker.card.name')" :value="entity.user?.nickname" />
|
||||
|
|
|
@ -19,6 +19,7 @@ export const useInvoiceOutGlobalStore = defineStore({
|
|||
maxShipped: null,
|
||||
clientId: null,
|
||||
printer: null,
|
||||
serialType: null,
|
||||
},
|
||||
addresses: [],
|
||||
minInvoicingDate: null,
|
||||
|
@ -100,6 +101,7 @@ export const useInvoiceOutGlobalStore = defineStore({
|
|||
maxShipped: new Date(formData.maxShipped),
|
||||
clientId: formData.clientId ? formData.clientId : null,
|
||||
companyFk: formData.companyFk,
|
||||
serialType: formData.serialType,
|
||||
};
|
||||
|
||||
this.validateMakeInvoceParams(params, clientsToInvoice);
|
||||
|
@ -152,7 +154,13 @@ export const useInvoiceOutGlobalStore = defineStore({
|
|||
);
|
||||
throw new Error('Invoice date in the future');
|
||||
}
|
||||
|
||||
if (!params.serialType) {
|
||||
notify(
|
||||
'invoiceOut.globalInvoices.errors.chooseValidSerialType',
|
||||
'negative'
|
||||
);
|
||||
throw new Error('Invalid Serial Type');
|
||||
}
|
||||
if (!params.companyFk) {
|
||||
notify('invoiceOut.globalInvoices.errors.chooseValidCompany', 'negative');
|
||||
throw new Error('Invalid company');
|
||||
|
@ -180,6 +188,7 @@ export const useInvoiceOutGlobalStore = defineStore({
|
|||
invoiceDate: new Date(formData.invoiceDate),
|
||||
maxShipped: new Date(formData.maxShipped),
|
||||
companyFk: formData.companyFk,
|
||||
serialType: formData.serialType,
|
||||
};
|
||||
|
||||
this.status = 'invoicing';
|
||||
|
@ -191,12 +200,7 @@ export const useInvoiceOutGlobalStore = defineStore({
|
|||
this.addressIndex++;
|
||||
this.isInvoicing = false;
|
||||
} catch (err) {
|
||||
if (
|
||||
err &&
|
||||
err.response &&
|
||||
err.response.status >= 400 &&
|
||||
err.response.status < 500
|
||||
) {
|
||||
if (err?.response?.status >= 400 && err?.response?.status < 500) {
|
||||
this.invoiceClientError(address, err.response?.data?.error?.message);
|
||||
return;
|
||||
} else {
|
||||
|
@ -243,7 +247,7 @@ export const useInvoiceOutGlobalStore = defineStore({
|
|||
params,
|
||||
});
|
||||
|
||||
if (data.data && data.data.error) throw new Error();
|
||||
if (data?.data?.error) throw new Error();
|
||||
|
||||
const status = exportFile('negativeBases.csv', data, {
|
||||
encoding: 'windows-1252',
|
||||
|
|
Loading…
Reference in New Issue