แก้ select /input

This commit is contained in:
setthawutttty 2024-12-02 15:12:53 +07:00
parent a934497083
commit 97879802b1
45 changed files with 138 additions and 279 deletions

View file

@ -49,8 +49,7 @@ const selected = ref<any>([]);
const typeOps = ref<typeOp[]>([ const typeOps = ref<typeOp[]>([
{ id: "citizenId", name: "เลขประจำตัวประชาชน" }, { id: "citizenId", name: "เลขประจำตัวประชาชน" },
{ id: "firstname", name: "ชื่อ" }, { id: "fullName", name: "ชื่อ-นามสกุล" },
{ id: "lastname", name: "นามสกุล" },
]); ]);
/** รับค่ามาจาก หน้าหลัก */ /** รับค่ามาจาก หน้าหลัก */
@ -131,12 +130,11 @@ async function getSearch() {
showLoader(); showLoader();
const body = { const body = {
fieldName: type.value, fieldName: type.value,
keyword: search.value, keyword: search.value ? search.value.trim():'',
}; };
await http await http
.post( .post(
config.API.orgSearchPersonal() + config.API.orgSearchPersonal(),
`?page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}&searchKeyword=${search.value}`,
body body
) )
.then((res) => { .then((res) => {
@ -236,7 +234,7 @@ watch(
</q-toolbar> </q-toolbar>
<q-separator /> <q-separator />
<q-card-section class="q-pa-md scroll" style="max-height: 80vh"> <q-card-section class="q-pa-md scroll" style="max-height: 80vh">
<div class="row col-12 q-col-gutter-sm items-start"> <div class="row col-12 q-col-gutter-sm items-start q-mb-sm">
<div class="col-12 col-sm-5 col-md-3"> <div class="col-12 col-sm-5 col-md-3">
<q-select <q-select
label="ค้นหาจาก" label="ค้นหาจาก"
@ -260,14 +258,13 @@ watch(
clearable clearable
dense dense
label="คำค้น" label="คำค้น"
:rules="[(val:string) => !!val || `กรุณากรอกคำค้น`]"
> >
<template v-slot:after> <template v-slot:after>
<q-btn <q-btn
color="primary" color="primary"
icon="search" icon="search"
label="ค้นหา" label="ค้นหา"
outline unelevated
class="full-width q-py-sm q-px-md" class="full-width q-py-sm q-px-md"
@click="searchInput()" @click="searchInput()"
> >

View file

@ -425,7 +425,7 @@ onMounted(async () => {
ref="table" ref="table"
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
:filter="filterKeyword" :filter="filterKeyword.trim()"
row-key="Order" row-key="Order"
flat flat
bordered bordered

View file

@ -427,6 +427,8 @@ onMounted(async () => {
option-label="name" option-label="name"
emit-value emit-value
use-input use-input
hide-selected
fill-input
map-options map-options
hide-bottom-space hide-bottom-space
:options="complainstStore.complainantoptions" :options="complainstStore.complainantoptions"
@ -462,6 +464,8 @@ onMounted(async () => {
outlined outlined
option-label="name" option-label="name"
option-value="id" option-value="id"
hide-selected
fill-input
map-options map-options
v-model="organization" v-model="organization"
:options="optionOrganization" :options="optionOrganization"
@ -498,6 +502,8 @@ onMounted(async () => {
:readonly="isReadonly || checkRoutePermisson" :readonly="isReadonly || checkRoutePermisson"
hide-bottom-space hide-bottom-space
map-options map-options
hide-selected
fill-input
:rules="[(val:string) => !!val || `${'กรุณาเลือกหน่วยงาน'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือกหน่วยงาน'}`]"
@update:model-value="changeFormData()" @update:model-value="changeFormData()"
use-input use-input

View file

@ -48,7 +48,7 @@ async function getList() {
config.API.complaintList( config.API.complaintList(
pagination.value.page, pagination.value.page,
pagination.value.rowsPerPage, pagination.value.rowsPerPage,
filterKeyword.value, filterKeyword.value.trim(),
statusFilter.value statusFilter.value
) )
) )
@ -91,7 +91,6 @@ function resetFilter() {
* @param update function * @param update function
*/ */
function filterOptionFn(val: string, update: Function) { function filterOptionFn(val: string, update: Function) {
statusFilter.value = "";
update(() => { update(() => {
option.value = complainstStore.statusOptions.filter( option.value = complainstStore.statusOptions.filter(
(e: any) => e.name.search(val) !== -1 (e: any) => e.name.search(val) !== -1
@ -133,6 +132,8 @@ onMounted(async () => {
map-options map-options
option-label="name" option-label="name"
option-value="id" option-value="id"
hide-selected
fill-input
:options="option" :options="option"
@update:model-value="getSearch()" @update:model-value="getSearch()"
use-input use-input
@ -184,13 +185,7 @@ onMounted(async () => {
@keydown.enter.prevent="getSearch()" @keydown.enter.prevent="getSearch()"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>

View file

@ -371,7 +371,7 @@ async function getList() {
config.API.directorList( config.API.directorList(
pagination.value.page, pagination.value.page,
pagination.value.rowsPerPage, pagination.value.rowsPerPage,
filterKeyword2.value, filterKeyword2.value.trim(),
mainStore.pathDirector(route.name as string) mainStore.pathDirector(route.name as string)
) )
) )
@ -792,6 +792,8 @@ onMounted(async () => {
option-value="id" option-value="id"
option-label="name" option-label="name"
emit-value emit-value
hide-selected
fill-input
use-input use-input
map-options map-options
hide-bottom-space hide-bottom-space
@ -828,6 +830,8 @@ onMounted(async () => {
option-label="name" option-label="name"
option-value="id" option-value="id"
v-model="organization" v-model="organization"
hide-selected
fill-input
:options="option" :options="option"
label="หน่วยงานที่ถูกร้องเรียน" label="หน่วยงานที่ถูกร้องเรียน"
clearable clearable
@ -871,6 +875,8 @@ onMounted(async () => {
label="ลักษณะการสืบสวน" label="ลักษณะการสืบสวน"
emit-value emit-value
map-options map-options
hide-selected
fill-input
clearable clearable
option-label="name" option-label="name"
option-value="id" option-value="id"

View file

@ -50,7 +50,7 @@ async function getList() {
config.API.investigateMain( config.API.investigateMain(
pagination.value.page, pagination.value.page,
pagination.value.rowsPerPage, pagination.value.rowsPerPage,
filterKeyword.value, filterKeyword.value.trim(),
statusFilter.value statusFilter.value
) )
) )
@ -141,6 +141,8 @@ onMounted(async () => {
outlined outlined
emit-value emit-value
map-options map-options
hide-selected
fill-input
option-label="name" option-label="name"
option-value="id" option-value="id"
:options="option" :options="option"
@ -180,13 +182,7 @@ onMounted(async () => {
@keydown.enter.prevent="getSerach()" @keydown.enter.prevent="getSerach()"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>
@ -202,7 +198,6 @@ onMounted(async () => {
map-options map-options
:options="dataInvestigate.columns" :options="dataInvestigate.columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2" class="col-xs-12 col-sm-3 col-md-2"
/> />

View file

@ -451,7 +451,7 @@ async function fetchDListDirector() {
config.API.directorList( config.API.directorList(
pagination.value.page, pagination.value.page,
pagination.value.rowsPerPage, pagination.value.rowsPerPage,
filterKeyword2.value, filterKeyword2.value.trim(),
mainStore.pathDirector(route.name as string) mainStore.pathDirector(route.name as string)
) )
) )
@ -782,6 +782,8 @@ onMounted(async () => {
option-label="name" option-label="name"
emit-value emit-value
use-input use-input
hide-selected
fill-input
map-options map-options
hide-bottom-space hide-bottom-space
:options="complainstStore.complainantoptions" :options="complainstStore.complainantoptions"
@ -818,6 +820,8 @@ onMounted(async () => {
outlined outlined
option-label="name" option-label="name"
option-value="id" option-value="id"
hide-selected
fill-input
map-options map-options
v-model="organization" v-model="organization"
:options="optionOrganization" :options="optionOrganization"
@ -1768,6 +1772,8 @@ onMounted(async () => {
:options="option" :options="option"
label="ผลการสอบสวน" label="ผลการสอบสวน"
emit-value emit-value
hide-selected
fill-input
hide-bottom-space hide-bottom-space
map-options map-options
option-label="name" option-label="name"
@ -1793,6 +1799,8 @@ onMounted(async () => {
:readonly="isReadonly || checkRoutePermisson" :readonly="isReadonly || checkRoutePermisson"
for="#fault" for="#fault"
outlined outlined
hide-selected
fill-input
dense dense
ref="disciplinaryCauseTextRef" ref="disciplinaryCauseTextRef"
v-model="formData.disciplinaryCauseText" v-model="formData.disciplinaryCauseText"

View file

@ -33,7 +33,7 @@ async function fetchListDisciplinary() {
await http await http
.get( .get(
config.API.disciplineDisciplinary() + config.API.disciplineDisciplinary() +
`?page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}&keyword=${filter.value}&status=${status.value}` `?page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}&keyword=${filter.value.trim()}&status=${status.value}`
) )
.then((res) => { .then((res) => {
const data = res.data.result.data; const data = res.data.result.data;

View file

@ -123,7 +123,6 @@ function filterFn() {
* @param update function * @param update function
*/ */
function filterOptionFn(val: string, update: Function) { function filterOptionFn(val: string, update: Function) {
statusFilter.value = "";
update(() => { update(() => {
option.value = dataInvestigateDis.statusOptions.filter( option.value = dataInvestigateDis.statusOptions.filter(
(e: any) => e.name.search(val) !== -1 (e: any) => e.name.search(val) !== -1
@ -146,6 +145,8 @@ function updatePagination(newPagination: any) {
dense dense
outlined outlined
emit-value emit-value
hide-selected
fill-input
map-options map-options
option-label="name" option-label="name"
option-value="id" option-value="id"
@ -187,13 +188,7 @@ function updatePagination(newPagination: any) {
@keydown.enter.prevent="filterFn" @keydown.enter.prevent="filterFn"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="inputfilter == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="inputfilter !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>
<!-- แสดงคอลมนใน table --> <!-- แสดงคอลมนใน table -->

View file

@ -192,6 +192,8 @@ watch(
option-value="code" option-value="code"
emit-value emit-value
map-options map-options
hide-selected
fill-input
use-input use-input
style="width: 350px; max-width: auto" style="width: 350px; max-width: auto"
@update:model-value="selected = []" @update:model-value="selected = []"
@ -223,13 +225,7 @@ watch(
style="width: 850px; max-width: auto" style="width: 850px; max-width: auto"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="filterKeyword2 !== ''"
name="clear"
class="cursor-pointer"
@click="Reset"
/>
</template> </template>
</q-input> </q-input>
<q-select <q-select
@ -243,7 +239,6 @@ watch(
map-options map-options
:options="props.columns" :options="props.columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="gt-xs q-ml-sm" class="gt-xs q-ml-sm"
/> />
@ -254,7 +249,7 @@ watch(
<d-table <d-table
:columns="props.columns" :columns="props.columns"
:rows="rows" :rows="rows"
:filter="filterKeyword2" :filter="filterKeyword2?.trim()"
row-key="id" row-key="id"
:visible-columns="props.visibleColumns" :visible-columns="props.visibleColumns"
selection="multiple" selection="multiple"

View file

@ -15,7 +15,7 @@ import type {
ArrayPerson, ArrayPerson,
ArrayFileList, ArrayFileList,
} from "@/modules/11_discipline/interface/request/complaint"; } from "@/modules/11_discipline/interface/request/complaint";
import type { FormData as FormInvestigateFact } from "@/modules/11_discipline/interface/request/InvestigateFact"; import type { FormData as FormInvestigateFact } from "@/modules/11_discipline/interface/request/investigateFact";
import DialogSendToCommand from "@/modules/11_discipline/components/4_Result/DialogSendToCommand.vue"; import DialogSendToCommand from "@/modules/11_discipline/components/4_Result/DialogSendToCommand.vue";
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; // import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //

View file

@ -36,7 +36,7 @@ async function fetchListResult() {
await http await http
.get( .get(
config.API.listResult() + config.API.listResult() +
`?page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}&keyword=${filter.value}&status=${status.value}` `?page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}&keyword=${filter.value.trim()}&status=${status.value}`
) )
.then(async (res) => { .then(async (res) => {
const data = res.data.result.data; const data = res.data.result.data;

View file

@ -80,7 +80,6 @@ function updatePaging(p: number, pS: number, key: string) {
emit("update:queryString", p, pS, key); emit("update:queryString", p, pS, key);
} }
function dataUpdate() { function dataUpdate() {
props.filterStatus(statusFilter.value); props.filterStatus(statusFilter.value);
} }
@ -98,7 +97,6 @@ function filterFn() {
* @param update function * @param update function
*/ */
function filterOptionFn(val: string, update: Function) { function filterOptionFn(val: string, update: Function) {
statusFilter.value = "";
update(() => { update(() => {
option.value = store.statusOptions.filter( option.value = store.statusOptions.filter(
(e: any) => e.name.search(val) !== -1 (e: any) => e.name.search(val) !== -1
@ -123,6 +121,8 @@ function updatePagination(newPagination: any) {
outlined outlined
emit-value emit-value
map-options map-options
hide-selected
fill-input
option-label="name" option-label="name"
option-value="id" option-value="id"
:options="option" :options="option"
@ -162,13 +162,7 @@ function updatePagination(newPagination: any) {
class="col-xs-12 col-sm-3 col-md-2" class="col-xs-12 col-sm-3 col-md-2"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="inputfilter == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="inputfilter !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>
<q-select <q-select

View file

@ -198,13 +198,7 @@ onMounted(() => {
placeholder="ค้นหา" placeholder="ค้นหา"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>
@ -220,7 +214,6 @@ onMounted(() => {
map-options map-options
:options="dataStore.columns" :options="dataStore.columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2" class="col-xs-12 col-sm-3 col-md-2"
/> />
@ -230,7 +223,7 @@ onMounted(() => {
:columns="dataStore.columns" :columns="dataStore.columns"
:rows="dataStore.rows" :rows="dataStore.rows"
row-key="id" row-key="id"
:filter="filterKeyword" :filter="filterKeyword.trim()"
:visible-columns="dataStore.visibleColumns" :visible-columns="dataStore.visibleColumns"
v-model:pagination="pagination" v-model:pagination="pagination"
> >

View file

@ -50,8 +50,7 @@ const props = defineProps({
const type = ref<string>("citizenId"); const type = ref<string>("citizenId");
const typeOps = ref<typeOp[]>([ const typeOps = ref<typeOp[]>([
{ id: "citizenId", name: "เลขประจำตัวประชาชน" }, { id: "citizenId", name: "เลขประจำตัวประชาชน" },
{ id: "firstname", name: "ชื่อ" }, { id: "fullName", name: "ชื่อ-นามสกุล" },
{ id: "lastname", name: "นามสกุล" },
]); ]);
const isReadonly = ref<boolean>(false); // const isReadonly = ref<boolean>(false); //
const emit = defineEmits(["formDataReturn"]); const emit = defineEmits(["formDataReturn"]);
@ -321,7 +320,6 @@ watch(
hide-bottom-space hide-bottom-space
dense dense
label="คำค้น" label="คำค้น"
:rules="[(val:string) => !!val || `กรุณากรอกคำค้น`]"
> >
<template v-slot:after> <template v-slot:after>
<q-btn <q-btn
@ -329,7 +327,7 @@ watch(
icon="search" icon="search"
label="ค้นหา" label="ค้นหา"
class="full-width q-py-sm q-px-md" class="full-width q-py-sm q-px-md"
outline unelevated
@click="searchInput()" @click="searchInput()"
> >
</q-btn> </q-btn>

View file

@ -52,7 +52,7 @@ async function getList() {
config.API.directorList( config.API.directorList(
pagination.value.page, pagination.value.page,
pagination.value.rowsPerPage, pagination.value.rowsPerPage,
filterKeyword.value, filterKeyword.value.trim(),
mainStore.pathDirector(route.name as string) mainStore.pathDirector(route.name as string)
) )
) )
@ -189,13 +189,7 @@ onMounted(() => {
@keydown.enter.prevent="filterFn" @keydown.enter.prevent="filterFn"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>

View file

@ -183,6 +183,8 @@ watch(
option-label="name" option-label="name"
option-value="code" option-value="code"
emit-value emit-value
hide-selected
fill-input
map-options map-options
use-input use-input
style="width: 350px; max-width: auto" style="width: 350px; max-width: auto"
@ -209,13 +211,7 @@ watch(
style="width: 200px; max-width: auto" style="width: 200px; max-width: auto"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="filterKeyword = ''"
/>
</template> </template>
</q-input> </q-input>
@ -230,7 +226,6 @@ watch(
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="gt-xs q-ml-sm" class="gt-xs q-ml-sm"
/> />
@ -239,7 +234,7 @@ watch(
<d-table <d-table
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
:filter="filterKeyword" :filter="filterKeyword.trim()"
row-key="id" row-key="id"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
selection="multiple" selection="multiple"
@ -293,6 +288,6 @@ watch(
<DialogCreateCommand <DialogCreateCommand
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="commandType" :command-type-code="commandType"
:persons="selected ? dataMapToSend:[]" :persons="selected ? dataMapToSend : []"
/> />
</template> </template>

View file

@ -165,7 +165,7 @@ async function getList() {
config.API.suspendMain( config.API.suspendMain(
pagination.value.page, pagination.value.page,
pagination.value.rowsPerPage, pagination.value.rowsPerPage,
filterKeyword.value filterKeyword.value.trim()
) )
) )
.then(async (res) => { .then(async (res) => {
@ -247,13 +247,7 @@ onMounted(async () => {
@keydown.enter.prevent="filterFn" @keydown.enter.prevent="filterFn"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>
@ -268,7 +262,6 @@ onMounted(async () => {
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm" class="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
/> />

View file

@ -389,6 +389,8 @@ onMounted(() => {
dense dense
outlined outlined
emit-value emit-value
hide-selected
fill-input
map-options map-options
lazy-rules lazy-rules
option-label="name" option-label="name"
@ -417,6 +419,8 @@ onMounted(() => {
dense dense
bg-color="white" bg-color="white"
outlined outlined
hide-selected
fill-input
emit-value emit-value
lazy-rules lazy-rules
:rules="[(val:string) => !!val || `${'กรุณาเลือกสถานะ'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือกสถานะ'}`]"

View file

@ -223,7 +223,7 @@ async function getData() {
totalList.value = Math.ceil( totalList.value = Math.ceil(
res.data.result.total / pagination.value.rowsPerPage res.data.result.total / pagination.value.rowsPerPage
); );
total.value = res.data.result.total; total.value = res.data.result.total;
fetchAppealComplain(res.data.result.data); fetchAppealComplain(res.data.result.data);
}) })
.catch((e) => { .catch((e) => {
@ -279,7 +279,6 @@ function filterOptionFnType(val: string, update: Function) {
function updatePagination(newPagination: any) { function updatePagination(newPagination: any) {
pagination.value.page = 1; pagination.value.page = 1;
pagination.value.rowsPerPage = newPagination.rowsPerPage; pagination.value.rowsPerPage = newPagination.rowsPerPage;
} }
function getSearch() { function getSearch() {
@ -335,12 +334,7 @@ onMounted(async () => {
@keydown.enter.prevent="filterFn" @keydown.enter.prevent="filterFn"
> >
<template v-slot:append> <template v-slot:append>
<q-icon <q-icon name="search" />
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>
@ -417,6 +411,8 @@ onMounted(async () => {
outlined outlined
emit-value emit-value
map-options map-options
hide-selected
fill-input
option-label="name" option-label="name"
option-value="id" option-value="id"
:options="optionType" :options="optionType"
@ -449,6 +445,8 @@ onMounted(async () => {
dense dense
outlined outlined
emit-value emit-value
hide-selected
fill-input
map-options map-options
option-label="name" option-label="name"
option-value="id" option-value="id"

View file

@ -144,7 +144,7 @@ function updateInput() {
/**รีเซ็ตค่าในช่องค้นหา */ /**รีเซ็ตค่าในช่องค้นหา */
function Reset() { function Reset() {
filterKeyword2.value = '' filterKeyword2.value = "";
props.getSearch?.(); props.getSearch?.();
} }
@ -183,13 +183,7 @@ watch(
style="max-width: 100%" style="max-width: 100%"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="filterKeyword2 !== ''"
name="clear"
class="cursor-pointer"
@click="Reset"
/>
</template> </template>
</q-input> </q-input>

View file

@ -72,7 +72,11 @@ const initialPagination = ref<any>({
/** ฟังชั่นส่งคนไปออกคำสั่ง */ /** ฟังชั่นส่งคนไปออกคำสั่ง */
function onclickSend() { function onclickSend() {
if (props.title == "ส่งไปพักราชการ" || props.title == "ส่งไปสืบสวน" || props.title == "ส่งไปสอบสวน") { if (
props.title == "ส่งไปพักราชการ" ||
props.title == "ส่งไปสืบสวน" ||
props.title == "ส่งไปสอบสวน"
) {
if (selected.value.length === 0) { if (selected.value.length === 0) {
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 บุคคล"); dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 บุคคล");
} else { } else {
@ -142,13 +146,7 @@ watch(
class="q-ml-sm" class="q-ml-sm"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filter == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
</template> </template>
</q-input> </q-input>
<!-- แสดงคอลมนใน table --> <!-- แสดงคอลมนใน table -->
@ -173,7 +171,7 @@ watch(
ref="table" ref="table"
:columns="props.columns" :columns="props.columns"
:rows="props.rows" :rows="props.rows"
:filter="filter" :filter="filter.trim()"
row-key="personId" row-key="personId"
flat flat
bordered bordered

View file

@ -192,20 +192,14 @@ watch(
style="max-width: 100%" style="max-width: 100%"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="filterKeyword2 !== ''"
name="clear"
class="cursor-pointer"
@click="Reset"
/>
</template> </template>
</q-input> </q-input>
<d-table <d-table
:columns="columns2" :columns="columns2"
:rows="rows2" :rows="rows2"
:filter="filterKeyword2" :filter="filterKeyword2?.trim()"
row-key="id" row-key="id"
:visible-columns="visibleColumns2" :visible-columns="visibleColumns2"
selection="multiple" selection="multiple"

View file

@ -194,20 +194,14 @@ watch(
style="max-width: 100%" style="max-width: 100%"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword2 == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="filterKeyword2 !== ''"
name="clear"
class="cursor-pointer"
@click="Reset"
/>
</template> </template>
</q-input> </q-input>
<d-table <d-table
:columns="columns" :columns="columns"
:rows="rows2" :rows="rows2"
:filter="filterKeyword2" :filter="filterKeyword2?.trim()"
row-key="id" row-key="id"
selection="multiple" selection="multiple"
v-model:selected="selected" v-model:selected="selected"

View file

@ -55,8 +55,7 @@ const type = ref<string>("citizenId");
const search = ref<string>(""); const search = ref<string>("");
const typeOps = ref<typeOp[]>([ const typeOps = ref<typeOp[]>([
{ id: "citizenId", name: "เลขประจำตัวประชาชน" }, { id: "citizenId", name: "เลขประจำตัวประชาชน" },
{ id: "firstname", name: "ชื่อ" }, { id: "fullName", name: "ชื่อ - นามสกุล" },
{ id: "lastname", name: "นามสกุล" },
]); ]);
/** /**
@ -303,9 +302,9 @@ onMounted(async () => {
<q-btn <q-btn
color="primary" color="primary"
icon="search" icon="search"
unelevated
label="ค้นหา" label="ค้นหา"
class="full-width q-py-sm q-px-md" class="full-width q-py-sm q-px-md"
outline
@click="searchInput()" @click="searchInput()"
> >
</q-btn> </q-btn>

View file

@ -139,13 +139,7 @@ onMounted(() => {
placeholder="ค้นหา" placeholder="ค้นหา"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>
@ -160,7 +154,6 @@ onMounted(() => {
map-options map-options
:options="dataStore.columns" :options="dataStore.columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2" class="col-xs-12 col-sm-3 col-md-2"
/> />
@ -170,7 +163,7 @@ onMounted(() => {
<d-table <d-table
:columns="dataStore.columns" :columns="dataStore.columns"
:rows="dataStore.rows" :rows="dataStore.rows"
:filter="filterKeyword" :filter="filterKeyword.trim()"
row-key="tb-list" row-key="tb-list"
flat flat
bordered bordered

View file

@ -113,13 +113,7 @@ onMounted(() => {
placeholder="ค้นหา" placeholder="ค้นหา"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>
@ -134,7 +128,6 @@ onMounted(() => {
map-options map-options
:options="dataStore.columns" :options="dataStore.columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2" class="col-xs-12 col-sm-3 col-md-2"
/> />
@ -144,7 +137,7 @@ onMounted(() => {
<d-table <d-table
:columns="dataStore.columns" :columns="dataStore.columns"
:rows="dataStore.rows" :rows="dataStore.rows"
:filter="filterKeyword" :filter="filterKeyword.trim()"
row-key="tb-list" row-key="tb-list"
flat flat
bordered bordered

View file

@ -98,7 +98,7 @@ async function fetchEvaluteList() {
const body = { const body = {
page: currentPage.value, page: currentPage.value,
pageSize: pageSize.value, pageSize: pageSize.value,
keyword: filter.value, keyword: filter.value.trim(),
status: selectedStatus.value, status: selectedStatus.value,
}; };
await http await http
@ -215,13 +215,7 @@ onMounted(async () => {
@keydown.enter.prevent="filterFn" @keydown.enter.prevent="filterFn"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="filter == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template> </template>
</q-input> </q-input>

View file

@ -537,6 +537,8 @@ watch(
lazy-rules lazy-rules
:options="groupOldOp" :options="groupOldOp"
map-options map-options
hide-selected
fill-input
option-label="name" option-label="name"
option-value="id" option-value="id"
emit-value emit-value

View file

@ -186,7 +186,7 @@ function getData() {
http http
.get( .get(
config.API.salaryFormula() + config.API.salaryFormula() +
`/?page=${formFilter.page}&pageSize=${formFilter.pageSize}&keyword=${formFilter.keyword}&posTypeId=${posType.value}` `/?page=${formFilter.page}&pageSize=${formFilter.pageSize}&keyword=${formFilter.keyword.trim()}&posTypeId=${posType.value}`
) )
.then((res) => { .then((res) => {
const data = res.data.result.data; const data = res.data.result.data;
@ -317,6 +317,8 @@ onMounted(async () => {
option-value="id" option-value="id"
emit-value emit-value
map-options map-options
hide-selected
fill-input
use-input use-input
@update:model-value="filterFn" @update:model-value="filterFn"
@filter="(inputValue: string, @filter="(inputValue: string,

View file

@ -102,7 +102,7 @@ async function fetchListChart() {
await http await http
.get( .get(
config.API.salaryEmployeeChart + config.API.salaryEmployeeChart +
`?page=${formFilter.page}&pageSize=${formFilter.pageSize}&keyword=${formFilter.keyword}` `?page=${formFilter.page}&pageSize=${formFilter.pageSize}&keyword=${formFilter.keyword.trim()}`
) )
.then((res) => { .then((res) => {
rows.value = res.data.result.data; rows.value = res.data.result.data;

View file

@ -105,7 +105,7 @@ async function fetchListSalaly() {
showLoader(); showLoader();
const page = formQuery.page.toString(); const page = formQuery.page.toString();
const pageSize = formQuery.pageSize.toString(); const pageSize = formQuery.pageSize.toString();
const keyword = formQuery.keyword.toString(); const keyword = formQuery.keyword.toString().trim();
await http await http
.get( .get(
config.API.salaryChart + config.API.salaryChart +

View file

@ -366,7 +366,6 @@ function filterSelector(val: string, update: Function, refData: string) {
switch (refData) { switch (refData) {
case "agencyFilter": case "agencyFilter":
update(() => { update(() => {
agencyFilter.value = val === "" ? agencyFilter.value : "";
agencyOptions.value = agencyOptionsMain.value.filter( agencyOptions.value = agencyOptionsMain.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1 (v: DataOption) => v.name.indexOf(val) > -1
); );
@ -501,6 +500,8 @@ onMounted(async () => {
outlined outlined
emit-value emit-value
map-options map-options
hide-selected
fill-input
option-label="name" option-label="name"
option-value="id" option-value="id"
:options="agencyOptions" :options="agencyOptions"

View file

@ -357,7 +357,6 @@ function filterSelector(val: string, update: Function, refData: string) {
switch (refData) { switch (refData) {
case "agencyFilter": case "agencyFilter":
update(() => { update(() => {
agencyFilter.value = val === "" ? agencyFilter.value : "";
agencyOptions.value = agencyOptionsMain.value.filter( agencyOptions.value = agencyOptionsMain.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1 (v: DataOption) => v.name.indexOf(val) > -1
); );
@ -493,6 +492,8 @@ onMounted(async () => {
map-options map-options
option-label="name" option-label="name"
option-value="id" option-value="id"
hide-selected
fill-input
:options="agencyOptions" :options="agencyOptions"
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space

View file

@ -14,7 +14,7 @@ import type { DataOption } from "@/modules/14_KPI/interface/index/Main";
import type { import type {
ResRound, ResRound,
ResDevelopment, ResDevelopment,
} from "@/modules/14_KPI/interface/response/index"; } from "@/modules/14_KPI/interface/response/Index";
/** importComponents*/ /** importComponents*/
import DialogIndividual from "@/modules/14_KPI/components/results/dialogIndividual.vue"; import DialogIndividual from "@/modules/14_KPI/components/results/dialogIndividual.vue";
@ -143,7 +143,7 @@ async function fetcDataList() {
.post(config.API.achievementDev, { .post(config.API.achievementDev, {
page: page.value, page: page.value,
pageSize: pageSize.value, pageSize: pageSize.value,
keyword: keyword.value, keyword: keyword.value.trim(),
kpiPeriodId: store.formQuery.round ? store.formQuery.round : "", kpiPeriodId: store.formQuery.round ? store.formQuery.round : "",
}) })
.then(async (res) => { .then(async (res) => {
@ -296,13 +296,7 @@ onMounted(async () => {
@keydown.enter="onSearchData" @keydown.enter="onSearchData"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="keyword === ''" name="search" /> <q-icon name="search" />
<q-icon
v-else
name="clear"
class="cursor-pointer"
@click="(keyword = ''), onSearchData()"
/>
</template> </template>
</q-input> </q-input>
<q-select <q-select

View file

@ -332,13 +332,7 @@ onMounted(async () => {
@keydown.enter="onSearchData" @keydown.enter="onSearchData"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="keyword === ''" name="search" /> <q-icon name="search" />
<q-icon
v-else
name="clear"
class="cursor-pointer"
@click="(keyword = ''), onSearchData()"
/>
</template> </template>
</q-input> </q-input>
<q-select <q-select
@ -385,6 +379,8 @@ onMounted(async () => {
map-options map-options
:options="resultOp" :options="resultOp"
option-value="id" option-value="id"
hide-selected
fill-input
option-label="name" option-label="name"
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space

View file

@ -143,7 +143,7 @@ async function fetchList() {
page: formQuery.page, page: formQuery.page,
pageSize: formQuery.pageSize, pageSize: formQuery.pageSize,
kpiPeriodId: store.formQuery.round, kpiPeriodId: store.formQuery.round,
keyword: store.formQuery.keyword, keyword: store.formQuery.keyword.trim(),
status: formQuery.status === "" ? undefined : formQuery.status, status: formQuery.status === "" ? undefined : formQuery.status,
results: formQuery.results === "" ? undefined : formQuery.results, results: formQuery.results === "" ? undefined : formQuery.results,
}; };
@ -322,13 +322,7 @@ onMounted(async () => {
@keydown.enter.prevent="changRound" @keydown.enter.prevent="changRound"
> >
<template v-slot:append> <template v-slot:append>
<q-icon <q-icon name="search" />
v-if="store.formQuery.keyword !== ''"
name="clear"
class="cursor-pointer"
@click="(store.formQuery.keyword = ''), changRound()"
/>
<q-icon v-else name="search" color="grey-5" />
</template> </template>
</q-input> </q-input>
<q-select <q-select
@ -373,6 +367,8 @@ onMounted(async () => {
emit-value emit-value
map-options map-options
:options="statusOp" :options="statusOp"
hide-selected
fill-input
option-value="id" option-value="id"
option-label="name" option-label="name"
lazy-rules lazy-rules
@ -408,6 +404,8 @@ onMounted(async () => {
:options="resultOp" :options="resultOp"
option-value="id" option-value="id"
option-label="name" option-label="name"
hide-selected
fill-input
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
outlined outlined

View file

@ -42,7 +42,7 @@ async function fetcDataList() {
status: tab.value, status: tab.value,
page: page.value, page: page.value,
pageSize: pageSize.value, pageSize: pageSize.value,
keyword: keyword.value, keyword: keyword.value.trim(),
kpiPeriodId: store.formQuery.round ? store.formQuery.round : "", kpiPeriodId: store.formQuery.round ? store.formQuery.round : "",
results: result.value === "" ? undefined : result.value, results: result.value === "" ? undefined : result.value,
}) })

View file

@ -164,13 +164,7 @@ onMounted(async () => {
label="ค้นหา" label="ค้นหา"
> >
<template v-slot:append> <template v-slot:append>
<q-icon <q-icon name="search" />
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
<q-icon v-else name="search" color="grey-5" />
</template> </template>
</q-input> </q-input>
<q-tree <q-tree
@ -180,7 +174,7 @@ onMounted(async () => {
node-key="orgTreeId" node-key="orgTreeId"
label-key="labelName" label-key="labelName"
v-model:expanded="expanded" v-model:expanded="expanded"
:filter="filter" :filter="filter.trim()"
no-results-label="ไม่พบข้อมูลที่ค้นหา" no-results-label="ไม่พบข้อมูลที่ค้นหา"
no-nodes-label="ไม่มีข้อมูล" no-nodes-label="ไม่มีข้อมูล"
:style=" :style="

View file

@ -568,6 +568,8 @@ defineExpose({
emit-value emit-value
map-options map-options
hide-bottom-space hide-bottom-space
hide-selected
fill-input
class="inputgreen" class="inputgreen"
lazy-rules lazy-rules
:rules="[ :rules="[

View file

@ -411,16 +411,9 @@ defineExpose({
outlined outlined
v-model="filter" v-model="filter"
label="ค้นหา" label="ค้นหา"
class="inputgreen"
> >
<template v-slot:append> <template v-slot:append>
<q-icon <q-icon name="search" />
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
<q-icon v-else name="search" color="grey-5" />
</template> </template>
</q-input> </q-input>
<q-tree <q-tree
@ -430,7 +423,7 @@ defineExpose({
selected-color="primary" selected-color="primary"
node-key="id" node-key="id"
label-key="name" label-key="name"
:filter="filter" :filter="filter.trim()"
:no-results-label="notFound" :no-results-label="notFound"
:no-nodes-label="noData" :no-nodes-label="noData"
v-model:expanded="expanded" v-model:expanded="expanded"
@ -476,16 +469,9 @@ defineExpose({
outlined outlined
v-model="filter2" v-model="filter2"
label="ค้นหา" label="ค้นหา"
class="inputgreen"
> >
<template v-slot:append> <template v-slot:append>
<q-icon <q-icon name="search" />
v-if="filter2 !== ''"
name="clear"
class="cursor-pointer"
@click="filter2 = ''"
/>
<q-icon v-else name="search" color="grey-5" />
</template> </template>
</q-input> </q-input>
<q-tree <q-tree
@ -494,7 +480,7 @@ defineExpose({
:nodes="nodes" :nodes="nodes"
node-key="id" node-key="id"
label-key="name" label-key="name"
:filter="filter2" :filter="filter2.trim()"
:no-results-label="notFound" :no-results-label="notFound"
:no-nodes-label="noData" :no-nodes-label="noData"
v-model:expanded="expanded2" v-model:expanded="expanded2"
@ -682,6 +668,8 @@ defineExpose({
option-label="name" option-label="name"
option-value="id" option-value="id"
emit-value emit-value
fill-input
hide-selected
map-options map-options
class="inputgreen" class="inputgreen"
use-input use-input

View file

@ -195,6 +195,7 @@ function onEdit(id: string) {
/** ดึงข้อมูล */ /** ดึงข้อมูล */
async function getData() { async function getData() {
showLoader(); showLoader();
formFilter.keyword = formFilter.keyword.trim()
await http await http
.post(config.API.developmentHistoryList("employee"), formFilter) .post(config.API.developmentHistoryList("employee"), formFilter)
.then((res) => { .then((res) => {
@ -362,16 +363,7 @@ onMounted(async () => {
@keydown.enter.prevent="(formFilter.page = 1), getData()" @keydown.enter.prevent="(formFilter.page = 1), getData()"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="formFilter.keyword == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="formFilter.keyword !== ''"
name="clear"
class="cursor-pointer"
@click="
formFilter.keyword = '';
getData();
"
/>
</template> </template>
</q-input> </q-input>
</div> </div>

View file

@ -182,6 +182,7 @@ function fetchListOrg() {
*/ */
async function getData() { async function getData() {
showLoader(); showLoader();
formFilter.keyword = formFilter.keyword.trim();
await http await http
.post(config.API.developmentHistoryList("officer"), formFilter) .post(config.API.developmentHistoryList("officer"), formFilter)
.then((res) => { .then((res) => {
@ -384,16 +385,7 @@ onMounted(() => {
@keydown.enter.prevent="(formFilter.page = 1), getData()" @keydown.enter.prevent="(formFilter.page = 1), getData()"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="formFilter.keyword == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="formFilter.keyword !== ''"
name="clear"
class="cursor-pointer"
@click="
formFilter.keyword = '';
getData();
"
/>
</template> </template>
</q-input> </q-input>
</div> </div>

View file

@ -120,7 +120,7 @@ async function fetchListProject() {
await http await http
.get( .get(
config.API.developmentMain + config.API.developmentMain +
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&year=${formQuery.year}&status=${formQuery.status}&node=${formQuery.node}&nodeId=${formQuery.nodeId}` `?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword.trim()}&year=${formQuery.year}&status=${formQuery.status}&node=${formQuery.node}&nodeId=${formQuery.nodeId}`
) )
.then((res) => { .then((res) => {
const data = res.data.result.data; const data = res.data.result.data;
@ -301,13 +301,7 @@ onMounted(() => {
<div class="text-subtitle2 text-bold">หนวยงาน/วนราชการ</div> <div class="text-subtitle2 text-bold">หนวยงาน/วนราชการ</div>
<q-input dense outlined v-model="filterMain" label="ค้นหา"> <q-input dense outlined v-model="filterMain" label="ค้นหา">
<template v-slot:append> <template v-slot:append>
<q-icon <q-icon name="search" />
v-if="filterMain !== ''"
name="clear"
class="cursor-pointer"
@click="filterMain = ''"
/>
<q-icon v-else name="search" color="grey-5" />
</template> </template>
</q-input> </q-input>
@ -318,7 +312,7 @@ onMounted(() => {
node-key="orgTreeName" node-key="orgTreeName"
label-key="labelName" label-key="labelName"
v-model:expanded="expanded" v-model:expanded="expanded"
:filter="filterMain" :filter="filterMain.trim()"
no-results-label="ไม่พบข้อมูลที่ค้นหา" no-results-label="ไม่พบข้อมูลที่ค้นหา"
no-nodes-label="ไม่มีข้อมูล" no-nodes-label="ไม่มีข้อมูล"
v-model:selected="formQuery.nodeId" v-model:selected="formQuery.nodeId"
@ -454,17 +448,7 @@ onMounted(() => {
@keyup.enter="fetchListProjectNew" @keyup.enter="fetchListProjectNew"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="formQuery.keyword == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="formQuery.keyword !== ''"
name="clear"
class="cursor-pointer"
@click="
(formQuery.keyword = ''),
fetchListProject(),
(formQuery.page = 1)
"
/>
</template> </template>
</q-input> </q-input>
@ -593,13 +577,7 @@ onMounted(() => {
<div class="q-pa-md"> <div class="q-pa-md">
<q-input dense outlined v-model="filter" label="ค้นหา"> <q-input dense outlined v-model="filter" label="ค้นหา">
<template v-slot:append> <template v-slot:append>
<q-icon <q-icon name="search" />
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
<q-icon v-else name="search" color="grey-5" />
</template> </template>
</q-input> </q-input>
<q-tree <q-tree

View file

@ -138,7 +138,7 @@ function fetchList() {
http http
.get( .get(
config.API.devScholarship + config.API.devScholarship +
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&year=${formQuery.year}&scholarshipType=${formQuery.type}` `?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword.trim()}&year=${formQuery.year}&scholarshipType=${formQuery.type}`
) )
.then((res) => { .then((res) => {
const data = res.data.result.data; const data = res.data.result.data;
@ -305,13 +305,7 @@ onMounted(() => {
@keyup.enter="fetchNewList()" @keyup.enter="fetchNewList()"
> >
<template v-slot:append> <template v-slot:append>
<q-icon v-if="formQuery.keyword == ''" name="search" /> <q-icon name="search" />
<q-icon
v-if="formQuery.keyword !== ''"
name="clear"
class="cursor-pointer"
@click="(formQuery.keyword = ''), fetchNewList()"
/>
</template> </template>
</q-input> </q-input>