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]}`,
|
icon: `vn:${(category.icon || '').split('-')[1]}`,
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getCategoryClass = (category, params) => {
|
||||||
|
if (category.id === params?.categoryFk) {
|
||||||
|
return 'active';
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -105,10 +111,7 @@ const setCategoryList = (data) => {
|
||||||
<div
|
<div
|
||||||
v-for="category in categoryList"
|
v-for="category in categoryList"
|
||||||
:key="category.name"
|
:key="category.name"
|
||||||
:class="[
|
:class="['category', getCategoryClass(category, params)]"
|
||||||
'category',
|
|
||||||
category.id === params?.categoryFk && 'active',
|
|
||||||
]"
|
|
||||||
>
|
>
|
||||||
<QIcon
|
<QIcon
|
||||||
:name="category.icon"
|
:name="category.icon"
|
||||||
|
|
|
@ -6,6 +6,8 @@ import OrderCatalogItemDialog from 'pages/Order/Card/OrderCatalogItemDialog.vue'
|
||||||
import toCurrency from '../../../filters/toCurrency';
|
import toCurrency from '../../../filters/toCurrency';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
const DEFAULT_PRICE_KG = 0;
|
||||||
|
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
const token = session.getToken();
|
const token = session.getToken();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -70,7 +72,7 @@ const dialog = ref(null);
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</div>
|
</div>
|
||||||
<p v-if="item.priceKg" class="price-kg">
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -45,8 +45,7 @@ const addToOrder = async () => {
|
||||||
class="link"
|
class="link"
|
||||||
@click="
|
@click="
|
||||||
() => {
|
() => {
|
||||||
item.quantity =
|
item.quantity += item.grouping;
|
||||||
Number(item.quantity) + item.grouping;
|
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
@ -56,7 +55,7 @@ const addToOrder = async () => {
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
<QInput
|
<QInput
|
||||||
v-model="item.quantity"
|
v-model.number="item.quantity"
|
||||||
type="number"
|
type="number"
|
||||||
:step="item.grouping"
|
:step="item.grouping"
|
||||||
min="0"
|
min="0"
|
||||||
|
|
|
@ -9,7 +9,9 @@ import useCardDescription from 'src/composables/useCardDescription';
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.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({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -60,6 +62,10 @@ const setData = (entity) => {
|
||||||
data.value = useCardDescription(entity.client.name, entity.id);
|
data.value = useCardDescription(entity.client.name, entity.id);
|
||||||
state.set('ClaimDescriptor', entity);
|
state.set('ClaimDescriptor', entity);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getConfirmationValue = (isConfirmed) => {
|
||||||
|
return t(isConfirmed ? 'order.summary.confirmed' : 'order.summary.notConfirmed');
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -79,13 +85,7 @@ const setData = (entity) => {
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('order.summary.state')"
|
:label="t('order.summary.state')"
|
||||||
:value="
|
:value="getConfirmationValue(entity.isConfirmed)"
|
||||||
t(
|
|
||||||
entity.isConfirmed
|
|
||||||
? 'order.summary.confirmed'
|
|
||||||
: 'order.summary.notConfirmed'
|
|
||||||
)
|
|
||||||
"
|
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('order.field.salesPersonFk')">
|
<VnLv :label="t('order.field.salesPersonFk')">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
@ -98,7 +98,10 @@ const setData = (entity) => {
|
||||||
<VnLv :label="t('order.summary.landed')" :value="toDate(entity?.landed)" />
|
<VnLv :label="t('order.summary.landed')" :value="toDate(entity?.landed)" />
|
||||||
<VnLv :label="t('order.field.agency')" :value="entity?.agencyMode?.name" />
|
<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.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)" />
|
<VnLv :label="t('order.summary.total')" :value="toCurrency(entity?.total)" />
|
||||||
</template>
|
</template>
|
||||||
<template #actions="{ entity }">
|
<template #actions="{ entity }">
|
||||||
|
|
|
@ -78,7 +78,7 @@ const detailsColumns = ref([
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('order.summary.confirmed')"
|
:label="t('order.summary.confirmed')"
|
||||||
:value="entity?.isConfirmed === 1"
|
:value="Boolean(entity?.isConfirmed)"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
|
|
Loading…
Reference in New Issue