8315-devToTest #1094
|
@ -15,7 +15,6 @@ import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vu
|
||||||
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
import { toDateTimeFormat } from 'src/filters/date';
|
import { toDateTimeFormat } from 'src/filters/date';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import dataByOrder from 'src/utils/dataByOrder';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
@ -144,16 +143,10 @@ const columns = computed(() => [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
async function fetchClientAddress(id, formData = {}) {
|
async function fetchClientAddress(id, formData = {}) {
|
||||||
const { data } = await axios.get(`Clients/${id}`, {
|
const { data } = await axios.get(
|
||||||
params: {
|
`Clients/${id}/addresses?filter[order]=isActive DESC`
|
||||||
filter: {
|
);
|
||||||
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
|
|
||||||
include: { relation: 'addresses' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
addressOptions.value = data;
|
addressOptions.value = data;
|
||||||
addressesList.value = data.addresses;
|
|
||||||
formData.addressId = data.defaultAddressFk;
|
formData.addressId = data.defaultAddressFk;
|
||||||
fetchAgencies(formData);
|
fetchAgencies(formData);
|
||||||
}
|
}
|
||||||
|
@ -164,7 +157,7 @@ async function fetchAgencies({ landed, addressId }) {
|
||||||
const { data } = await axios.get('Agencies/landsThatDay', {
|
const { data } = await axios.get('Agencies/landsThatDay', {
|
||||||
params: { addressFk: addressId, landed },
|
params: { addressFk: addressId, landed },
|
||||||
});
|
});
|
||||||
agencyList.value = dataByOrder(data, 'agencyMode ASC');
|
agencyList.value = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getDateColor = (date) => {
|
const getDateColor = (date) => {
|
||||||
|
@ -261,27 +254,22 @@ onMounted(() => {
|
||||||
@update:model-value="() => fetchAgencies(data)"
|
@update:model-value="() => fetchAgencies(data)"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem
|
<QItem v-bind="scope.itemProps">
|
||||||
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 }}
|
:class="{
|
||||||
</QItemLabel>
|
'color-vn-label': !scope.opt?.isActive,
|
||||||
<QItemLabel caption>
|
}"
|
||||||
{{ `${scope.opt.street}, ${scope.opt.city}` }}
|
>
|
||||||
|
{{
|
||||||
|
`${
|
||||||
|
!scope.opt?.isActive
|
||||||
|
? t('basicData.inactive')
|
||||||
|
: ''
|
||||||
|
} `
|
||||||
|
}}
|
||||||
|
{{ scope.opt?.nickname }}: {{ scope.opt?.street }},
|
||||||
|
{{ scope.opt?.city }}
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
Loading…
Reference in New Issue