filter input
This commit is contained in:
parent
b01e667f34
commit
46cd97fb50
7 changed files with 243 additions and 49 deletions
|
|
@ -40,7 +40,7 @@ const affiliationReceived = ref<string>("");
|
||||||
const receivedate = ref<Date | null>();
|
const receivedate = ref<Date | null>();
|
||||||
const announceDate = ref<Date | null>();
|
const announceDate = ref<Date | null>();
|
||||||
const invoiceDate = ref<Date | null>(null);
|
const invoiceDate = ref<Date | null>(null);
|
||||||
|
const filterinsigniaOp2 = ref<any>(DataStore.insigniaOp2)
|
||||||
const employeeClass = ref<string>("");
|
const employeeClass = ref<string>("");
|
||||||
const employeeClassOps = ref<DataOption[]>([
|
const employeeClassOps = ref<DataOption[]>([
|
||||||
{ id: "officer", name: "ข้าราชการ กทม.สามัญ" },
|
{ id: "officer", name: "ข้าราชการ กทม.สามัญ" },
|
||||||
|
|
@ -276,6 +276,19 @@ const searchcardid = () => {
|
||||||
} else notifyError($q, "ไม่พบข้อมูลเลขบัตรประชาชนนี้");
|
} else notifyError($q, "ไม่พบข้อมูลเลขบัตรประชาชนนี้");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const filterSelector = (val: any, update: Function, name: any) => {
|
||||||
|
update(() => {
|
||||||
|
const needle = val.toLowerCase();
|
||||||
|
if (name === 'insigniaOp2') {
|
||||||
|
brand.value = ''
|
||||||
|
filterinsigniaOp2.value = DataStore.insigniaOp2.filter(
|
||||||
|
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -398,14 +411,17 @@ const searchcardid = () => {
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
option-label="name"
|
option-label="name"
|
||||||
:options="DataStore.insigniaOp2"
|
:options="filterinsigniaOp2"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
:readonly="false"
|
:readonly="false"
|
||||||
|
use-input
|
||||||
:borderless="false"
|
:borderless="false"
|
||||||
style="min-width: 150px"
|
style="min-width: 150px"
|
||||||
:rules="[
|
:rules="[
|
||||||
(val) => !!val || 'กรุณากรอกชื่อชั้นตราเครื่องราชอิสริยาภรณ์',
|
(val) => !!val || 'กรุณากรอกชื่อชั้นตราเครื่องราชอิสริยาภรณ์',
|
||||||
]"
|
]"
|
||||||
|
@filter="(inputValue:any,doneFn:Function) =>
|
||||||
|
filterSelector(inputValue, doneFn,'insigniaOp2') "
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
|
|
|
||||||
|
|
@ -124,18 +124,21 @@ onMounted(()=>{
|
||||||
<q-dialog v-model="props.modal" persistent>
|
<q-dialog v-model="props.modal" persistent>
|
||||||
<q-card style="min-width: 900px">
|
<q-card style="min-width: 900px">
|
||||||
<q-toolbar>
|
<q-toolbar>
|
||||||
<q-toolbar-title v-if="props.fileCheck === null" class="text-subtitle2 text-bold">รับเครื่องราชฯ</q-toolbar-title>
|
<q-toolbar-title class="text-subtitle2 text-bold">รับ-คืนเครื่องราชฯ</q-toolbar-title>
|
||||||
<q-toolbar-title v-else class="text-subtitle2 text-bold">คืนเครื่องราชฯ</q-toolbar-title>
|
|
||||||
<q-btn icon="close" unelevated round dense @click="close" style="color: #ff8080; background-color: #ffdede" />
|
<q-btn icon="close" unelevated round dense @click="close" style="color: #ff8080; background-color: #ffdede" />
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
||||||
<q-form ref="myForm">
|
<q-form ref="myForm">
|
||||||
<div class="q-pa-md bg-grey-1">
|
<div class="q-pa-md bg-grey-1">
|
||||||
<div v-if="props.fileCheck === null" class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
|
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||||
|
<div class="col-12 text-weight-bold text-grey-7">
|
||||||
|
รับเครื่องราชฯ
|
||||||
|
</div>
|
||||||
<div class="col-xs-12 col-sm-4">
|
<div class="col-xs-12 col-sm-4">
|
||||||
|
|
||||||
<datepicker menu-class-name="modalfix" v-model="Datereceive" :locale="'th'" autoApply borderless
|
<datepicker menu-class-name="modalfix" v-model="Datereceive" :locale="'th'" autoApply borderless
|
||||||
:enableTimePicker="false" week-start="0">
|
:enableTimePicker="false" week-start="0" :readonly="fileCheck !== null">
|
||||||
<template #year="{ year }">
|
<template #year="{ year }">
|
||||||
{{ year + 543 }}
|
{{ year + 543 }}
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -145,7 +148,7 @@ onMounted(()=>{
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<q-input dense borderless outlined lazy-rules :rules="[(val) => !!val || 'กรุณาเลือกวันที่ได้รับ']"
|
<q-input dense borderless outlined lazy-rules :rules="[(val) => !!val || 'กรุณาเลือกวันที่ได้รับ']"
|
||||||
hide-bottom-space :model-value="Datereceive != null ? date2Thai(Datereceive) : undefined
|
hide-bottom-space :model-value="Datereceive != null ? date2Thai(Datereceive) : undefined
|
||||||
" :label="`${'วันที่ได้รับ'}`" clearable @clear="clearReceiveDate">
|
" :label="`${'วันที่ได้รับ'}`" clearable @clear="clearReceiveDate" :disable="fileCheck !== null">
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon name="event" class="cursor-pointer" color="primary">
|
<q-icon name="event" class="cursor-pointer" color="primary">
|
||||||
</q-icon>
|
</q-icon>
|
||||||
|
|
@ -158,7 +161,7 @@ onMounted(()=>{
|
||||||
<div class="col-xs-12 col-sm-4">
|
<div class="col-xs-12 col-sm-4">
|
||||||
|
|
||||||
<q-file outlined dense v-model="files" label="ไฟล์หลักฐานการรับ" lazy-rules
|
<q-file outlined dense v-model="files" label="ไฟล์หลักฐานการรับ" lazy-rules
|
||||||
:rules="[(val) => val || 'กรุณาเลือกไฟล์หลักฐานการรับ']" hide-bottom-space>
|
:rules="[(val) => val || 'กรุณาเลือกไฟล์หลักฐานการรับ']" hide-bottom-space :disable="fileCheck !== null">
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon name="attach_file" color="primary" />
|
<q-icon name="attach_file" color="primary" />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -167,10 +170,15 @@ onMounted(()=>{
|
||||||
<div class="col-xs-12 col-sm-4">
|
<div class="col-xs-12 col-sm-4">
|
||||||
<q-select hide-bottom-space :options="OrgList" dense borderless option-label="name" option-value="id"
|
<q-select hide-bottom-space :options="OrgList" dense borderless option-label="name" option-value="id"
|
||||||
emit-value map-options outlined v-model="OrganazationId" lazy-rules :label="`หน่วยงานที่รับ`"
|
emit-value map-options outlined v-model="OrganazationId" lazy-rules :label="`หน่วยงานที่รับ`"
|
||||||
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่รับ']" />
|
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่รับ']" :disable="fileCheck !== null"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="props.fileCheck !== null" class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
|
<div class="col-12 q-my-sm"> <q-separator/></div>
|
||||||
|
|
||||||
|
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||||
|
<div class="col-12 text-weight-bold text-grey-7">
|
||||||
|
คืนเครื่องราชฯ
|
||||||
|
</div>
|
||||||
<div class="col-xs-12 col-sm-4">
|
<div class="col-xs-12 col-sm-4">
|
||||||
|
|
||||||
<datepicker menu-class-name="modalfix" v-model="Datereturn" :locale="'th'" autoApply borderless
|
<datepicker menu-class-name="modalfix" v-model="Datereturn" :locale="'th'" autoApply borderless
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch,onMounted } from "vue";
|
||||||
import { QForm, useQuasar } from "quasar";
|
import { QForm, useQuasar } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
@ -14,6 +14,7 @@ const routeName = router.currentRoute.value.name;
|
||||||
const amount = ref<number | null>();
|
const amount = ref<number | null>();
|
||||||
const Org = ref<string | null>("");
|
const Org = ref<string | null>("");
|
||||||
const grandCross = ref<string | null>("");
|
const grandCross = ref<string | null>("");
|
||||||
|
const filterInsigniaOp = ref<any>()
|
||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
props.close();
|
props.close();
|
||||||
};
|
};
|
||||||
|
|
@ -41,7 +42,22 @@ watch(props, () => {
|
||||||
amount.value = null;
|
amount.value = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
watch(() => props.insigniaList, (newVal) => {
|
||||||
|
filterInsigniaOp.value = newVal;
|
||||||
|
});
|
||||||
|
const filterSelector = (val: any, update: Function, name: any) => {
|
||||||
|
update(() => {
|
||||||
|
const needle = val.toLowerCase();
|
||||||
|
if (name === 'filterInsigniaOp') {
|
||||||
|
grandCross.value = null
|
||||||
|
filterInsigniaOp.value = props.insigniaList.filter(
|
||||||
|
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
const clickSave = () => {
|
const clickSave = () => {
|
||||||
if (myForm.value !== null) {
|
if (myForm.value !== null) {
|
||||||
myForm.value.validate().then(async (success) => {
|
myForm.value.validate().then(async (success) => {
|
||||||
|
|
@ -67,12 +83,14 @@ const clickSave = () => {
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<q-select
|
<q-select
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:options="insigniaList"
|
:options="filterInsigniaOp"
|
||||||
dense
|
dense
|
||||||
borderless
|
borderless
|
||||||
|
use-input
|
||||||
|
lazy-rules
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
emit-value
|
emit-valuez
|
||||||
map-options
|
map-options
|
||||||
outlined
|
outlined
|
||||||
options-cover
|
options-cover
|
||||||
|
|
@ -83,6 +101,8 @@ const clickSave = () => {
|
||||||
? `เครื่องราชฯ`
|
? `เครื่องราชฯ`
|
||||||
: `เลือกหน่วยงาน`
|
: `เลือกหน่วยงาน`
|
||||||
"
|
"
|
||||||
|
@filter="(inputValue:any,doneFn:Function) =>
|
||||||
|
filterSelector(inputValue, doneFn,'filterInsigniaOp') "
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,7 @@ watch(tab, () => {
|
||||||
if (!a) {
|
if (!a) {
|
||||||
DataStore.insignia = "";
|
DataStore.insignia = "";
|
||||||
}
|
}
|
||||||
filterInsigniaOp.value = insigniaOp.value
|
filterInsigniaOp.value = insigniaOp.value
|
||||||
fecthlistInsignia();
|
fecthlistInsignia();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch,onMounted } from "vue";
|
||||||
import { QForm, useQuasar } from "quasar";
|
import { QForm, useQuasar } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -30,8 +30,10 @@ const returndate = ref<Date | null>();
|
||||||
const reason = ref<string>("");
|
const reason = ref<string>("");
|
||||||
const listPerson = ref<any>([]);
|
const listPerson = ref<any>([]);
|
||||||
const OrgList = ref<DataOption[]>([]);
|
const OrgList = ref<DataOption[]>([]);
|
||||||
|
const filterOrgList = ref<any>([]);
|
||||||
const insigniaNoteProfileId = ref<string>("");
|
const insigniaNoteProfileId = ref<string>("");
|
||||||
|
const filterSelectRound = ref<any>()
|
||||||
|
const selectRound = ref<any>()
|
||||||
// เคลียร์ข้อมูลในฟอร์ม
|
// เคลียร์ข้อมูลในฟอร์ม
|
||||||
const clearData = () => {
|
const clearData = () => {
|
||||||
receivedate.value = null;
|
receivedate.value = null;
|
||||||
|
|
@ -68,7 +70,10 @@ const props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
selectRoundOption: {
|
selectRoundOption: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
},
|
||||||
|
filterSelectRoundOption: {
|
||||||
|
type: Array,
|
||||||
},
|
},
|
||||||
profileId: {
|
profileId: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|
@ -92,7 +97,8 @@ watch(props, () => {
|
||||||
|
|
||||||
// ดึงข้อมูลรายการเครื่องราช
|
// ดึงข้อมูลรายการเครื่องราช
|
||||||
const fecthlistInsignia = async () => {
|
const fecthlistInsignia = async () => {
|
||||||
showLoader();
|
if(roundNo.value !== ''&& roundNo.value !== null){
|
||||||
|
showLoader();
|
||||||
let data = {
|
let data = {
|
||||||
insigniaTypeId: props.typeId,
|
insigniaTypeId: props.typeId,
|
||||||
insigniaNoteId: roundNo.value,
|
insigniaNoteId: roundNo.value,
|
||||||
|
|
@ -115,6 +121,8 @@ const fecthlistInsignia = async () => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ดึงข้อมูลรายการหน่วยงาน
|
// ดึงข้อมูลรายการหน่วยงาน
|
||||||
const fetchOrgList = async () => {
|
const fetchOrgList = async () => {
|
||||||
|
|
@ -136,6 +144,7 @@ const fetchOrgList = async () => {
|
||||||
// ];
|
// ];
|
||||||
// } else {
|
// } else {
|
||||||
OrgList.value = orgArr;
|
OrgList.value = orgArr;
|
||||||
|
filterOrgList.value = OrgList.value
|
||||||
// }
|
// }
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -240,6 +249,31 @@ const clearReceiveDate = () => {
|
||||||
const clearReturnDate = () => {
|
const clearReturnDate = () => {
|
||||||
returndate.value = null;
|
returndate.value = null;
|
||||||
};
|
};
|
||||||
|
const filterSelector = (val: any, update: Function, name: any) => {
|
||||||
|
update(() => {
|
||||||
|
const needle = val.toLowerCase();
|
||||||
|
if (name === 'filterOrgList') {
|
||||||
|
OrganazationId.value = ''
|
||||||
|
filterOrgList.value = OrgList.value.filter(
|
||||||
|
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (name === 'filterSelectRoundOption') {
|
||||||
|
roundNo.value = ''
|
||||||
|
filterSelectRound.value = selectRound.value.filter(
|
||||||
|
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
const setValue = () => {
|
||||||
|
filterSelectRound.value = props.filterSelectRoundOption
|
||||||
|
selectRound.value = props.selectRoundOption
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
setValue();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -267,14 +301,18 @@ const clearReturnDate = () => {
|
||||||
:label="`${'รอบการขอเครื่องราชฯ'}`"
|
:label="`${'รอบการขอเครื่องราชฯ'}`"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
|
use-input
|
||||||
option-label="name"
|
option-label="name"
|
||||||
:options="selectRoundOption"
|
:options="filterSelectRound"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
:readonly="false"
|
:readonly="false"
|
||||||
:borderless="false"
|
:borderless="false"
|
||||||
style="min-width: 150px"
|
style="min-width: 150px"
|
||||||
:rules="[(val) => !!val || 'กรุณาเลือกรอบการขอเครื่องราชฯ']"
|
:rules="[(val) => !!val || 'กรุณาเลือกรอบการขอเครื่องราชฯ']"
|
||||||
@update:model-value="fecthlistInsignia()"
|
@update:model-value="fecthlistInsignia()"
|
||||||
|
@filter="(inputValue:any,
|
||||||
|
doneFn:Function) => filterSelector(inputValue, doneFn,'filterSelectRoundOption'
|
||||||
|
) "
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 q-mt-md text-weight-bold text-grey-7">
|
<div class="col-12 q-mt-md text-weight-bold text-grey-7">
|
||||||
|
|
@ -382,18 +420,22 @@ const clearReturnDate = () => {
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<q-select
|
<q-select
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:options="OrgList"
|
:options="filterOrgList"
|
||||||
dense
|
dense
|
||||||
borderless
|
borderless
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
emit-value
|
emit-value
|
||||||
|
use-input
|
||||||
map-options
|
map-options
|
||||||
outlined
|
outlined
|
||||||
v-model="OrganazationId"
|
v-model="OrganazationId"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
:label="`เลือกหน่วยงาน`"
|
:label="`เลือกหน่วยงาน`"
|
||||||
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงาน']"
|
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงาน']"
|
||||||
|
@filter="(inputValue:any,
|
||||||
|
doneFn:Function) => filterSelector(inputValue, doneFn,'filterOrgList'
|
||||||
|
) "
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -452,7 +494,7 @@ const clearReturnDate = () => {
|
||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<q-select
|
<q-select
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:options="OrgList"
|
:options="filterOrgList"
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
borderless
|
borderless
|
||||||
|
|
@ -461,9 +503,13 @@ const clearReturnDate = () => {
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
outlined
|
outlined
|
||||||
|
use-input
|
||||||
v-model="OrganazationId"
|
v-model="OrganazationId"
|
||||||
:label="`เลือกหน่วยงานที่ส่งคืน`"
|
:label="`เลือกหน่วยงานที่ส่งคืน`"
|
||||||
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่คืน']"
|
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่คืน']"
|
||||||
|
@filter="(inputValue:any,
|
||||||
|
doneFn:Function) => filterSelector(inputValue, doneFn,'filterOrgList'
|
||||||
|
) "
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,15 +19,18 @@ const tab = ref<string>("");
|
||||||
|
|
||||||
const selectRound = ref<string>();
|
const selectRound = ref<string>();
|
||||||
const selectRoundOption = ref<OptionDataYear[]>([]);
|
const selectRoundOption = ref<OptionDataYear[]>([]);
|
||||||
|
const filterSelectRoundOption = ref<any>([]);
|
||||||
const selectRoundAllOption = ref<OptionDataYear[]>([]);
|
const selectRoundAllOption = ref<OptionDataYear[]>([]);
|
||||||
|
const filterSelectRoundAllOption = ref<OptionDataYear[]>([]);
|
||||||
|
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
const action = ref<string>("");
|
const action = ref<string>("");
|
||||||
const profileId = ref<string>("");
|
const profileId = ref<string>("");
|
||||||
const roundYear = ref<any>();
|
const roundYear = ref<any>();
|
||||||
const insigniaList = ref<any>([]);
|
const insigniaList = ref<any>([]);
|
||||||
|
const fileterInsigniaList = ref<any>([]);
|
||||||
const loadView = ref<boolean>(false);
|
const loadView = ref<boolean>(false);
|
||||||
|
const employeeClassOps = ref<any>(DataStore.employeeClassOps)
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fecthRound();
|
await fecthRound();
|
||||||
});
|
});
|
||||||
|
|
@ -58,8 +61,10 @@ const fecthRound = async () => {
|
||||||
year: e.year,
|
year: e.year,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
filterSelectRoundAllOption.value = selectRoundAllOption.value
|
||||||
selectRound.value = data[0].id;
|
selectRound.value = data[0].id;
|
||||||
|
filterSelectRoundOption.value = selectRoundOption.value
|
||||||
|
console.log(filterSelectRoundOption.value)
|
||||||
yearRound.value = data[0].year;
|
yearRound.value = data[0].year;
|
||||||
roundYear.value = data[0].year;
|
roundYear.value = data[0].year;
|
||||||
if (roundYear.value) {
|
if (roundYear.value) {
|
||||||
|
|
@ -326,6 +331,7 @@ watch(tab, async () => {
|
||||||
(x: any) => x.type == tab.value || x.type == ""
|
(x: any) => x.type == tab.value || x.type == ""
|
||||||
);
|
);
|
||||||
DataStore.insignia = "";
|
DataStore.insignia = "";
|
||||||
|
fileterInsigniaList.value = insigniaList.value
|
||||||
fecthlistInsignia();
|
fecthlistInsignia();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -392,6 +398,44 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||||
else return start + "-" + end + " ใน " + total;
|
else return start + "-" + end + " ใน " + total;
|
||||||
};
|
};
|
||||||
|
const filterSelector = (val: any, update: Function, name: any) => {
|
||||||
|
update(() => {
|
||||||
|
const needle = val.toLowerCase();
|
||||||
|
if (name === 'employeeClassOps') {
|
||||||
|
DataStore.employeeClass = ''
|
||||||
|
employeeClassOps.value = DataStore.employeeClassOps.filter(
|
||||||
|
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (name === 'fileterInsigniaList') {
|
||||||
|
DataStore.insignia = null as any
|
||||||
|
fileterInsigniaList.value = insigniaList.value.filter(
|
||||||
|
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (name === 'filterSelectRoundAllOption') {
|
||||||
|
yearRound.value = null as any
|
||||||
|
filterSelectRoundAllOption.value = selectRoundAllOption.value.filter(
|
||||||
|
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const clearInsigniaFilters = (name: string) => {
|
||||||
|
if (name === "employeeClassOps") {
|
||||||
|
DataStore.employeeClass = "all";
|
||||||
|
employeeClassOps.value = DataStore.employeeClassOps;
|
||||||
|
}
|
||||||
|
else if (name === "fileterInsigniaList") {
|
||||||
|
DataStore.insignia = "";
|
||||||
|
fileterInsigniaList.value = insigniaList.value;
|
||||||
|
}
|
||||||
|
// else if (name === 'employeeClassOps') {
|
||||||
|
|
||||||
|
// }
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -426,7 +470,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
>
|
>
|
||||||
<div class="q-pa-md">
|
<div class="q-pa-md">
|
||||||
<div class="row col-12 q-pb-sm q-col-gutter-x-xs">
|
<div class="row col-12 q-pb-sm q-col-gutter-x-xs">
|
||||||
<div>
|
|
||||||
<q-select
|
<q-select
|
||||||
v-model="yearRound"
|
v-model="yearRound"
|
||||||
dense
|
dense
|
||||||
|
|
@ -436,26 +480,30 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
:label="`${'รอบการเสนอขอเครื่องราชฯ'}`"
|
:label="`${'รอบการเสนอขอเครื่องราชฯ'}`"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
|
use-input
|
||||||
option-label="name"
|
option-label="name"
|
||||||
:options="selectRoundAllOption"
|
:options="filterSelectRoundAllOption"
|
||||||
option-value="year"
|
option-value="year"
|
||||||
:borderless="false"
|
:borderless="false"
|
||||||
style="min-width: 150px"
|
style="min-width: 150px"
|
||||||
@update:model-value="selectorRound"
|
@update:model-value="selectorRound"
|
||||||
|
@filter="(inputValue:any,
|
||||||
|
doneFn:Function) => filterSelector(inputValue, doneFn,'filterSelectRoundAllOption'
|
||||||
|
) "
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<q-select
|
<q-select
|
||||||
v-model="DataStore.insignia"
|
v-model="DataStore.insignia"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
use-input
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:label="`${'เครื่องราชฯ'}`"
|
:label="`${'เครื่องราชฯ'}`"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
option-label="name"
|
option-label="name"
|
||||||
:options="insigniaList"
|
:options="fileterInsigniaList"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
:readonly="false"
|
:readonly="false"
|
||||||
:borderless="false"
|
:borderless="false"
|
||||||
|
|
@ -466,31 +514,68 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
DataStore.employeeClass
|
DataStore.employeeClass
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
/>
|
@filter="(inputValue:any,
|
||||||
|
doneFn:Function) => filterSelector(inputValue, doneFn,'fileterInsigniaList'
|
||||||
|
) "
|
||||||
|
>
|
||||||
|
<template v-if="DataStore.insignia !== ''" v-slot:append>
|
||||||
|
<q-icon
|
||||||
|
name="cancel"
|
||||||
|
@click.stop.prevent="
|
||||||
|
clearInsigniaFilters('fileterInsigniaList'),
|
||||||
|
DataStore.searchDatatable(
|
||||||
|
DataStore.insignia,
|
||||||
|
DataStore.employeeClass
|
||||||
|
)
|
||||||
|
"
|
||||||
|
class="cursor-pointer"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<q-select
|
<q-select
|
||||||
v-model="DataStore.employeeClass"
|
class="col-2"
|
||||||
dense
|
v-model="DataStore.employeeClass"
|
||||||
outlined
|
dense
|
||||||
lazy-rules
|
outlined
|
||||||
hide-bottom-space
|
lazy-rules
|
||||||
:label="`${'สถานภาพ'}`"
|
hide-bottom-space
|
||||||
emit-value
|
:label="`${'สถานภาพ'}`"
|
||||||
map-options
|
emit-value
|
||||||
option-label="name"
|
use-input
|
||||||
:options="DataStore.employeeClassOps"
|
map-options
|
||||||
option-value="id"
|
option-label="name"
|
||||||
:readonly="false"
|
:options="employeeClassOps"
|
||||||
:borderless="false"
|
option-value="id"
|
||||||
style="min-width: 150px"
|
:readonly="false"
|
||||||
@update:model-value="
|
:borderless="false"
|
||||||
DataStore.searchDatatable(
|
style="min-width: 150px"
|
||||||
DataStore.insignia,
|
@update:model-value="
|
||||||
DataStore.employeeClass
|
DataStore.searchDatatable(
|
||||||
)
|
DataStore.insignia,
|
||||||
|
DataStore.employeeClass
|
||||||
|
)
|
||||||
|
"
|
||||||
|
@filter="(inputValue:any,
|
||||||
|
doneFn:Function) => filterSelector(inputValue, doneFn,'employeeClassOps'
|
||||||
|
) "
|
||||||
|
>
|
||||||
|
<template v-if="DataStore.employeeClass !== 'all'" v-slot:append>
|
||||||
|
<q-icon
|
||||||
|
name="cancel"
|
||||||
|
@click.stop.prevent="
|
||||||
|
clearInsigniaFilters('employeeClassOps'),
|
||||||
|
DataStore.searchDatatable(
|
||||||
|
DataStore.insignia,
|
||||||
|
DataStore.employeeClass
|
||||||
|
)
|
||||||
"
|
"
|
||||||
|
class="cursor-pointer"
|
||||||
/>
|
/>
|
||||||
|
</template>
|
||||||
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -600,7 +685,8 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
:round-id="selectRound == '0' ? 'all' : selectRound"
|
:round-id="selectRound == '0' ? 'all' : selectRound"
|
||||||
:action="action"
|
:action="action"
|
||||||
:profile-id="profileId"
|
:profile-id="profileId"
|
||||||
:select-round-option="selectRoundOption"
|
v-model:selectRoundOption="selectRoundOption"
|
||||||
|
v-model:filterSelectRoundOption="filterSelectRoundOption"
|
||||||
:type-id="tab"
|
:type-id="tab"
|
||||||
/>
|
/>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ onMounted(async () => {
|
||||||
const splitterModel = ref(14);
|
const splitterModel = ref(14);
|
||||||
const selectList = ref<any>();
|
const selectList = ref<any>();
|
||||||
const optionsList = ref<any>([{ id: 0, name: "เลือกกรอบการยื่นขอ" }]);
|
const optionsList = ref<any>([{ id: 0, name: "เลือกกรอบการยื่นขอ" }]);
|
||||||
|
const filterOtion = ref<any>([]);
|
||||||
|
|
||||||
const nextPage = () => {
|
const nextPage = () => {
|
||||||
if (page.value < numOfPages.value) {
|
if (page.value < numOfPages.value) {
|
||||||
|
|
@ -65,6 +66,7 @@ const fecthlistRound = async () => {
|
||||||
year: e.period_year,
|
year: e.period_year,
|
||||||
name: e.period_name,
|
name: e.period_name,
|
||||||
}));
|
}));
|
||||||
|
filterOtion.value = optionsList.value
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -130,6 +132,18 @@ const downloadReport = async (
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const filterSelector = (val: any, update: Function, name: any) => {
|
||||||
|
update(() => {
|
||||||
|
const needle = val.toLowerCase();
|
||||||
|
if (name === 'selectList') {
|
||||||
|
filterOtion.value = optionsList.value.filter(
|
||||||
|
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -152,19 +166,23 @@ const downloadReport = async (
|
||||||
<q-toolbar style="padding: 0">
|
<q-toolbar style="padding: 0">
|
||||||
<q-form ref="myForm" class="row items-center">
|
<q-form ref="myForm" class="row items-center">
|
||||||
<q-select
|
<q-select
|
||||||
|
style="width: 400px;"
|
||||||
class="q-pa-none"
|
class="q-pa-none"
|
||||||
use-input
|
use-input
|
||||||
fill-input
|
fill-input
|
||||||
hide-selected
|
hide-selected
|
||||||
dense
|
dense
|
||||||
|
lazy-rules
|
||||||
outlined
|
outlined
|
||||||
v-model="selectList"
|
v-model="selectList"
|
||||||
:options="optionsList"
|
:options="filterOtion"
|
||||||
label="เลือกรอบ"
|
label="เลือกรอบ"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
:rules="[(val) => !!val || 'กรุณาเลือกรอบ']"
|
:rules="[(val) => !!val || 'กรุณาเลือกรอบ']"
|
||||||
@update:model-value="updateSelect"
|
@update:model-value="updateSelect"
|
||||||
|
@filter="(inputValue:any,doneFn:Function) =>
|
||||||
|
filterSelector(inputValue, doneFn,'selectList') "
|
||||||
/>
|
/>
|
||||||
</q-form>
|
</q-form>
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue