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