Compare commits
13 Commits
d6aedad38e
...
5a90434425
Author | SHA1 | Date |
---|---|---|
Javier Segarra | 5a90434425 | |
Alex Moreno | 6b8470d6e1 | |
Javier Segarra | 350c28eef0 | |
Alex Moreno | c1e06325d3 | |
Javier Segarra | 3b5d385d22 | |
Jorge Penadés | 7039b68bba | |
Javi Gallego | 2a1cc49499 | |
Carlos Satorres | 093e6cb0e8 | |
Carlos Satorres | 131cd2de8c | |
Carlos Satorres | 2d5d1c549b | |
Carlos Satorres | c59baf9cf5 | |
Alex Moreno | 51beef3cbe | |
Carlos Satorres | 2806c94fdb |
|
@ -9,8 +9,6 @@ import VnRow from 'components/ui/VnRow.vue';
|
||||||
import FormModelPopup from './FormModelPopup.vue';
|
import FormModelPopup from './FormModelPopup.vue';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
|
|
||||||
defineProps({ showEntityField: { type: Boolean, default: true } });
|
|
||||||
|
|
||||||
const emit = defineEmits(['onDataSaved']);
|
const emit = defineEmits(['onDataSaved']);
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const bicInputRef = ref(null);
|
const bicInputRef = ref(null);
|
||||||
|
@ -18,17 +16,16 @@ const state = useState();
|
||||||
|
|
||||||
const customer = computed(() => state.get('customer'));
|
const customer = computed(() => state.get('customer'));
|
||||||
|
|
||||||
|
const countriesFilter = {
|
||||||
|
fields: ['id', 'name', 'code'],
|
||||||
|
};
|
||||||
|
|
||||||
const bankEntityFormData = reactive({
|
const bankEntityFormData = reactive({
|
||||||
name: null,
|
name: null,
|
||||||
bic: null,
|
bic: null,
|
||||||
countryFk: customer.value?.countryFk,
|
countryFk: customer.value?.countryFk,
|
||||||
id: null,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const countriesFilter = {
|
|
||||||
fields: ['id', 'name', 'code'],
|
|
||||||
};
|
|
||||||
|
|
||||||
const countriesOptions = ref([]);
|
const countriesOptions = ref([]);
|
||||||
|
|
||||||
const onDataSaved = (...args) => {
|
const onDataSaved = (...args) => {
|
||||||
|
@ -44,7 +41,6 @@ onMounted(async () => {
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Countries"
|
url="Countries"
|
||||||
:filter="countriesFilter"
|
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="(data) => (countriesOptions = data)"
|
@on-fetch="(data) => (countriesOptions = data)"
|
||||||
/>
|
/>
|
||||||
|
@ -54,6 +50,7 @@ onMounted(async () => {
|
||||||
:title="t('title')"
|
:title="t('title')"
|
||||||
:subtitle="t('subtitle')"
|
:subtitle="t('subtitle')"
|
||||||
:form-initial-data="bankEntityFormData"
|
:form-initial-data="bankEntityFormData"
|
||||||
|
:filter="countriesFilter"
|
||||||
@on-data-saved="onDataSaved"
|
@on-data-saved="onDataSaved"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data, validate }">
|
<template #form-inputs="{ data, validate }">
|
||||||
|
@ -85,7 +82,13 @@ onMounted(async () => {
|
||||||
:rules="validate('bankEntity.countryFk')"
|
:rules="validate('bankEntity.countryFk')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showEntityField" class="col">
|
<div
|
||||||
|
v-if="
|
||||||
|
countriesOptions.find((c) => c.id === data.countryFk)?.code ==
|
||||||
|
'ES'
|
||||||
|
"
|
||||||
|
class="col"
|
||||||
|
>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('id')"
|
:label="t('id')"
|
||||||
v-model="data.id"
|
v-model="data.id"
|
||||||
|
|
|
@ -101,7 +101,13 @@ const mixinRules = [
|
||||||
<QIcon
|
<QIcon
|
||||||
name="close"
|
name="close"
|
||||||
size="xs"
|
size="xs"
|
||||||
v-if="hover && value && !$attrs.disabled && $props.clearable"
|
v-if="
|
||||||
|
hover &&
|
||||||
|
value &&
|
||||||
|
!$attrs.disabled &&
|
||||||
|
!$attrs.readonly &&
|
||||||
|
$props.clearable
|
||||||
|
"
|
||||||
@click="
|
@click="
|
||||||
() => {
|
() => {
|
||||||
value = null;
|
value = null;
|
||||||
|
|
|
@ -130,7 +130,7 @@ function cancel() {
|
||||||
<template #body-cell-description="{ row, value }">
|
<template #body-cell-description="{ row, value }">
|
||||||
<QTd auto-width align="right" class="link">
|
<QTd auto-width align="right" class="link">
|
||||||
{{ value }}
|
{{ value }}
|
||||||
<ItemDescriptorProxy :id="row.itemFk"></ItemDescriptorProxy>
|
<ItemDescriptorProxy :id="row.itemFk" />
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
|
|
|
@ -25,7 +25,7 @@ const claimFilter = computed(() => {
|
||||||
include: {
|
include: {
|
||||||
relation: 'user',
|
relation: 'user',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['id', 'nickname'],
|
fields: ['id', 'nickname', 'name'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -256,10 +256,10 @@ const showBalancePdf = ({ id }) => {
|
||||||
{{ toCurrency(balances[rowIndex]?.balance) }}
|
{{ toCurrency(balances[rowIndex]?.balance) }}
|
||||||
</template>
|
</template>
|
||||||
<template #column-description="{ row }">
|
<template #column-description="{ row }">
|
||||||
<div class="link" v-if="row.isInvoice">
|
<span class="link" v-if="row.isInvoice" @click.stop>
|
||||||
{{ t('bill', { ref: row.description }) }}
|
{{ t('bill', { ref: row.description }) }}
|
||||||
<InvoiceOutDescriptorProxy :id="row.description" />
|
<InvoiceOutDescriptorProxy :id="row.id" />
|
||||||
</div>
|
</span>
|
||||||
<span v-else class="q-pa-xs dotted rounded-borders" :title="row.description">
|
<span v-else class="q-pa-xs dotted rounded-borders" :title="row.description">
|
||||||
{{ row.description }}
|
{{ row.description }}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -126,7 +126,6 @@ const setWireTransfer = async () => {
|
||||||
(_, requestResponse) =>
|
(_, requestResponse) =>
|
||||||
onBankEntityCreated(requestResponse, row)
|
onBankEntityCreated(requestResponse, row)
|
||||||
"
|
"
|
||||||
:show-entity-field="false"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
|
|
|
@ -239,7 +239,7 @@ function makeInvoiceDialog() {
|
||||||
}
|
}
|
||||||
async function makeInvoice() {
|
async function makeInvoice() {
|
||||||
const params = {
|
const params = {
|
||||||
ticketsIds: [parseInt(ticketId)],
|
ticketsIds: [parseInt(ticketId.value)],
|
||||||
};
|
};
|
||||||
await axios.post(`Tickets/invoiceTicketsAndPdf`, params);
|
await axios.post(`Tickets/invoiceTicketsAndPdf`, params);
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ async function transferClient(client) {
|
||||||
|
|
||||||
async function addTurn(day) {
|
async function addTurn(day) {
|
||||||
const params = {
|
const params = {
|
||||||
ticketFk: parseInt(ticketId),
|
ticketFk: parseInt(ticketId.value),
|
||||||
weekDay: day,
|
weekDay: day,
|
||||||
agencyModeFk: ticket.value.agencyModeFk,
|
agencyModeFk: ticket.value.agencyModeFk,
|
||||||
};
|
};
|
||||||
|
@ -280,7 +280,7 @@ async function addTurn(day) {
|
||||||
|
|
||||||
async function createRefund(withWarehouse) {
|
async function createRefund(withWarehouse) {
|
||||||
const params = {
|
const params = {
|
||||||
ticketsIds: [parseInt(ticketId)],
|
ticketsIds: [parseInt(ticketId.value)],
|
||||||
withWarehouse: withWarehouse,
|
withWarehouse: withWarehouse,
|
||||||
negative: true,
|
negative: true,
|
||||||
};
|
};
|
||||||
|
@ -368,7 +368,7 @@ async function uploadDocuware(force) {
|
||||||
|
|
||||||
const { data } = await axios.post(`Docuwares/upload`, {
|
const { data } = await axios.post(`Docuwares/upload`, {
|
||||||
fileCabinet: 'deliveryNote',
|
fileCabinet: 'deliveryNote',
|
||||||
ticketIds: [parseInt(ticketId)],
|
ticketIds: [parseInt(ticketId.value)],
|
||||||
});
|
});
|
||||||
|
|
||||||
if (data) notify({ message: t('PDF sent!'), type: 'positive' });
|
if (data) notify({ message: t('PDF sent!'), type: 'positive' });
|
||||||
|
|
|
@ -15,7 +15,7 @@ const filter = {
|
||||||
include: {
|
include: {
|
||||||
relation: 'user',
|
relation: 'user',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['id', 'nickname'],
|
fields: ['id', 'nickname', 'name'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue