1360 lines
42 KiB
Vue
1360 lines
42 KiB
Vue
<script setup lang="ts">
|
|
import { useRouter, useRoute } from "vue-router";
|
|
import { useQuasar, QForm } from "quasar";
|
|
import { ref, onMounted } from "vue";
|
|
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
|
|
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 keycloak from "@/plugins/keycloak";
|
|
import type {
|
|
TypeFile,
|
|
rowFile,
|
|
FileList,
|
|
CheckBoxType,
|
|
} from "@/modules/06_retirement/interface/response/Main";
|
|
import type { QTableProps } from "quasar";
|
|
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
|
|
|
|
const avatar = ref<string>("");
|
|
const modalPersonal = ref<boolean>(false);
|
|
const personId = ref<string>("");
|
|
/** Use */
|
|
const $q = useQuasar();
|
|
const route = useRoute();
|
|
const router = useRouter();
|
|
const mixin = useCounterMixin();
|
|
const RetirementData = useRetirementDataStore();
|
|
const {
|
|
messageError,
|
|
date2Thai,
|
|
showLoader,
|
|
hideLoader,
|
|
success,
|
|
dialogMessage,
|
|
dialogConfirm,
|
|
dialogRemove,
|
|
} = mixin;
|
|
const { statusText } = RetirementData;
|
|
|
|
/** ตัวแปร */
|
|
const roleUser = ref<string>("");
|
|
const id = ref<string>(route.params.id.toString());
|
|
const myForm = ref<QForm | null>(null);
|
|
const myFormConfirm = ref<QForm | null>(null);
|
|
const edit = ref<boolean>(false);
|
|
const conditions = ref<boolean>(false);
|
|
const dataDetail = ref<any>({
|
|
datetext: "",
|
|
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: "",
|
|
});
|
|
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>("");
|
|
const remarkHorizontal = ref<string>("");
|
|
const modal = ref<boolean>(false);
|
|
const actionPass = ref<boolean>(false);
|
|
const reasonReign = ref<string>("");
|
|
const dateBreak = ref<Date | null>(null);
|
|
|
|
/** คอลัมน์ */
|
|
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",
|
|
},
|
|
]);
|
|
|
|
/**เปิด-ปิด modal */
|
|
const closeModal = () => (modal.value = false);
|
|
const openModal = () => (modal.value = true);
|
|
|
|
const file = ref<any>(null);
|
|
const fileList = ref<FileList[]>([]);
|
|
const checkboxGroup = ref<CheckBoxType[]>([]);
|
|
const checkboxOp = ref<CheckBoxType[]>([
|
|
{ label: "ไม่เป็นหนี้สหกรณ์", value: "debt" },
|
|
{ label: "test1", value: "test1" },
|
|
{ label: "test2", value: "test2" },
|
|
]);
|
|
/** Hook */
|
|
onMounted(async () => {
|
|
fetchData(id.value);
|
|
if (keycloak.tokenParsed !== undefined) {
|
|
const commander = await keycloak.tokenParsed.role.includes("commander");
|
|
const oligarch = await keycloak.tokenParsed.role.includes("oligarch");
|
|
if (commander) {
|
|
roleUser.value = "commander";
|
|
} else if (oligarch) {
|
|
roleUser.value = "oligarch";
|
|
} else {
|
|
roleUser.value = "admin";
|
|
}
|
|
}
|
|
});
|
|
|
|
const 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;
|
|
};
|
|
|
|
/**
|
|
* นำข้อมูลมาจาก API
|
|
*/
|
|
const fetchData = async (id: string) => {
|
|
showLoader();
|
|
await http
|
|
.get(config.API.resingByid(id))
|
|
.then((res: any) => {
|
|
const data = res.data.result;
|
|
console.log(data);
|
|
|
|
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;
|
|
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 ?? "";
|
|
remarkHorizontal.value = data.remarkHorizontal ?? "-";
|
|
getAvatar(data.profileId);
|
|
})
|
|
.catch((e) => {
|
|
messageError($q, e);
|
|
})
|
|
.finally(() => {
|
|
hideLoader();
|
|
});
|
|
};
|
|
|
|
function getAvatar(id: string) {
|
|
if (id) {
|
|
http
|
|
.get(config.API.profileAvaId(id))
|
|
.then((res) => {
|
|
console.log(res);
|
|
const dataList = res.data.result;
|
|
avatar.value = dataList.avatar;
|
|
})
|
|
.catch((e) => {})
|
|
.finally(() => {});
|
|
}
|
|
}
|
|
|
|
// const downloadFile = (response: any, filename: string) => {
|
|
// const link = document.createElement("a");
|
|
// var fileName = filename;
|
|
// link.href = window.URL.createObjectURL(new Blob([response.data]));
|
|
// link.setAttribute("download", fileName);
|
|
// document.body.appendChild(link);
|
|
// link.click();
|
|
// document.body.removeChild(link);
|
|
// };
|
|
|
|
/**Pop up */
|
|
const popUp = (action: "pass" | "passNot") => {
|
|
reasonReign.value = "";
|
|
dateBreak.value = null;
|
|
actionPass.value = action === "pass";
|
|
openModal();
|
|
};
|
|
//เงื่อนไขpop up
|
|
const conditionPopup = () => {
|
|
if (myFormConfirm.value !== null) {
|
|
myFormConfirm.value.validate().then(async (check) => {
|
|
if (check) {
|
|
if (actionPass.value) {
|
|
await confirmpopUp();
|
|
} else {
|
|
await rejectpopUp();
|
|
}
|
|
}
|
|
});
|
|
}
|
|
};
|
|
|
|
//pop up ยืนยันการอนุมัติ
|
|
const confirmpopUp = async () => {
|
|
dialogConfirm(
|
|
$q,
|
|
async () => {
|
|
const body = {
|
|
reason: reasonReign.value,
|
|
};
|
|
await http
|
|
.put(config.API.resignConfirm(roleUser.value, id.value), body)
|
|
.then(() => {
|
|
success($q, "การอนุมัติสำเร็จ");
|
|
closeModal();
|
|
})
|
|
.catch((e) => {
|
|
messageError($q, e);
|
|
})
|
|
.finally(() => {
|
|
fetchData(id.value);
|
|
});
|
|
},
|
|
"ยืนยันการอนุมัติ",
|
|
"ต้องการยืนยันการอนุมัติการลานี้หรือไม่ ?"
|
|
);
|
|
};
|
|
|
|
//pop up การยับยั้งสำเร็จ
|
|
const rejectpopUp = async () => {
|
|
dialogConfirm(
|
|
$q,
|
|
async () => {
|
|
const body = {
|
|
reason: reasonReign.value,
|
|
date: dateBreak.value,
|
|
};
|
|
await http
|
|
.put(config.API.resignReject(roleUser.value, id.value), body)
|
|
.then(() => {
|
|
success($q, "การยับยั้งสำเร็จ");
|
|
closeModal();
|
|
})
|
|
.catch((e) => {
|
|
messageError($q, e);
|
|
})
|
|
.finally(() => {
|
|
fetchData(id.value);
|
|
});
|
|
},
|
|
"ยืนยันการยับยั้ง",
|
|
"ต้องการยืนยันการยับยั้งนี้หรือไม่ ?"
|
|
);
|
|
};
|
|
|
|
/**
|
|
* กดยกเลิก
|
|
*/
|
|
const clickCancel = async () => {
|
|
await fetchData(id.value);
|
|
edit.value = false;
|
|
};
|
|
/**
|
|
* กดยกเลิก
|
|
*/
|
|
const clickCancelConditions = async () => {
|
|
await fetchData(id.value);
|
|
conditions.value = false;
|
|
};
|
|
|
|
|
|
const saveConditions = () => {
|
|
if (myForm.value !== null) {
|
|
myForm.value.validate().then((success) => {
|
|
if (success) {
|
|
dialogMessage(
|
|
$q,
|
|
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
|
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย",
|
|
"mdi-help-circle-outline",
|
|
"ตกลง",
|
|
"public",
|
|
async () => await dataSave(),
|
|
undefined
|
|
);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
|
|
//Save จาก Api
|
|
const dataSave = async () => {
|
|
|
|
};
|
|
|
|
/**
|
|
* Functionบันทึก
|
|
*/
|
|
const conditionSave = () => {
|
|
if (myForm.value !== null) {
|
|
myForm.value.validate().then((success) => {
|
|
if (success) {
|
|
dialogMessage(
|
|
$q,
|
|
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
|
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย",
|
|
"mdi-help-circle-outline",
|
|
"ตกลง",
|
|
"public",
|
|
async () => await saveData(),
|
|
undefined
|
|
);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
|
|
|
|
//Save จาก Api
|
|
const saveData = async () => {
|
|
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();
|
|
await http
|
|
.put(config.API.resingByid(id.value), formData)
|
|
.then(() => {
|
|
success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
|
|
edit.value = false;
|
|
})
|
|
.catch((e) => {
|
|
messageError($q, e);
|
|
})
|
|
.finally(async () => {
|
|
await fetchData(id.value);
|
|
hideLoader();
|
|
});
|
|
};
|
|
|
|
/**
|
|
* Function เพิ่ม Class เวลา Edit
|
|
* @param val เมื่อเป็นEdit จะเปลี่ยน Class
|
|
*/
|
|
const getClass = (val: boolean) => {
|
|
return {
|
|
"full-width inputgreen cursor-pointer": val,
|
|
"full-width cursor-pointer": !val,
|
|
};
|
|
};
|
|
|
|
/** แปลง StatusOrder */
|
|
const statusOrder = (val: boolean) => {
|
|
switch (val) {
|
|
case true:
|
|
return "ยับยั้งการลาออก";
|
|
case false:
|
|
return "อนุมัติการลาออก";
|
|
}
|
|
};
|
|
|
|
// เอกสารดาวน์โหลด
|
|
const rowsFileDownload = ref<rowFile[]>([
|
|
{
|
|
fileName: "แบบฟอร์มหนังสือขอลาออกจากราชการ",
|
|
pathName: "",
|
|
},
|
|
]);
|
|
|
|
// ดาว์นโหลดไฟล์
|
|
const fileDownload = async (type: string, fileName: string) => {
|
|
showLoader();
|
|
await http
|
|
.get(config.API.reportResignList(type, id.value), {
|
|
responseType: "blob",
|
|
})
|
|
.then(async (res) => {
|
|
downloadFile(res, `${fileName}.${type}`);
|
|
})
|
|
.catch((e) => {
|
|
messageError($q, e);
|
|
})
|
|
.finally(() => {
|
|
hideLoader();
|
|
});
|
|
};
|
|
|
|
// ดาว์นโหลดไฟล์
|
|
const downloadFile = (response: any, filename: string) => {
|
|
const link = document.createElement("a");
|
|
var fileName = filename;
|
|
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
|
link.setAttribute("download", fileName);
|
|
document.body.appendChild(link);
|
|
link.click();
|
|
document.body.removeChild(link);
|
|
};
|
|
|
|
function onclickViewinfo(id: string) {
|
|
modalPersonal.value = true;
|
|
personId.value = id;
|
|
}
|
|
|
|
function updatemodalPersonal(modal: boolean) {
|
|
modalPersonal.value = modal;
|
|
}
|
|
|
|
function uploadFiles() {
|
|
const Data = new FormData();
|
|
Data.append("file", file.value);
|
|
showLoader();
|
|
http
|
|
.put(config.API.investigateRelevantUploadFile(id.value), Data)
|
|
.then((res) => {
|
|
success($q, "อัปโหลดไฟล์สำเร็จ");
|
|
})
|
|
.catch((e) => {
|
|
messageError($q, e);
|
|
})
|
|
.finally(async () => {
|
|
hideLoader();
|
|
file.value = null;
|
|
});
|
|
}
|
|
|
|
function downloadFiles(link: string) {
|
|
window.open(link, "_blank");
|
|
}
|
|
|
|
/**
|
|
* ลบไฟล์
|
|
* @param id id file
|
|
*/
|
|
function removeFile(id: string) {
|
|
dialogRemove($q, () => confirmRemove(id));
|
|
}
|
|
|
|
/**
|
|
* ยืนยัน ลบ ไฟล์
|
|
* @param id id file
|
|
*/
|
|
function confirmRemove(fileId: string) {
|
|
showLoader();
|
|
http
|
|
.delete(config.API.investigateRelevantFileDelete(id.value, fileId))
|
|
.then((res) => {
|
|
success($q, `ลบไฟล์สำเร็จ`);
|
|
fetchData(id.value);
|
|
})
|
|
.catch((e) => {
|
|
messageError($q, e);
|
|
})
|
|
.finally(() => {});
|
|
}
|
|
</script>
|
|
<template>
|
|
<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.go(-1)"
|
|
/>
|
|
รายละเอียดการลาออกของ
|
|
{{ dataDetail.firstName + " " + dataDetail.lastName }}
|
|
</div>
|
|
<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>
|
|
<q-space />
|
|
<div
|
|
class="q-gutter-x-sm"
|
|
v-if="
|
|
(roleUser === 'commander' && dataDetail.commanderReject === null) ||
|
|
(roleUser === 'oligarch' &&
|
|
dataDetail.oligarchReject === null &&
|
|
dataDetail.commanderReject !== 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')"
|
|
/>
|
|
</div>
|
|
</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>
|
|
<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>
|
|
<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>
|
|
</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>
|
|
</div>
|
|
</q-card>
|
|
<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>
|
|
<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">
|
|
<q-btn
|
|
type="a"
|
|
target="_blank"
|
|
:href="props.row.pathName"
|
|
flat
|
|
dense
|
|
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">
|
|
<q-btn
|
|
flat
|
|
dense
|
|
round
|
|
color="red"
|
|
icon="picture_as_pdf"
|
|
@click="fileDownload('pdf', props.row.fileName)"
|
|
>
|
|
<q-tooltip>ไฟล์ PDF</q-tooltip>
|
|
</q-btn>
|
|
<q-btn
|
|
flat
|
|
dense
|
|
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>
|
|
</div>
|
|
</q-card>
|
|
|
|
<q-card
|
|
v-if="dataDetail.status == 'WAITTING'"
|
|
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="!conditions">
|
|
<q-btn
|
|
outline
|
|
color="primary"
|
|
dense
|
|
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="saveConditions"
|
|
/>
|
|
<q-btn
|
|
outline
|
|
color="red"
|
|
dense
|
|
class="q-px-sm"
|
|
label="ยกเลิก"
|
|
style="width: 80px"
|
|
@click="clickCancelConditions"
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-12"><q-separator /></div>
|
|
<div class="col-7">
|
|
<q-option-group
|
|
:options="checkboxOp"
|
|
type="checkbox"
|
|
v-model="checkboxGroup"
|
|
:disable="!conditions"
|
|
/>
|
|
</div>
|
|
<div class="col-5">
|
|
<div class="row col-12 q-col-gutter-y-sm q-pa-sm">
|
|
<div class="col-12 row">
|
|
<q-file
|
|
class="col-12"
|
|
for="#evidenceFiles"
|
|
outlined
|
|
dense
|
|
v-model="file"
|
|
label="อัปโหลดเอกสารหลักฐานต่าง ๆ"
|
|
hide-bottom-space
|
|
:disable="!conditions"
|
|
>
|
|
<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.fileName }}</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.pathName)"
|
|
>
|
|
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
|
</q-btn>
|
|
</div>
|
|
<div>
|
|
<q-btn
|
|
dense
|
|
flat
|
|
round
|
|
size="12px"
|
|
color="red"
|
|
icon="mdi-delete-outline"
|
|
@click="removeFile(file.id)"
|
|
><q-tooltip>ลบไฟล์</q-tooltip></q-btn
|
|
>
|
|
</div>
|
|
</div>
|
|
</q-item-section>
|
|
</q-item>
|
|
</q-list>
|
|
</div>
|
|
|
|
<div class="col-12" v-else>
|
|
<q-card class="q-pa-md" bordered> ไม่มีรายการเอกสาร </q-card>
|
|
</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>
|
|
</div>
|
|
<q-separator />
|
|
<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>
|
|
</div>
|
|
<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>
|
|
</div>
|
|
<div class="col-xs-12 row items-start">
|
|
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
|
<div
|
|
class="col-12 text-detail"
|
|
v-if="dataDetail.commanderReject === false"
|
|
>
|
|
{{
|
|
dataDetail.commanderApproveReason !== null
|
|
? dataDetail.commanderApproveReason
|
|
: "-"
|
|
}}
|
|
</div>
|
|
<div
|
|
class="col-12 text-detail"
|
|
v-if="dataDetail.commanderReject === true"
|
|
>
|
|
{{
|
|
dataDetail.commanderRejectReason !== null
|
|
? dataDetail.commanderRejectReason
|
|
: "-"
|
|
}}
|
|
</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>
|
|
</div>
|
|
<q-separator />
|
|
<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.oligarchReject !== null
|
|
? statusOrder(dataDetail.oligarchReject)
|
|
: "-"
|
|
}}
|
|
</div>
|
|
</div>
|
|
<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)
|
|
: "-"
|
|
}}
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-12 row items-start">
|
|
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
|
<div
|
|
class="col-12 text-detail"
|
|
v-if="dataDetail.oligarchReject == false"
|
|
>
|
|
{{
|
|
dataDetail.oligarchApproveReason !== null
|
|
? dataDetail.oligarchApproveReason
|
|
: "-"
|
|
}}
|
|
</div>
|
|
<div
|
|
class="col-12 text-detail"
|
|
v-else-if="dataDetail.oligarchReject == true"
|
|
>
|
|
{{
|
|
dataDetail.oligarchRejectReason !== null
|
|
? dataDetail.oligarchRejectReason
|
|
: "-"
|
|
}}
|
|
</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>
|
|
<q-space />
|
|
<div class="q-gutter-sm" v-if="!edit">
|
|
<q-btn
|
|
outline
|
|
color="primary"
|
|
dense
|
|
icon-right="mdi-file-edit-outline"
|
|
class="q-px-sm"
|
|
label="แก้ไข"
|
|
style="width: 80px"
|
|
@click="edit = !edit"
|
|
v-if="!(status == 'REPORT' || status == 'DONE')"
|
|
/>
|
|
</div>
|
|
<div class="q-gutter-sm" v-else>
|
|
<q-btn
|
|
outline
|
|
color="public"
|
|
dense
|
|
class="q-px-sm"
|
|
label="บันทึก"
|
|
style="width: 80px"
|
|
@click="conditionSave"
|
|
/>
|
|
<q-btn
|
|
outline
|
|
color="red"
|
|
dense
|
|
class="q-px-sm"
|
|
label="ยกเลิก"
|
|
style="width: 80px"
|
|
@click="clickCancel"
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div class="col-12"><q-separator /></div>
|
|
<q-form ref="myForm">
|
|
<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) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]"
|
|
hide-bottom-space
|
|
:label="`${'ตำแหน่ง/สังกัด'}`"
|
|
type="textarea"
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-6 col-sm-3 row">
|
|
<div class="col-12">
|
|
<q-input
|
|
:class="getClass(edit)"
|
|
:outlined="edit"
|
|
dense
|
|
lazy-rules
|
|
:readonly="!edit"
|
|
:borderless="!edit"
|
|
v-model="positionTypeOld"
|
|
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
|
|
hide-bottom-space
|
|
:label="`${'ตำแหน่งประเภท'}`"
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-6 col-sm-3 row">
|
|
<div class="col-12">
|
|
<q-input
|
|
:class="getClass(edit)"
|
|
:outlined="edit"
|
|
dense
|
|
lazy-rules
|
|
:readonly="!edit"
|
|
:borderless="!edit"
|
|
v-model="positionLevelOld"
|
|
:rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]"
|
|
hide-bottom-space
|
|
:label="`${'ระดับ'}`"
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-6 col-sm-3 row">
|
|
<div class="col-12">
|
|
<q-input
|
|
:class="getClass(edit)"
|
|
:outlined="edit"
|
|
dense
|
|
lazy-rules
|
|
:readonly="!edit"
|
|
:borderless="!edit"
|
|
v-model="posNo"
|
|
:rules="[(val) => !!val || `${'กรุณากรอกเลขที่'}`]"
|
|
hide-bottom-space
|
|
:label="`${'เลขที่'}`"
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-6 col-sm-3 row">
|
|
<div class="col-12">
|
|
<CurrencyInput
|
|
v-model="salary"
|
|
:edit="edit"
|
|
:options="{
|
|
currency: 'THB',
|
|
}"
|
|
:label="`${'เงินเดือน'}`"
|
|
/>
|
|
</div>
|
|
</div>
|
|
<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) => !!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
|
|
lazy-rules
|
|
:borderless="!edit"
|
|
:model-value="date !== null ? date2Thai(date) : null"
|
|
:rules="[
|
|
(val) =>
|
|
!!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>
|
|
<!-- <div class="col-xs-4 row">
|
|
<div class="col-12">
|
|
<datepicker
|
|
menu-class-name="modalfix"
|
|
:readonly="!edit"
|
|
v-model="dateLeave"
|
|
: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
|
|
lazy-rules
|
|
:borderless="!edit"
|
|
:model-value="
|
|
dateLeave !== null ? date2Thai(dateLeave) : null
|
|
"
|
|
:rules="[
|
|
(val) =>
|
|
!!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> -->
|
|
<div class="col-12">
|
|
<q-input
|
|
:class="getClass(edit)"
|
|
:outlined="edit"
|
|
dense
|
|
lazy-rules
|
|
:readonly="!edit"
|
|
:borderless="!edit"
|
|
v-model="reason"
|
|
:rules="[
|
|
(val) => !!val || `${'กรุณากรอกเหตุผลที่ลาออกจากราชการ'}`,
|
|
]"
|
|
hide-bottom-space
|
|
:label="`${'เหตุผลที่ลาออกจากราชการ (หมายเหตุแนวตั้ง)'}`"
|
|
type="textarea"
|
|
/>
|
|
</div>
|
|
<div class="col-12">
|
|
<q-input
|
|
:class="getClass(edit)"
|
|
:outlined="edit"
|
|
dense
|
|
lazy-rules
|
|
:readonly="!edit"
|
|
:borderless="!edit"
|
|
v-model="remarkHorizontal"
|
|
:rules="[(val) => !!val || `${'กรุณากรอกหมายเหตุแนวนอน '}`]"
|
|
hide-bottom-space
|
|
:label="`${'หมายเหตุแนวนอน '}`"
|
|
type="textarea"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</q-form>
|
|
</q-card>
|
|
<q-dialog v-model="modal" persistent>
|
|
<q-card style="width: 800px">
|
|
<q-form ref="myFormConfirm">
|
|
<DialogHeader
|
|
:title="`${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
|
|
:rules="[(val) => !!val || 'กรุณากรอกความคิดเห็น/เหตุผล']"
|
|
v-model="reasonReign"
|
|
:label="`${'กรอกความคิดเห็น/เหตุผล'}`"
|
|
type="textarea"
|
|
/>
|
|
</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
|
|
lazy-rules
|
|
:model-value="
|
|
dateBreak !== null ? date2Thai(dateBreak) : null
|
|
"
|
|
hide-bottom-space
|
|
:label="`${' วันสุดท้ายที่ยับยั้ง'}`"
|
|
:rules="[(val) => !!val || 'กรุณาเลือกวันที่']"
|
|
>
|
|
<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>
|
|
</q-card-section>
|
|
<q-separator />
|
|
<DialogFooter :editvisible="true" :save="conditionPopup" />
|
|
</q-form>
|
|
</q-card>
|
|
</q-dialog>
|
|
|
|
<PopupPersonal
|
|
:modal="modalPersonal"
|
|
:id="personId"
|
|
@update:modal="updatemodalPersonal"
|
|
/>
|
|
</template>
|
|
|
|
<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>
|