รายชื่อลูกจ้างชั่วคราว => Query
This commit is contained in:
parent
18d1429adb
commit
b53eaa8fea
2 changed files with 40 additions and 21 deletions
|
|
@ -265,12 +265,11 @@ watch(
|
||||||
<q-dialog v-model="modal" persistent>
|
<q-dialog v-model="modal" persistent>
|
||||||
<q-card style="min-width: 600px">
|
<q-card style="min-width: 600px">
|
||||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||||
<q-card-section class="flex justify-between" style="padding: 0">
|
<DialogHeader
|
||||||
<DialogHeader
|
tittle="เพิ่มข้อมูลลูกจ้างชั่วคราว"
|
||||||
tittle="เพิ่มข้อมูลลูกจ้างชั่วคราว"
|
:close="closeDialog"
|
||||||
:close="closeDialog"
|
/>
|
||||||
/>
|
|
||||||
</q-card-section>
|
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-section class="q-pa-md q-col-gutter-md">
|
<q-card-section class="q-pa-md q-col-gutter-md">
|
||||||
<div class="row q-col-gutter-md">
|
<div class="row q-col-gutter-md">
|
||||||
|
|
@ -551,15 +550,7 @@ watch(
|
||||||
|
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-actions align="right">
|
<q-card-actions align="right">
|
||||||
<q-btn
|
<q-btn id="onSubmit" type="submit" label="บันทึก" color="public">
|
||||||
id="onSubmit"
|
|
||||||
type="submit"
|
|
||||||
dense
|
|
||||||
unelevated
|
|
||||||
label="บันทึก"
|
|
||||||
color="public"
|
|
||||||
class="q-px-md"
|
|
||||||
>
|
|
||||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,10 @@ import config from "@/app.config";
|
||||||
|
|
||||||
/** importType*/
|
/** importType*/
|
||||||
import type { QInput, QTableProps } from "quasar";
|
import type { QInput, QTableProps } from "quasar";
|
||||||
import type { NewPagination } from "@/modules/08_registryEmployee/interface/index/Main";
|
import type {
|
||||||
|
NewPagination,
|
||||||
|
DataOption,
|
||||||
|
} from "@/modules/08_registryEmployee/interface/index/Main";
|
||||||
import type { DataEmployee } from "@/modules/08_registryEmployee/interface/response/Employee";
|
import type { DataEmployee } from "@/modules/08_registryEmployee/interface/response/Employee";
|
||||||
|
|
||||||
/** importComponents*/
|
/** importComponents*/
|
||||||
|
|
@ -41,7 +44,13 @@ const queryParams = reactive({
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
type: "temp",
|
type: "temp",
|
||||||
|
searchField: "fullName",
|
||||||
|
searchKeyword: "",
|
||||||
});
|
});
|
||||||
|
const searchTypeOption = ref<DataOption[]>([
|
||||||
|
{ id: "fullName", name: "ชื่อ-นามสกุล" },
|
||||||
|
{ id: "citizenId", name: "เลขประจำตัวประชาชน" },
|
||||||
|
]);
|
||||||
|
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -298,21 +307,41 @@ onMounted(() => {
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-space />
|
<q-space />
|
||||||
<div class="items-center" style="display: flex">
|
<div class="items-center" style="display: flex">
|
||||||
|
<q-select
|
||||||
|
outlined
|
||||||
|
v-model="queryParams.searchField"
|
||||||
|
:options="searchTypeOption"
|
||||||
|
emit-value
|
||||||
|
dense
|
||||||
|
emit-option
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
map-options
|
||||||
|
/>
|
||||||
<!-- ค้นหาข้อความใน table -->
|
<!-- ค้นหาข้อความใน table -->
|
||||||
<q-input
|
<q-input
|
||||||
standout
|
standout
|
||||||
dense
|
dense
|
||||||
v-model="filter"
|
v-model="queryParams.searchKeyword"
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
debounce="300"
|
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
style="max-width: 200px"
|
style="max-width: 200px"
|
||||||
class="q-ml-sm"
|
class="q-ml-sm"
|
||||||
|
@keydown.enter.prevent="(queryParams.page = 1), fetchList()"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon v-if="filter == ''" name="search" />
|
<q-icon v-if="queryParams.searchKeyword == ''" name="search" />
|
||||||
<q-icon v-if="filter !== ''" name="clear" class="cursor-pointer" />
|
<q-icon
|
||||||
|
v-if="queryParams.searchKeyword !== ''"
|
||||||
|
name="clear"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="
|
||||||
|
(queryParams.searchKeyword = ''),
|
||||||
|
(queryParams.page = 1),
|
||||||
|
fetchList()
|
||||||
|
"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
<!-- แสดงคอลัมน์ใน table -->
|
<!-- แสดงคอลัมน์ใน table -->
|
||||||
|
|
@ -337,7 +366,6 @@ onMounted(() => {
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:filter="filter"
|
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
@update:pagination="updatePagination"
|
@update:pagination="updatePagination"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue