diff --git a/src/components/ui/VnSubToolBar.vue b/src/components/ui/VnSubToolBar.vue new file mode 100644 index 000000000..81a1820f1 --- /dev/null +++ b/src/components/ui/VnSubToolBar.vue @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/src/components/ui/vnSubToolBar.vue b/src/components/ui/vnSubToolBar.vue deleted file mode 100644 index 31c67cf63..000000000 --- a/src/components/ui/vnSubToolBar.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - diff --git a/src/pages/Claim/Card/ClaimCard.vue b/src/pages/Claim/Card/ClaimCard.vue index 41e4a46cb..2c0642509 100644 --- a/src/pages/Claim/Card/ClaimCard.vue +++ b/src/pages/Claim/Card/ClaimCard.vue @@ -7,8 +7,8 @@ import { computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import ClaimDescriptor from './ClaimDescriptor.vue'; +import VnSubToolBar from 'src/components/ui/VnSubToolBar.vue'; -import { onMounted, onUnmounted } from 'vue'; const stateStore = useStateStore(); const { t } = useI18n(); const route = useRoute(); @@ -22,18 +22,6 @@ const $props = defineProps({ const entityId = computed(() => { return $props.id || route.params.id; }); - -onMounted(() => { - console.log('MOUNTED', stateStore.isSubToolbarShown()); - stateStore.toggleSubToolbar(); - console.log('MOUNTED', stateStore.isSubToolbarShown()); -}); - -onUnmounted(() => { - console.log('MOUNTED', stateStore.isSubToolbarShown()); - stateStore.toggleSubToolbar(); - console.log('MOUNTED', stateStore.isSubToolbarShown()); -}); @@ -53,11 +41,7 @@ onUnmounted(() => { - - - - - + diff --git a/src/pages/Claim/Card/ClaimLines.vue b/src/pages/Claim/Card/ClaimLines.vue index a47e18fdf..e7f67bcc2 100644 --- a/src/pages/Claim/Card/ClaimLines.vue +++ b/src/pages/Claim/Card/ClaimLines.vue @@ -12,14 +12,12 @@ import FetchData from 'components/FetchData.vue'; import { toDate, toCurrency, toPercentage } from 'filters/index'; import VnDiscount from 'components/common/vnDiscount.vue'; import ClaimLinesImport from './ClaimLinesImport.vue'; -import VnSubToolBar from 'src/components/ui/vnSubToolBar.vue'; const quasar = useQuasar(); const route = useRoute(); const { t } = useI18n(); const stateStore = useStateStore(); -const subToolbarLoaded = computed(() => stateStore.isSubToolbarShown()); const arrayData = useArrayData('ClaimLines'); const store = arrayData.store; @@ -48,14 +46,17 @@ async function onFetchClaim(data) { const amount = ref(); const amountClaimed = ref(); async function onFetch(rows) { + amount.value = 0; + amountClaimed.value = 0; if (!rows || !rows.length) return; + amount.value = rows.reduce( - (acumulator, { sale }) => acumulator + sale.price * sale.quantity, + (accumulator, { sale }) => accumulator + sale.price * sale.quantity, 0 ); amountClaimed.value = rows.reduce( - (acumulator, line) => acumulator + line.sale.price * line.quantity, + (accumulator, line) => accumulator + line.sale.price * line.quantity, 0 ); } @@ -154,30 +155,9 @@ function showImportDialog() { }) .onOk(() => claimLinesForm.value.reload()); } -function isSubToolbarShown() { - return amount.value && amountClaimed; -} - {{ subToolbarLoaded }} - - - - {{ t('Amount') }} - - {{ toCurrency(amount) }} - - - - - {{ t('Amount Claimed') }} - - {{ toCurrency(amountClaimed) }} - - - - - + { - console.log('MOUNTED', stateStore.isSubToolbarShown()); - stateStore.toggleSubToolbar(); - console.log('MOUNTED', stateStore.isSubToolbarShown()); -}); diff --git a/src/pages/InvoiceOut/Card/InvoiceOutCard.vue b/src/pages/InvoiceOut/Card/InvoiceOutCard.vue index d24eb3ef2..f5e8e86b8 100644 --- a/src/pages/InvoiceOut/Card/InvoiceOutCard.vue +++ b/src/pages/InvoiceOut/Card/InvoiceOutCard.vue @@ -4,6 +4,7 @@ import { useStateStore } from 'stores/useStateStore'; import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue'; import LeftMenu from 'components/LeftMenu.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue'; +import VnSubToolBar from 'src/components/ui/VnSubToolBar.vue'; const stateStore = useStateStore(); const { t } = useI18n(); @@ -26,12 +27,7 @@ const { t } = useI18n(); - - - - - - + diff --git a/src/pages/Shelving/Card/ShelvingForm.vue b/src/pages/Shelving/Card/ShelvingForm.vue index e30ac1939..c5221aad0 100644 --- a/src/pages/Shelving/Card/ShelvingForm.vue +++ b/src/pages/Shelving/Card/ShelvingForm.vue @@ -5,6 +5,7 @@ import { useRoute } from 'vue-router'; import VnRow from 'components/ui/VnRow.vue'; import FetchData from 'components/FetchData.vue'; import FormModel from 'components/FormModel.vue'; +import VnSubToolBar from 'src/components/ui/VnSubToolBar.vue'; const { t } = useI18n(); const route = useRoute(); @@ -15,7 +16,7 @@ const defaultInitialData = { priority: 0, code: null, isRecyclable: false, -} +}; const parkingFilter = { fields: ['id', 'code'] }; const parkingList = ref([]); @@ -58,11 +59,7 @@ const shelvingFilter = { }; - - - - - +