forked from verdnatura/salix-front
feat: add Options style in AddressList from OrderCreate
This commit is contained in:
parent
c3510aea60
commit
63536ea0f5
|
@ -149,7 +149,12 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
async function fetchClientAddress(id, formData = {}) {
|
async function fetchClientAddress(id, formData = {}) {
|
||||||
const { data } = await axios.get(`Clients/${id}`, {
|
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;
|
addressesList.value = data.addresses;
|
||||||
formData.addressId = data.defaultAddressFk;
|
formData.addressId = data.defaultAddressFk;
|
||||||
|
@ -240,12 +245,28 @@ const getDateColor = (date) => {
|
||||||
@update:model-value="() => fetchAgencies(data)"
|
@update:model-value="() => fetchAgencies(data)"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<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>
|
<QItemSection>
|
||||||
<QItemLabel>
|
<QItemLabel>
|
||||||
{{ scope.opt?.nickname }}: {{ scope.opt?.street }},
|
{{ scope.opt.nickname }}
|
||||||
{{ scope.opt?.city }}</QItemLabel
|
</QItemLabel>
|
||||||
>
|
<QItemLabel caption>
|
||||||
|
{{ `${scope.opt.street}, ${scope.opt.city}` }}
|
||||||
|
</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue