hrms-mgt/src/modules/06_retirement/components/resign/ResignByid.vue

1468 lines
47 KiB
Vue
Raw Normal View History

<script setup lang="ts">
2024-10-21 15:37:18 +07:00
import { ref, onMounted, computed } from "vue";
2024-09-18 15:18:57 +07:00
import axios from "axios";
import { useRouter, useRoute } from "vue-router";
import { useQuasar, QForm } from "quasar";
2024-09-18 15:18:57 +07:00
import http from "@/plugins/http";
import config from "@/app.config";
2024-09-18 15:18:57 +07:00
import genReport from "@/plugins/genreport";
import { useCounterMixin } from "@/stores/mixin";
import DialogHeader from "@/components/DialogHeader.vue";
2024-05-23 16:34:22 +07:00
2023-11-17 14:21:53 +07:00
import type {
TypeFile,
rowFile,
FileList,
2023-11-17 14:21:53 +07:00
} from "@/modules/06_retirement/interface/response/Main";
import type { QTableProps } from "quasar";
2024-05-23 13:10:14 +07:00
import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
2024-09-18 15:18:57 +07:00
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
2024-05-23 13:10:14 +07:00
import CardProfile from "@/components/CardProfile.vue";
2024-10-17 18:06:31 +07:00
import WorkFlow from "@/components/Workflow/Main.vue";
2023-11-17 14:21:53 +07:00
/** Use */
2023-08-14 16:45:23 +07:00
const $q = useQuasar();
const route = useRoute();
2023-08-14 16:45:23 +07:00
const router = useRouter();
2024-08-13 11:22:07 +07:00
const checkRoutePermisson = ref<boolean>(route.name == "resignDetailbyid");
const mixin = useCounterMixin();
2023-08-14 16:45:23 +07:00
const {
messageError,
date2Thai,
showLoader,
hideLoader,
success,
2024-05-23 16:34:22 +07:00
2023-08-29 14:17:00 +07:00
dialogConfirm,
dialogRemove,
2023-08-14 16:45:23 +07:00
} = mixin;
2023-11-17 14:21:53 +07:00
/** ตัวแปร */
2024-09-18 15:18:57 +07:00
const modalPersonal = ref<boolean>(false);
const personId = ref<string>("");
2024-10-24 16:09:11 +07:00
const roleUser = ref<string>("");
2024-05-23 13:10:14 +07:00
const dataProfile = ref<DataProfile>();
const id = ref<string>(route.params.id.toString());
2023-08-14 16:45:23 +07:00
const myForm = ref<QForm | null>(null);
const edit = ref<boolean>(false);
const conditions = ref<boolean>(false);
2023-08-29 14:17:00 +07:00
const dataDetail = ref<any>({
datetext: "",
2023-08-14 16:45:23 +07:00
activeDate: new Date(),
createdAt: new Date(),
firstName: "",
id: "",
isActive: true,
lastName: "",
location: "",
organizationPositionOld: "",
positionLevelOld: "",
positionNumberOld: "",
positionTypeOld: "",
prefix: "",
profileId: "",
reason: "",
salary: 0,
sendDate: new Date(),
status: "",
statustext: "",
fullname: "",
statusMain: "",
cancelReason: "",
2023-08-14 16:45:23 +07:00
});
2024-09-18 15:18:57 +07:00
2024-10-17 18:06:31 +07:00
const workflowRef = ref<any>(null);
2023-08-14 16:45:23 +07:00
const organizationPositionOld = ref<string>("");
const positionTypeOld = ref<string>("");
const positionLevelOld = ref<string>("");
const posNo = ref<string>("");
const salary = ref<number>(0);
const date = ref<Date | null>(null);
const dateLeave = ref<Date | null>(null);
const reason = ref<string>("");
const location = ref<string>("");
const status = ref<string>("");
2023-10-06 13:32:54 +07:00
const remarkHorizontal = ref<string>("");
const modal = ref<boolean>(false);
const actionPass = ref<boolean>(false);
const reasonReign = ref<string>("");
const dateBreak = ref<Date | null>(null);
2024-10-21 15:37:18 +07:00
const isCheckData = computed(() => {
if (
organizationPositionOld.value !== "" &&
positionTypeOld.value !== "" &&
positionLevelOld.value !== "" &&
posNo.value !== "" &&
2024-10-24 16:09:11 +07:00
date.value !== null &&
2024-10-25 10:41:12 +07:00
dataDetail.value.commanderReject !== null &&
dataDetail.value.oligarchReject !== null
2024-10-21 15:37:18 +07:00
) {
return true;
} else return false;
});
2023-11-17 14:21:53 +07:00
/** คอลัมน์ */
const rows = ref<TypeFile[]>([]);
const columns = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: true,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "fileName",
align: "left",
label: "ชื่อไฟล์",
sortable: true,
field: "fileName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "btnMicrosoft",
align: "right",
label: "ปุ่ม",
sortable: true,
field: "btnMicrosoft",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
2023-11-17 14:21:53 +07:00
/**เปิด-ปิด modal */
2024-10-24 16:09:11 +07:00
function closeModal() {
modal.value = false;
}
function openModal() {
modal.value = true;
}
const file = ref<any>(null);
const fileList = ref<FileList[]>([]);
const isNoDebt = ref<boolean>(false);
const isNoBurden = ref<boolean>(false);
const isDiscipline = ref<boolean>(false);
2024-05-23 16:34:22 +07:00
2024-09-18 15:18:57 +07:00
// เอกสารดาวน์โหลด
const rowsFileDownload = ref<rowFile[]>([
{
fileName: "แบบฟอร์มหนังสือขอลาออกจากราชการ",
pathName: "",
},
]);
2023-08-14 16:45:23 +07:00
2024-09-18 15:18:57 +07:00
function diffDate() {
if (date.value !== null && dateLeave.value !== null) {
const time = dateLeave.value.getTime() - date.value.getTime();
//วันที่ขอลาออกจากราชการ - วันที่ยื่นขอลาออกจากราชการ
const day = time / (1000 * 3600 * 24);
if (day < 30) {
return true;
}
return false;
}
return false;
2024-09-18 15:18:57 +07:00
}
2024-05-23 16:34:22 +07:00
/** นำข้อมูลมาจาก API*/
2024-09-18 15:18:57 +07:00
async function fetchData(id: string) {
2024-10-25 10:41:12 +07:00
showLoader();
await http
.get(config.API.resingByid(id))
2024-10-24 16:09:11 +07:00
.then(async (res) => {
const data = await res.data.result;
2024-05-23 13:10:14 +07:00
dataProfile.value = data as DataProfile;
2023-10-06 13:32:54 +07:00
let list: TypeFile[] = [];
if (data.docs.length > 0) {
data.docs.map((doc: TypeFile) => {
list.push({
pathName: doc.pathName ?? "",
fileName: doc.fileName ?? "",
});
});
}
rows.value = list;
dataDetail.value = data;
2023-08-14 16:45:23 +07:00
organizationPositionOld.value = data.organizationPositionOld ?? "";
positionTypeOld.value = data.positionTypeOld ?? "";
positionLevelOld.value = data.positionLevelOld ?? "";
posNo.value = data.positionNumberOld ?? "";
salary.value = data.salary ? data.salary : 0;
date.value = data.sendDate ? new Date(data.sendDate) : null;
dateLeave.value = data.activeDate ? new Date(data.activeDate) : null;
reason.value = data.reason ?? "";
location.value = data.location ?? "";
status.value = data.status ?? "";
2023-10-06 13:32:54 +07:00
remarkHorizontal.value = data.remarkHorizontal ?? "-";
isNoDebt.value = data.isNoDebt;
isNoBurden.value = data.isNoBurden;
isDiscipline.value = data.isDiscipline;
})
2023-08-29 15:22:27 +07:00
.catch((e) => {
messageError($q, e);
2024-10-25 10:41:12 +07:00
})
.finally(() => {
2023-08-29 15:22:27 +07:00
hideLoader();
});
2024-09-18 15:18:57 +07:00
}
2023-11-17 14:21:53 +07:00
/**Pop up */
2024-10-24 16:09:11 +07:00
function popUp(action: "pass" | "passNot", type: string) {
reasonReign.value = "";
dateBreak.value = null;
actionPass.value = action === "pass";
2024-10-24 16:09:11 +07:00
roleUser.value = type;
openModal();
2024-09-18 15:18:57 +07:00
}
2024-05-23 16:34:22 +07:00
2023-11-17 14:21:53 +07:00
//เงื่อนไขpop up
2024-10-24 16:09:11 +07:00
function onSubmit() {
if (actionPass.value) {
confirmpopUp();
} else {
rejectpopUp();
}
}
2023-08-14 16:45:23 +07:00
//pop up ยืนยันการอนุญาต
2024-10-24 16:09:11 +07:00
async function confirmpopUp() {
dialogConfirm(
$q,
async () => {
showLoader();
const body = {
reason: reasonReign.value,
};
await http
.put(config.API.resignConfirm(roleUser.value, id.value), body)
.then(async () => {
await fetchData(id.value);
closeModal();
success($q, "การอนุญาตสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
},
"ยืนยันการอนุญาต",
"ต้องการยืนยันการอนุญาตการลานี้หรือไม่ ?"
);
}
2023-08-14 16:45:23 +07:00
2023-11-17 14:21:53 +07:00
//pop up การยับยั้งสำเร็จ
2024-10-24 16:09:11 +07:00
async function rejectpopUp() {
dialogConfirm(
$q,
async () => {
showLoader();
const body = {
reason: reasonReign.value,
date: dateBreak.value,
};
await http
.put(config.API.resignReject(roleUser.value, id.value), body)
.then(async () => {
await fetchData(id.value);
closeModal();
success($q, "การยับยั้งสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
},
"ยืนยันการยับยั้ง",
"ต้องการยืนยันการยับยั้งนี้หรือไม่ ?"
);
}
2023-11-17 14:21:53 +07:00
/**
* กดยกเล
*/
2024-09-18 15:18:57 +07:00
async function clickCancel() {
await fetchData(id.value);
edit.value = false;
2024-05-23 16:34:22 +07:00
myForm.value?.resetValidation();
2024-09-18 15:18:57 +07:00
}
/**
* กดยกเล
*/
2024-09-18 15:18:57 +07:00
async function clickCancelConditions() {
await fetchData(id.value);
conditions.value = false;
2024-09-18 15:18:57 +07:00
}
2024-05-23 16:34:22 +07:00
/** Function บันทึก รายการตรวจสอบเงื่อนไขต่าง ๆ*/
2024-09-18 15:18:57 +07:00
function onSubmitConditions() {
2024-05-23 16:34:22 +07:00
dialogConfirm($q, () => {
showLoader();
http
.put(config.API.resignConditions(id.value), {
isNoDebt: isNoDebt.value,
isNoBurden: isNoBurden.value,
isDiscipline: isDiscipline.value,
2024-05-23 16:34:22 +07:00
})
2024-10-24 16:09:11 +07:00
.then(async () => {
await fetchData(id.value);
2024-05-23 16:34:22 +07:00
success($q, "บันทึกเงื่อนไขต่าง ๆ สำเร็จ");
conditions.value = false;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
});
2024-09-18 15:18:57 +07:00
}
2024-05-23 16:34:22 +07:00
/** Function บันทึก ,แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
2024-09-18 15:18:57 +07:00
function onSubmitAttached() {
2024-05-23 16:34:22 +07:00
dialogConfirm($q, () => {
const formData = new FormData();
const send = date.value !== null ? new Date(date.value).toUTCString() : "";
const activeDate =
dateLeave.value !== null ? new Date(dateLeave.value).toUTCString() : "";
formData.append("Location", location.value);
formData.append("SendDate", send);
formData.append("ActiveDate", activeDate);
formData.append("Reason", reason.value);
formData.append("OrganizationPositionOld", organizationPositionOld.value);
formData.append("PositionTypeOld", positionTypeOld.value);
formData.append("PositionLevelOld", positionLevelOld.value);
formData.append("PositionNumberOld", posNo.value);
formData.append("AmountOld", salary.value.toString());
formData.append("remarkHorizontal", remarkHorizontal.value);
showLoader();
http
.put(config.API.resingByid(id.value), formData)
2024-10-24 16:09:11 +07:00
.then(async () => {
await fetchData(id.value);
2024-05-23 16:34:22 +07:00
success($q, "บันทึกข้อมูลสำเร็จ");
2024-10-24 16:09:11 +07:00
edit.value = false;
2024-05-23 16:34:22 +07:00
})
.catch((e) => {
messageError($q, e);
})
2024-10-24 16:09:11 +07:00
.finally(() => {
hideLoader();
2024-05-23 16:34:22 +07:00
});
});
2024-09-18 15:18:57 +07:00
}
2023-08-29 14:17:00 +07:00
2023-11-17 14:21:53 +07:00
/**
* Function เพ Class เวลา Edit
* @param val เมอเปนEdit จะเปลยน Class
*/
2024-09-18 15:18:57 +07:00
function getClass(val: boolean) {
2023-08-29 14:17:00 +07:00
return {
"full-width inputgreen cursor-pointer": val,
"full-width cursor-pointer": !val,
};
2024-09-18 15:18:57 +07:00
}
2023-11-17 14:21:53 +07:00
/** แปลง StatusOrder */
2024-09-18 15:18:57 +07:00
function statusOrder(val: boolean) {
2023-08-29 14:17:00 +07:00
switch (val) {
case true:
return "ยับยั้ง";
2023-08-29 14:17:00 +07:00
case false:
return "อนุญาต";
2023-08-29 14:17:00 +07:00
}
2024-09-18 15:18:57 +07:00
}
2023-11-17 14:21:53 +07:00
// ดาว์นโหลดไฟล์
2024-09-18 15:18:57 +07:00
async function fileDownload(type: string, fileName: string) {
showLoader();
await http
.get(config.API.reportResignList(type, id.value))
.then(async (res) => {
const data = res.data.result;
await genReport(data, `${fileName}`, type);
})
2024-06-14 11:06:31 +07:00
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
})
.finally(() => {
hideLoader();
});
2024-09-18 15:18:57 +07:00
}
function updatemodalPersonal(modal: boolean) {
modalPersonal.value = modal;
}
2024-05-23 16:34:22 +07:00
async function fetchFile() {
showLoader();
await http
.get(config.API.file("พ้นจากราชการ", "หลักฐานลาออก", id.value))
.then(async (res) => {
fileList.value = await res.data;
2024-05-23 16:34:22 +07:00
})
.catch((e) => {
messageError($q, e);
hideLoader();
});
}
function uploadFiles() {
2024-05-23 16:34:22 +07:00
showLoader();
http
.post(config.API.file("พ้นจากราชการ", "หลักฐานลาออก", id.value), {
replace: true,
fileList: [
{
fileName: file.value.name,
},
],
})
.then(async (res) => {
const foundKey: string | undefined = Object.keys(res.data).find(
(key) =>
res.data[key]?.fileName !== undefined &&
res.data[key]?.fileName !== ""
);
foundKey && (await uploadFileURL(res.data[foundKey]?.uploadUrl));
2024-05-23 16:34:22 +07:00
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
async function uploadFileURL(uploadUrl: string) {
const Data = new FormData();
Data.append("file", file.value);
showLoader();
2024-05-23 16:34:22 +07:00
await axios
.put(uploadUrl, file.value, {
headers: {
"Content-Type": file.value.type,
},
})
.then(async () => {
await fetchFile();
success($q, "อัปโหลดไฟล์สำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
2024-05-23 16:34:22 +07:00
.finally(() => {
hideLoader();
file.value = null;
});
}
async function downloadFiles(fileName: string) {
showLoader();
await http
2024-05-23 16:34:22 +07:00
.get(
config.API.fileByFile("พ้นจากราชการ", "หลักฐานลาออก", id.value, fileName)
)
.then(async (res) => {
const data = await res.data.downloadUrl;
2024-05-23 16:34:22 +07:00
window.open(data, "_blank");
})
.catch((e) => {
messageError($q, e);
})
2024-05-23 16:34:22 +07:00
.finally(async () => {
hideLoader();
});
}
/**
* ลบไฟล
* @param id id file
*/
function removeFile(fileName: string) {
dialogRemove($q, () => {
showLoader();
http
.delete(
config.API.fileByFile(
"พ้นจากราชการ",
"หลักฐานลาออก",
id.value,
fileName
)
)
.then(() => {
setTimeout(async () => {
await fetchFile();
success($q, `ลบไฟล์สำเร็จ`);
2024-05-23 16:34:22 +07:00
hideLoader();
}, 1000);
})
.catch((e) => {
messageError($q, e);
hideLoader();
});
});
}
2024-09-18 15:18:57 +07:00
/** Hook */
onMounted(async () => {
showLoader();
await Promise.all([fetchData(id.value), fetchFile()]).finally(() => {
hideLoader();
});
2024-09-18 15:18:57 +07:00
});
2023-08-29 14:17:00 +07:00
</script>
2024-07-18 17:19:26 +07:00
<template>
2024-10-17 18:06:31 +07:00
<div class="q-gutter-sm q-pa-sm">
<div class="toptitle text-dark col-12 row items-center">
<q-btn
icon="mdi-arrow-left"
unelevated
round
dense
flat
color="primary"
class="q-mr-sm"
@click="router.push('/retirement/resign')"
/>
รายละเอยดการลาออกของ
{{ dataDetail.firstName + " " + dataDetail.lastName }}
</div>
2024-05-23 13:10:14 +07:00
2024-10-17 18:06:31 +07:00
<CardProfile :data="dataProfile as DataProfile" />
2024-05-23 13:10:14 +07:00
2024-10-17 18:06:31 +07:00
<!-- อมลการลาออก -->
<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>
2024-10-18 14:51:16 +07:00
<!-- <q-space />
2024-10-17 18:06:31 +07:00
<div
class="q-gutter-x-sm"
v-if="
(roleUser === 'officer' && dataDetail.officerReject === null) ||
(roleUser === 'commander' &&
dataDetail.commanderReject === null &&
dataDetail.officerReject !== null) ||
(roleUser === 'oligarch' &&
dataDetail.oligarchReject === null &&
dataDetail.commanderReject !== null &&
dataDetail.officerReject !== null)
"
>
<q-btn
outline
color="primary"
dense
icon-right="check"
class="q-px-sm"
label="อนุญาต"
@click="popUp('pass')"
/>
<q-btn
outline
color="red"
dense
icon-right="close"
class="q-px-sm"
label="ยับยั้ง"
@click="popUp('passNot')"
/>
2024-10-18 14:51:16 +07:00
</div> -->
2024-10-17 18:06:31 +07:00
</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-6 col-sm-3 row items-start">
<div class="col-12">
<div class="col-12 text-top">สถานทนขอลาออกจากราชการ</div>
<div class="col-12 text-detail">{{ dataDetail.location }}</div>
</div>
</div>
2024-10-17 18:06:31 +07:00
<div class="col-xs-6 col-sm-3 row items-start">
<div class="col-12">
<div class="col-12 text-top">นทนขอลาออกจากราชการ</div>
<div class="col-12 text-detail">
{{ date2Thai(dataDetail.sendDate) }}
</div>
</div>
</div>
2024-10-17 18:06:31 +07:00
<div class="col-xs-6 col-sm-3 row items-start">
<div class="col-12">
<div class="col-12 text-top">เหตผลทลาออกจากราชการ</div>
<div class="col-12 text-detail">{{ dataDetail.reason }}</div>
</div>
2024-10-17 18:06:31 +07:00
</div>
<div class="col-xs-6 col-sm-3 row items-start">
<div class="col-12">
<div class="col-12 text-top">นทขอลาออกจากราชการ</div>
<div
:class="
diffDate()
? 'col-12 text-detail text-red text-bold'
: 'col-12 text-detail'
"
>
{{ date2Thai(dataDetail.activeDate) }}
</div>
<div
:class="
diffDate()
? 'col-12 text-detail text-red text-bold'
: 'col-12 text-detail'
"
>
{{ diffDate() ? "(ยื่นขอลาออกน้อยกว่า 30 วัน)" : "" }}
</div>
</div>
</div>
<div
class="col-xs-12 col-sm-12 row items-start"
v-if="dataDetail.statusMain === 'CANCEL'"
>
<div class="col-12">
<div class="col-12 text-top">เหตผลการขอยกเล</div>
<div class="col-12 text-detail text-red">
{{ dataDetail.cancelReason }}
</div>
</div>
</div>
</div>
</div>
2024-10-17 18:06:31 +07:00
</q-card>
2024-10-17 18:06:31 +07:00
<!-- เอกสารเพมเต -->
<q-card
v-if="rows.length > 0"
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>
</div>
2024-10-17 18:06:31 +07:00
<div class="col-12"><q-separator /></div>
<div class="col-12">
<d-table
:rows="rows"
:columns="columns"
row-key="fileName"
hide-header
hide-bottom
>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="fileName" :props="props">
{{ props.row.fileName }}
</q-td>
<q-td key="btnMicrosoft" :props="props">
2024-06-25 01:09:43 +07:00
<q-btn
2024-10-17 18:06:31 +07:00
type="a"
target="_blank"
:href="props.row.pathName"
flat
2024-06-25 01:09:43 +07:00
dense
2024-10-17 18:06:31 +07:00
round
color="red"
icon="picture_as_pdf"
>
<q-tooltip>ไฟล PDF</q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
</d-table>
</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>
</div>
<div class="col-12"><q-separator /></div>
<div class="col-12">
<d-table
:rows="rowsFileDownload"
:columns="columns"
row-key="fileName"
hide-header
hide-bottom
>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td key="fileName" :props="props">
{{ props.row.fileName }}
</q-td>
<q-td key="btnMicrosoft" :props="props">
2024-06-25 01:09:43 +07:00
<q-btn
2024-10-17 18:06:31 +07:00
flat
2024-06-25 01:09:43 +07:00
dense
2024-10-17 18:06:31 +07:00
round
2024-06-25 01:09:43 +07:00
color="red"
2024-10-17 18:06:31 +07:00
icon="picture_as_pdf"
@click="fileDownload('pdf', props.row.fileName)"
>
<q-tooltip>ไฟล PDF</q-tooltip>
</q-btn>
<q-btn
flat
2024-06-25 01:09:43 +07:00
dense
2024-10-17 18:06:31 +07:00
round
color="blue"
icon="mdi-file-word"
@click="fileDownload('docx', props.row.fileName)"
>
<q-tooltip>ไฟล WORD</q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
</d-table>
2024-05-23 16:34:22 +07:00
</div>
2024-10-17 18:06:31 +07:00
</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>
</div>
<div class="col-12"><q-separator /></div>
<div class="row col-12 q-pa-sm q-col-gutter-sm">
<div class="col-6">
<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>
<q-space />
<div
v-if="
!checkRoutePermisson &&
workflowRef?.permission.isUpdate &&
dataDetail.statusMain !== 'CANCEL'
"
>
2024-10-17 18:06:31 +07:00
<div v-if="!conditions">
2024-05-23 16:34:22 +07:00
<q-btn
2024-10-17 18:06:31 +07:00
outline
color="primary"
2024-05-23 16:34:22 +07:00
dense
2024-10-17 18:06:31 +07:00
icon-right="mdi-file-edit-outline"
class="q-px-sm"
label="แก้ไข"
style="width: 80px"
@click="conditions = !conditions"
/>
</div>
<div v-else class="q-gutter-x-sm">
<q-btn
outline
color="public"
dense
class="q-px-sm"
label="บันทึก"
style="width: 80px"
@click="onSubmitConditions"
/>
<q-btn
outline
color="red"
dense
class="q-px-sm"
label="ยกเลิก"
style="width: 80px"
@click="clickCancelConditions"
/>
</div>
</div>
2024-05-23 16:34:22 +07:00
</div>
2024-10-17 18:06:31 +07:00
<div class="col-12"><q-separator /></div>
<div class="col-12">
<q-checkbox
v-model="isNoDebt"
label="ไม่เป็นหนี้สหกรณ์"
color="teal"
2024-10-25 10:41:12 +07:00
:disable="!conditions"
2024-10-17 18:06:31 +07:00
/>
</div>
<div class="col-12">
<q-checkbox
v-model="isNoBurden"
label="ไม่มีภาระผูกพันค้ำประกันทุนการศึกษา"
color="teal"
2024-10-25 10:41:12 +07:00
:disable="!conditions"
2024-10-17 18:06:31 +07:00
/>
</div>
<div class="col-12">
<q-checkbox
v-model="isDiscipline"
label="ไม่มีพฤติการณ์ทางวินัย"
color="teal"
2024-10-25 10:41:12 +07:00
:disable="!conditions"
2024-10-17 18:06:31 +07:00
/>
</div>
</q-card>
</div>
<div class="col-6">
<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>
</div>
<div class="col-12"><q-separator /></div>
<div class="row col-12 q-col-gutter-y-sm q-pa-sm">
<div class="col-12 row">
<q-file
v-if="
!checkRoutePermisson &&
workflowRef?.permission.isUpdate &&
dataDetail.statusMain !== 'CANCEL'
2024-10-17 18:06:31 +07:00
"
class="col-12"
for="#evidenceFiles"
outlined
dense
v-model="file"
label="อัปโหลดเอกสารหลักฐานต่าง ๆ"
hide-bottom-space
2024-05-23 16:34:22 +07:00
>
2024-10-17 18:06:31 +07:00
<template v-slot:prepend>
<q-icon name="attach_file" color="primary" />
</template>
<template v-slot:after>
<q-btn
v-if="file"
size="14px"
flat
round
dense
color="add"
icon="mdi-upload"
@click="uploadFiles"
><q-tooltip>ปโหลดเอกสาร</q-tooltip></q-btn
>
</template>
</q-file>
</div>
<div v-if="fileList.length > 0" class="col-xs-12 row">
<q-list class="full-width rounded-borders" bordered separator>
<q-item
v-for="File in fileList"
:key="File.id"
clickable
v-ripple
>
<q-item-section>{{ File.title }}</q-item-section>
<q-item-section avatar>
<div class="row">
<div>
<q-btn
dense
flat
round
size="12px"
color="blue"
icon="mdi-download-outline"
@click="downloadFiles(File.fileName)"
>
<q-tooltip>ดาวนโหลดไฟล</q-tooltip>
</q-btn>
</div>
<div>
<q-btn
v-if="
dataDetail.status == 'WAITTING' &&
!checkRoutePermisson &&
dataDetail.statusMain !== 'CANCEL'
2024-10-17 18:06:31 +07:00
"
dense
flat
round
size="12px"
color="red"
icon="mdi-delete-outline"
@click="removeFile(File.fileName)"
><q-tooltip>ลบไฟล</q-tooltip></q-btn
>
</div>
2024-05-23 16:34:22 +07:00
</div>
2024-10-17 18:06:31 +07:00
</q-item-section>
</q-item>
</q-list>
</div>
2024-05-23 16:34:22 +07:00
2024-10-17 18:06:31 +07:00
<div class="col-12" v-else>
<q-card class="q-pa-sm" bordered> ไมรายการเอกสาร </q-card>
</div>
2024-05-23 16:34:22 +07:00
</div>
2024-10-17 18:06:31 +07:00
</q-card>
</div>
2024-05-23 16:34:22 +07:00
</div>
2024-10-17 18:06:31 +07:00
</q-card>
2024-10-17 18:06:31 +07:00
<!-- ผลการพจารณาของการเจาหนาทของหนวยงาน -->
2024-10-24 16:09:11 +07:00
<!-- <q-card bordered class="row col-12 text-dark q-mt-sm">
2024-10-17 18:06:31 +07:00
<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>
2024-05-23 16:34:22 +07:00
</div>
2024-10-17 18:06:31 +07:00
<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-6 row items-start">
<div class="col-12 text-top">สถานะ</div>
<div class="col-12 text-detail">
{{
dataDetail.officerReject !== null
? statusOrder(dataDetail.officerReject)
: "-"
}}
</div>
2024-05-23 16:34:22 +07:00
</div>
2024-10-17 18:06:31 +07:00
<div class="col-xs-6 row items-start">
<div class="col-12 text-top">นสดทายทบย</div>
<div class="col-12 text-detail">
{{
dataDetail.officerRejectDate !== null
? date2Thai(dataDetail.officerRejectDate)
: "-"
}}
</div>
2024-05-23 16:34:22 +07:00
</div>
2024-10-17 18:06:31 +07:00
<div class="col-xs-12 row items-start">
<div class="col-12 text-top">ความคดเหนและเหตผล</div>
2024-10-17 18:06:31 +07:00
<div class="col-12 text-detail">
{{
dataDetail.officerReject
? dataDetail.officerRejectReason
: dataDetail.officerApproveReason
}}
</div>
2024-05-23 16:34:22 +07:00
</div>
</div>
</div>
2024-10-24 16:09:11 +07:00
</q-card> -->
2024-10-17 18:06:31 +07:00
<!-- ผลการพจารณาของผงคบบญชา -->
<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>
2024-10-24 16:09:11 +07:00
<q-space />
2024-10-30 14:51:00 +07:00
<div
class="q-gutter-x-sm"
v-if="
workflowRef?.permission.isUpdate &&
dataDetail.commanderReject === null &&
dataDetail.statusMain !== 'CANCEL'
2024-10-30 14:51:00 +07:00
"
>
2024-10-24 16:09:11 +07:00
<q-btn
outline
color="primary"
dense
icon-right="check"
class="q-px-sm"
label="อนุญาต"
@click="popUp('pass', 'commander')"
/>
<q-btn
outline
color="red"
dense
icon-right="close"
class="q-px-sm"
label="ยับยั้ง"
@click="popUp('passNot', 'commander')"
/>
</div>
</div>
2024-10-24 16:09:11 +07:00
2024-10-17 18:06:31 +07:00
<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-6 row items-start">
<div class="col-12 text-top">สถานะ</div>
<div class="col-12 text-detail">
{{
dataDetail.commanderReject !== null
? statusOrder(dataDetail.commanderReject)
: "-"
}}
</div>
2023-08-29 14:17:00 +07:00
</div>
2024-10-17 18:06:31 +07:00
<div class="col-xs-6 row items-start">
<div class="col-12 text-top">นสดทายทบย</div>
<div class="col-12 text-detail">
{{
dataDetail.commanderRejectDate !== null
? date2Thai(dataDetail.commanderRejectDate)
: "-"
}}
</div>
2023-08-29 14:17:00 +07:00
</div>
2024-10-17 18:06:31 +07:00
<div class="col-xs-12 row items-start">
<div class="col-12 text-top">ความคดเหนและเหตผล</div>
<div class="col-12 text-detail">
{{
dataDetail.commanderReject
? dataDetail.commanderRejectReason
: dataDetail.commanderApproveReason
}}
</div>
2023-08-29 14:17:00 +07:00
</div>
</div>
</div>
2024-10-17 18:06:31 +07:00
</q-card>
2024-10-17 18:06:31 +07:00
<!-- ผลการพจารณาของผอำนาจ -->
<q-card bordered class="row col-12 text-dark q-mt-sm">
2024-05-23 16:34:22 +07:00
<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">
2024-10-17 18:06:31 +07:00
ผลการพจารณาของผอำนาจ
2024-05-23 16:34:22 +07:00
</div>
2024-10-24 16:09:11 +07:00
<q-space />
2024-10-30 14:51:00 +07:00
<div
class="q-gutter-x-sm"
v-if="
workflowRef?.permission.isUpdate &&
dataDetail.oligarchReject === null &&
dataDetail.statusMain !== 'CANCEL'
2024-10-30 14:51:00 +07:00
"
>
2024-10-24 16:09:11 +07:00
<q-btn
outline
color="primary"
dense
icon-right="check"
class="q-px-sm"
label="อนุญาต"
@click="popUp('pass', 'oligarch')"
/>
<q-btn
outline
color="red"
dense
icon-right="close"
class="q-px-sm"
label="ยับยั้ง"
@click="popUp('passNot', 'oligarch')"
/>
</div>
2023-08-14 16:45:23 +07:00
</div>
2024-05-23 16:34:22 +07:00
<div class="col-12"><q-separator /></div>
2023-08-14 16:45:23 +07:00
<div class="row col-12 q-pa-md">
<div class="col-12 row bg-white q-col-gutter-md">
2024-10-17 18:06:31 +07:00
<div class="col-xs-6 row items-start">
<div class="col-12 text-top">สถานะ</div>
<div class="col-12 text-detail">
{{
dataDetail.oligarchReject !== null
? statusOrder(dataDetail.oligarchReject)
: "-"
}}
2023-08-14 16:45:23 +07:00
</div>
</div>
2024-10-17 18:06:31 +07:00
<div class="col-xs-6 row items-start">
<div class="col-12 text-top">นสดทายทบย</div>
<div class="col-12 text-detail">
{{
dataDetail.oligarchRejectDate !== null
? date2Thai(dataDetail.oligarchRejectDate)
: "-"
}}
2023-08-14 16:45:23 +07:00
</div>
</div>
2024-10-17 18:06:31 +07:00
<div class="col-xs-12 row items-start">
<div class="col-12 text-top">ความคดเหนและเหตผล</div>
<div class="col-12 text-detail">
{{
dataDetail.oligarchReject
? dataDetail.oligarchRejectReason
: dataDetail.oligarchApproveReason
}}
</div>
</div>
</div>
</div>
</q-card>
<!-- แกไขขอมลเพอลงบญชแนบทาย -->
<q-card bordered class="row col-12 text-dark q-mt-sm">
<q-form
2024-11-14 18:01:33 +07:00
class="col-12"
2024-10-17 18:06:31 +07:00
ref="myForm"
greedy
@submit.prevent
@validation-success="onSubmitAttached"
>
<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>
<q-space />
<div
v-if="
!checkRoutePermisson &&
workflowRef?.permission.isUpdate &&
dataDetail.statusMain !== 'CANCEL'
"
>
2024-10-17 18:06:31 +07:00
<div class="q-gutter-sm" v-if="!edit">
<q-btn
outline
color="primary"
2023-08-14 16:45:23 +07:00
dense
2024-10-17 18:06:31 +07:00
icon-right="mdi-file-edit-outline"
class="q-px-sm"
label="แก้ไข"
style="width: 80px"
@click="edit = !edit"
v-if="!(status == 'REPORT' || status == 'DONE')"
2023-08-14 16:45:23 +07:00
/>
</div>
2024-10-17 18:06:31 +07:00
<div class="q-gutter-sm" v-else>
<q-btn
outline
color="public"
2023-08-14 16:45:23 +07:00
dense
2024-10-17 18:06:31 +07:00
class="q-px-sm"
label="บันทึก"
style="width: 80px"
type="submit"
/>
<q-btn
outline
color="red"
dense
class="q-px-sm"
label="ยกเลิก"
style="width: 80px"
@click="clickCancel"
2023-08-14 16:45:23 +07:00
/>
</div>
</div>
2024-10-17 18:06:31 +07:00
</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-12 row items-center">
<div class="col-12">
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="organizationPositionOld"
:rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัดเดิม'}`]"
hide-bottom-space
:label="`${'ตำแหน่ง/สังกัดเดิม'}`"
type="textarea"
/>
</div>
</div>
<div class="col-xs-6 col-sm-4 row">
2024-10-17 18:06:31 +07:00
<div class="col-12">
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="positionTypeOld"
:rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
hide-bottom-space
:label="`${'ตำแหน่งประเภท'}`"
/>
</div>
</div>
<div class="col-xs-6 col-sm-4 row">
2024-10-17 18:06:31 +07:00
<div class="col-12">
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="positionLevelOld"
:rules="[(val:string) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ระดับตำแหน่ง'}`"
/>
</div>
</div>
<div class="col-xs-6 col-sm-4 row">
2024-10-17 18:06:31 +07:00
<div class="col-12">
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="posNo"
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]"
hide-bottom-space
:label="`${'เลขที่'}`"
/>
</div>
</div>
<!-- <div class="col-xs-6 col-sm-3 row">
2024-10-17 18:06:31 +07:00
<div class="col-12">
<q-input
v-model="salary"
:outlined="edit"
dense
:readonly="!edit"
:borderless="!edit"
hide-bottom-space
:label="`${'เงินเดือน'}`"
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules
:class="getClass(edit)"
mask="###,###,###,###"
reverse-fill-mask
/>
</div>
</div> -->
2024-10-17 18:06:31 +07:00
<div class="col-12"><q-separator /></div>
<div class="col-xs-4 row">
<div class="col-12">
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="location"
:rules="[
(val:string) => !!val || `${'กรุณากรอกสถานที่ยื่นขอลาออกจากราชการ'}`,
]"
hide-bottom-space
:label="`${'สถานที่ยื่นขอลาออกจากราชการ'}`"
/>
</div>
</div>
<div class="col-xs-4 row">
<div class="col-12">
<datepicker
menu-class-name="modalfix"
:readonly="!edit"
v-model="date"
:locale="'th'"
autoApply
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
:readonly="!edit"
:class="getClass(edit)"
:outlined="edit"
dense
:borderless="!edit"
:model-value="date !== null ? date2Thai(date) : null"
:rules="[
(val:string) =>
!!val || `${'กรุณาเลือก วันที่ยื่นขอลาออกจากราชการ'}`,
]"
hide-bottom-space
:label="`${' วันที่ยื่นขอลาออกจากราชการ'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
:style="
edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
</div>
2023-08-14 16:45:23 +07:00
<div class="col-12">
2024-05-24 17:50:43 +07:00
<q-input
2024-10-17 18:06:31 +07:00
:class="getClass(edit)"
2024-05-24 17:50:43 +07:00
:outlined="edit"
dense
2024-10-17 18:06:31 +07:00
lazy-rules
2024-05-24 17:50:43 +07:00
:readonly="!edit"
:borderless="!edit"
2024-10-17 18:06:31 +07:00
v-model="reason"
:rules="[
(val:string) => !!val || `${'กรุณากรอกเหตุผลที่ลาออกจากราชการ'}`,
]"
2024-05-24 17:50:43 +07:00
hide-bottom-space
2024-10-17 18:06:31 +07:00
:label="`${'เหตุผลที่ลาออกจากราชการ (หมายเหตุแนวตั้ง)'}`"
type="textarea"
2023-08-14 16:45:23 +07:00
/>
</div>
<div class="col-12">
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
2024-10-17 18:06:31 +07:00
v-model="remarkHorizontal"
:rules="[(val:string) => !!val || `${'กรุณากรอกหมายเหตุแนวนอน '}`]"
2023-08-14 16:45:23 +07:00
hide-bottom-space
2024-10-17 18:06:31 +07:00
:label="`${'หมายเหตุแนวนอน '}`"
type="textarea"
2023-08-14 16:45:23 +07:00
/>
</div>
</div>
</div>
2024-10-17 18:06:31 +07:00
</q-form>
</q-card>
2024-10-21 15:37:18 +07:00
<WorkFlow
ref="workflowRef"
v-model:is-check-data="isCheckData"
:id="id"
2024-11-15 10:24:53 +07:00
sys-name="SYS_RESIGN"
2024-10-21 15:37:18 +07:00
/>
2024-10-17 18:06:31 +07:00
</div>
2024-05-23 16:34:22 +07:00
<q-dialog v-model="modal" persistent>
<q-card style="width: 800px">
2024-10-24 16:09:11 +07:00
<q-form greedy @submit.prevent @validation-success="onSubmit">
<DialogHeader
:tittle="`${actionPass ? 'อนุญาตการลาออก' : 'ยับยั้งการลาออก'}`"
:close="closeModal"
/>
<q-separator />
<q-card-section class="q-p-sm q-gutter-md">
<div class="col-xs-12 col-sm-12 col-md-12">
<q-input
hide-bottom-space
dense
outlined
lazy-rules
2024-09-20 15:23:06 +07:00
:rules="[(val:string) => !!val || 'กรุณากรอกความคิดเห็น/เหตุผล']"
v-model="reasonReign"
:label="`${'กรอกความคิดเห็น/เหตุผล'}`"
type="textarea"
2024-10-24 16:09:11 +07:00
class="inputgreen"
/>
</div>
<div class="col-xs-12 col-sm-12 col-md-12" v-if="!actionPass">
<datepicker
menu-class-name="modalfix"
v-model="dateBreak"
:locale="'th'"
autoApply
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
outlined
dense
2024-10-24 16:09:11 +07:00
class="inputgreen"
:model-value="
dateBreak !== null ? date2Thai(dateBreak) : null
"
hide-bottom-space
:label="`${' วันสุดท้ายที่ยับยั้ง'}`"
2024-09-20 15:23:06 +07:00
:rules="[(val:string) => !!val || 'กรุณาเลือกวันที่']"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
2024-10-24 16:09:11 +07:00
color="primary"
:style="
edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
</q-card-section>
<q-separator />
2024-10-24 16:09:11 +07:00
<q-card-actions align="right" class="bg-white text-teal">
<q-btn label="บันทึก" color="secondary" type="submit"
><q-tooltip>นทกขอม</q-tooltip></q-btn
>
</q-card-actions>
2024-10-18 14:51:16 +07:00
<!-- <DialogFooter :editvisible="true" :save="conditionPopup" /> -->
</q-form>
</q-card>
</q-dialog>
<PopupPersonal
:modal="modalPersonal"
:id="personId"
@update:modal="updatemodalPersonal"
/>
</template>
2023-08-14 16:45:23 +07:00
<style lang="scss" scope>
.q-img {
border-radius: 5px;
height: 70px;
}
.text-top {
color: gray;
font-weight: 400;
padding-bottom: 3px;
}
.text-detail {
font-weight: 500;
}
</style>