perf: orderList
gitea/salix-front/pipeline/pr-test There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-test There was a failure building this commit
Details
This commit is contained in:
parent
df794391ec
commit
e6e21b61bd
|
@ -152,11 +152,23 @@ onMounted(() => {
|
|||
});
|
||||
|
||||
async function fetchClientAddress(id, formData = {}) {
|
||||
const { data } = await axios.get(
|
||||
`Clients/${id}/addresses?filter[order]=isActive DESC`
|
||||
);
|
||||
const { data } = await axios.get(`Clients/${id}/addresses`, {
|
||||
params: {
|
||||
filter: JSON.stringify({
|
||||
include: [
|
||||
{
|
||||
relation: 'client',
|
||||
scope: {
|
||||
fields: ['defaultAddressFk'],
|
||||
},
|
||||
},
|
||||
],
|
||||
order: ['isActive DESC'],
|
||||
}),
|
||||
},
|
||||
});
|
||||
addressOptions.value = data;
|
||||
formData.addressId = data.defaultAddressFk;
|
||||
formData.addressId = data[0].client.defaultAddressFk;
|
||||
fetchAgencies(formData);
|
||||
}
|
||||
|
||||
|
@ -164,7 +176,13 @@ async function fetchAgencies({ landed, addressId }) {
|
|||
if (!landed || !addressId) return (agencyList.value = []);
|
||||
|
||||
const { data } = await axios.get('Agencies/landsThatDay', {
|
||||
params: { addressFk: addressId, landed },
|
||||
params: {
|
||||
filter: JSON.stringify({
|
||||
order: ['agencyMode DESC', 'agencyModeFk ASC'],
|
||||
}),
|
||||
addressFk: addressId,
|
||||
landed,
|
||||
},
|
||||
});
|
||||
agencyList.value = data;
|
||||
}
|
||||
|
@ -255,6 +273,7 @@ const getDateColor = (date) => {
|
|||
</template>
|
||||
</VnSelect>
|
||||
<VnSelect
|
||||
:disable="!data.clientFk"
|
||||
v-model="data.addressId"
|
||||
:options="addressOptions"
|
||||
:label="t('module.address')"
|
||||
|
@ -281,6 +300,9 @@ const getDateColor = (date) => {
|
|||
{{ scope.opt?.street }},
|
||||
{{ scope.opt?.city }}
|
||||
</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ `#${scope.opt?.id}` }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue