This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-03 13:20:18 +07:00
parent 4842a8de5f
commit 7a3e916039
4 changed files with 45 additions and 13 deletions

View file

@ -38,7 +38,7 @@ const router = useRouter();
const store = useDevelopmentDataStore();
const $q = useQuasar();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const agencyOp = ref<[]>([]);
const agencyOp = ref<any[]>([]);
const rows = ref<any[]>([]);
const visibleColumns = ref<string[]>([
@ -149,12 +149,19 @@ function fetchListOrg() {
showLoader();
http
.get(config.API.developmentHistoryListOrg("officer", formFilter.year))
.then((res) => {
.then(async (res) => {
console.log(res);
formFilter.root = null;
formFilter.page = 1;
rows.value = [];
agencyOp.value = res.data.result;
getData();
const option = [{ name: "ทั้งหมด", id: null }];
const optionNew = await res.data.result.map((e: string) => ({
name: e,
id: e,
}));
option.push(...optionNew);
agencyOp.value = option;
await getData();
})
.catch((err) => {
messageError($q, err);
@ -313,7 +320,16 @@ onMounted(() => {
option-label="name"
@update:model-value="(formFilter.page = 1), getData()"
style="min-width: 150px"
/>
map-options
emit-value
>
<template v-if="formFilter.root" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="(formFilter.root = null), fetchListOrg()"
class="cursor-pointer"
/> </template
></q-select>
</q-toolbar>
<q-toolbar class="col-4 q-pa-none q-gutter-x-sm">
<q-space />