Several changes
This commit is contained in:
parent
992ada0984
commit
859c87940d
|
@ -21,6 +21,7 @@ const {
|
||||||
nPdfs,
|
nPdfs,
|
||||||
totalPdfs,
|
totalPdfs,
|
||||||
errors,
|
errors,
|
||||||
|
addresses,
|
||||||
} = storeToRefs(invoiceOutGlobalStore);
|
} = storeToRefs(invoiceOutGlobalStore);
|
||||||
|
|
||||||
const selectedCustomerId = ref(null);
|
const selectedCustomerId = ref(null);
|
||||||
|
@ -86,6 +87,14 @@ const selectCustomerId = (id) => {
|
||||||
selectedCustomerId.value = id;
|
selectedCustomerId.value = id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const statusText = computed(() => {
|
||||||
|
return status.value === 'invoicing'
|
||||||
|
? `${t(`status.${status.value}`)} ${
|
||||||
|
addresses.value[getAddressNumber.value]?.clientId
|
||||||
|
}`
|
||||||
|
: t(`status.${status.value}`);
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => (stateStore.rightDrawer = true));
|
onMounted(() => (stateStore.rightDrawer = true));
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
stateStore.rightDrawer = false;
|
stateStore.rightDrawer = false;
|
||||||
|
@ -103,7 +112,7 @@ onUnmounted(() => {
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<QCard v-if="status" class="card">
|
<QCard v-if="status" class="card">
|
||||||
<QCardSection class="card-section">
|
<QCardSection class="card-section">
|
||||||
<span class="text">{{ t(`status.${status}`) }}</span>
|
<span class="text">{{ statusText }}</span>
|
||||||
<span class="text">{{
|
<span class="text">{{
|
||||||
t('invoiceOut.globalInvoices.statusCard.percentageText', {
|
t('invoiceOut.globalInvoices.statusCard.percentageText', {
|
||||||
getPercentage: getPercentage,
|
getPercentage: getPercentage,
|
||||||
|
|
|
@ -119,7 +119,7 @@ const openPdf = () => {
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
auto-load
|
auto-load
|
||||||
data-key="InvoiceOutList"
|
data-key="InvoiceOutList"
|
||||||
order="issued DESC, id DESC"
|
:order="['issued DESC', 'id DESC']"
|
||||||
url="InvoiceOuts/filter"
|
url="InvoiceOuts/filter"
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onBeforeMount } from 'vue';
|
import { ref, computed, onBeforeMount, onMounted, nextTick } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
|
@ -45,6 +45,14 @@ onBeforeMount(async () => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const componentIsRendered = ref(false);
|
||||||
|
|
||||||
|
onMounted(() =>
|
||||||
|
nextTick(() => {
|
||||||
|
componentIsRendered.value = true;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
const rows = computed(() => arrayData.value.store.data);
|
const rows = computed(() => arrayData.value.store.data);
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
@ -139,7 +147,10 @@ const downloadCSV = async () => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<template v-if="stateStore.isHeaderMounted()">
|
<template v-if="stateStore.isHeaderMounted()">
|
||||||
<Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown()">
|
<Teleport
|
||||||
|
to="#st-actions"
|
||||||
|
v-if="stateStore?.isSubToolbarShown() && componentIsRendered"
|
||||||
|
>
|
||||||
<QBtn color="primary" icon-right="download" no-caps @click="downloadCSV()">
|
<QBtn color="primary" icon-right="download" no-caps @click="downloadCSV()">
|
||||||
<QTooltip>{{ t('Download as CSV') }}</QTooltip>
|
<QTooltip>{{ t('Download as CSV') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
@ -178,6 +189,21 @@ const downloadCSV = async () => {
|
||||||
<WorkerDescriptorProxy :id="row.comercialId" />
|
<WorkerDescriptorProxy :id="row.comercialId" />
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
|
<template #body-cell-active="{ row }">
|
||||||
|
<QTd>
|
||||||
|
<QCheckbox :model-value="!!row.isActive" disable />
|
||||||
|
</QTd>
|
||||||
|
</template>
|
||||||
|
<template #body-cell-hasToInvoice="{ row }">
|
||||||
|
<QTd>
|
||||||
|
<QCheckbox :model-value="!!row.hasToInvoice" disable />
|
||||||
|
</QTd>
|
||||||
|
</template>
|
||||||
|
<template #body-cell-verifiedData="{ row }">
|
||||||
|
<QTd>
|
||||||
|
<QCheckbox :model-value="!!row.isTaxDataChecked" disable />
|
||||||
|
</QTd>
|
||||||
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
</QPage>
|
</QPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -43,7 +43,7 @@ export default {
|
||||||
name: 'InvoiceOutNegativeBases',
|
name: 'InvoiceOutNegativeBases',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'negativeBases',
|
title: 'negativeBases',
|
||||||
icon: 'view_list',
|
icon: 'vn:ticket',
|
||||||
},
|
},
|
||||||
component: () =>
|
component: () =>
|
||||||
import('src/pages/InvoiceOut/InvoiceOutNegativeBases.vue'),
|
import('src/pages/InvoiceOut/InvoiceOutNegativeBases.vue'),
|
||||||
|
|
|
@ -107,7 +107,6 @@ export const useInvoiceOutGlobalStore = defineStore({
|
||||||
if (clientsToInvoice == 'all') params.clientId = undefined;
|
if (clientsToInvoice == 'all') params.clientId = undefined;
|
||||||
|
|
||||||
const { data } = await axios.post('InvoiceOuts/clientsToInvoice', params);
|
const { data } = await axios.post('InvoiceOuts/clientsToInvoice', params);
|
||||||
|
|
||||||
this.addresses = data;
|
this.addresses = data;
|
||||||
|
|
||||||
if (!this.addresses || !this.addresses.length > 0) {
|
if (!this.addresses || !this.addresses.length > 0) {
|
||||||
|
@ -188,10 +187,8 @@ export const useInvoiceOutGlobalStore = defineStore({
|
||||||
|
|
||||||
const { data } = await axios.post('InvoiceOuts/invoiceClient', params);
|
const { data } = await axios.post('InvoiceOuts/invoiceClient', params);
|
||||||
|
|
||||||
if (data) {
|
if (data) await this.makePdfAndNotify(data, address);
|
||||||
await this.makePdfAndNotify(data, address);
|
this.addressIndex++;
|
||||||
}
|
|
||||||
|
|
||||||
this.isInvoicing = false;
|
this.isInvoicing = false;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (
|
if (
|
||||||
|
@ -201,7 +198,6 @@ export const useInvoiceOutGlobalStore = defineStore({
|
||||||
err.response.status < 500
|
err.response.status < 500
|
||||||
) {
|
) {
|
||||||
this.invoiceClientError(address, err.response?.data?.error?.message);
|
this.invoiceClientError(address, err.response?.data?.error?.message);
|
||||||
this.addressIndex++;
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
this.invoicing = false;
|
this.invoicing = false;
|
||||||
|
|
Loading…
Reference in New Issue