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>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-btn flat round color="primary" icon="mdi-account-arrow-right" @click="clickAddOrder" />
|
2023-07-17 14:02:44 +07:00
|
|
|
<q-space />
|
|
|
|
|
<div class="items-center" style="display: flex">
|
|
|
|
|
<!-- ค้นหาข้อความใน table -->
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-input standout dense v-model="filter" ref="filterRef" outlined debounce="300" placeholder="ค้นหา"
|
|
|
|
|
style="max-width: 200px" class="q-ml-sm">
|
2023-07-17 14:02:44 +07:00
|
|
|
<template v-slot:append>
|
|
|
|
|
<q-icon v-if="filter == ''" name="search" />
|
2023-08-19 20:14:41 +07:00
|
|
|
<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 -->
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-select v-model="visibleColumnsEmployeeTemp" :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" />
|
2023-07-17 14:02:44 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12 q-pt-sm">
|
2023-08-19 20:14:41 +07:00
|
|
|
<d-table :rows="rows" :columns="columns" :visible-columns="visibleColumnsEmployeeTemp" :filter="filter"
|
|
|
|
|
row-key="id">
|
2023-07-17 14:02:44 +07:00
|
|
|
<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">
|
2023-07-27 14:07:53 +07:00
|
|
|
<q-tr :props="props" class="cursor-pointer">
|
|
|
|
|
<q-td key="no" :props="props" @click="redirectToPage(props.row.id)">
|
2023-07-17 14:02:44 +07:00
|
|
|
{{ props.rowIndex + 1 }}
|
|
|
|
|
</q-td>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-td key="fullname" :props="props" @click="redirectToPage(props.row.id)">
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.fullname }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-td key="newAgency" :props="props" @click="redirectToPage(props.row.id)">
|
|
|
|
|
<div class="col-12" v-if="props.row.draftOrganizationOrganization == null &&
|
|
|
|
|
props.row.draftPositionEmployee == null
|
|
|
|
|
">
|
2023-08-04 14:52:57 +07:00
|
|
|
<div class="text-weight-medium">
|
|
|
|
|
{{ "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12" v-else>
|
|
|
|
|
<div class="text-weight-medium">
|
|
|
|
|
{{ props.row.draftOrganizationOrganization ?? "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-weight-light">
|
|
|
|
|
{{ props.row.draftPositionEmployee ?? "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-td>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-td key="currentAgency" :props="props" @click="redirectToPage(props.row.id)">
|
|
|
|
|
<div class="col-12" v-if="props.row.oc == null && props.row.position == null">
|
2023-08-04 14:52:57 +07:00
|
|
|
<div class="text-weight-medium">
|
|
|
|
|
{{ "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12" v-else>
|
|
|
|
|
<div class="text-weight-medium">
|
|
|
|
|
{{ props.row.oc ?? "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-weight-light">
|
|
|
|
|
{{ props.row.position ?? "-" }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-td>
|
|
|
|
|
<!-- <q-td
|
2023-07-27 14:07:53 +07:00
|
|
|
key="positionEmployeePosition"
|
|
|
|
|
:props="props"
|
|
|
|
|
@click="redirectToPage(props.row.id)"
|
|
|
|
|
>
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.positionEmployeePosition }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-07-27 14:07:53 +07:00
|
|
|
<q-td
|
|
|
|
|
key="positionEmployeePositionSide"
|
|
|
|
|
:props="props"
|
|
|
|
|
@click="redirectToPage(props.row.id)"
|
|
|
|
|
>
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.positionEmployeePositionSide }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-07-27 14:07:53 +07:00
|
|
|
<q-td
|
|
|
|
|
key="positionLine"
|
|
|
|
|
:props="props"
|
|
|
|
|
@click="redirectToPage(props.row.id)"
|
|
|
|
|
>
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.positionLine }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-07-27 14:07:53 +07:00
|
|
|
<q-td
|
|
|
|
|
key="positionEmployeeGroup"
|
|
|
|
|
:props="props"
|
|
|
|
|
@click="redirectToPage(props.row.id)"
|
|
|
|
|
>
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.positionEmployeeGroup }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-07-27 14:07:53 +07:00
|
|
|
<q-td key="oc" :props="props" @click="redirectToPage(props.row.id)">
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.oc }}
|
2023-08-04 14:52:57 +07:00
|
|
|
</q-td> -->
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-td key="amount" :props="props" @click="redirectToPage(props.row.id)">
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.amount }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-td key="govAge" :props="props" @click="redirectToPage(props.row.id)">
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.govAge }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-td key="dateAppoint" :props="props" @click="redirectToPage(props.row.id)">
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.dateAppoint }}
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-td>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-td key="dateStart" :props="props" @click="redirectToPage(props.row.id)">
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.dateStart }}
|
|
|
|
|
</q-td>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-td key="salaryDate" :props="props" @click="redirectToPage(props.row.id)">
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.salaryDate }}
|
|
|
|
|
</q-td>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-td key="refSalary" :props="props" @click="redirectToPage(props.row.id)">
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.refSalary }}
|
|
|
|
|
</q-td>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-td key="age" :props="props" @click="redirectToPage(props.row.id)">
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.age }}
|
|
|
|
|
</q-td>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-td key="fullnameOld" :props="props" @click="redirectToPage(props.row.id)">
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.fullnameOld }}
|
|
|
|
|
</q-td>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-td key="createdAt" :props="props" @click="redirectToPage(props.row.id)">
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.createdAt }}
|
|
|
|
|
</q-td>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-td key="isLeave" :props="props" @click="redirectToPage(props.row.id)">
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.isLeave }}
|
|
|
|
|
</q-td>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-td key="leaveDateOrder" :props="props" @click="redirectToPage(props.row.id)">
|
2023-07-21 12:22:14 +07:00
|
|
|
{{ props.row.leaveDateOrder }}
|
|
|
|
|
</q-td>
|
|
|
|
|
|
2023-07-17 14:02:44 +07:00
|
|
|
<q-td auto-width>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-btn icon="mdi-dots-vertical" size="12px" color="grey-7" flat round dense>
|
2023-07-17 14:02:44 +07:00
|
|
|
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
|
|
|
|
<q-list dense style="min-width: 160px">
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-item clickable v-close-popup @click="editDetail(props.row)">
|
|
|
|
|
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
|
|
|
|
<q-icon color="blue" size="xs" name="mdi-account-settings" />
|
2023-07-17 14:02:44 +07:00
|
|
|
</q-item-section>
|
|
|
|
|
<q-item-section>กำหนดตำแหน่ง</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
<q-separator />
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-item clickable v-close-popup @click="clickDelete(props.row.id)">
|
|
|
|
|
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
2023-07-17 14:02:44 +07:00
|
|
|
<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>
|
2023-08-04 14:52:57 +07:00
|
|
|
</d-table>
|
2023-07-17 14:02:44 +07:00
|
|
|
</div>
|
|
|
|
|
</q-card>
|
2023-07-21 12:22:14 +07:00
|
|
|
<q-dialog v-model="modal" persistent>
|
2023-07-24 14:41:52 +07:00
|
|
|
<q-card style="width: 70vw; max-width: 70vw">
|
|
|
|
|
<DialogHeader tittle="กำหนดตำแหน่ง" :close="modalOpenClose" />
|
|
|
|
|
<q-separator />
|
|
|
|
|
<q-card-section class="q-pa-sm">
|
2023-08-19 20:14:41 +07:00
|
|
|
<d-table :rows="rowsPosition" :columns="columnsPosition" row-key="id" selection="single"
|
|
|
|
|
v-model:selected="selectedPosition" :visible-columns="visibleColumnsPosition">
|
2023-07-24 14:41:52 +07:00
|
|
|
<template v-slot:body-selection="scope">
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-checkbox keep-color color="primary" dense v-model="scope.selected" />
|
2023-07-24 14:41:52 +07:00
|
|
|
</template>
|
|
|
|
|
</d-table>
|
|
|
|
|
</q-card-section>
|
|
|
|
|
<q-separator />
|
|
|
|
|
<q-card-actions align="right">
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-btn dense unelevated label="บันทึก" color="public" @click="checkSave" class="q-px-md"><!-- icon="mdi-content-save-outline"
|
2023-07-24 14:41:52 +07:00
|
|
|
<q-tooltip>บันทึก</q-tooltip> -->
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-card-actions>
|
|
|
|
|
</q-card>
|
2023-07-21 12:22:14 +07:00
|
|
|
</q-dialog>
|
2023-07-25 18:13:17 +07:00
|
|
|
|
|
|
|
|
<!-- dialog ส่งรายชื่อไปออกคำสั่ง -->
|
|
|
|
|
<q-dialog v-model="modaladdOrder">
|
|
|
|
|
<q-card style="width: 900px; max-width: 80vw">
|
2023-08-19 20:14:41 +07:00
|
|
|
<DialogHeader tittle="ส่งรายชื่อไปออกคำสั่ง" :close="clickCloseSendModal" />
|
2023-07-25 18:13:17 +07:00
|
|
|
<q-separator />
|
|
|
|
|
<q-card-section class="q-pt-none">
|
|
|
|
|
<div class="row justify-end">
|
|
|
|
|
<div class="col-5">
|
|
|
|
|
<q-toolbar style="padding: 0">
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-input borderless outlined dense debounce="300" v-model="filter" placeholder="ค้นหา"
|
|
|
|
|
style="width: 850px; max-width: auto">
|
2023-07-25 18:13:17 +07:00
|
|
|
<template v-slot:append>
|
|
|
|
|
<q-icon name="search" />
|
|
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
</q-toolbar>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2023-08-19 20:14:41 +07:00
|
|
|
<d-table :rows="rowsOrder" :columns="columnsOrder" :visible-columns="visibleColumnsOrder" :filter="filter"
|
|
|
|
|
row-key="id" selection="single" v-model:selected="selectedToOrder">
|
2023-07-25 18:13:17 +07:00
|
|
|
<template v-slot:body-selection="scope">
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-checkbox keep-color color="primary" dense v-model="scope.selected" />
|
2023-07-25 18:13:17 +07:00
|
|
|
</template>
|
|
|
|
|
<template v-slot:body="props">
|
|
|
|
|
<q-tr :props="props" class="cursor-pointer">
|
|
|
|
|
<q-td>
|
2023-08-19 20:14:41 +07:00
|
|
|
<q-checkbox keep-color color="primary" dense v-model="props.selected" />
|
2023-07-25 18:13:17 +07:00
|
|
|
</q-td>
|
|
|
|
|
<q-td key="no" :props="props">
|
|
|
|
|
{{ props.rowIndex + 1 }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="fullname" :props="props">
|
|
|
|
|
{{ props.row.fullname }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="positionEmployeePosition" :props="props">
|
|
|
|
|
{{ props.row.positionEmployeePosition }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="positionEmployeePositionSide" :props="props">
|
|
|
|
|
{{ props.row.positionEmployeePositionSide }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="positionLine" :props="props">
|
|
|
|
|
{{ props.row.positionLine }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="positionEmployeeGroup" :props="props">
|
|
|
|
|
{{ props.row.positionEmployeeGroup }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="oc" :props="props">
|
|
|
|
|
{{ props.row.oc }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="amount" :props="props">
|
|
|
|
|
{{ props.row.amount }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="govAge" :props="props">
|
|
|
|
|
{{ props.row.govAge }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="dateAppoint" :props="props">
|
|
|
|
|
{{ props.row.dateAppoint }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<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>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
</d-table>
|
|
|
|
|
</q-card-section>
|
|
|
|
|
|
|
|
|
|
<q-card-actions align="right" class="bg-white text-teal">
|
|
|
|
|
<q-btn label="บันทึก" @click="checkSaveOrder" color="public" />
|
|
|
|
|
</q-card-actions>
|
|
|
|
|
</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">
|
2023-08-04 14:52:57 +07:00
|
|
|
import { ref, onMounted } from "vue";
|
2023-07-04 17:40:05 +07:00
|
|
|
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-25 18:13:17 +07:00
|
|
|
import type {
|
2023-07-21 12:22:14 +07:00
|
|
|
FormRegistryEmployee,
|
|
|
|
|
ResponseEmployeeTemp,
|
|
|
|
|
} from "@/modules/08_registryEmployee/request/Main.ts";
|
2023-07-24 14:41:52 +07:00
|
|
|
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
|
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-24 14:41:52 +07:00
|
|
|
const {
|
|
|
|
|
typeRetire,
|
|
|
|
|
success,
|
|
|
|
|
messageError,
|
|
|
|
|
showLoader,
|
|
|
|
|
hideLoader,
|
|
|
|
|
date2Thai,
|
|
|
|
|
dialogMessage,
|
2023-08-18 11:11:37 +07:00
|
|
|
dialogRemove,
|
|
|
|
|
dialogConfirm,
|
|
|
|
|
dialogMessageNotify
|
2023-07-24 14:41:52 +07:00
|
|
|
} = mixin;
|
|
|
|
|
|
2023-07-25 18:13:17 +07:00
|
|
|
const modaladdOrder = ref<boolean>(false);
|
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>("");
|
|
|
|
|
const modal = ref<boolean>(false);
|
2023-07-24 14:41:52 +07:00
|
|
|
const id = ref<string>("");
|
2023-07-04 17:40:05 +07:00
|
|
|
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,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
2023-07-25 18:13:17 +07:00
|
|
|
const visibleColumnsOrder = ref<String[]>([
|
2023-07-04 17:40:05 +07:00
|
|
|
"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",
|
|
|
|
|
"leaveDateOrder",
|
2023-08-04 14:52:57 +07:00
|
|
|
"newAgency",
|
|
|
|
|
"currentAgency",
|
2023-07-21 12:22:14 +07:00
|
|
|
];
|
2023-08-04 14:52:57 +07:00
|
|
|
// "isLeave",
|
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-08-04 14:52:57 +07:00
|
|
|
name: "newAgency",
|
2023-07-04 17:40:05 +07:00
|
|
|
align: "left",
|
2023-08-04 14:52:57 +07:00
|
|
|
label: "หน่วยงานที่รับการบรรจุ",
|
2023-07-04 17:40:05 +07:00
|
|
|
sortable: true,
|
2023-08-04 14:52:57 +07:00
|
|
|
field: "newAgency",
|
2023-07-21 12:22:14 +07:00
|
|
|
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-08-04 14:52:57 +07:00
|
|
|
name: "currentAgency",
|
2023-07-04 17:40:05 +07:00
|
|
|
align: "left",
|
2023-08-04 14:52:57 +07:00
|
|
|
label: "หน่วยงานปัจจุบัน",
|
2023-07-04 17:40:05 +07:00
|
|
|
sortable: true,
|
2023-08-04 14:52:57 +07:00
|
|
|
field: "currentAgency",
|
2023-07-21 12:22:14 +07:00
|
|
|
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-08-04 14:52:57 +07:00
|
|
|
// {
|
|
|
|
|
// name: "positionEmployeePosition",
|
|
|
|
|
// align: "left",
|
|
|
|
|
// label: "ตำแหน่ง",
|
|
|
|
|
// sortable: true,
|
|
|
|
|
// field: "positionEmployeePosition",
|
|
|
|
|
// headerStyle: "font-size: 14px",
|
|
|
|
|
// style: "font-size: 14px",
|
|
|
|
|
// sort: (a: string, b: string) =>
|
|
|
|
|
// a.localeCompare(b, undefined, {
|
|
|
|
|
// numeric: true,
|
|
|
|
|
// sensitivity: "base",
|
|
|
|
|
// }),
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// name: "positionEmployeePositionSide",
|
|
|
|
|
// align: "left",
|
|
|
|
|
// label: "ด้านของตำแหน่ง",
|
|
|
|
|
// sortable: true,
|
|
|
|
|
// field: "positionEmployeePositionSide",
|
|
|
|
|
// headerStyle: "font-size: 14px",
|
|
|
|
|
// style: "font-size: 14px",
|
|
|
|
|
// sort: (a: string, b: string) =>
|
|
|
|
|
// a.localeCompare(b, undefined, {
|
|
|
|
|
// numeric: true,
|
|
|
|
|
// sensitivity: "base",
|
|
|
|
|
// }),
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// name: "positionLine",
|
|
|
|
|
// align: "left",
|
|
|
|
|
// label: "สายงาน",
|
|
|
|
|
// sortable: true,
|
|
|
|
|
// field: "positionLine",
|
|
|
|
|
// headerStyle: "font-size: 14px",
|
|
|
|
|
// style: "font-size: 14px",
|
|
|
|
|
// sort: (a: string, b: string) =>
|
|
|
|
|
// a.localeCompare(b, undefined, {
|
|
|
|
|
// numeric: true,
|
|
|
|
|
// sensitivity: "base",
|
|
|
|
|
// }),
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
// name: "positionEmployeeGroup",
|
|
|
|
|
// align: "left",
|
|
|
|
|
// label: "กลุ่มงาน",
|
|
|
|
|
// sortable: true,
|
|
|
|
|
// field: "positionEmployeeGroup",
|
|
|
|
|
// headerStyle: "font-size: 14px",
|
|
|
|
|
// style: "font-size: 14px",
|
|
|
|
|
// sort: (a: string, b: string) =>
|
|
|
|
|
// a.localeCompare(b, undefined, {
|
|
|
|
|
// numeric: true,
|
|
|
|
|
// sensitivity: "base",
|
|
|
|
|
// }),
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// name: "oc",
|
|
|
|
|
// align: "left",
|
|
|
|
|
// label: "สังกัด",
|
|
|
|
|
// sortable: true,
|
|
|
|
|
// 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-08-04 14:52:57 +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-24 14:41:52 +07:00
|
|
|
|
|
|
|
|
const selectedPosition = ref<any[]>([]);
|
2023-07-25 18:13:17 +07:00
|
|
|
const selectedToOrder = ref<any[]>([]);
|
2023-07-24 14:41:52 +07:00
|
|
|
const visibleColumnsPosition = ref<String[]>([
|
|
|
|
|
"organizationOrganizationName",
|
|
|
|
|
"organizationAgencyName",
|
|
|
|
|
"organizationGovernmentAgencyName",
|
|
|
|
|
"organizationShortNameName",
|
|
|
|
|
"organizationTypeName",
|
|
|
|
|
"organizationLevelName",
|
|
|
|
|
"positionEmployeeLineName",
|
|
|
|
|
"positionEmployeePositionName",
|
|
|
|
|
"posNo",
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
const columnsPosition = ref<QTableProps["columns"]>([
|
|
|
|
|
{
|
|
|
|
|
name: "organizationOrganizationName",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "หน่วยงาน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "organizationOrganizationName",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "organizationAgencyName",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "รหัสหน่วยงาน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "organizationAgencyName",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "organizationGovernmentAgencyName",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "รหัสส่วนราชการ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "organizationGovernmentAgencyName",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "organizationShortNameName",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ชื่อย่อหน่วยงาน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "organizationShortNameName",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "organizationTypeName",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ประเภทหน่วยงาน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "organizationTypeName",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "organizationLevelName",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ระดับหน่วยงาน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "organizationLevelName",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "positionEmployeeLineName",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "สายงาน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "positionEmployeeLineName",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "positionEmployeePositionName",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ตำแหน่ง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "positionEmployeePositionName",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "posNo",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "เลขที่ตำแหน่ง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "posNo",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
const rowsPosition = ref<any>([]);
|
2023-07-25 18:13:17 +07:00
|
|
|
const columnsOrder = ref<QTableProps["columns"]>([
|
|
|
|
|
{
|
|
|
|
|
name: "no",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ลำดับ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "no",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "fullname",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ชื่อ-สกุล",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "fullname",
|
|
|
|
|
headerStyle: "font-size: 14px; min-width: 200px",
|
|
|
|
|
style: "font-size: 14px; ",
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
name: "positionEmployeePosition",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ตำแหน่ง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "positionEmployeePosition",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "positionEmployeePositionSide",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ด้านของตำแหน่ง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "positionEmployeePositionSide",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "positionLine",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "สายงาน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
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-24 14:41:52 +07:00
|
|
|
|
2023-07-25 18:13:17 +07:00
|
|
|
{
|
|
|
|
|
name: "positionEmployeeGroup",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "กลุ่มงาน",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "positionEmployeeGroup",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "oc",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "สังกัด",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "oc",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "amount",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ค่าจ้าง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "amount",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "govAge",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "อายุราชการ(ปี)",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "govAge",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, {
|
|
|
|
|
numeric: true,
|
|
|
|
|
sensitivity: "base",
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "refSalary",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "เอกสารอ้างอิง",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "refSalary",
|
|
|
|
|
headerStyle: "font-size: 14px; min-width: 200px",
|
|
|
|
|
style: "font-size: 14px; ",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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",
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "fullnameOld",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ชื่อ-สกุล(เดิม)",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "fullnameOld",
|
|
|
|
|
headerStyle: "font-size: 14px; min-width: 200px",
|
|
|
|
|
style: "font-size: 14px; ",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
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" }),
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
const rowsOrder = ref<FormRegistryEmployee[]>([]);
|
|
|
|
|
const selected = ref([]);
|
2023-07-04 17:40:05 +07:00
|
|
|
onMounted(async () => {
|
|
|
|
|
await nodeTree();
|
|
|
|
|
});
|
|
|
|
|
|
2023-07-24 14:41:52 +07:00
|
|
|
const checkNull = (text: string) =>
|
|
|
|
|
text == null
|
|
|
|
|
? ""
|
|
|
|
|
: text == "00000000-0000-0000-0000-000000000000"
|
2023-08-19 20:14:41 +07:00
|
|
|
? ""
|
|
|
|
|
: text;
|
2023-07-24 14:41:52 +07:00
|
|
|
|
|
|
|
|
const getPosition = async (id: string) => {
|
|
|
|
|
showLoader();
|
|
|
|
|
await http
|
|
|
|
|
.get(config.API.organizationEmployeePositionId(id))
|
|
|
|
|
.then((res) => {
|
|
|
|
|
const { result } = res.data;
|
|
|
|
|
let data: any[] = [];
|
|
|
|
|
result.map((r: any) => {
|
|
|
|
|
data.push({
|
|
|
|
|
id: checkNull(r.id),
|
|
|
|
|
agency: checkNull(r.agency),
|
|
|
|
|
conditionNote: checkNull(r.conditionNote),
|
|
|
|
|
department: checkNull(r.department),
|
|
|
|
|
government: checkNull(r.government),
|
|
|
|
|
isActive: r.isActive,
|
|
|
|
|
isCondition: r.isCondition,
|
|
|
|
|
isDirector: r.isDirector,
|
|
|
|
|
organizationUserNote: checkNull(r.organizationUserNote),
|
|
|
|
|
qualification: checkNull(r.qualification),
|
|
|
|
|
pile: checkNull(r.pile),
|
|
|
|
|
posNo: checkNull(r.posNo),
|
|
|
|
|
positionCondition: checkNull(r.positionCondition),
|
|
|
|
|
positionMasterUserNote: checkNull(r.positionMasterUserNote),
|
|
|
|
|
organizationOrder: checkNull(r.organizationOrder),
|
|
|
|
|
organizationFaxId: checkNull(r.organizationFaxId),
|
|
|
|
|
organizationLevelId: checkNull(r.organizationLevelId),
|
|
|
|
|
organizationOrganizationId: checkNull(r.organizationOrganizationId),
|
|
|
|
|
organizationTelExternalId: checkNull(r.organizationTelExternalId),
|
|
|
|
|
organizationTelInternalId: checkNull(r.organizationTelInternalId),
|
|
|
|
|
organizationTypeId: checkNull(r.organizationTypeId),
|
|
|
|
|
positionEmployeeStatusId: checkNull(r.positionEmployeeStatusId),
|
|
|
|
|
positionEmployeeLineId: checkNull(r.positionEmployeeLineId),
|
|
|
|
|
positionEmployeePositionId: checkNull(r.positionEmployeePositionId),
|
|
|
|
|
organizationAgencyId: checkNull(r.organizationAgencyId),
|
|
|
|
|
organizationGovernmentAgencyId: checkNull(
|
|
|
|
|
r.organizationGovernmentAgencyId
|
|
|
|
|
),
|
|
|
|
|
organizationShortNameId: checkNull(r.organizationShortNameId),
|
|
|
|
|
organizationFaxName: checkNull(r.organizationFaxName),
|
|
|
|
|
organizationLevelName: checkNull(r.organizationLevelName),
|
|
|
|
|
organizationOrganizationName: checkNull(
|
|
|
|
|
r.organizationOrganizationName
|
|
|
|
|
),
|
|
|
|
|
organizationTelExternalName: checkNull(r.organizationTelExternalName),
|
|
|
|
|
organizationTelInternalName: checkNull(r.organizationTelInternalName),
|
|
|
|
|
organizationTypeName: checkNull(r.organizationTypeName),
|
|
|
|
|
positionEmployeeStatusName: checkNull(r.positionEmployeeStatusName),
|
|
|
|
|
positionEmployeeLineName: checkNull(r.positionEmployeeLineName),
|
|
|
|
|
positionEmployeePositionName: checkNull(
|
|
|
|
|
r.positionEmployeePositionName
|
|
|
|
|
),
|
|
|
|
|
organizationAgencyName: checkNull(r.organizationAgencyName),
|
|
|
|
|
organizationGovernmentAgencyName: checkNull(
|
|
|
|
|
r.organizationGovernmentAgencyName
|
|
|
|
|
),
|
|
|
|
|
organizationShortNameName: checkNull(r.organizationShortNameName),
|
|
|
|
|
positionEmployeeLevels: r.positionEmployeeLevels,
|
|
|
|
|
positionEmployeePositionSides: r.positionEmployeePositionSides,
|
|
|
|
|
use: r.use,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const index = data.findIndex((r: any) => r.use == true);
|
|
|
|
|
if (index >= 0) {
|
|
|
|
|
selectedPosition.value = [data[index]];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rowsPosition.value = data;
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
};
|
2023-07-25 18:13:17 +07:00
|
|
|
|
|
|
|
|
const clickAddOrder = () => {
|
|
|
|
|
modaladdOrder.value = true;
|
|
|
|
|
const filteredRows = rowsOrder.value.filter(
|
2023-08-19 20:14:41 +07:00
|
|
|
(row) => row.draftPositionEmployee !== null
|
2023-07-25 18:13:17 +07:00
|
|
|
);
|
|
|
|
|
rowsOrder.value = filteredRows;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const clickCloseSendModal = () => {
|
|
|
|
|
modaladdOrder.value = false;
|
|
|
|
|
};
|
2023-08-19 20:14:41 +07:00
|
|
|
const checkSave = () => {
|
|
|
|
|
dialogConfirm($q, async () => await saveData())
|
2023-08-18 11:11:37 +07:00
|
|
|
}
|
|
|
|
|
const saveData = async () => {
|
2023-07-24 14:41:52 +07:00
|
|
|
if (selectedPosition.value.length == 0) {
|
2023-08-18 11:11:37 +07:00
|
|
|
dialogMessageNotify(
|
2023-07-24 14:41:52 +07:00
|
|
|
$q,
|
2023-08-18 11:11:37 +07:00
|
|
|
"ไม่สามารถบันทึกข้อมูลได้ กรุณาเลือกตำแหน่ง",
|
|
|
|
|
// "กรุณาเลือกตำแหน่ง",
|
|
|
|
|
// "warning",
|
|
|
|
|
// undefined,
|
|
|
|
|
// "orange",
|
|
|
|
|
// undefined,
|
|
|
|
|
// undefined,
|
|
|
|
|
// true
|
2023-07-24 14:41:52 +07:00
|
|
|
);
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
await savePosition();
|
|
|
|
|
}
|
|
|
|
|
};
|
2023-08-19 20:14:41 +07:00
|
|
|
const checkSaveOrder = () => {
|
|
|
|
|
dialogConfirm($q, async () => await SaveOrder())
|
2023-08-18 11:11:37 +07:00
|
|
|
}
|
|
|
|
|
const SaveOrder = async () => {
|
2023-07-25 18:13:17 +07:00
|
|
|
if (selectedToOrder.value.length == 0) {
|
2023-08-18 11:11:37 +07:00
|
|
|
dialogMessageNotify(
|
2023-07-25 18:13:17 +07:00
|
|
|
$q,
|
2023-08-18 11:11:37 +07:00
|
|
|
"ไม่สามารถบันทึกข้อมูลได้ กรุณาเลือกตำแหน่ง",
|
|
|
|
|
// "กรุณาเลือกตำแหน่ง",
|
|
|
|
|
// "warning",
|
|
|
|
|
// undefined,
|
|
|
|
|
// "orange",
|
|
|
|
|
// undefined,
|
|
|
|
|
// undefined,
|
|
|
|
|
// true
|
2023-07-25 18:13:17 +07:00
|
|
|
);
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
2023-08-19 20:14:41 +07:00
|
|
|
// ส่งไปออกคำสั่ง
|
|
|
|
|
await sendToOrder();
|
2023-07-25 18:13:17 +07:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2023-07-24 14:41:52 +07:00
|
|
|
const savePosition = async () => {
|
|
|
|
|
showLoader();
|
|
|
|
|
const data = {
|
|
|
|
|
organizationEmployeeId: selectedPosition.value[0].id,
|
|
|
|
|
};
|
|
|
|
|
await http
|
|
|
|
|
.put(config.API.organizationEmployeePositionId(id.value), data)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(async () => {
|
|
|
|
|
await nodeTree();
|
|
|
|
|
modalOpenClose();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2023-08-19 20:14:41 +07:00
|
|
|
const sendToOrder = async () => {
|
|
|
|
|
modaladdOrder.value = false;
|
2023-07-25 18:13:17 +07:00
|
|
|
// showLoader();
|
|
|
|
|
// const data = {
|
|
|
|
|
// organizationEmployeeId: selectedPosition.value[0].id,
|
|
|
|
|
// };
|
|
|
|
|
// await http
|
|
|
|
|
// .put(config.API.organizationEmployeePositionId(id.value), data)
|
|
|
|
|
// .then((res) => {
|
|
|
|
|
// success($q, "บันทึกข้อมูลสำเร็จ");
|
|
|
|
|
// })
|
|
|
|
|
// .catch((e) => {
|
|
|
|
|
// messageError($q, e);
|
|
|
|
|
// })
|
|
|
|
|
// .finally(async () => {
|
|
|
|
|
// await nodeTree();
|
|
|
|
|
// modalOpenClose();
|
|
|
|
|
// });
|
|
|
|
|
};
|
|
|
|
|
|
2023-07-24 14:41:52 +07:00
|
|
|
const modalOpenClose = () => {
|
|
|
|
|
modal.value = !modal.value;
|
|
|
|
|
if (!modal.value) {
|
|
|
|
|
selectedPosition.value = [];
|
|
|
|
|
rowsPosition.value = [];
|
|
|
|
|
id.value = "";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2023-08-19 20:14:41 +07:00
|
|
|
// const next = (id: string) => {
|
|
|
|
|
// router.push(`/registry-employee/${id}`);
|
|
|
|
|
// };
|
2023-07-07 15:29:37 +07:00
|
|
|
|
2023-07-04 17:40:05 +07:00
|
|
|
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;
|
|
|
|
|
|
2023-08-10 17:58:18 +07:00
|
|
|
router.push(`/registry-employee/add`);
|
2023-07-07 15:29:37 +07:00
|
|
|
// router.push(`/placement/detail`);
|
2023-07-04 17:40:05 +07:00
|
|
|
};
|
|
|
|
|
|
2023-07-25 18:13:17 +07:00
|
|
|
// ดูรายการแก้ไขรายชื่อ
|
2023-07-28 09:42:50 +07:00
|
|
|
const redirectToPage = (id?: string) => {
|
2023-08-10 17:58:18 +07:00
|
|
|
router.push(`/registry-employee/edit/${id}`);
|
2023-07-25 18:13:17 +07:00
|
|
|
};
|
2023-07-24 14:41:52 +07:00
|
|
|
const editDetail = async (row: any) => {
|
|
|
|
|
await getPosition(row.id);
|
|
|
|
|
console.log(row);
|
|
|
|
|
id.value = row.id;
|
2023-07-21 12:22:14 +07:00
|
|
|
modal.value = true;
|
2023-07-10 09:32:58 +07:00
|
|
|
};
|
|
|
|
|
|
2023-08-18 11:11:37 +07:00
|
|
|
|
2023-08-19 20:14:41 +07:00
|
|
|
const clickDelete = (id: string) => {
|
|
|
|
|
dialogRemove($q, async () => await deleteData(id))
|
2023-08-18 11:11:37 +07:00
|
|
|
}
|
|
|
|
|
|
2023-08-19 20:14:41 +07:00
|
|
|
const deleteData = async (id: string) => {
|
|
|
|
|
showLoader();
|
|
|
|
|
await http
|
|
|
|
|
.delete(config.API.profileInforId(id))
|
|
|
|
|
.then((res) => {
|
|
|
|
|
success($q, "ลบข้อมูลการสอบสำเร็จ");
|
|
|
|
|
showEmployeeTemp();
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
})
|
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();
|
2023-07-25 18:13:17 +07:00
|
|
|
await showEmployeeTempOrder();
|
2023-07-21 12:22:14 +07:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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;
|
2023-07-24 14:41:52 +07:00
|
|
|
showLoader();
|
2023-07-21 12:22:14 +07:00
|
|
|
await http
|
2023-07-28 12:22:26 +07:00
|
|
|
.post(config.API.searchProfileTemp("all"), {
|
2023-07-21 12:22:14 +07:00
|
|
|
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)),
|
2023-08-04 14:52:57 +07:00
|
|
|
newAgency: "",
|
|
|
|
|
currentAgency: "",
|
|
|
|
|
draftPositionEmployee: e.draftPositionEmployee,
|
|
|
|
|
draftOrganizationOrganization: e.draftOrganizationOrganization,
|
2023-07-21 12:22:14 +07:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
2023-07-24 14:41:52 +07:00
|
|
|
hideLoader();
|
2023-07-04 17:40:05 +07:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2023-07-25 18:13:17 +07:00
|
|
|
const showEmployeeTempOrder = async () => {
|
|
|
|
|
let cirteria = [];
|
|
|
|
|
|
|
|
|
|
cirteria.push({
|
|
|
|
|
criteriaType: "employee_class",
|
|
|
|
|
criteriaValue: "temp",
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
cirteria.push({
|
|
|
|
|
criteriaType: "is_retire",
|
|
|
|
|
criteriaValue: "false",
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (selected.value == null || selected.value == "") return;
|
|
|
|
|
showLoader();
|
|
|
|
|
await http
|
2023-07-28 12:22:26 +07:00
|
|
|
.post(config.API.searchProfileTemp("all"), {
|
2023-07-25 18:13:17 +07:00
|
|
|
criterias: cirteria,
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
let data = res.data.result;
|
|
|
|
|
rowsOrder.value = [];
|
|
|
|
|
data.map((e: ResponseEmployeeTemp) => {
|
|
|
|
|
rowsOrder.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)),
|
2023-08-04 14:52:57 +07:00
|
|
|
newAgency: "",
|
|
|
|
|
currentAgency: "",
|
|
|
|
|
draftPositionEmployee: e.draftPositionEmployee,
|
|
|
|
|
draftOrganizationOrganization: e.draftOrganizationOrganization,
|
2023-07-25 18:13:17 +07:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
2023-08-04 14:52:57 +07:00
|
|
|
// console.log(rowsOrder);
|
2023-07-25 18:13:17 +07:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2023-07-04 17:40:05 +07:00
|
|
|
const onSelected = async (id: string) => {
|
|
|
|
|
// await fetchPositionNumber(id);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
</script>
|
2023-08-04 14:52:57 +07:00
|
|
|
<style lang="scss"></style>
|