2023-07-04 17:40:05 +07:00
|
|
|
<template>
|
|
|
|
|
<div class="toptitle text-dark col-12 row items-center">
|
|
|
|
|
รายชื่อลูกจ้างชั่วคราว
|
|
|
|
|
</div>
|
2023-07-17 14:02:44 +07:00
|
|
|
<q-card flat bordered class="q-pa-md">
|
|
|
|
|
<div class="col-12 row items-center">
|
|
|
|
|
<q-btn flat round color="primary" @click="clickAdd" icon="mdi-plus">
|
|
|
|
|
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
<q-space />
|
|
|
|
|
<div class="items-center" style="display: flex">
|
|
|
|
|
<!-- ค้นหาข้อความใน table -->
|
|
|
|
|
<q-input
|
|
|
|
|
standout
|
2023-07-14 15:38:09 +07:00
|
|
|
dense
|
2023-07-17 14:02:44 +07:00
|
|
|
v-model="filter"
|
|
|
|
|
ref="filterRef"
|
|
|
|
|
outlined
|
|
|
|
|
debounce="300"
|
|
|
|
|
placeholder="ค้นหา"
|
|
|
|
|
style="max-width: 200px"
|
|
|
|
|
class="q-ml-sm"
|
2023-07-14 15:38:09 +07:00
|
|
|
>
|
2023-07-17 14:02:44 +07:00
|
|
|
<template v-slot:append>
|
|
|
|
|
<q-icon v-if="filter == ''" name="search" />
|
|
|
|
|
<q-icon
|
|
|
|
|
v-if="filter !== ''"
|
|
|
|
|
name="clear"
|
|
|
|
|
class="cursor-pointer"
|
|
|
|
|
@click="resetFilter"
|
|
|
|
|
/>
|
2023-07-14 15:38:09 +07:00
|
|
|
</template>
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-input>
|
|
|
|
|
<!-- แสดงคอลัมน์ใน table -->
|
|
|
|
|
<q-select
|
2023-07-21 12:22:14 +07:00
|
|
|
v-model="visibleColumnsEmployeeTemp"
|
2023-07-17 14:02:44 +07:00
|
|
|
:display-value="$q.lang.table.columns"
|
|
|
|
|
multiple
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
:options="columns"
|
|
|
|
|
options-dense
|
|
|
|
|
option-value="name"
|
|
|
|
|
map-options
|
|
|
|
|
emit-value
|
|
|
|
|
style="min-width: 150px"
|
|
|
|
|
class="gt-xs q-ml-sm"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12 q-pt-sm">
|
|
|
|
|
<q-table
|
|
|
|
|
flat
|
|
|
|
|
bordered
|
|
|
|
|
dense
|
|
|
|
|
:rows="rows"
|
|
|
|
|
:columns="columns"
|
2023-07-21 12:22:14 +07:00
|
|
|
:visible-columns="visibleColumnsEmployeeTemp"
|
2023-07-17 14:02:44 +07:00
|
|
|
:filter="filter"
|
|
|
|
|
row-key="name"
|
|
|
|
|
class="custom-header-table"
|
|
|
|
|
:pagination-label="paginationLabel"
|
|
|
|
|
v-model:pagination="pagination"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:header="props">
|
|
|
|
|
<q-tr :props="props">
|
|
|
|
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<span class="text-weight-medium">{{ col.label }}</span>
|
|
|
|
|
</q-th>
|
|
|
|
|
<q-th auto-width />
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:body="props">
|
|
|
|
|
<q-tr :props="props" class="cursor-pointer">
|
|
|
|
|
<q-td key="no" :props="props">
|
|
|
|
|
{{ props.rowIndex + 1 }}
|
|
|
|
|
</q-td>
|
2023-07-21 12:22:14 +07:00
|
|
|
<q-td key="fullname" :props="props">
|
|
|
|
|
{{ props.row.fullname }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-07-21 12:22:14 +07:00
|
|
|
<q-td key="positionEmployeePosition" :props="props">
|
|
|
|
|
{{ props.row.positionEmployeePosition }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-07-21 12:22:14 +07:00
|
|
|
<q-td key="positionEmployeePositionSide" :props="props">
|
|
|
|
|
{{ props.row.positionEmployeePositionSide }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-07-21 12:22:14 +07:00
|
|
|
<q-td key="positionLine" :props="props">
|
|
|
|
|
{{ props.row.positionLine }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-07-21 12:22:14 +07:00
|
|
|
<q-td key="positionEmployeeGroup" :props="props">
|
|
|
|
|
{{ props.row.positionEmployeeGroup }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-07-21 12:22:14 +07:00
|
|
|
<q-td key="oc" :props="props">
|
|
|
|
|
{{ props.row.oc }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-07-21 12:22:14 +07:00
|
|
|
<q-td key="amount" :props="props">
|
|
|
|
|
{{ props.row.amount }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-07-21 12:22:14 +07:00
|
|
|
<q-td key="govAge" :props="props">
|
|
|
|
|
{{ props.row.govAge }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-07-21 12:22:14 +07:00
|
|
|
<q-td key="dateAppoint" :props="props">
|
|
|
|
|
{{ props.row.dateAppoint }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-07-21 12:22:14 +07:00
|
|
|
<q-td key="dateStart" :props="props">
|
|
|
|
|
{{ props.row.dateStart }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="salaryDate" :props="props">
|
|
|
|
|
{{ props.row.salaryDate }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="refSalary" :props="props">
|
|
|
|
|
{{ props.row.refSalary }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="age" :props="props">
|
|
|
|
|
{{ props.row.age }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="fullnameOld" :props="props">
|
|
|
|
|
{{ props.row.fullnameOld }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="createdAt" :props="props">
|
|
|
|
|
{{ props.row.createdAt }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="isLeave" :props="props">
|
|
|
|
|
{{ props.row.isLeave }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="leaveDateOrder" :props="props">
|
|
|
|
|
{{ props.row.leaveDateOrder }}
|
|
|
|
|
</q-td>
|
|
|
|
|
|
2023-07-17 14:02:44 +07:00
|
|
|
<q-td auto-width>
|
|
|
|
|
<q-btn
|
|
|
|
|
icon="mdi-dots-vertical"
|
|
|
|
|
size="12px"
|
|
|
|
|
color="grey-7"
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
dense
|
|
|
|
|
>
|
|
|
|
|
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
|
|
|
|
<q-list dense style="min-width: 160px">
|
|
|
|
|
<q-item
|
|
|
|
|
clickable
|
|
|
|
|
v-close-popup
|
|
|
|
|
@click="editDetail(props.row)"
|
|
|
|
|
>
|
|
|
|
|
<q-item-section
|
|
|
|
|
style="min-width: 0px"
|
|
|
|
|
avatar
|
|
|
|
|
class="q-py-sm"
|
2023-07-04 17:40:05 +07:00
|
|
|
>
|
2023-07-17 14:02:44 +07:00
|
|
|
<q-icon
|
|
|
|
|
color="blue"
|
|
|
|
|
size="xs"
|
|
|
|
|
name="mdi-account-settings"
|
|
|
|
|
/>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
<q-item-section>กำหนดตำแหน่ง</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
<q-separator />
|
|
|
|
|
<q-item
|
|
|
|
|
clickable
|
|
|
|
|
v-close-popup
|
|
|
|
|
@click="clickDelete('test')"
|
|
|
|
|
>
|
|
|
|
|
<q-item-section
|
|
|
|
|
style="min-width: 0px"
|
|
|
|
|
avatar
|
|
|
|
|
class="q-py-sm"
|
|
|
|
|
>
|
|
|
|
|
<q-icon color="red" size="xs" name="mdi-delete" />
|
|
|
|
|
</q-item-section>
|
|
|
|
|
<q-item-section>ลบ</q-item-section>
|
|
|
|
|
</q-item>
|
2023-07-04 17:40:05 +07:00
|
|
|
|
2023-07-17 14:02:44 +07:00
|
|
|
<q-separator />
|
|
|
|
|
</q-list>
|
|
|
|
|
</q-menu>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:pagination="scope">
|
|
|
|
|
<q-pagination
|
|
|
|
|
v-model="pagination.page"
|
|
|
|
|
active-color="primary"
|
|
|
|
|
color="dark"
|
|
|
|
|
:max="scope.pagesNumber"
|
|
|
|
|
:max-pages="5"
|
|
|
|
|
size="sm"
|
|
|
|
|
boundary-links
|
|
|
|
|
direction-links
|
|
|
|
|
></q-pagination>
|
|
|
|
|
</template>
|
|
|
|
|
</q-table>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card>
|
2023-07-21 12:22:14 +07:00
|
|
|
<q-dialog v-model="modal" persistent>
|
|
|
|
|
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md"> </q-card>
|
|
|
|
|
</q-dialog>
|
2023-07-04 17:40:05 +07:00
|
|
|
</template>
|
2023-07-21 12:22:14 +07:00
|
|
|
|
2023-07-04 17:40:05 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, onMounted } from "vue";
|
|
|
|
|
import { useQuasar } from "quasar";
|
|
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
2023-07-10 11:56:55 +07:00
|
|
|
import type { QInput, QForm, QTableProps } from "quasar";
|
2023-07-07 15:29:37 +07:00
|
|
|
import { useRouter } from "vue-router";
|
2023-07-04 17:40:05 +07:00
|
|
|
import http from "@/plugins/http";
|
|
|
|
|
import config from "@/app.config";
|
2023-07-13 14:33:04 +07:00
|
|
|
import type { treeTab } from "@/modules/05_placement/interface/index/Main";
|
2023-07-21 12:22:14 +07:00
|
|
|
import {
|
|
|
|
|
FormRegistryEmployee,
|
|
|
|
|
ResponseEmployeeTemp,
|
|
|
|
|
} from "@/modules/08_registryEmployee/request/Main.ts";
|
|
|
|
|
import { useDataStore } from "@/stores/data";
|
2023-07-04 17:40:05 +07:00
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
next: {
|
|
|
|
|
type: Function,
|
|
|
|
|
default: () => console.log("not function"),
|
|
|
|
|
},
|
|
|
|
|
previous: {
|
|
|
|
|
type: Function,
|
|
|
|
|
default: () => console.log("not function"),
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const $q = useQuasar();
|
|
|
|
|
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
2023-07-21 12:22:14 +07:00
|
|
|
const { typeRetire, success, messageError, showLoader, hideLoader, date2Thai } =
|
|
|
|
|
mixin;
|
|
|
|
|
const dataStore = useDataStore();
|
|
|
|
|
const { loaderPage } = dataStore;
|
2023-07-07 15:29:37 +07:00
|
|
|
const router = useRouter();
|
2023-07-04 17:40:05 +07:00
|
|
|
const myForm = ref<QForm>();
|
|
|
|
|
const filterRef = ref<QInput>();
|
|
|
|
|
const filter = ref<string>("");
|
2023-07-21 12:22:14 +07:00
|
|
|
const selected = ref<string>("");
|
2023-07-04 17:40:05 +07:00
|
|
|
const modal = ref<boolean>(false);
|
|
|
|
|
const visibleColumnsModal = ref<String[]>(["no", "positionNum", "name"]);
|
|
|
|
|
const columnsModal = [
|
|
|
|
|
{ name: "no", align: "left", label: "ลำดับ", field: "no", sortable: true },
|
|
|
|
|
{
|
|
|
|
|
name: "positionNum",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "เลขประจำตัวประชาชน",
|
|
|
|
|
field: "positionNum",
|
|
|
|
|
sortable: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "name",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ชื่อ-สกุล",
|
|
|
|
|
field: "name",
|
|
|
|
|
sortable: true,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const pagination = ref({
|
|
|
|
|
sortBy: "desc",
|
|
|
|
|
descending: false,
|
|
|
|
|
page: 1,
|
|
|
|
|
rowsPerPage: 10,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const visibleColumns = ref<String[]>([
|
|
|
|
|
"no",
|
2023-07-21 12:22:14 +07:00
|
|
|
"fullname",
|
|
|
|
|
"fullnameOld",
|
|
|
|
|
"oc",
|
|
|
|
|
"positionEmployeePosition",
|
|
|
|
|
"positionEmployeePositionSide",
|
|
|
|
|
"positionLine",
|
|
|
|
|
"govAge",
|
|
|
|
|
"positionEmployeeGroup",
|
|
|
|
|
"dateAppoint",
|
|
|
|
|
"refSalary",
|
|
|
|
|
"dateStart",
|
|
|
|
|
"createdAt",
|
|
|
|
|
"salaryDate",
|
|
|
|
|
"age",
|
|
|
|
|
"amount",
|
|
|
|
|
"isLeave",
|
|
|
|
|
"leaveDateOrder",
|
2023-07-04 17:40:05 +07:00
|
|
|
]);
|
2023-07-21 12:22:14 +07:00
|
|
|
|
|
|
|
|
const visibleColumnsEmployeeTemp = ref<String[]>([]);
|
|
|
|
|
visibleColumnsEmployeeTemp.value = [
|
|
|
|
|
"no",
|
|
|
|
|
"fullname",
|
|
|
|
|
"fullnameOld",
|
|
|
|
|
"oc",
|
|
|
|
|
"positionEmployeePosition",
|
|
|
|
|
"positionEmployeePositionSide",
|
|
|
|
|
"positionLine",
|
|
|
|
|
"govAge",
|
|
|
|
|
"positionEmployeeGroup",
|
|
|
|
|
"dateAppoint",
|
|
|
|
|
"refSalary",
|
|
|
|
|
"dateStart",
|
|
|
|
|
"createdAt",
|
|
|
|
|
"salaryDate",
|
|
|
|
|
"age",
|
|
|
|
|
"amount",
|
|
|
|
|
"isLeave",
|
|
|
|
|
"leaveDateOrder",
|
|
|
|
|
];
|
2023-07-10 11:56:55 +07:00
|
|
|
const columns = ref<QTableProps["columns"]>([
|
2023-07-04 17:40:05 +07:00
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "no",
|
2023-07-04 17:40:05 +07:00
|
|
|
align: "left",
|
2023-07-21 12:22:14 +07:00
|
|
|
label: "ลำดับ",
|
2023-07-04 17:40:05 +07:00
|
|
|
sortable: true,
|
2023-07-21 12:22:14 +07:00
|
|
|
field: "no",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
2023-07-04 17:40:05 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "fullname",
|
2023-07-04 17:40:05 +07:00
|
|
|
align: "left",
|
2023-07-21 12:22:14 +07:00
|
|
|
label: "ชื่อ-สกุล",
|
2023-07-04 17:40:05 +07:00
|
|
|
sortable: true,
|
2023-07-21 12:22:14 +07:00
|
|
|
field: "fullname",
|
|
|
|
|
headerStyle: "font-size: 14px; min-width: 200px",
|
|
|
|
|
style: "font-size: 14px; ",
|
2023-07-04 17:40:05 +07:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "positionEmployeePosition",
|
2023-07-04 17:40:05 +07:00
|
|
|
align: "left",
|
|
|
|
|
label: "ตำแหน่ง",
|
|
|
|
|
sortable: true,
|
2023-07-21 12:22:14 +07:00
|
|
|
field: "positionEmployeePosition",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
2023-07-04 17:40:05 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "positionEmployeePositionSide",
|
2023-07-04 17:40:05 +07:00
|
|
|
align: "left",
|
2023-07-21 12:22:14 +07:00
|
|
|
label: "ด้านของตำแหน่ง",
|
2023-07-04 17:40:05 +07:00
|
|
|
sortable: true,
|
2023-07-21 12:22:14 +07:00
|
|
|
field: "positionEmployeePositionSide",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
2023-07-04 17:40:05 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "positionLine",
|
2023-07-04 17:40:05 +07:00
|
|
|
align: "left",
|
2023-07-21 12:22:14 +07:00
|
|
|
label: "สายงาน",
|
2023-07-04 17:40:05 +07:00
|
|
|
sortable: true,
|
2023-07-21 12:22:14 +07:00
|
|
|
field: "positionLine",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
2023-07-04 17:40:05 +07:00
|
|
|
},
|
2023-07-21 12:22:14 +07:00
|
|
|
|
2023-07-04 17:40:05 +07:00
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "positionEmployeeGroup",
|
2023-07-04 17:40:05 +07:00
|
|
|
align: "left",
|
2023-07-21 12:22:14 +07:00
|
|
|
label: "กลุ่มงาน",
|
2023-07-04 17:40:05 +07:00
|
|
|
sortable: true,
|
2023-07-21 12:22:14 +07:00
|
|
|
field: "positionEmployeeGroup",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
2023-07-04 17:40:05 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "oc",
|
2023-07-04 17:40:05 +07:00
|
|
|
align: "left",
|
|
|
|
|
label: "สังกัด",
|
|
|
|
|
sortable: true,
|
2023-07-21 12:22:14 +07:00
|
|
|
field: "oc",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
2023-07-04 17:40:05 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "amount",
|
2023-07-04 17:40:05 +07:00
|
|
|
align: "left",
|
2023-07-21 12:22:14 +07:00
|
|
|
label: "ค่าจ้าง",
|
2023-07-04 17:40:05 +07:00
|
|
|
sortable: true,
|
2023-07-21 12:22:14 +07:00
|
|
|
field: "amount",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
2023-07-04 17:40:05 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "govAge",
|
2023-07-04 17:40:05 +07:00
|
|
|
align: "left",
|
2023-07-21 12:22:14 +07:00
|
|
|
label: "อายุราชการ(ปี)",
|
2023-07-04 17:40:05 +07:00
|
|
|
sortable: true,
|
2023-07-21 12:22:14 +07:00
|
|
|
field: "govAge",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
2023-07-10 09:32:58 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "dateAppoint",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "วันที่จ้าง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "dateAppoint",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
// sort: (a: string, b: string) =>
|
|
|
|
|
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
2023-07-10 09:32:58 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "dateStart",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "วันที่เริ่มปฎิบัติราชการ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "dateStart",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
// sort: (a: string, b: string) =>
|
|
|
|
|
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
2023-07-10 09:32:58 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "salaryDate",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "วันที่แต่งตั้ง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "salaryDate",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
// sort: (a: string, b: string) =>
|
|
|
|
|
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
2023-07-04 17:40:05 +07:00
|
|
|
},
|
2023-07-10 09:32:58 +07:00
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "refSalary",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "เอกสารอ้างอิง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "refSalary",
|
|
|
|
|
headerStyle: "font-size: 14px; min-width: 200px",
|
|
|
|
|
style: "font-size: 14px; ",
|
2023-07-10 09:32:58 +07:00
|
|
|
},
|
2023-07-04 17:40:05 +07:00
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "age",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "อายุ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "age",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
2023-07-04 17:40:05 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "fullnameOld",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ชื่อ-สกุล(เดิม)",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "fullnameOld",
|
|
|
|
|
headerStyle: "font-size: 14px; min-width: 200px",
|
|
|
|
|
style: "font-size: 14px; ",
|
2023-07-04 17:40:05 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "createdAt",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "วันที่สร้าง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "createdAt",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
// sort: (a: string, b: string) =>
|
|
|
|
|
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
2023-07-04 17:40:05 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "isLeave",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "สถานะ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "isLeave",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
// sort: (a: string, b: string) =>
|
|
|
|
|
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
2023-07-04 17:40:05 +07:00
|
|
|
},
|
|
|
|
|
{
|
2023-07-21 12:22:14 +07:00
|
|
|
name: "leaveDateOrder",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "วันที่พ้นราชการ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "leaveDateOrder",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
// sort: (a: string, b: string) =>
|
|
|
|
|
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
2023-07-04 17:40:05 +07:00
|
|
|
},
|
2023-07-17 14:02:44 +07:00
|
|
|
]);
|
2023-07-21 12:22:14 +07:00
|
|
|
const rows = ref<FormRegistryEmployee[]>([]);
|
2023-07-04 17:40:05 +07:00
|
|
|
onMounted(async () => {
|
|
|
|
|
await nodeTree();
|
|
|
|
|
});
|
|
|
|
|
|
2023-07-07 15:29:37 +07:00
|
|
|
const next = (id: string) => {
|
|
|
|
|
router.push(`/registryEmployee/${id}`);
|
|
|
|
|
};
|
|
|
|
|
|
2023-07-04 17:40:05 +07:00
|
|
|
const paginationLabel = (start: number, end: number, total: number) => {
|
|
|
|
|
// if (props.paging == true)
|
|
|
|
|
// return " " + start + " ใน " + end + " จากจำนวน " + total + " รายการ";
|
|
|
|
|
// else
|
|
|
|
|
return start + "-" + end + " ใน " + total;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const resetFilter = () => {
|
|
|
|
|
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
|
|
|
|
filter.value = "";
|
|
|
|
|
filterRef.value!.focus();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const getClass = (val: boolean) => {
|
|
|
|
|
return {
|
|
|
|
|
"full-width inputgreen cursor-pointer": val,
|
|
|
|
|
"full-width cursor-pointer": !val,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const clickClose = async () => {
|
|
|
|
|
// if (editRow.value == true) {
|
|
|
|
|
// dialogMessage(
|
|
|
|
|
// $q,
|
|
|
|
|
// "ข้อมูลมีการแก้ไข",
|
|
|
|
|
// "ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?",
|
|
|
|
|
// "mdi-help-circle-outline",
|
|
|
|
|
// "ตกลง",
|
|
|
|
|
// "orange",
|
|
|
|
|
// () => (modal.value = false),
|
|
|
|
|
// undefined
|
|
|
|
|
// );
|
|
|
|
|
// } else {
|
|
|
|
|
modal.value = false;
|
|
|
|
|
// next.value = false;
|
|
|
|
|
// previous.value = false;
|
|
|
|
|
// }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const clickAdd = () => {
|
2023-07-07 15:29:37 +07:00
|
|
|
// modal.value = true;
|
|
|
|
|
|
|
|
|
|
router.push(`/registryEmployee/add`);
|
|
|
|
|
// router.push(`/placement/detail`);
|
2023-07-04 17:40:05 +07:00
|
|
|
};
|
|
|
|
|
|
2023-07-10 11:56:55 +07:00
|
|
|
const editDetail = (id: string) => {
|
2023-07-21 12:22:14 +07:00
|
|
|
modal.value = true;
|
2023-07-10 09:32:58 +07:00
|
|
|
};
|
|
|
|
|
|
2023-07-04 17:40:05 +07:00
|
|
|
const clickDelete = (id: string) => {
|
2023-07-10 09:32:58 +07:00
|
|
|
$q.dialog({
|
|
|
|
|
title: "ยืนยันการลบข้อมูล",
|
|
|
|
|
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
|
|
|
|
cancel: {
|
|
|
|
|
flat: true,
|
|
|
|
|
color: "negative",
|
|
|
|
|
},
|
|
|
|
|
persistent: true,
|
|
|
|
|
})
|
|
|
|
|
.onOk(async () => {
|
2023-07-21 12:22:14 +07:00
|
|
|
loaderPage(true);
|
|
|
|
|
await http
|
|
|
|
|
.delete(config.API.profileInforId(id))
|
|
|
|
|
.then((res) => {
|
|
|
|
|
success($q, "ลบข้อมูลการสอบสำเร็จ");
|
|
|
|
|
showEmployeeTemp();
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
loaderPage(false);
|
|
|
|
|
});
|
2023-07-10 09:32:58 +07:00
|
|
|
})
|
|
|
|
|
.onCancel(() => {})
|
|
|
|
|
.onDismiss(() => {});
|
2023-07-04 17:40:05 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const nodeTree = async () => {
|
|
|
|
|
showLoader();
|
|
|
|
|
await http
|
|
|
|
|
.get(config.API.profileOrganizRoot)
|
|
|
|
|
.then((res: any) => {
|
|
|
|
|
const data = res.data.result;
|
|
|
|
|
if (data.length > 0) {
|
2023-07-21 12:22:14 +07:00
|
|
|
selected.value = data[0].id;
|
2023-07-04 17:40:05 +07:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
2023-07-21 12:22:14 +07:00
|
|
|
.finally(async () => {
|
2023-07-04 17:40:05 +07:00
|
|
|
hideLoader();
|
2023-07-21 12:22:14 +07:00
|
|
|
await showEmployeeTemp();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const showEmployeeTemp = async () => {
|
|
|
|
|
let cirteria = [];
|
|
|
|
|
|
|
|
|
|
cirteria.push({
|
|
|
|
|
criteriaType: "employee_class",
|
|
|
|
|
criteriaValue: "temp",
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
cirteria.push({
|
|
|
|
|
criteriaType: "is_retire",
|
|
|
|
|
criteriaValue: "false",
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (selected.value == null || selected.value == "") return;
|
|
|
|
|
loaderPage(true);
|
|
|
|
|
await http
|
|
|
|
|
.post(config.API.searchProfileByOcId(selected.value, "all"), {
|
|
|
|
|
criterias: cirteria,
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
let data = res.data.result;
|
|
|
|
|
rows.value = [];
|
|
|
|
|
data.map((e: ResponseEmployeeTemp) => {
|
|
|
|
|
rows.value.push({
|
|
|
|
|
id: e.id,
|
|
|
|
|
fullname: e.fullname,
|
|
|
|
|
fullnameOld: e.fullnameOld,
|
|
|
|
|
position: e.position,
|
|
|
|
|
positionPathSide: e.positionPathSide,
|
|
|
|
|
positionLine: e.positionLine,
|
|
|
|
|
govAge: e.govAge,
|
|
|
|
|
positionEmployeePosition: e.positionEmployeePosition,
|
|
|
|
|
positionEmployeePositionSide: e.positionEmployeePositionSide,
|
|
|
|
|
positionEmployeeGroup: e.positionEmployeeGroup,
|
|
|
|
|
oc: e.oc,
|
|
|
|
|
age: e.age,
|
|
|
|
|
amount: e.amount == null ? "" : e.amount.toLocaleString(),
|
|
|
|
|
refSalary: e.refSalary,
|
|
|
|
|
dateAppoint:
|
|
|
|
|
e.dateAppoint == null ? null : date2Thai(new Date(e.dateAppoint)),
|
|
|
|
|
dateStart:
|
|
|
|
|
e.dateStart == null ? null : date2Thai(new Date(e.dateStart)),
|
|
|
|
|
createdAt:
|
|
|
|
|
e.createdAt == null ? null : date2Thai(new Date(e.createdAt)),
|
|
|
|
|
isLeave: e.isLeave == false ? "ครอง" : `${typeRetire(e.leaveReason)}`,
|
|
|
|
|
leaveDateOrder:
|
|
|
|
|
e.leaveDateOrder == null
|
|
|
|
|
? null
|
|
|
|
|
: date2Thai(new Date(e.leaveDateOrder)),
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
loaderPage(false);
|
2023-07-04 17:40:05 +07:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onSelected = async (id: string) => {
|
|
|
|
|
// await fetchPositionNumber(id);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const deleteData = async (id: string) => {};
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
.icon-color {
|
|
|
|
|
color: #4154b3;
|
|
|
|
|
}
|
|
|
|
|
.custom-header-table {
|
|
|
|
|
max-height: 64vh;
|
|
|
|
|
.q-table tr:nth-child(odd) td {
|
|
|
|
|
background: white;
|
|
|
|
|
}
|
|
|
|
|
.q-table tr:nth-child(even) td {
|
|
|
|
|
background: #f8f8f8;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.q-table thead tr {
|
|
|
|
|
background: #ecebeb;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.q-table thead tr th {
|
|
|
|
|
position: sticky;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
}
|
|
|
|
|
/* this will be the loading indicator */
|
|
|
|
|
.q-table thead tr:last-child th {
|
|
|
|
|
/* height of all previous header rows */
|
|
|
|
|
top: 48px;
|
|
|
|
|
}
|
|
|
|
|
.q-table thead tr:first-child th {
|
|
|
|
|
top: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|