Merge branch 'develop' into work

This commit is contained in:
Kittapath 2023-07-21 14:21:35 +07:00
commit 2dd7d8988f
8 changed files with 696 additions and 427 deletions

View file

@ -123,8 +123,9 @@ const myFilterMethod = (node: any, filter: string) => {
const filt = filter;
return (
((node.name && node.name == null) || !node.name) &&
((node.organizationName && node.organizationName.indexOf(filt) > -1) ||
// ((node.name && node.name == null) || !node.name) &&
(node.name && node.name.indexOf(filt) > -1) ||
(node.organizationName && node.organizationName.indexOf(filt) > -1) ||
(node.positionNum && node.positionNum.indexOf(filt) > -1) ||
(node.positionName && node.positionName.indexOf(filt) > -1) ||
(node.governmentCode &&
@ -139,7 +140,7 @@ const myFilterMethod = (node: any, filter: string) => {
(node.executivePosition && node.executivePosition.indexOf(filt) > -1) ||
(node.executivePositionSide &&
node.executivePositionSide.indexOf(filt) > -1) ||
(node.positionLevel && node.positionLevel.indexOf(filt) > -1))
(node.positionLevel && node.positionLevel.indexOf(filt) > -1)
);
};
@ -354,6 +355,7 @@ const selectedPosition = async (data: any) => {
dataForm.positionTypeId = "";
}
};
const checkPosition = (val: string) => {
const num = placementPosition.value.findIndex((e: string) => e === val);
return num;
@ -368,179 +370,191 @@ watch(props, () => {
});
console.log("personal", personal.value);
}
if (personal.value.draft === false) {
const findData = dataRespone.value.find(findByPerson);
console.log(findData);
loadTreeData();
selectedPosition(findData.children.children.children)
// console.log("draft===>", personal.value.draft);
if (personal.value.draft === true) {
// const findData = dataRespone.value.find(findByPerson);
let findData: any = null;
dataRespone.value.map((x: any) => {
findData = findByPerson(x);
if (findData != null) {
console.log("findData===>", findData);
selectedPosition(findData)
}
})
// loadTreeData();
// selectedPosition(findData.children.children.children)
}
});
const findByPerson = (obj: any) => {
if (
obj.positionLineId === personal.value.positionLineId &&
obj.positionTypeId === personal.value.positionTypeId &&
obj.positionNumId === personal.value.posNoId
function findByPerson(element: any) {
// console.log("searchTree element===>", element)
if (element.positionNumId && element.positionLineId === personal.value.positionLineId &&
element.positionTypeId === personal.value.positionTypeId &&
element.positionNumId === personal.value.posNoId
) {
return true;
return element;
} else if (element.children) {
var i;
var result = null;
for (i = 0; result == null && i < element.children.length; i++) {
result = findByPerson(element.children[i]);
}
return result;
}
if (obj.children && obj.children.length > 0) {
obj.children = obj.children.find(findByPerson);
return obj.children;
}
return false;
};
return null;
}
</script>
<template>
<q-dialog v-model="props.modal" persistent>
<q-card style="width: 700px; max-width: 80vw">
<q-form ref="myFormPosition">
<DialogHeader title="เลือกหน่วยงานที่รับบรรจุ" :close="closeModal" />
<q-separator />
<q-card-section class="q-pa-sm bg-grey-1">
<div class="row col-12 q-col-gutter-sm">
<div class="col-xs-12 col-sm-6 row">
<q-card flat bordered class="fit q-pa-sm">
<q-scroll-area visible style="height: 70vh">
<q-input
outlined
dense
ref="filterRef"
v-model="search"
placeholder="ค้นหา"
class="q-mb-sm"
>
<template v-slot:append>
<q-icon name="mdi-magnify" />
</template>
</q-input>
<div class="q-pa-sm q-gutter-sm">
<q-tree
no-transition
dense
:nodes="treeData"
node-key="keyId"
:filter="search"
:no-results-label="notFound"
:no-nodes-label="noData"
:filter-method="myFilterMethod"
>
<template v-slot:header-organization="prop">
<div class="col">
<div
class="row items-center q-px-xs q-pt-xs q-gutter-sm"
>
<!--แสดงชอแผนก มพวหนา คลกแลวกาง/ Tree-->
<div class="text-weight-medium">
{{ prop.node.organizationName }}
</div>
<q-dialog v-model="props.modal" persistent>
<q-card style="width: 900px; max-width: 80vw">
<q-form ref="myFormPosition">
<DialogHeader title="เลือกหน่วยงานที่รับบรรจุ" :close="closeModal" />
<q-separator />
<q-card-section class="q-pa-sm bg-grey-1">
<div class="row col-12 q-col-gutter-sm">
<div class="col-xs-12 col-sm-7 row">
<q-card flat bordered class="fit q-pa-sm">
<q-scroll-area visible style="height: 70vh">
<q-input
outlined
dense
ref="filterRef"
v-model="search"
placeholder="ค้นหา"
class="q-mb-sm"
>
<template v-slot:append>
<q-icon name="mdi-magnify" />
</template>
</q-input>
<div class="q-pa-sm q-gutter-sm">
<q-tree
no-transition
dense
:nodes="treeData"
node-key="keyId"
:filter="search"
:no-results-label="notFound"
:no-nodes-label="noData"
:filter-method="myFilterMethod"
>
<template v-slot:header-organization="prop">
<div class="col">
<div
class="row items-center q-px-xs q-pt-xs q-gutter-sm"
>
<!--แสดงชอแผนก มพวหนา คลกแลวกาง/ Tree-->
<div class="text-weight-medium">
{{ prop.node.organizationName }}
</div>
<!--แสดง Total Count PositionNum-->
<!-- <q-badge rounded color="grey-2" text-color="dark"
<!--แสดง Total Count PositionNum-->
<!-- <q-badge rounded color="grey-2" text-color="dark"
:label="prop.node.totalPositionCount" /> -->
<q-badge
v-if="prop.node.totalPositionVacant > 0"
rounded
color="red"
outline
:label="prop.node.totalPositionVacant"
/>
<q-badge
v-if="prop.node.totalPositionVacant > 0"
rounded
color="red"
outline
:label="prop.node.totalPositionVacant"
/>
<q-space />
</div>
<div class="col items-center q-px-xs q-pt-xs">
<div class="text-weight-medium text-grey-7">
{{ prop.node.governmentCode }}
{{ prop.node.organizationShortName }}
</div>
</div>
</div>
</template>
<q-space />
</div>
<div class="col items-center q-px-xs q-pt-xs">
<div class="text-weight-medium text-grey-7">
{{ prop.node.governmentCode }}
{{ prop.node.organizationShortName }}
</div>
</div>
</div>
</template>
<template v-slot:header-person="prop">
<q-item
clickable
:active="selected == prop.node.keyId"
@click="selectedPosition(prop.node)"
:disable="
prop.node.name != null ||
checkPosition(prop.node.positionNumId) != -1
"
active-class="my-list-link text-primary text-weight-medium"
class="row items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
>
<img
v-if="
prop.node.avatar == '' ||
prop.node.avatar ==
'https://cdn.quasar.dev/img/boy-avatar.png'
"
src="@/assets/avatar_user.jpg"
class="col-xs-1 col-sm-2"
style="
<template v-slot:header-person="prop">
<q-item
clickable
:active="selected == prop.node.keyId"
@click="selectedPosition(prop.node)"
:disable="prop.node.name != null ||
checkPosition(prop.node.positionNumId) != -1
"
active-class="my-list-link text-primary text-weight-medium"
class="row items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
>
<img
v-if="prop.node.avatar == '' ||
prop.node.avatar ==
'https://cdn.quasar.dev/img/boy-avatar.png'
"
src="@/assets/avatar_user.jpg"
class="col-xs-1 col-sm-2"
style="
width: 28px;
height: 28px;
border-radius: 50%;
"
/>
<img
v-else
:src="prop.node.avatar"
class="col-xs-1 col-sm-2"
style="
/>
<img
v-else
:src="prop.node.avatar"
class="col-xs-1 col-sm-2"
style="
width: 28px;
height: 28px;
border-radius: 50%;
"
/>
<!--=====ตำแหนงวาง แดง=====-->
<div
v-if="prop.node.name == null"
class="q-px-sm text-weight-medium text-red"
>
าง
</div>
<!--=====วหน เขยว=====-->
<div v-else-if="prop.node.positionLeaderFlag">
<div
class="q-px-sm text-weight-medium text-primary"
>
{{ prop.node.name }}
</div>
</div>
<!--=====กนอง ปกต=====-->
<div v-else>
<div class="q-px-sm text-weight-medium">
{{ prop.node.name }}
</div>
</div>
<!--อทายชอคน แสดงสปกต-->
<div class="q-pr-sm">
{{ prop.node.positionName }}
</div>
<div class="q-pr-sm">
{{ prop.node.positionNum }}
</div>
<div class="q-pr-sm">
{{ prop.node.positionLevel }}
</div>
<q-icon
v-if="prop.node.positionLeaderFlag"
class="q-mr-sm"
size="15px"
color="primary"
name="mdi-bookmark"
></q-icon>
/>
<!--=====ตำแหนงวาง แดง=====-->
<div
v-if="prop.node.name == null"
class="q-px-sm text-weight-medium text-red"
>
าง
</div>
<!--=====วหน เขยว=====-->
<div v-else-if="prop.node.positionLeaderFlag">
<div
class="q-px-sm text-weight-medium text-primary"
>
{{ prop.node.name }}
</div>
</div>
<!--=====กนอง ปกต=====-->
<div v-else>
<div class="q-px-sm text-weight-medium">
{{ prop.node.name }}
</div>
</div>
<!--อทายชอคน แสดงสปกต-->
<div class="q-pr-sm">
{{ prop.node.positionName }}
</div>
<div class="q-pr-sm">
{{ prop.node.positionNum }}
</div>
<div class="q-pr-sm">
{{ prop.node.positionLevel }}
</div>
<q-icon
v-if="prop.node.positionLeaderFlag"
class="q-mr-sm"
size="15px"
color="primary"
name="mdi-bookmark"
></q-icon>
<q-space />
</q-item>
</template>
</q-tree>
</div>
</q-scroll-area>
</q-card>
</div>
<div class="col-xs-12 col-sm-6">
<q-space />
</q-item>
</template>
</q-tree>
</div>
</q-scroll-area>
</q-card>
</div>
<div class="col-xs-12 col-sm-5">
<q-card flat bordered class="fit q-pa-sm">
<q-scroll-area visible style="height: 70vh">
<div class="row col-12 q-col-gutter-xs">

View file

@ -63,6 +63,16 @@ const visibleColumns = ref<any[]>([
"draft",
"positionCandidate",
]);
const visibleColumnslist = ref<any>([
"fullName",
"examNumber",
"idCard",
"positionNumber",
"organizationName",
"draft",
"bmaOfficer",
"positionCandidate",
]);
const columns = ref<QTableProps["columns"]>([
{
@ -185,9 +195,9 @@ const convertContainStatus = (val: string) => {
};
const convertDraft = (val: boolean) => {
switch (val) {
case false:
return "รอส่งตัว";
case true:
return "รอส่งตัว";
case false:
return "ส่งตัวแล้ว";
default:
return "-";
@ -273,7 +283,7 @@ const saveDeferment = async () => {
console.log("ยืนยันการขอผ่อนผัน");
await http
.post(config.API.deferment(), formData)
.then((res) => {
.then(() => {
success($q, "บันทึกสำเร็จ");
})
.catch((e) => {
@ -473,6 +483,8 @@ watch(containStatus, () => {
const modaladdlist = ref<boolean>(false);
const selected = ref<any>([]);
const personal_selected = ref<any>([]);
const filterlistAdd = ref<string>("");
const paging = ref<boolean>(true);
const savelist = () => {
selected.value.map((e: any) => {
personal_selected.value.push(e.personalId);
@ -486,21 +498,21 @@ const savelist = () => {
flat: true,
const: "negative",
},
})
.onOk(async () => {
showLoader();
await http.put(config.API.putPosition(examId), personal_selected.value);
})
.then(() => {
success($q, "บันทึกสำเร็จ");
})
.catch(() => {
console.log(e);
})
.finally(async () => {
await getTable();
hideLoader();
});
}).onOk(async () => {
showLoader();
await http
.put(config.API.putPosition(examId), personal_selected.value)
.then(() => {
success($q, "บันทึกสำเร็จ");
})
.catch((e: any) => {
console.log(e);
})
.finally(async () => {
await getTable();
hideLoader();
});
});
}
};
const handleModalAddListUpdate = (val: boolean) => {
@ -512,6 +524,16 @@ const checkSelected = computed(() => {
return true;
}
});
const pagination = ref({
sortBy: "fullname",
descending: true,
page: 1,
rowsPerPage: 10,
});
const paginationLabel = (start: number, end: number, total: number) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
};
</script>
<template>
<q-form ref="myForm">
@ -869,21 +891,72 @@ const checkSelected = computed(() => {
<!-- dialog เพมรายช -->
<q-dialog v-model="modaladdlist">
<q-card style="width: 850px; max-width: 80vw">
<q-card style="width: 900px; max-width: 80vw">
<q-card-section>
<div class="text-h6">งรายชอไปยงหนวยงาน</div>
<q-toolbar class="q-py-md">
<q-toolbar-title class="header-text text-weight-bolder"
>งรายชอไปยงหนวยงาน
</q-toolbar-title>
<q-btn
icon="close"
unelevated
round
dense
@click="modaladdlist = false"
style="color: #ff8080; background-color: #ffdede"
/>
</q-toolbar>
</q-card-section>
<q-card-section class="q-pt-none">
<div class="row justify-end">
<div class="col-5">
<q-toolbar style="padding: 0">
<q-input
borderless
outlined
dense
debounce="300"
v-model="filterlistAdd"
placeholder="ค้นหา"
style="width: 850px; max-width: auto"
>
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
<q-select
v-model="visibleColumnslist"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
/>
</q-toolbar>
</div>
</div>
<q-table
flat
bordered
dense
:rows="rowsFilter"
:columns="columns"
:filter="filterlistAdd"
row-key="name"
class="custom-header-table"
selection="multiple"
v-model:selected="selected"
:pagination-label="paginationLabel"
:visible-columns="visibleColumnslist"
>
<template v-slot:header-selection="scope">
<q-checkbox
@ -1027,6 +1100,17 @@ const checkSelected = computed(() => {
</q-td>
</q-tr>
</template>
<template v-slot:pagination="scope">
<q-pagination
v-model="pagination.page"
color="primary"
:max="scope.pagesNumber"
:max-pages="5"
size="sm"
boundary-links
direction-links
></q-pagination>
</template>
</q-table>
</q-card-section>

View file

@ -129,7 +129,7 @@
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer" @click="router.push(`/probation/work/1`)">
<q-tr :props="props" class="cursor-pointer" @click="router.push(`/probation/form`)">
<q-td
v-for="col in props.cols"
:key="col.name"

View file

@ -27,10 +27,10 @@ const probationDetail = () =>
import("@/modules/05_placement/components/probation/ProbationDetail.vue");
const probationForm = () =>
import("@/modules/05_placement/components/probation/form.vue");
import("@/modules/05_placement/components/probation/MainDetail.vue");
const probationWorkAdd = () =>
import("@/modules/05_placement/components/probation/MainDetail.vue");
import("@/modules/05_placement/components/probation/AddWork.vue");
export default [
{
path: "/placement",

View file

@ -1,13 +1,47 @@
interface FormRegistryEmployee {
no: string;
name: string;
positionNum: string;
id: string;
fullname: String;
fullnameOld: String;
oc: String;
position: string;
path: string;
type: string;
level: string;
affiliation: string;
yearly: number;
pay: string;
positionPathSide: String;
positionLine: String;
govAge: number;
refSalary: String;
positionEmployeePosition: String | null;
positionEmployeePositionSide: String | null;
positionEmployeeGroup: String | null;
age: String;
amount: String;
dateAppoint: String | null;
dateStart: String | null;
createdAt: String | null;
// salaryDate: String | null;
isLeave: String;
// leaveReason: string;
leaveDateOrder: String | null;
}
export type { FormRegistryEmployee };
interface ResponseEmployeeTemp {
id: string;
fullname: String;
fullnameOld: String;
oc: String;
position: string;
positionPathSide: String;
positionLine: String;
govAge: number;
refSalary: String;
positionEmployeePosition: String | null;
positionEmployeePositionSide: String | null;
positionEmployeeGroup: String | null;
age: String;
amount: String;
dateAppoint: Date | null;
dateStart: Date | null;
createdAt: Date | null;
salaryDate: Date | null;
isLeave: boolean;
leaveReason: string;
leaveDateOrder: Date | null;
}
export type { ResponseEmployeeTemp, FormRegistryEmployee };

View file

@ -33,7 +33,7 @@
</q-input>
<!-- แสดงคอลมนใน table -->
<q-select
v-model="visibleColumns"
v-model="visibleColumnsEmployeeTemp"
:display-value="$q.lang.table.columns"
multiple
outlined
@ -55,7 +55,7 @@
dense
:rows="rows"
:columns="columns"
:visible-columns="visibleColumns"
:visible-columns="visibleColumnsEmployeeTemp"
:filter="filter"
row-key="name"
class="custom-header-table"
@ -75,33 +75,58 @@
<q-td key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="positionNum" :props="props">
{{ props.row.positionNum }}
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="name" :props="props">
{{ props.row.name }}
<q-td key="positionEmployeePosition" :props="props">
{{ props.row.positionEmployeePosition }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position }}
<q-td key="positionEmployeePositionSide" :props="props">
{{ props.row.positionEmployeePositionSide }}
</q-td>
<q-td key="path" :props="props">
{{ props.row.path }}
<q-td key="positionLine" :props="props">
{{ props.row.positionLine }}
</q-td>
<q-td key="type" :props="props">
{{ props.row.type }}
<q-td key="positionEmployeeGroup" :props="props">
{{ props.row.positionEmployeeGroup }}
</q-td>
<q-td key="level" :props="props">
{{ props.row.level }}
<q-td key="oc" :props="props">
{{ props.row.oc }}
</q-td>
<q-td key="affiliation" :props="props">
{{ props.row.affiliation }}
<q-td key="amount" :props="props">
{{ props.row.amount }}
</q-td>
<q-td key="yearly" :props="props">
{{ props.row.yearly }}
<q-td key="govAge" :props="props">
{{ props.row.govAge }}
</q-td>
<q-td key="pay" :props="props">
{{ props.row.pay }}
<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-td auto-width>
<q-btn
icon="mdi-dots-vertical"
@ -169,7 +194,11 @@
</q-table>
</div>
</q-card>
<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>
</template>
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
@ -179,7 +208,11 @@ import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import type { treeTab } from "@/modules/05_placement/interface/index/Main";
import { FormRegistryEmployee } from "@/modules/08_registryEmployee/request/Main.ts";
import {
FormRegistryEmployee,
ResponseEmployeeTemp,
} from "@/modules/08_registryEmployee/request/Main.ts";
import { useDataStore } from "@/stores/data";
const props = defineProps({
next: {
@ -194,20 +227,16 @@ const props = defineProps({
const $q = useQuasar();
const mixin = useCounterMixin(); //
const { dialogMessage, messageError, showLoader, hideLoader } = mixin;
const { typeRetire, success, messageError, showLoader, hideLoader, date2Thai } =
mixin;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const router = useRouter();
const myForm = ref<QForm>();
const filterRef = ref<QInput>();
const filter = ref<string>("");
const mutiselect = ref([]);
const selected = ref<string>("");
const modal = ref<boolean>(false);
const search = ref<string>("");
const expanded = ref<string[]>([]);
const nodesTree = ref<treeTab[]>([]);
const send = ref<String[]>([]);
const selectedModal = ref([]);
const filterModal = ref<string>("");
const visibleColumnsModal = ref<String[]>(["no", "positionNum", "name"]);
const columnsModal = [
{ name: "no", align: "left", label: "ลำดับ", field: "no", sortable: true },
@ -227,12 +256,6 @@ const columnsModal = [
},
];
const paginationModal = ref({
sortBy: "desc",
descending: false,
page: 1,
rowsPerPage: 10,
});
const pagination = ref({
sortBy: "desc",
descending: false,
@ -242,231 +265,270 @@ const pagination = ref({
const visibleColumns = ref<String[]>([
"no",
"positionNum",
"name",
"position",
"path",
"type",
"level",
"affiliation",
"yearly",
"pay",
"fullname",
"fullnameOld",
"oc",
"positionEmployeePosition",
"positionEmployeePositionSide",
"positionLine",
"govAge",
"positionEmployeeGroup",
"dateAppoint",
"refSalary",
"dateStart",
"createdAt",
"salaryDate",
"age",
"amount",
"isLeave",
"leaveDateOrder",
]);
const visibleColumnsEmployeeTemp = ref<String[]>([]);
visibleColumnsEmployeeTemp.value = [
"no",
"fullname",
"fullnameOld",
"oc",
"positionEmployeePosition",
"positionEmployeePositionSide",
"positionLine",
"govAge",
"positionEmployeeGroup",
"dateAppoint",
"refSalary",
"dateStart",
"createdAt",
"salaryDate",
"age",
"amount",
"isLeave",
"leaveDateOrder",
];
const columns = ref<QTableProps["columns"]>([
{ name: "no", align: "left", label: "ลำดับ", field: "no", sortable: true },
{
name: "name",
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: "ชื่อ-สกุล",
field: "name",
sortable: true,
},
{
name: "positionNum",
align: "left",
label: "ตำแหน่งเลขที่",
field: "positionNum",
sortable: true,
field: "fullname",
headerStyle: "font-size: 14px; min-width: 200px",
style: "font-size: 14px; ",
},
{
name: "position",
name: "positionEmployeePosition",
align: "left",
label: "ตำแหน่ง",
field: "position",
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: "path",
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: "สายงาน",
field: "path",
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: "type",
name: "positionEmployeeGroup",
align: "left",
label: "ประเภท",
field: "type",
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: "level",
align: "left",
label: "ระดับชั้นงาน",
field: "level",
sortable: true,
},
{
name: "affiliation",
name: "oc",
align: "left",
label: "สังกัด",
field: "affiliation",
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: "yearly",
align: "left",
label: "ปีงบประมาณ",
field: "yearly",
sortable: true,
},
{
name: "pay",
name: "amount",
align: "left",
label: "ค่าจ้าง",
field: "pay",
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 rows = ref<FormRegistryEmployee[]>([
{
no: "0ac56905-1a74-4606-a120-233340adde95",
name: "นางนัทธ์ เหล่าสกุล",
positionNum: "สกก.3",
position: "นักบริหาร",
path: "บริหาร",
type: "บริหาร",
level: "ชำนาญการพิเศษ",
affiliation: "ฝ่ายบริหารงานทั่วไป",
yearly: 2565,
pay: "40,000",
},
{
no: "0ac56905-1a74-4606-a120-233340adde95",
name: "นายภูวนัย ต้นทอง",
positionNum: "กทม.2",
position: "นักบริหาร",
path: "บริหาร",
type: "บริหาร",
level: "ชำนาญการพิเศษ",
affiliation: "ฝ่ายบริหารงานทั่วไป",
yearly: 2565,
pay: "35,000",
},
{
no: "0ac56905-1a74-4606-a120-233340adde95",
name: "นางปริศนา ตรีวุฒิ",
positionNum: "กบห.3",
position: "นักบริหาร",
path: "บริหาร",
type: "บริหาร",
level: "ชำนาญการพิเศษ",
affiliation: "ฝ่ายบริหารงานทั่วไป",
yearly: 2565,
pay: "38,000",
},
{
no: "0ac56905-1a74-4606-a120-233340adde95",
name: "นางเมษา เกียรติบวรสกุล ",
positionNum: "สกก.3",
position: "นักบริหาร",
path: "บริหาร",
type: "บริหาร",
level: "ชำนาญการพิเศษ",
affiliation: "ฝ่ายบริหารงานทั่วไป",
yearly: 2565,
pay: "25,000",
},
{
no: "0ac56905-1a74-4606-a120-233340adde95",
name: "นางพริมา พงศ์พินิจ",
positionNum: "สกก.3",
position: "นักบริหาร",
path: "บริหาร",
type: "บริหาร",
level: "ชำนาญการพิเศษ",
affiliation: "ฝ่ายบริหารงานทั่วไป",
yearly: 2565,
pay: "30,000",
},
{
no: "0ac56905-1a74-4606-a120-233340adde95",
name: "นางพรพักตร์ พาใจขวัญ",
positionNum: "สกก.3",
position: "นักบริหาร",
path: "บริหาร",
type: "บริหาร",
level: "ชำนาญการพิเศษ",
affiliation: "ฝ่ายบริหารงานทั่วไป",
yearly: 2565,
pay: "40,000",
},
{
no: "0ac56905-1a74-4606-a120-233340adde95",
name: "นางชลธิมา คมสกุล ",
positionNum: "สกก.3",
position: "นักบริหาร",
path: "บริหาร",
type: "บริหาร",
level: "ชำนาญการพิเศษ",
affiliation: "ฝ่ายบริหารงานทั่วไป",
yearly: 2565,
pay: "15,000",
},
{
no: "0ac56905-1a74-4606-a120-233340adde95",
name: "นางนัทธ์ เหล่าสกุล",
positionNum: "สกก.3",
position: "นักบริหาร",
path: "บริหาร",
type: "บริหาร",
level: "ชำนาญการพิเศษ",
affiliation: "ฝ่ายบริหารงานทั่วไป",
yearly: 2565,
pay: "40,000",
},
{
no: "0ac56905-1a74-4606-a120-233340adde95",
name: "นางนัทธ์ เหล่าสกุล",
positionNum: "สกก.3",
position: "นักบริหาร",
path: "บริหาร",
type: "บริหาร",
level: "ชำนาญการพิเศษ",
affiliation: "ฝ่ายบริหารงานทั่วไป",
yearly: 2565,
pay: "40,000",
},
{
no: "0ac56905-1a74-4606-a120-233340adde95",
name: "นางนัทธ์ เหล่าสกุล",
positionNum: "สกก.3",
position: "นักบริหาร",
path: "บริหาร",
type: "บริหาร",
level: "ชำนาญการพิเศษ",
affiliation: "ฝ่ายบริหารงานทั่วไป",
yearly: 2565,
pay: "17,000",
},
{
no: "0ac56905-1a74-4606-a120-233340adde95",
name: "นางนัทธ์ เหล่าสกุล",
positionNum: "สกก.3",
position: "นักบริหาร",
path: "บริหาร",
type: "บริหาร",
level: "ชำนาญการพิเศษ",
affiliation: "ฝ่ายบริหารงานทั่วไป",
yearly: 2565,
pay: "40,000",
},
{
no: "0ac56905-1a74-4606-a120-233340adde95",
name: "นางนัทธ์ เหล่าสกุล",
positionNum: "สกก.3",
position: "นักบริหาร",
path: "บริหาร",
type: "บริหาร",
level: "ชำนาญการพิเศษ",
affiliation: "ฝ่ายบริหารงานทั่วไป",
yearly: 2565,
pay: "20,250",
},
]);
const rows = ref<FormRegistryEmployee[]>([]);
onMounted(async () => {
await nodeTree();
});
@ -522,7 +584,7 @@ const clickAdd = () => {
};
const editDetail = (id: string) => {
router.push({ name: "" });
modal.value = true;
};
const clickDelete = (id: string) => {
@ -536,7 +598,19 @@ const clickDelete = (id: string) => {
persistent: true,
})
.onOk(async () => {
await deleteData(id);
loaderPage(true);
await http
.delete(config.API.profileInforId(id))
.then((res) => {
success($q, "ลบข้อมูลการสอบสำเร็จ");
showEmployeeTemp();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
})
.onCancel(() => {})
.onDismiss(() => {});
@ -548,16 +622,76 @@ const nodeTree = async () => {
.get(config.API.profileOrganizRoot)
.then((res: any) => {
const data = res.data.result;
nodesTree.value = data;
if (data.length > 0) {
expanded.value = [data[0].id];
selected.value = data[0].id;
}
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
.finally(async () => {
hideLoader();
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);
});
};