API การลา ข้าราชการ, ลูกจ้าง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-05-29 14:17:39 +07:00
parent 6bde04376f
commit 32dcdc9336
28 changed files with 525 additions and 868 deletions

View file

@ -9,7 +9,6 @@ import config from "@/app.config";
import genReport from "@/plugins/genreport";
import { useCounterMixin } from "@/stores/mixin";
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
import { checkPermission } from "@/utils/permissions";
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
import DialogHeader from "@/components/DialogHeader.vue";
@ -26,7 +25,6 @@ import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
import CardProfile from "@/components/CardProfile.vue";
import WorkFlow from "@/components/Workflow/Main.vue";
import DialogAddCommander from "@/modules/06_retirement/components/DialogAddCommander.vue";
/** Use */
@ -57,15 +55,6 @@ const dataProfile = ref<DataProfile>();
const approveStep = ref<string>("");
const group = ref<string>("");
// const approveCheck = computed(() => {
// return (
// rowsApprover.value?.commanders?.every(
// (commander) =>
// commander.approveStatus === "APPROVE" ||
// commander.approveStatus === "REJECT"
// ) ?? false
// );
// });
const idCheck = computed(() => {
if (
typeAdd.value == "COMMANDER" &&
@ -86,31 +75,6 @@ const idCheck = computed(() => {
}
});
// const approvePendingCheck = computed(() => {
// const commanders = rowsApprover.value?.commanders || [];
// const index = commanders.findIndex((c) => c.profileId === myProfileId.value);
// if (index === -1) {
// return false;
// }
// const currentCommander = commanders[index];
// if (currentCommander.approveStatus !== "PENDING") {
// return false;
// }
// if (index === 0) {
// return true;
// }
// const previousApproved = commanders
// .slice(0, index)
// .every(
// (c) => c.approveStatus === "APPROVE" || c.approveStatus === "REJECT"
// );
// return previousApproved;
// });
const isOfficer = ref<boolean>(false);
const isStaff = ref<boolean>(false);
const profileType = ref<string>("");
@ -213,7 +177,6 @@ const dataDetail = ref<any>({
reasonResign: "",
});
const workflowRef = ref<any>(null);
const organizationPositionOld = ref<string>("");
const positionTypeOld = ref<string>("");
const positionLevelOld = ref<string>("");
@ -230,20 +193,6 @@ const actionPass = ref<boolean>(false);
const reasonReign = ref<string>("");
const dateBreak = ref<Date | null>(null);
const isCheckData = computed(() => {
if (
organizationPositionOld.value !== "" &&
positionTypeOld.value !== "" &&
positionLevelOld.value !== "" &&
posNo.value !== "" &&
date.value !== null &&
dataDetail.value.commanderReject !== null &&
dataDetail.value.oligarchReject !== null
) {
return true;
} else return false;
});
/** คอลัมน์ */
const rows = ref<TypeFile[]>([]);
const columns = ref<QTableProps["columns"]>([
@ -316,7 +265,6 @@ function diffDate() {
* @param id id ของผใชงาน
*/
async function fetchData(id: string) {
showLoader();
await http
.get(config.API.resingByid(id))
.then(async (res) => {
@ -361,9 +309,6 @@ async function fetchData(id: string) {
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
@ -394,19 +339,6 @@ function onSubmit(type: string) {
} else if (roleUser.value === "oligarch" && !actionPass.value) {
rejectpopUp("");
}
// if (actionPass.value) {
// if (type === "approver") {
// confirmpopUp("/comander");
// } else {
// confirmpopUp("");
// }
// } else {
// if (type === "approver") {
// rejectpopUp("/comander");
// } else {
// rejectpopUp("");
// }
// }
}
/**
@ -503,15 +435,20 @@ async function clickCancel() {
/** ฟังก์ชันยกเลิกการแก้ไขข้อมูลรายการตรวจสอบเงื่อนไขต่างๆ*/
async function clickCancelConditions() {
await fetchData(id.value);
conditions.value = false;
const data = dataDetail.value;
if (data) {
isNoDebt.value = data.isNoDebt;
isNoBurden.value = data.isNoBurden;
isDiscipline.value = data.isDiscipline;
conditions.value = false;
}
}
/** ฟังก์ชันบันทึกเงื่อนไขต่างๆ*/
function onSubmitConditions() {
dialogConfirm($q, () => {
dialogConfirm($q, async () => {
showLoader();
http
await http
.put(config.API.resignConditions(id.value), {
isNoDebt: isNoDebt.value,
isNoBurden: isNoBurden.value,
@ -533,7 +470,7 @@ function onSubmitConditions() {
/** ฟังก์ชันบันทึกข้อมูลเพื่อลงบัญชีแนบท้าย*/
function onSubmitAttached() {
dialogConfirm($q, () => {
dialogConfirm($q, async () => {
const formData = new FormData();
const send = date.value !== null ? new Date(date.value).toUTCString() : "";
const activeDate =
@ -549,7 +486,7 @@ function onSubmitAttached() {
formData.append("AmountOld", salary.value.toString());
formData.append("remarkHorizontal", remarkHorizontal.value);
showLoader();
http
await http
.put(config.API.resingByid(id.value), formData)
.then(async () => {
await fetchData(id.value);
@ -598,7 +535,6 @@ function updatemodalPersonal(modal: boolean) {
}
async function fetchFile() {
showLoader();
await http
.get(config.API.file("พ้นจากราชการ", "หลักฐานลาออก", id.value))
.then(async (res) => {
@ -606,13 +542,12 @@ async function fetchFile() {
})
.catch((e) => {
messageError($q, e);
hideLoader();
});
}
function uploadFiles() {
async function uploadFiles() {
showLoader();
http
await http
.post(config.API.file("พ้นจากราชการ", "หลักฐานลาออก", id.value), {
replace: true,
fileList: [
@ -683,9 +618,9 @@ async function downloadFiles(fileName: string) {
* @param id id file
*/
function removeFile(fileName: string) {
dialogRemove($q, () => {
dialogRemove($q, async () => {
showLoader();
http
await http
.delete(
config.API.fileByFile(
"พ้นจากราชการ",
@ -694,15 +629,16 @@ function removeFile(fileName: string) {
fileName
)
)
.then(() => {
.then(async () => {
setTimeout(async () => {
await fetchFile();
success($q, `ลบไฟล์สำเร็จ`);
hideLoader();
}, 1000);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
});
@ -823,39 +759,6 @@ onMounted(async () => {
<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 === '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')"
/>
</div> -->
</div>
<div class="col-12"><q-separator /></div>
<div class="row col-12 q-pa-md">
@ -1208,51 +1111,6 @@ onMounted(async () => {
</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="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>
</div>
<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>
</div>
<div class="col-xs-12 row items-start">
<div class="col-12 text-top">ความคดเหนและเหตผล</div>
<div class="col-12 text-detail">
{{
dataDetail.officerReject
? dataDetail.officerRejectReason
: dataDetail.officerApproveReason
}}
</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">
@ -1278,34 +1136,6 @@ onMounted(async () => {
<q-tooltip>เพมรายชอผงคบบญชา</q-tooltip>
</q-btn>
<q-space />
<!-- workflowRef?.permission.isUpdate && -->
<!-- <div
class="q-gutter-x-sm"
v-if="
dataDetail.commanderReject === null &&
dataDetail.statusMain === 'WAITTING'
"
>
<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>
<div class="col-12"><q-separator /></div>
@ -1863,12 +1693,11 @@ onMounted(async () => {
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white text-teal">
<q-card-actions align="right">
<q-btn label="บันทึก" color="secondary" type="submit"
><q-tooltip>นทกขอม</q-tooltip></q-btn
>
</q-card-actions>
<!-- <DialogFooter :editvisible="true" :save="conditionPopup" /> -->
</q-form>
</q-card>
</q-dialog>