feat: agency in ticketlist sort data
This commit is contained in:
parent
7f370dc29c
commit
df794391ec
|
@ -1,11 +1,11 @@
|
|||
import axios from 'axios';
|
||||
import agency from 'src/router/modules/agency';
|
||||
|
||||
export async function getAgencies(formData, client, _filter = {}) {
|
||||
if (!formData.warehouseId || !formData.addressId || !formData.landed) return;
|
||||
|
||||
|
||||
const filter = {
|
||||
..._filter
|
||||
order: ['name ASC'],
|
||||
..._filter,
|
||||
};
|
||||
|
||||
let defaultAgency = null;
|
||||
|
@ -18,9 +18,11 @@ export async function getAgencies(formData, client, _filter = {}) {
|
|||
|
||||
const { data } = await axios.get('Agencies/getAgenciesWithWarehouse', { params });
|
||||
|
||||
if(data && client) {
|
||||
defaultAgency = data.find((agency) => agency.agencyModeFk === client.defaultAddress.agencyModeFk );
|
||||
};
|
||||
|
||||
return {options: data, agency: defaultAgency}
|
||||
if (data && client) {
|
||||
defaultAgency = data.find(
|
||||
(agency) => agency.agencyModeFk === client.defaultAddress.agencyModeFk,
|
||||
);
|
||||
}
|
||||
|
||||
return { options: data, agency: defaultAgency };
|
||||
}
|
||||
|
|
|
@ -66,7 +66,12 @@ function validateDateRange(params) {
|
|||
"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData url="AgencyModes" @on-fetch="(data) => (agencies = data)" auto-load />
|
||||
<FetchData
|
||||
url="AgencyModes"
|
||||
:sort-by="['name ASC']"
|
||||
@on-fetch="(data) => (agencies = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
|
||||
<VnFilterPanel
|
||||
:data-key="props.dataKey"
|
||||
|
|
|
@ -651,6 +651,9 @@ watch(
|
|||
{{ scope.opt?.city }}
|
||||
</span>
|
||||
</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ `#${scope.opt?.id}` }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue