From 82eac261f47f2835e5bc6473241b9e34a824f60f Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 20 Jan 2026 10:29:25 +0700 Subject: [PATCH 1/2] fix:send_Date --- .../components/DialogResingn.vue | 53 ++++----- .../components/DialogTransfer.vue | 101 ++++++++++++++---- 2 files changed, 109 insertions(+), 45 deletions(-) diff --git a/src/modules/04_registryPerson/components/DialogResingn.vue b/src/modules/04_registryPerson/components/DialogResingn.vue index d9bd78997..c4e072197 100644 --- a/src/modules/04_registryPerson/components/DialogResingn.vue +++ b/src/modules/04_registryPerson/components/DialogResingn.vue @@ -24,6 +24,7 @@ const { dateToISO, pathRegistryEmp, success, + dialogConfirm, } = useCounterMixin(); //props @@ -64,32 +65,34 @@ const reasonOp = ref([ }, ]); -async function onSubmit() { - try { - showLoader(); - const formData = new FormData(); - formData.append("ProfileId", profileId.value); - formData.append("Location", form.location); - formData.append( - "ActiveDate", - form.activeDate !== null ? dateToISO(form.activeDate) : "" - ); - formData.append("Reason", form.reason); - if (form.files) { - formData.append("file", form.files); - } - if (form.reason === "OTHER") { - formData.append("remark", form.remark); - } +function onSubmit() { + dialogConfirm($q, async () => { + try { + showLoader(); + const formData = new FormData(); + formData.append("ProfileId", profileId.value); + formData.append("Location", form.location); + formData.append( + "ActiveDate", + form.activeDate !== null ? dateToISO(form.activeDate) : "" + ); + formData.append("Reason", form.reason); + if (form.files) { + formData.append("file", form.files); + } + if (form.reason === "OTHER") { + formData.append("remark", form.remark); + } - await http.post(config.API.resignAdmin(empType.value), formData); - router.push({ name: isEmployee.value ? "resignEmployee" : "resign" }); - success($q, "บันทึกข้อมูลสำเร็จ"); - } catch (error) { - messageError($q, error); - } finally { - hideLoader(); - } + await http.post(config.API.resignAdmin(empType.value), formData); + router.push({ name: isEmployee.value ? "resignEmployee" : "resign" }); + success($q, "บันทึกข้อมูลสำเร็จ"); + } catch (error) { + messageError($q, error); + } finally { + hideLoader(); + } + }); } /** function ปิด popup*/ diff --git a/src/modules/04_registryPerson/components/DialogTransfer.vue b/src/modules/04_registryPerson/components/DialogTransfer.vue index 5d54e07c4..1f135fb73 100644 --- a/src/modules/04_registryPerson/components/DialogTransfer.vue +++ b/src/modules/04_registryPerson/components/DialogTransfer.vue @@ -15,7 +15,15 @@ import DialogHeader from "@/components/DialogHeader.vue"; const $q = useQuasar(); const router = useRouter(); const route = useRoute(); -const { showLoader, hideLoader, messageError, success } = useCounterMixin(); +const { + showLoader, + hideLoader, + messageError, + success, + date2Thai, + convertDateToAPI, + dialogConfirm, +} = useCounterMixin(); //props const modal = defineModel("modal", { required: true }); @@ -26,27 +34,34 @@ const form = reactive({ tranferOrg: "", noteReason: "", files: null as File | null, + date: null as Date | null, }); -async function onSubmit() { - try { - showLoader(); - const formData = new FormData(); - formData.append("ProfileId", profileId.value); - formData.append("Organization", form.tranferOrg); - formData.append("Reason", form.noteReason); - if (form.files) { - formData.append("file", form.files); - } +function onSubmit() { + dialogConfirm($q, async () => { + try { + showLoader(); + const formData = new FormData(); + formData.append("ProfileId", profileId.value); + formData.append("Organization", form.tranferOrg); + formData.append("Reason", form.noteReason); + formData.append( + "Date", + form.date !== null ? (convertDateToAPI(form.date) as string) : "" + ); + if (form.files) { + formData.append("file", form.files); + } - await http.post(config.API.transferAdmin, formData); - router.push({ name: "transfer" }); - success($q, "บันทึกข้อมูลสำเร็จ"); - } catch (error) { - messageError($q, error); - } finally { - hideLoader(); - } + await http.post(config.API.transferAdmin, formData); + router.push({ name: "transfer" }); + success($q, "บันทึกข้อมูลสำเร็จ"); + } catch (error) { + messageError($q, error); + } finally { + hideLoader(); + } + }); } /** function ปิด popup*/ @@ -55,6 +70,7 @@ function closeDialog() { form.tranferOrg = ""; form.noteReason = ""; form.files = null; + form.date = null; } @@ -67,7 +83,7 @@ function closeDialog() {
-
+
+
+ + + + + +
+
Date: Tue, 20 Jan 2026 11:48:54 +0700 Subject: [PATCH 2/2] fix leave: case request deputy --- .../06_retirement/components/02_resign/ResignByid.vue | 6 ++++-- .../06_retirement/components/03_resignEmp/ResignByid.vue | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/modules/06_retirement/components/02_resign/ResignByid.vue b/src/modules/06_retirement/components/02_resign/ResignByid.vue index f29f64217..9413a3488 100644 --- a/src/modules/06_retirement/components/02_resign/ResignByid.vue +++ b/src/modules/06_retirement/components/02_resign/ResignByid.vue @@ -56,6 +56,7 @@ const roleUser = ref(""); const dataProfile = ref(); const approveStep = ref(""); const group = ref(""); +const deputyName = ref("สำนักปลัดกรุงเทพมหานคร"); const idCheck = computed(() => { if ( @@ -679,7 +680,8 @@ async function checkOfficer() { try { const data = await fetchDataCheckIsoffice("SYS_RESIGN"); isOfficer.value = data.isOfficer; - isStaff.value = data.isStaff; + isStaff.value = + data.isStaff || dataDetail.value.rootOld === deputyName.value; } catch (err) { messageError($q, err); } @@ -730,9 +732,9 @@ onMounted(async () => { await Promise.all([ fetchData(id.value), fetchKeycloakPosition(), - checkOfficer(), fetchFile(), ]).finally(() => { + checkOfficer(); hideLoader(); }); }); diff --git a/src/modules/06_retirement/components/03_resignEmp/ResignByid.vue b/src/modules/06_retirement/components/03_resignEmp/ResignByid.vue index 9383118c8..802f75753 100644 --- a/src/modules/06_retirement/components/03_resignEmp/ResignByid.vue +++ b/src/modules/06_retirement/components/03_resignEmp/ResignByid.vue @@ -78,6 +78,7 @@ const idCheck = computed(() => { } }); +const deputyName = ref("สำนักปลัดกรุงเทพมหานคร"); const isOfficer = ref(false); const isStaff = ref(false); const profileType = ref(""); @@ -707,7 +708,10 @@ async function checkOfficer() { try { const data = await fetchDataCheckIsoffice("SYS_RESIGN_EMP"); isOfficer.value = data.isOfficer; - isStaff.value = data.isStaff; + isStaff.value = + data.isStaff || dataDetail.value.rootOld === deputyName.value; + console.log("rootOld", dataDetail.value.rootOld); + console.log("isStaff", isStaff.value); } catch (err) { messageError($q, err); } @@ -759,8 +763,8 @@ onMounted(async () => { fetchData(id.value), fetchKeycloakPosition(), fetchFile(), - checkOfficer(), ]).finally(() => { + checkOfficer(); hideLoader(); }); });