diff --git a/src/pages/Order/OrderList.vue b/src/pages/Order/OrderList.vue index 52d108595..fa182bc39 100644 --- a/src/pages/Order/OrderList.vue +++ b/src/pages/Order/OrderList.vue @@ -149,7 +149,12 @@ onMounted(() => { }); async function fetchClientAddress(id, formData = {}) { const { data } = await axios.get(`Clients/${id}`, { - params: { filter: { include: { relation: 'addresses' } } }, + params: { + filter: { + order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'], + include: { relation: 'addresses' }, + }, + }, }); addressesList.value = data.addresses; formData.addressId = data.defaultAddressFk; @@ -191,7 +196,7 @@ const getDateColor = (date) => { urlCreate: 'Orders/new', title: t('module.cerateOrder'), onDataSaved: (url) => { - tableRef.redirect(`${url}/catalog`); + tableRef.redirect(`${url}/catalog`); }, formInitialData: { active: true, @@ -240,12 +245,28 @@ const getDateColor = (date) => { @update:model-value="() => fetchAgencies(data)" > <template #option="scope"> - <QItem v-bind="scope.itemProps"> + <QItem + v-bind="scope.itemProps" + :class="{ disabled: !scope.opt.isActive }" + > + <QItemSection style="min-width: min-content" avatar> + <QIcon + v-if=" + scope.opt.isActive && data.addressId === scope.opt.id + " + size="sm" + color="grey" + name="star" + class="fill-icon" + /> + </QItemSection> <QItemSection> <QItemLabel> - {{ scope.opt?.nickname }}: {{ scope.opt?.street }}, - {{ scope.opt?.city }}</QItemLabel - > + {{ scope.opt.nickname }} + </QItemLabel> + <QItemLabel caption> + {{ `${scope.opt.street}, ${scope.opt.city}` }} + </QItemLabel> </QItemSection> </QItem> </template>