updated retirement field

This commit is contained in:
Warunee Tamkoo 2024-05-24 17:50:43 +07:00
parent 48ef8c19a6
commit 332a35569e
22 changed files with 172 additions and 192 deletions

View file

@ -155,7 +155,9 @@
<q-space />
<div v-if="roleRegistryverify || roleKeyregistry">
<q-btn
v-if="!profileStore.isVerified && isSendVerified && roleRegistryverify"
v-if="
!profileStore.isVerified && isSendVerified && roleRegistryverify
"
outlined
color="green"
icon="verified"
@ -165,7 +167,9 @@
<q-tooltip>นยนการตรวจสอบขอม</q-tooltip>
</q-btn>
<q-btn
v-else-if="!profileStore.isVerified && !isSendVerified && roleKeyregistry"
v-else-if="
!profileStore.isVerified && !isSendVerified && roleKeyregistry
"
outlined
color="secondary"
icon="send"
@ -692,7 +696,6 @@
class="full-width inputgreen cursor-pointer"
outlined
dense
:model-value="date2Thai(leaveDate)"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่พ้นราชการ'}`]"
hide-bottom-space
@ -757,7 +760,6 @@
class="full-width inputgreen cursor-pointer"
outlined
dense
:model-value="date2Thai(leaveDateOrder)"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่ออกคำสั่ง'}`]"
hide-bottom-space

View file

@ -183,12 +183,66 @@ async function fetchProfile(id: string) {
});
}
const reasonStatus = ref<boolean>(false);
const leaveReason = ref<string>("");
const reasonOptions = ref<DataOption[]>([
{
id: "RETIRE",
name: "เกษียณอายุราชการ",
},
{
id: "RESIGN",
name: "ลาออก",
},
{
id: "TRANSFER",
name: "ให้โอน",
},
{
id: "DEATH",
name: "ถึงแก่กรรม",
},
{
id: "LAYOFF",
name: "ให้ออก",
},
{
id: "DISCHARGE",
name: "ปลดออก",
},
{
id: "DISMISS",
name: "ไล่ออก",
},
{
id: "OTHER",
name: "อื่นๆ",
},
]);
async function fetchDataPersonal() {
showLoader();
await http
.get(config.API.registryNewByProfileId(profileId.value, empType.value))
.then((res) => {
formDetail.value = res.data.result;
if (res.data.result.leaveReason) {
//
const reason = reasonOptions.value.filter(
(r: DataOption) => r.id == res.data.result.leaveReason
);
if (reason.length > 0) {
leaveReason.value = ` (พ้นจากราชการด้วยสาเหตุ: ${reason[0].name})`;
} else if (
res.data.result.leaveReason !== null &&
res.data.result.leaveReason !== ""
) {
leaveReason.value = ` (พ้นจากราชการด้วยสาเหตุ: ${res.data.result.leaveReason})`;
}
reasonStatus.value = reason.length > 0 ? true : false;
}
fileName.value = res.data.result.avatarName;
if (formDetail.value?.avatarName) {
fetchProfile(profileId.value);
@ -593,7 +647,7 @@ onMounted(async () => {
v-if="formDetail && formDetail.firstName && formDetail.lastName"
>
{{
`${formDetail?.prefix}${formDetail?.firstName} ${formDetail?.lastName}`
`${formDetail?.prefix}${formDetail?.firstName} ${formDetail?.lastName} ${leaveReason}`
}}
</h2>
</div>

View file

@ -251,7 +251,7 @@ onMounted(async () => {
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-12 row q-pa-md items-center">
<div class="col-12">
<div class="text-weight-bold">ตำแหนและหนวยงานเด</div>
<div class="text-weight-bold">ตำแหน/งกเด</div>
</div>
<div class="col-12">

View file

@ -233,7 +233,7 @@ onMounted(async () => {
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-12 row q-pa-md items-center">
<div class="col-12">
<div class="text-weight-bold">ตำแหนและหนวยงานเด</div>
<div class="text-weight-bold">ตำแหน/งกเด</div>
</div>
<div class="col-12">

View file

@ -230,7 +230,7 @@ onMounted(async () => {
<div class="col-xs-12 row items-center">
<div class="col-12">
<div class="text-weight-bold">ตำแหนและหนวยงานเด</div>
<div class="text-weight-bold">ตำแหน/งกเด</div>
</div>
<div class="col-12">
<q-input

View file

@ -93,7 +93,7 @@ const columns2 = ref<QTableProps["columns"]>([
{
name: "organizationPositionOld",
align: "left",
label: "ตำแหน่งและหน่วยงานเดิม",
label: "ตำแหน่ง/สังกัดเดิม",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",

View file

@ -97,7 +97,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "organizationPositionOld",
align: "left",
label: "ตำแหน่งและหน่วยงานเดิม",
label: "ตำแหน่ง/สังกัดเดิม",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",

View file

@ -847,7 +847,7 @@ onMounted(async () => {
/>
</div>
<div class="col-xs-12">
<div class="text-weight-bold">ตำแหนและหนวยงานเด</div>
<div class="text-weight-bold">ตำแหน/งกเด</div>
</div>
<div class="col-xs-12">
<q-input

View file

@ -360,9 +360,7 @@ onMounted(async () => {
<div class="col-12 q-pb-sm"><q-separator /></div>
<div class="col-12">
<div class="text-weight-bold text-grey">
ตำแหนงและหนวยงานเด
</div>
<div class="text-weight-bold text-grey">ตำแหน/งกดเด</div>
</div>
<div class="col-12">
<q-input

View file

@ -84,7 +84,7 @@ const columns2 = ref<QTableProps["columns"]>([
{
name: "organizationPositionOld",
align: "left",
label: "ตำแหน่งและหน่วยงานเดิม",
label: "ตำแหน่ง/สังกัดเดิม",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",

View file

@ -91,7 +91,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "organizationPositionOld",
align: "left",
label: "ตำแหน่งและหน่วยงานเดิม",
label: "ตำแหน่ง/สังกัดเดิม",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",

View file

@ -203,7 +203,7 @@ onMounted(() => {
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-12 row items-center">
<div class="col-12">
<div class="text-weight-bold">ตำแหนและหนวยงานเด</div>
<div class="text-weight-bold">ตำแหน/งกเด</div>
</div>
<div class="col-12">
<q-input

View file

@ -74,7 +74,7 @@ const columns2 = ref<QTableProps["columns"]>([
{
name: "organizationPositionOld",
align: "left",
label: "ตำแหน่งและหน่วยงานเดิม",
label: "ตำแหน่ง/สังกัดเดิม",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",

View file

@ -84,7 +84,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "organizationPositionOld",
align: "left",
label: "ตำแหน่งและหน่วยงานเดิม",
label: "ตำแหน่ง/สังกัดเดิม",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",

View file

@ -555,7 +555,7 @@ onMounted(async () => {
<div class="row bg-white q-col-gutter-y-md">
<div class="col-xs-12 row items-center">
<div class="col-12">
<div class="text-weight-bold">ตำแหนและหนวยงานเด</div>
<div class="text-weight-bold">ตำแหน/งกเด</div>
</div>
<div class="col-12">
<q-input

View file

@ -39,7 +39,7 @@ const dataProfile = ref<DataProfile>();
const fullname = ref<string>("");
/** form แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
const organizationPositionOld = ref<string>(""); //
const organizationPositionOld = ref<string>(""); ///
const organization = ref<string>(""); //
const dateStart = ref<Date | null>(null); //
const dateEnd = ref<Date | null>(null); //
@ -196,7 +196,7 @@ onMounted(() => {
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-12 row items-center">
<div class="col-12">
<div class="text-weight-bold">ตำแหนและหนวยงานเด</div>
<div class="text-weight-bold">ตำแหน/งกเด</div>
</div>
<div class="col-12">
<q-input

View file

@ -307,7 +307,7 @@ function updatemodalPersonal(modal: boolean) {
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-12 row items-center">
<div class="col-12">
<div class="text-weight-bold">ตำแหนและหนวยงานเด</div>
<div class="text-weight-bold">ตำแหน/งกเด</div>
</div>
<div class="col-12">
<q-input

View file

@ -222,7 +222,7 @@ onMounted(async () => {
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-12 row items-center">
<div class="col-12">
<div class="text-weight-bold">ตำแหนและหนวยงานเด</div>
<div class="text-weight-bold">ตำแหน/งกเด</div>
</div>
<div class="col-12">
<q-input

View file

@ -307,7 +307,7 @@ function updatemodalPersonal(modal: boolean) {
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-12 row items-center">
<div class="col-12">
<div class="text-weight-bold">ตำแหนและหนวยงานเด</div>
<div class="text-weight-bold">ตำแหน/งกเด</div>
</div>
<div class="col-12">
<q-input

View file

@ -40,28 +40,36 @@ const columns2 = ref<QTableProps["columns"]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionTypeOld",
name: "location",
align: "left",
label: "ตำแหน่งในสายงาน",
label: "สถานที่ยื่นขอลาออกจากราชการ",
sortable: true,
field: "positionTypeOld",
field: "location",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionLevelOld",
name: "positionLevel",
align: "left",
label: "ระดับ",
label: "ประเภทตำแหน่ง",
sortable: true,
field: "positionLevelOld",
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
format(val, row) {
let name = "";
if (row.positionTypeOld && row.positionLevelOld) {
name = `${row.positionTypeOld} (${row.positionLevelOld})`;
} else if (row.positionTypeOld) {
name = `${row.positionTypeOld}`;
} else if (row.positionLevelOld) {
name = `(${row.positionLevelOld})`;
} else name = "-";
return name;
},
},
{
name: "positionNumberOld",
@ -77,7 +85,7 @@ const columns2 = ref<QTableProps["columns"]>([
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
label: "ตำแหน่ง/สังกัดเดิม",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
@ -113,9 +121,10 @@ const columns2 = ref<QTableProps["columns"]>([
/** คอลัมน์ที่แสดง */
const visibleColumns2 = ref<string[]>([
"no",
"prefix",
"fullname",
"positionTypeOld",
"positionLevelOld",
"location",
"positionLevel",
"positionNumberOld",
"organizationPositionOld",
"datetext",
@ -268,35 +277,22 @@ watchEffect(() => {
v-model="props.selected"
/>
</q-td>
<q-td key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="prefix" :props="props">
{{ props.row.prefix }}
</q-td>
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="positionTypeOld" :props="props">
{{ props.row.positionTypeOld }}
</q-td>
<q-td key="positionLevelOld" :props="props">
{{ props.row.positionLevelOld }}
</q-td>
<q-td key="positionNumberOld" :props="props">
{{ props.row.positionNumberOld }}
</q-td>
<q-td key="organizationPositionOld" :props="props">
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
<q-td v-for="col in props.cols" :key="col.id">
<div v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
</div>
<div
v-else
:class="
col.name === 'organizationPositionOld' ||
col.name === 'organization'
? 'table_ellipsis'
: ''
"
>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td key="datetext" :props="props">
{{ props.row.datetext }}
</q-td>
<q-td key="statustext" :props="props">
{{ props.row.statustext }}
</q-td>
</q-tr>
</template>

View file

@ -55,26 +55,24 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionTypeOld",
name: "positionLevel",
align: "left",
label: "ตำแหน่งในสายงาน",
label: "ประเภทตำแหน่ง",
sortable: true,
field: "positionTypeOld",
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionLevelOld",
align: "left",
label: "ระดับ",
sortable: true,
field: "positionLevelOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
format(val, row) {
let name = "";
if (row.positionTypeOld && row.positionLevelOld) {
name = `${row.positionTypeOld} (${row.positionLevelOld})`;
} else if (row.positionTypeOld) {
name = `${row.positionTypeOld}`;
} else if (row.positionLevelOld) {
name = `(${row.positionLevelOld})`;
} else name = "-";
return name;
},
},
{
name: "positionNumberOld",
@ -90,7 +88,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "organizationPositionOld",
align: "left",
label: "สังกัด",
label: "ตำแหน่ง/สังกัดเดิม",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
@ -129,8 +127,7 @@ const visibleColumns = ref<string[]>([
"prefix",
"fullname",
"location",
"positionTypeOld",
"positionLevelOld",
"positionLevel",
"positionNumberOld",
"organizationPositionOld",
"datetext",
@ -310,40 +307,27 @@ const pagination = ref({
</q-tr>
</template>
<template v-slot:body="props">
<q-tr
:props="props"
class="cursor-pointer"
@click="router.push(`/retirement/resign/${props.row.id}`)"
>
<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="location" :props="props">
{{ props.row.location }}
</q-td>
<q-td key="positionTypeOld" :props="props">
{{ props.row.positionTypeOld }}
</q-td>
<q-td key="positionLevelOld" :props="props">
{{ props.row.positionLevelOld }}
</q-td>
<q-td key="positionNumberOld" :props="props">
{{ props.row.positionNumberOld }}
</q-td>
<q-td key="organizationPositionOld" :props="props">
<div class="table_ellipsis">
{{ props.row.organizationPositionOld }}
<q-tr :props="props" class="cursor-pointer">
<q-td
v-for="col in props.cols"
:key="col.id"
@click="router.push(`/retirement/resign/${props.row.id}`)"
>
<div v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
</div>
<div
v-else
:class="
col.name === 'organizationPositionOld' ||
col.name === 'organization'
? 'table_ellipsis'
: ''
"
>
{{ col.value == null ? "" : col.value }}
</div>
</q-td>
<q-td key="datetext" :props="props">
{{ props.row.datetext }}
</q-td>
<q-td key="statustext" :props="props">
{{ props.row.statustext }}
</q-td>
</q-tr>
</template>

View file

@ -6,7 +6,6 @@ import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogF
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
import { useCounterMixin } from "@/stores/mixin";
import { useRetirementDataStore } from "@/modules/06_retirement/store";
import CurrencyInput from "@/components/CurruncyInput.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import axios from "axios";
@ -306,7 +305,7 @@ const onSubmitConditions = () => {
showLoader();
http
.put(config.API.resignConditions(id.value), {
IsNoDebt: checkboxGroup.value[0] ? true : false,
isNoDebt: checkboxGroup.value[0] ? true : false,
})
.then(() => {
fetchData(id.value);
@ -549,65 +548,6 @@ function removeFile(fileName: string) {
<CardProfile :data="dataProfile as DataProfile" />
<!-- <q-card bordered class="row col-12 text-dark">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-subtitle2">
{{ dataDetail.firstName + " " + dataDetail.lastName }}
</div>
<q-space />
<q-btn
outline
color="blue"
dense
icon-right="mdi-open-in-new"
class="q-px-sm"
label="ดูข้อมูลทะเบียนประวัติ"
@click="onclickViewinfo(dataDetail.profileId)"
/>
</div>
<div class="col-12"><q-separator /></div>
<div class="row col-12 q-pa-md">
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-3 col-sm-2 col-md-1 row">
<q-img :src="avatar" v-if="avatar !== '' && avatar !== null" />
<q-img src="@/assets/avatar_user.jpg" v-else />
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12 q-pl-md">
<div class="col-12 text-top">ตำแหนงในสายงาน</div>
<div class="col-12 text-detail">
{{ dataDetail.positionTypeOld }}
</div>
</div>
</div>
<div class="col-xs-6 col-sm-2 row items-center">
<div class="col-12">
<div class="col-12 text-top">ระด</div>
<div class="col-12 text-detail">
{{ dataDetail.positionLevelOld }}
</div>
</div>
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12">
<div class="col-12 text-top">งก</div>
<div class="col-12 text-detail">
{{ dataDetail.organizationPositionOld }}
</div>
</div>
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12">
<div class="col-12 text-top">สถานะ</div>
<div class="col-12 text-detail">
{{ statusText(dataDetail.status) }}
</div>
</div>
</div>
</div>
</div>
</q-card> -->
<q-card bordered class="row col-12 text-dark q-mt-sm">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-dark">อมลการลาออก</div>
@ -615,14 +555,14 @@ function removeFile(fileName: string) {
<div
class="q-gutter-x-sm"
v-if="
(roleUser === 'officer' && dataDetail.officerReject === null) ||
(roleUser === 'commander' &&
dataDetail.commanderReject === null &&
dataDetail.officerReject === null) ||
dataDetail.officerReject !== null) ||
(roleUser === 'oligarch' &&
dataDetail.oligarchReject === null &&
dataDetail.commanderReject !== null &&
dataDetail.officerReject === null) ||
(roleUser === 'officer' && dataDetail.officerReject === null)
dataDetail.officerReject !== null)
"
>
<q-btn
@ -1122,9 +1062,9 @@ function removeFile(fileName: string) {
:readonly="!edit"
:borderless="!edit"
v-model="organizationPositionOld"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัดเดิม'}`]"
hide-bottom-space
:label="`${'ตำแหน่ง/สังกัด'}`"
:label="`${'ตำแหน่ง/สังกัดเดิม'}`"
type="textarea"
/>
</div>
@ -1139,9 +1079,9 @@ function removeFile(fileName: string) {
:readonly="!edit"
:borderless="!edit"
v-model="positionTypeOld"
:rules="[(val) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
hide-bottom-space
:label="`${'ประเภทตำแหน่ง'}`"
:label="`${'ตำแหน่งประเภท'}`"
/>
</div>
</div>
@ -1155,9 +1095,9 @@ function removeFile(fileName: string) {
:readonly="!edit"
:borderless="!edit"
v-model="positionLevelOld"
:rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ระดับ'}`"
:label="`${'ระดับตำแหน่ง'}`"
/>
</div>
</div>
@ -1179,13 +1119,19 @@ function removeFile(fileName: string) {
</div>
<div class="col-xs-6 col-sm-3 row">
<div class="col-12">
<CurrencyInput
<q-input
v-model="salary"
:edit="edit"
:options="{
currency: 'THB',
}"
:outlined="edit"
dense
:readonly="!edit"
:borderless="!edit"
hide-bottom-space
:label="`${'เงินเดือน'}`"
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules
class="inputgreen"
mask="###,###,###,###"
reverse-fill-mask
/>
</div>
</div>