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