Fix fallowing feedback
This commit is contained in:
parent
8a6e78a143
commit
fbd5abb330
|
@ -135,12 +135,11 @@ async function save() {
|
||||||
await axios.patch($props.urlUpdate || $props.url, body);
|
await axios.patch($props.urlUpdate || $props.url, body);
|
||||||
}
|
}
|
||||||
emit('onDataSaved', formData.value);
|
emit('onDataSaved', formData.value);
|
||||||
|
originalData.value = JSON.parse(JSON.stringify(formData.value));
|
||||||
|
hasChanges.value = false;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
notify('errors.create', 'negative');
|
notify('errors.create', 'negative');
|
||||||
}
|
}
|
||||||
|
|
||||||
originalData.value = JSON.parse(JSON.stringify(formData.value));
|
|
||||||
hasChanges.value = false;
|
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import OrderForm from 'pages/Order/Card/OrderForm.vue';
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<QToolbar>
|
|
||||||
<div id="st-data"></div>
|
|
||||||
<QSpace />
|
|
||||||
<div id="st-actions"></div>
|
|
||||||
</QToolbar>
|
|
||||||
<OrderForm />
|
|
||||||
</template>
|
|
||||||
<style lang="scss" scoped></style>
|
|
|
@ -15,9 +15,7 @@ const stateStore = useStateStore();
|
||||||
</QDrawer>
|
</QDrawer>
|
||||||
<QPageContainer>
|
<QPageContainer>
|
||||||
<QPage>
|
<QPage>
|
||||||
<div class="q-pa-md">
|
|
||||||
<RouterView></RouterView>
|
<RouterView></RouterView>
|
||||||
</div>
|
|
||||||
</QPage>
|
</QPage>
|
||||||
</QPageContainer>
|
</QPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -384,7 +384,7 @@ const getCategoryClass = (category, params) => {
|
||||||
|
|
||||||
.category-icon {
|
.category-icon {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background-color: var(--vn-label);
|
background-color: var(--vn-light-gray);
|
||||||
font-size: 2.6rem;
|
font-size: 2.6rem;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
|
@ -24,7 +24,7 @@ const dialog = ref(null);
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="container order-catalog-item overflow-hidden">
|
<div class="container order-catalog-item overflow-hidden">
|
||||||
<div class="card shadow-6 bg-dark">
|
<QCard class="card shadow-6">
|
||||||
<div class="img-wrapper">
|
<div class="img-wrapper">
|
||||||
<QImg
|
<QImg
|
||||||
:src="`/api/Images/catalog/200x200/${item.id}/download?access_token=${token}`"
|
:src="`/api/Images/catalog/200x200/${item.id}/download?access_token=${token}`"
|
||||||
|
@ -76,7 +76,7 @@ const dialog = ref(null);
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</QCard>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -51,13 +51,13 @@ async function remove() {
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
deleteOrder: Delete order,
|
deleteOrder: Delete order
|
||||||
confirmDeletion: Confirm deletion,
|
confirmDeletion: Confirm deletion
|
||||||
confirmDeletionMessage: Are you sure you want to delete this order?
|
confirmDeletionMessage: Are you sure you want to delete this order?
|
||||||
|
|
||||||
es:
|
es:
|
||||||
deleteOrder: Eliminar pedido,
|
deleteOrder: Eliminar pedido
|
||||||
confirmDeletion: Confirmar eliminación,
|
confirmDeletion: Confirmar eliminación
|
||||||
confirmDeletionMessage: Seguro que quieres eliminar este pedido?
|
confirmDeletionMessage: Seguro que quieres eliminar este pedido?
|
||||||
|
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -65,8 +65,8 @@ const fetchAgencyList = async (landed, addressFk) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchOrderDetails = (order) => {
|
const fetchOrderDetails = (order) => {
|
||||||
fetchAddressList(order?.addressFk)
|
fetchAddressList(order?.addressFk);
|
||||||
fetchAgencyList(order?.landed, order?.addressFk)
|
fetchAgencyList(order?.landed, order?.addressFk);
|
||||||
};
|
};
|
||||||
|
|
||||||
const orderMapper = (order) => {
|
const orderMapper = (order) => {
|
||||||
|
@ -105,7 +105,7 @@ const orderFilter = {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QToolbar>
|
<QToolbar class="bg-vn-dark justify-end">
|
||||||
<div id="st-data"></div>
|
<div id="st-data"></div>
|
||||||
<QSpace />
|
<QSpace />
|
||||||
<div id="st-actions"></div>
|
<div id="st-actions"></div>
|
||||||
|
@ -116,6 +116,8 @@ const orderFilter = {
|
||||||
:filter="{ fields: ['id', 'name', 'defaultAddressFk'] }"
|
:filter="{ fields: ['id', 'name', 'defaultAddressFk'] }"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<div class="q-pa-md">
|
||||||
<FormModel
|
<FormModel
|
||||||
:url="!isNew ? `Orders/${route.params.id}` : null"
|
:url="!isNew ? `Orders/${route.params.id}` : null"
|
||||||
:url-create="isNew ? 'Orders/new' : null"
|
:url-create="isNew ? 'Orders/new' : null"
|
||||||
|
@ -206,4 +208,5 @@ const orderFilter = {
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
</FormModel>
|
</FormModel>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -56,6 +56,8 @@ const detailsColumns = ref([
|
||||||
<Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()">
|
<Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()">
|
||||||
<OrderSearchbar />
|
<OrderSearchbar />
|
||||||
</Teleport>
|
</Teleport>
|
||||||
|
|
||||||
|
<div class="q-pa-md">
|
||||||
<CardSummary ref="summary" :url="`Orders/${entityId}/summary`">
|
<CardSummary ref="summary" :url="`Orders/${entityId}/summary`">
|
||||||
<template #header="{ entity }">
|
<template #header="{ entity }">
|
||||||
{{ t('order.summary.basket') }} #{{ entity?.id }} -
|
{{ t('order.summary.basket') }} #{{ entity?.id }} -
|
||||||
|
@ -130,7 +132,9 @@ const detailsColumns = ref([
|
||||||
<span class="text-h6">{{ t('order.summary.subtotal') }}</span>
|
<span class="text-h6">{{ t('order.summary.subtotal') }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="text-h6">{{ toCurrency(entity?.subTotal) }}</span>
|
<span class="text-h6">{{
|
||||||
|
toCurrency(entity?.subTotal)
|
||||||
|
}}</span>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv>
|
<VnLv>
|
||||||
|
@ -177,11 +181,17 @@ const detailsColumns = ref([
|
||||||
<QTd key="description" :props="props" class="description">
|
<QTd key="description" :props="props" class="description">
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<span>{{ props.row.item.name }}</span>
|
<span>{{ props.row.item.name }}</span>
|
||||||
<span v-if="props.row.item.subName" class="subName">
|
<span
|
||||||
|
v-if="props.row.item.subName"
|
||||||
|
class="subName"
|
||||||
|
>
|
||||||
{{ props.row.item.subName }}
|
{{ props.row.item.subName }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<fetched-tags :item="props.row.item" :max-length="5" />
|
<fetched-tags
|
||||||
|
:item="props.row.item"
|
||||||
|
:max-length="5"
|
||||||
|
/>
|
||||||
</QTd>
|
</QTd>
|
||||||
<QTd key="quantity" :props="props">
|
<QTd key="quantity" :props="props">
|
||||||
{{ props.row.quantity }}
|
{{ props.row.quantity }}
|
||||||
|
@ -190,7 +200,9 @@ const detailsColumns = ref([
|
||||||
{{ props.row.price }}
|
{{ props.row.price }}
|
||||||
</QTd>
|
</QTd>
|
||||||
<QTd key="amount" :props="props">
|
<QTd key="amount" :props="props">
|
||||||
{{ toCurrency(props.row?.quantity * props.row?.price) }}
|
{{
|
||||||
|
toCurrency(props.row?.quantity * props.row?.price)
|
||||||
|
}}
|
||||||
</QTd>
|
</QTd>
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
|
@ -198,6 +210,7 @@ const detailsColumns = ref([
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
</CardSummary>
|
</CardSummary>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.cardSummary .summaryBody .vn-label-value.order-summary-address {
|
.cardSummary .summaryBody .vn-label-value.order-summary-address {
|
||||||
|
|
|
@ -25,6 +25,7 @@ const orderSummary = ref({
|
||||||
vat: null,
|
vat: null,
|
||||||
});
|
});
|
||||||
const componentKey = ref(0);
|
const componentKey = ref(0);
|
||||||
|
const order = ref(0);
|
||||||
|
|
||||||
const refresh = () => {
|
const refresh = () => {
|
||||||
componentKey.value += 1;
|
componentKey.value += 1;
|
||||||
|
@ -63,6 +64,12 @@ async function confirmOrder() {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData
|
||||||
|
:key="componentKey"
|
||||||
|
:url="`Orders/${route.params.id}`"
|
||||||
|
@on-fetch="(data) => (order = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
:key="componentKey"
|
:key="componentKey"
|
||||||
:url="`Orders/${route.params.id}/getTotal`"
|
:url="`Orders/${route.params.id}/getTotal`"
|
||||||
|
@ -177,7 +184,7 @@ async function confirmOrder() {
|
||||||
:value="toCurrency(row.price * row.quantity)"
|
:value="toCurrency(row.price * row.quantity)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #actions>
|
<template #actions v-if="!order?.isConfirmed">
|
||||||
<QBtn
|
<QBtn
|
||||||
:label="t('remove')"
|
:label="t('remove')"
|
||||||
@click.stop="confirmRemove(row)"
|
@click.stop="confirmRemove(row)"
|
||||||
|
@ -190,7 +197,7 @@ async function confirmOrder() {
|
||||||
</template>
|
</template>
|
||||||
</VnPaginate>
|
</VnPaginate>
|
||||||
</div>
|
</div>
|
||||||
<QPageSticky :offset="[20, 20]">
|
<QPageSticky :offset="[20, 20]" v-if="!order?.isConfirmed">
|
||||||
<QBtn fab icon="check" color="primary" @click="confirmOrder()" />
|
<QBtn fab icon="check" color="primary" @click="confirmOrder()" />
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('confirm') }}
|
{{ t('confirm') }}
|
||||||
|
|
Loading…
Reference in New Issue