refactor: refs #8388 compute totalAmount dynamically from arrayData
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
07f58bbec0
commit
2d0cb72774
|
@ -53,12 +53,16 @@ const warehouses = ref([]);
|
||||||
const defaultDmsDescription = ref();
|
const defaultDmsDescription = ref();
|
||||||
const dmsTypeId = ref();
|
const dmsTypeId = ref();
|
||||||
const selectedRows = ref([]);
|
const selectedRows = ref([]);
|
||||||
const totalAmount = ref();
|
|
||||||
const hasDiferentDms = ref(false);
|
const hasDiferentDms = ref(false);
|
||||||
let maxDays;
|
let maxDays;
|
||||||
let defaultDays;
|
let defaultDays;
|
||||||
let supplierRef;
|
let supplierRef;
|
||||||
let dmsFk;
|
let dmsFk;
|
||||||
|
|
||||||
|
const totalAmount = computed(() => {
|
||||||
|
return arrayData.store.data.totalAmount ?? 0;
|
||||||
|
});
|
||||||
|
|
||||||
const totalSelectedAmount = computed(() => {
|
const totalSelectedAmount = computed(() => {
|
||||||
if (!selectedRows.value.length) return 0;
|
if (!selectedRows.value.length) return 0;
|
||||||
return selectedRows.value.reduce((acc, entry) => acc + entry.amount, 0);
|
return selectedRows.value.reduce((acc, entry) => acc + entry.amount, 0);
|
||||||
|
@ -397,13 +401,10 @@ async function createInvoice() {
|
||||||
:user-params="{ daysAgo, isBooked }"
|
:user-params="{ daysAgo, isBooked }"
|
||||||
:row-click="false"
|
:row-click="false"
|
||||||
:table="{ selection: 'multiple' }"
|
:table="{ selection: 'multiple' }"
|
||||||
:limit="0"
|
|
||||||
:footer="true"
|
:footer="true"
|
||||||
@on-fetch="
|
|
||||||
(data) => (totalAmount = data?.reduce((acc, entry) => acc + entry.amount, 0))
|
|
||||||
"
|
|
||||||
:selection-fn="(rows) => rows.filter((row) => !row.isBooked)"
|
:selection-fn="(rows) => rows.filter((row) => !row.isBooked)"
|
||||||
auto-load
|
auto-load
|
||||||
|
key-data="preAccounting"
|
||||||
>
|
>
|
||||||
<template #top-left>
|
<template #top-left>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
|
Loading…
Reference in New Issue