0
0
Fork 0

Fix order feedback

This commit is contained in:
Kevin Martinez 2024-01-02 12:29:34 -04:00
parent 36ae5ab538
commit c29586632c
5 changed files with 25 additions and 18 deletions

View File

@ -76,6 +76,12 @@ const setCategoryList = (data) => {
icon: `vn:${(category.icon || '').split('-')[1]}`,
}));
};
const getCategoryClass = (category, params) => {
if (category.id === params?.categoryFk) {
return 'active';
}
};
</script>
<template>
@ -105,10 +111,7 @@ const setCategoryList = (data) => {
<div
v-for="category in categoryList"
:key="category.name"
:class="[
'category',
category.id === params?.categoryFk && 'active',
]"
:class="['category', getCategoryClass(category, params)]"
>
<QIcon
:name="category.icon"

View File

@ -6,6 +6,8 @@ import OrderCatalogItemDialog from 'pages/Order/Card/OrderCatalogItemDialog.vue'
import toCurrency from '../../../filters/toCurrency';
import { ref } from 'vue';
const DEFAULT_PRICE_KG = 0;
const session = useSession();
const token = session.getToken();
const { t } = useI18n();
@ -70,7 +72,7 @@ const dialog = ref(null);
</QIcon>
</div>
<p v-if="item.priceKg" class="price-kg">
{{ t('price-kg') }} {{ toCurrency(item.priceKg) || 1123 }}
{{ t('price-kg') }} {{ toCurrency(item.priceKg) || DEFAULT_PRICE_KG }}
</p>
</div>
</div>

View File

@ -45,8 +45,7 @@ const addToOrder = async () => {
class="link"
@click="
() => {
item.quantity =
Number(item.quantity) + item.grouping;
item.quantity += item.grouping;
}
"
>
@ -56,7 +55,7 @@ const addToOrder = async () => {
</td>
<td class="text-right">
<QInput
v-model="item.quantity"
v-model.number="item.quantity"
type="number"
:step="item.grouping"
min="0"

View File

@ -9,7 +9,9 @@ import useCardDescription from 'src/composables/useCardDescription';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import OrderDescriptorMenu from "pages/Order/Card/OrderDescriptorMenu.vue";
import OrderDescriptorMenu from 'pages/Order/Card/OrderDescriptorMenu.vue';
const DEFAULT_ITEMS = 0;
const $props = defineProps({
id: {
@ -60,6 +62,10 @@ const setData = (entity) => {
data.value = useCardDescription(entity.client.name, entity.id);
state.set('ClaimDescriptor', entity);
};
const getConfirmationValue = (isConfirmed) => {
return t(isConfirmed ? 'order.summary.confirmed' : 'order.summary.notConfirmed');
};
</script>
<template>
@ -79,13 +85,7 @@ const setData = (entity) => {
<template #body="{ entity }">
<VnLv
:label="t('order.summary.state')"
:value="
t(
entity.isConfirmed
? 'order.summary.confirmed'
: 'order.summary.notConfirmed'
)
"
:value="getConfirmationValue(entity.isConfirmed)"
/>
<VnLv :label="t('order.field.salesPersonFk')">
<template #value>
@ -98,7 +98,10 @@ const setData = (entity) => {
<VnLv :label="t('order.summary.landed')" :value="toDate(entity?.landed)" />
<VnLv :label="t('order.field.agency')" :value="entity?.agencyMode?.name" />
<VnLv :label="t('order.summary.alias')" :value="entity?.address?.nickname" />
<VnLv :label="t('order.summary.items')" :value="(entity?.rows?.length || 0).toString()" />
<VnLv
:label="t('order.summary.items')"
:value="(entity?.rows?.length || DEFAULT_ITEMS).toString()"
/>
<VnLv :label="t('order.summary.total')" :value="toCurrency(entity?.total)" />
</template>
<template #actions="{ entity }">

View File

@ -78,7 +78,7 @@ const detailsColumns = ref([
/>
<VnLv
:label="t('order.summary.confirmed')"
:value="entity?.isConfirmed === 1"
:value="Boolean(entity?.isConfirmed)"
/>
</QCard>
<QCard class="vn-one">