forked from verdnatura/salix-front
Fix order feedback
This commit is contained in:
parent
36ae5ab538
commit
c29586632c
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 }">
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in New Issue