forked from verdnatura/salix-front
fix: refs #6899 fix openReport call
This commit is contained in:
parent
d4f70355a7
commit
9aa283a612
|
@ -134,7 +134,6 @@ const refundInvoice = async (withWarehouse) => {
|
|||
};
|
||||
|
||||
const showTransferInvoiceForm = async () => {
|
||||
$props.menuRef.hide();
|
||||
quasar.dialog({
|
||||
component: TransferInvoiceForm,
|
||||
componentProps: {
|
||||
|
|
|
@ -6,6 +6,7 @@ import VnInputDate from 'src/components/common/VnInputDate.vue';
|
|||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import { usePrintService } from 'composables/usePrintService';
|
||||
import { useSession } from 'src/composables/useSession';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import InvoiceOutSummary from './Card/InvoiceOutSummary.vue';
|
||||
|
@ -25,6 +26,8 @@ const ticketsOptions = ref([]);
|
|||
const customerOptions = ref([]);
|
||||
const selectedRows = ref([]);
|
||||
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
|
||||
const MODEL = 'InvoiceOuts';
|
||||
const { openReport } = usePrintService();
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
|
@ -43,7 +46,7 @@ const columns = computed(() => [
|
|||
isTitle: true,
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'InvoiceOuts',
|
||||
url: MODEL,
|
||||
optionLabel: 'ref',
|
||||
optionValue: 'id',
|
||||
},
|
||||
|
@ -141,7 +144,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
|
||||
function openPdf(id) {
|
||||
try {
|
||||
const url = `api/InvoiceOuts/${id}/download?access_token=${tokenMultimedia}`;
|
||||
const url = `api/${MODEL}/${id}/download?access_token=${tokenMultimedia}`;
|
||||
window.open(url, '_blank');
|
||||
} catch (err) {
|
||||
console.error('Error opening PDF', err);
|
||||
|
@ -162,13 +165,13 @@ function downloadPdf() {
|
|||
);
|
||||
const invoiceOutIds = invoiceOutIdsArray.join(',');
|
||||
|
||||
const params = new URLSearchParams({
|
||||
access_token: tokenMultimedia,
|
||||
const params = {
|
||||
ids: invoiceOutIds,
|
||||
});
|
||||
};
|
||||
|
||||
const url = `api/InvoiceOuts/downloadZip?${params}`;
|
||||
window.open(url, '_blank');
|
||||
openReport(`${MODEL}/downloadZip`, params);
|
||||
// const url = `api/${MODEL}/downloadZip?${params}`;
|
||||
// window.open(url, '_blank');
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Error opening PDF');
|
||||
|
@ -199,7 +202,7 @@ watchEffect(selectedRows);
|
|||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="invoiceOut"
|
||||
url="InvoiceOuts/filter"
|
||||
:url="`${MODEL}/filter`"
|
||||
:create="{
|
||||
urlCreate: 'InvoiceOuts/createManualInvoice',
|
||||
title: t('Create Manual Invoice'),
|
||||
|
|
Loading…
Reference in New Issue