fix(03): select province input
This commit is contained in:
parent
3b0510922b
commit
e07ce319ea
1 changed files with 15 additions and 8 deletions
|
|
@ -9,6 +9,7 @@ import useAddressStore, {
|
||||||
import { EmployeeCheckupCreate } from 'src/stores/employee/types';
|
import { EmployeeCheckupCreate } from 'src/stores/employee/types';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { selectFilterOptionRefMod } from 'src/stores/utils';
|
import { selectFilterOptionRefMod } from 'src/stores/utils';
|
||||||
|
import { QSelect } from 'quasar';
|
||||||
|
|
||||||
const { locale } = useI18n();
|
const { locale } = useI18n();
|
||||||
const adrressStore = useAddressStore();
|
const adrressStore = useAddressStore();
|
||||||
|
|
@ -53,6 +54,12 @@ async function fetchProvince() {
|
||||||
const result = await adrressStore.fetchProvince();
|
const result = await adrressStore.fetchProvince();
|
||||||
|
|
||||||
if (result) addrOptions.provinceOps = result;
|
if (result) addrOptions.provinceOps = result;
|
||||||
|
|
||||||
|
provinceFilter = selectFilterOptionRefMod(
|
||||||
|
ref(addrOptions.provinceOps),
|
||||||
|
provinceOptions,
|
||||||
|
'name',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addData() {
|
function addData() {
|
||||||
|
|
@ -87,12 +94,11 @@ onMounted(async () => {
|
||||||
tab.value = 'tab0';
|
tab.value = 'tab0';
|
||||||
});
|
});
|
||||||
|
|
||||||
// const provinceOps = ref<Record<string, unknown>[]>([]);
|
const provinceOptions = ref<Record<string, unknown>[]>([]);
|
||||||
// const provinceFilter = selectFilterOptionRefMod(
|
let provinceFilter: (
|
||||||
// addrOptions.provinceOps,
|
value: string,
|
||||||
// provinceOps,
|
update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void,
|
||||||
// 'label',
|
) => void;
|
||||||
// );
|
|
||||||
|
|
||||||
const checkupTypeOptions = ref<Record<string, unknown>[]>([]);
|
const checkupTypeOptions = ref<Record<string, unknown>[]>([]);
|
||||||
const checkupTypeFilter = selectFilterOptionRefMod(
|
const checkupTypeFilter = selectFilterOptionRefMod(
|
||||||
|
|
@ -207,7 +213,7 @@ const insuranceCompanyFilter = selectFilterOptionRefMod(
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
:options="checkupTypeOptions"
|
:options="checkupTypeOptions"
|
||||||
:hide-dropdown-icon="readonly"
|
:hide-dropdown-icon="readonly"
|
||||||
:id="`${prefixId}-select-province`"
|
:id="`${prefixId}-select-checkup-type`"
|
||||||
:label="$t('formDialogInputCheckupType')"
|
:label="$t('formDialogInputCheckupType')"
|
||||||
@filter="checkupTypeFilter"
|
@filter="checkupTypeFilter"
|
||||||
>
|
>
|
||||||
|
|
@ -239,7 +245,8 @@ const insuranceCompanyFilter = selectFilterOptionRefMod(
|
||||||
:label="$t('province')"
|
:label="$t('province')"
|
||||||
:hide-dropdown-icon="readonly"
|
:hide-dropdown-icon="readonly"
|
||||||
:id="`${prefixId}-select-province`"
|
:id="`${prefixId}-select-province`"
|
||||||
:options="addrOptions.provinceOps"
|
:options="provinceOptions"
|
||||||
|
@filter="provinceFilter"
|
||||||
>
|
>
|
||||||
<template v-slot:no-option>
|
<template v-slot:no-option>
|
||||||
<q-item>
|
<q-item>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue