diff --git a/src/modules/06_retirement/components/resign/ResignByid.vue b/src/modules/06_retirement/components/resign/ResignByid.vue index e23c5efb3..1323059c0 100644 --- a/src/modules/06_retirement/components/resign/ResignByid.vue +++ b/src/modules/06_retirement/components/resign/ResignByid.vue @@ -7,17 +7,13 @@ import { useQuasar, QForm } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; import genReport from "@/plugins/genreport"; -import { tokenParsed } from "@/plugins/auth"; import { useCounterMixin } from "@/stores/mixin"; - -import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue"; import DialogHeader from "@/components/DialogHeader.vue"; import type { TypeFile, rowFile, FileList, - CheckBoxType, } from "@/modules/06_retirement/interface/response/Main"; import type { QTableProps } from "quasar"; import type { DataProfile } from "@/modules/05_placement/interface/index/Main"; @@ -527,22 +523,6 @@ onMounted(async () => { await Promise.all([fetchData(id.value), fetchFile()]).finally(() => { hideLoader(); }); - - // const user = await tokenParsed(); - // if (user) { - // const commander = await user.role.includes("commander"); - // const oligarch = await user.role.includes("oligarch"); - // const officer = await user.role.includes("officer"); - // if (commander) { - // roleUser.value = "commander"; - // } else if (oligarch) { - // roleUser.value = "oligarch"; - // } else if (officer) { - // roleUser.value = "officer"; - // } else { - // roleUser.value = "admin"; - // } - // } }); @@ -976,7 +956,13 @@ onMounted(async () => { ผลการพิจารณาของผู้บังคับบัญชา -
+
{ ผลการพิจารณาของผู้มีอำนาจ
-
+
(false); -const personId = ref(""); const roleUser = ref(""); const dataProfile = ref(); const id = ref(route.params.id.toString()); const myForm = ref(null); const edit = ref(false); -const conditions = ref(false); const dataDetail = ref({ datetext: "", activeDate: new Date(), @@ -133,7 +130,7 @@ function diffDate() { async function fetchData(id: string) { showLoader(); await http - .get(config.API.resingByid(id)) + .get(config.API.listResign() + `/cancel/${id}`) .then(async (res) => { const data = await res.data.result; dataProfile.value = data as DataProfile; @@ -173,68 +170,26 @@ function popUp(action: "pass" | "passNot", type: string) { //เงื่อนไขpop up function onSubmit() { - if (actionPass.value) { - confirmpopUp(); - } else { - rejectpopUp(); - } -} - -//pop up ยืนยันการอนุญาต -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(); - }); - }, - "ยืนยันการอนุญาต", - "ต้องการยืนยันการอนุญาตการลานี้หรือไม่ ?" - ); -} - -//pop up การยับยั้งสำเร็จ -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(); - }); - }, - "ยืนยันการยับยั้ง", - "ต้องการยืนยันการยับยั้งนี้หรือไม่ ?" - ); + dialogConfirm($q, async () => { + showLoader(); + const body = { + reason: reasonReign.value, + reject: !actionPass.value, + }; + await http + .put(config.API.resignReject(`${roleUser.value}-cancel`, id.value), body) + .then(async () => { + await fetchData(id.value); + closeModal(); + success($q, "บันทึกข้อมูลสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + }); } /** @@ -245,37 +200,6 @@ async function clickCancel() { edit.value = false; myForm.value?.resetValidation(); } -/** - * กดยกเลิก - */ -async function clickCancelConditions() { - await fetchData(id.value); - conditions.value = false; -} - -/** Function บันทึก รายการตรวจสอบเงื่อนไขต่าง ๆ*/ -function onSubmitConditions() { - dialogConfirm($q, () => { - showLoader(); - http - .put(config.API.resignConditions(id.value), { - isNoDebt: isNoDebt.value, - isNoBurden: isNoBurden.value, - isDiscipline: isDiscipline.value, - }) - .then(async () => { - await fetchData(id.value); - success($q, "บันทึกเงื่อนไขต่าง ๆ สำเร็จ"); - conditions.value = false; - }) - .catch((err) => { - messageError($q, err); - }) - .finally(() => { - hideLoader(); - }); - }); -} /** Function บันทึก ,แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/ function onSubmitAttached() { @@ -296,7 +220,7 @@ function onSubmitAttached() { formData.append("remarkHorizontal", remarkHorizontal.value); showLoader(); http - .put(config.API.resingByid(id.value), formData) + .put(config.API.listResign() + `/update-cancel/${id.value}`, formData) .then(async () => { await fetchData(id.value); success($q, "บันทึกข้อมูลสำเร็จ"); @@ -332,10 +256,6 @@ function statusOrder(val: boolean) { } } -function updatemodalPersonal(modal: boolean) { - modalPersonal.value = modal; -} - /** Hook */ onMounted(async () => { await fetchData(id.value); @@ -513,7 +433,7 @@ onMounted(async () => {
{{ dataDetail.commanderReject - ? dataDetail.commanderRejectReason + ? dataDetail.commanderApproveReason : dataDetail.commanderApproveReason }}
@@ -529,6 +449,7 @@ onMounted(async () => { ผลการพิจารณาของผู้มีอำนาจ
+
{{ dataDetail.oligarchReject - ? dataDetail.oligarchRejectReason + ? dataDetail.oligarchApproveReason : dataDetail.oligarchApproveReason }}
@@ -606,7 +527,6 @@ onMounted(async () => { แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย
-
{ ref="workflowRef" v-model:is-check-data="isCheckData" :id="id" - sys-name="SYS_RETIREMENT" + sys-name="RETIREMENT_CANCEL" />
@@ -844,7 +764,9 @@ onMounted(async () => { @@ -862,48 +784,6 @@ onMounted(async () => { class="inputgreen" />
-
- - - - - -
@@ -915,12 +795,6 @@ onMounted(async () => { - -