added concating orders comments
This commit is contained in:
@@ -7,6 +7,7 @@ import { onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
||||
import { useCategoriesStore } from '@/stores/categories.store'
|
||||
import type { Order, OrderProduct, Product } from '@/main'
|
||||
import { useRoutesStore } from '@/stores/routes.store'
|
||||
import { bool } from 'yup'
|
||||
|
||||
const ordersStore = useOrdersStore()
|
||||
const categoriesStore = useCategoriesStore()
|
||||
@@ -27,6 +28,7 @@ const orderByRouteAndNipRef = ref<Map<string, Map<number, {
|
||||
products: OrderProduct[]
|
||||
}>>>(new Map<string, Map<number, { orders: Order[]; products: OrderProduct[] }>>)
|
||||
const activeButton = ref(null)
|
||||
|
||||
const watchSearchDate = watch(searchDate, async (oldSearchDate, newSeatchDate) => {
|
||||
if (oldSearchDate != newSeatchDate) {
|
||||
await fetchOrders()
|
||||
@@ -129,7 +131,6 @@ function groupByNip() {
|
||||
Number(Number(existingProduct.MZE_TwrIlosc) + Number(element.MZE_TwrIlosc)).toFixed(2)
|
||||
)
|
||||
existingProduct.suma = Number(Number(existingProduct.MZE_TwrIlosc) * Number(existingProduct.MZE_TwrCena)).toFixed(2)
|
||||
|
||||
} else {
|
||||
element.MZE_TwrCena = String(Number(element.MZE_TwrCena).toFixed(2))
|
||||
element.MZE_TwrIlosc = String(Number(element.MZE_TwrIlosc).toFixed(2))
|
||||
@@ -162,11 +163,23 @@ onMounted(async () => {
|
||||
console.log(ordersByRoute.value)
|
||||
});
|
||||
|
||||
|
||||
onBeforeUnmount(async function() {
|
||||
const siteControlStore = useSiteControlStore();
|
||||
await siteControlStore.newOrder(false);
|
||||
})
|
||||
|
||||
function hasNonEmptyUwagi(item: any): boolean {
|
||||
let found = false;
|
||||
item.orders.forEach(order => {
|
||||
if(order.MZN_Uwagi) {
|
||||
found = true;
|
||||
}
|
||||
})
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -293,9 +306,9 @@ onBeforeUnmount(async function() {
|
||||
<Column field="MZE_TwrCena" header="Cena" />
|
||||
<Column field="suma" header="Suma" />
|
||||
</DataTable>
|
||||
<div v-if="item.orders[0].MZN_Uwagi != undefined">
|
||||
<p class="is-size-6 px-2">Uwagi</p>
|
||||
<p class="is-size-6 px-2">{{ item.orders[0].MZN_Uwagi }}</p>
|
||||
<div >
|
||||
<p v-if="hasNonEmptyUwagi(item)" class="is-size-6 px-2">Uwagi</p>
|
||||
<p v-for="order in item.orders" class="is-size-6 px-2">{{ order.MZN_Uwagi }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user