From 34dc306288c6af82d280c14425935a83faf9c646 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 19 Aug 2024 16:14:43 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9A=E0=B8=A3=E0=B8=A3=E0=B8=88=E0=B8=B8?= =?UTF-8?q?=20=E0=B9=81=E0=B8=95=E0=B9=88=E0=B8=87=E0=B8=95=E0=B8=B1?= =?UTF-8?q?=E0=B9=89=E0=B8=87=20=E0=B8=A2=E0=B9=89=E0=B8=B2=E0=B8=A2=20?= =?UTF-8?q?=E0=B9=82=E0=B8=AD=E0=B8=99=20=3D>=20=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B1=E0=B8=9A=20code=20=E0=B9=81=E0=B8=A5=E0=B8=B0=20load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dialogs/DialogOrgSelectEmployee.vue | 2 +- .../components/AppointEmployee/Detail.vue | 164 +++--- .../components/AppointEmployee/Main.vue | 483 +++--------------- .../components/AppointMent/Detail.vue | 107 ++-- .../components/AppointMent/Dialogbody.vue | 106 ++-- .../components/AppointMent/Main.vue | 183 ++++--- .../05_placement/components/Other/Detail.vue | 34 +- .../components/Other/Dialogbody.vue | 155 +++--- .../05_placement/components/Other/Main.vue | 96 ++-- .../components/PersonalDetail/Education.vue | 52 +- .../components/PersonalDetail/ExamResult.vue | 33 -- .../PersonalDetail/Information/Address.vue | 13 +- .../PersonalDetail/Information/Certicate.vue | 33 +- .../PersonalDetail/Information/Document.vue | 36 +- .../PersonalDetail/Information/Family.vue | 65 +-- .../Information/Information.vue | 23 +- .../PersonalDetail/Qualification.vue | 12 +- .../PersonalList/DialogSelectOrg.vue | 7 +- .../components/PersonalList/Table.vue | 77 +-- .../components/Receive/AddEmployee/Main.vue | 73 +-- .../components/Receive/receiveDetail2.vue | 97 ++-- .../components/Receive/receiveMain.vue | 69 +-- .../components/Repatriate/Dialogbody.vue | 141 ++--- .../components/Repatriate/RepatriateMain.vue | 171 ++++--- .../components/Repatriate/RepatriatebyId.vue | 42 +- .../components/Transfer/Dialogbody.vue | 8 +- .../components/Transfer/transferRegistry.vue | 12 +- .../components/helpgovernment/Dialogbody.vue | 125 +++-- .../helpgovernment/governmentDetail.vue | 38 +- .../components/helpgovernment/mainHelp.vue | 126 +++-- 30 files changed, 1154 insertions(+), 1429 deletions(-) diff --git a/src/components/Dialogs/DialogOrgSelectEmployee.vue b/src/components/Dialogs/DialogOrgSelectEmployee.vue index 23d797ac2..10abe1812 100644 --- a/src/components/Dialogs/DialogOrgSelectEmployee.vue +++ b/src/components/Dialogs/DialogOrgSelectEmployee.vue @@ -590,7 +590,7 @@ function onSubmit() { :key="index" :name="item" > -
+
(false); -const personId = ref(""); const $q = useQuasar(); const route = useRoute(); const router = useRouter(); const mixin = useCounterMixin(); +const paramsId = route.params.id; +const { + date2Thai, + messageError, + showLoader, + hideLoader, + success, + dialogConfirm, +} = mixin; +const modalPersonal = ref(false); const dataProfile = ref(); const appointment = ref({ @@ -46,16 +60,6 @@ const date = ref(null); const status = ref(""); const avatar = ref(""); -const paramsId = route.params.id; -const { - date2Thai, - messageError, - showLoader, - hideLoader, - success, - dialogConfirm, -} = mixin; - const title = ref({ fullname: "", organizationPositionOld: "", @@ -63,10 +67,12 @@ const title = ref({ positionTypeOld: "", }); -//เรียกข้อมูลตาม id -const fecthappointmentByid = async () => { +/** + * fetch รายละเอียดการปรับระดับชั้นงานลูกจ้าง + */ +function fecthappointmentByid() { showLoader(); - await http + http .get(config.API.appointEmployeeByid(paramsId.toString())) .then((res: ResponseData) => { dataProfile.value = res.data.result as unknown as DataProfile; @@ -96,58 +102,67 @@ const fecthappointmentByid = async () => { .finally(() => { hideLoader(); }); -}; +} -//ยืนยันการเเก้ไข -const clickSave = async () => { +/** + * ยืนยันการบันทึกข้อมูลเพื่อลงบัญชีแนบท้าย + */ +function clickSave() { if (myForm.value !== null) { - myForm.value.validate().then((success: any) => { - if (success) { + myForm.value.validate().then((result: any) => { + if (result) { dialogConfirm( $q, - async () => await putAppointment(), + async () => { + let data = { + citizenId: appointment.value.citizenId, + prefixId: appointment.value.prefixId, + firstname: appointment.value.firstname, + lastname: appointment.value.lastname, + educationOld: educationOld.value, + organizationPositionOld: organizationPositionOld.value, + positionTypeOld: positionTypeOld.value, + positionLevelOld: positionLevelOld.value, + positionNumberOld: posNo.value, + amountOld: salary.value.toString().replace(/,/g, ""), + reason: reason.value, + positionDate: date.value, + }; + showLoader(); + await http + .put(config.API.appointEmployeeByid(paramsId.toString()), data) + .then(async () => { + await fecthappointmentByid(); + await success($q, "บันทึกข้อมูลสำเร็จ"); + edit.value = false; + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + }, "ต้องการแก้ไขข้อมูลหรือไม่?", "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย" ); } }); } -}; -// เเก้ไขข้อมูล -const putAppointment = async () => { - let data = { - citizenId: appointment.value.citizenId, - prefixId: appointment.value.prefixId, - firstname: appointment.value.firstname, - lastname: appointment.value.lastname, - educationOld: educationOld.value, - organizationPositionOld: organizationPositionOld.value, - positionTypeOld: positionTypeOld.value, - positionLevelOld: positionLevelOld.value, - positionNumberOld: posNo.value, - amountOld: salary.value.toString().replace(/,/g, ""), - reason: reason.value, - positionDate: date.value, - }; - showLoader(); - await http - .put(config.API.appointEmployeeByid(paramsId.toString()), data) - .then(() => { - success($q, "บันทึกข้อมูลสำเร็จ"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - fecthappointmentByid(); - edit.value = false; - }); -}; -const cancel = () => { +} + +/** + * ยกเลิกการบันทึกข้อมูลเพื่อลงบัญชีแนบท้าย + */ +function cancel() { edit.value = false; fecthappointmentByid(); myForm.value?.resetValidation(); -}; +} + +/** + * Class input + */ const getClass = (val: boolean) => { return { "full-width inputgreen cursor-pointer": val, @@ -155,17 +170,8 @@ const getClass = (val: boolean) => { }; }; -function onclickViewinfo(id: string) { - modalPersonal.value = true; - personId.value = id; -} - -function updatemodalPersonal(modal: boolean) { - modalPersonal.value = modal; -} - -onMounted(async () => { - await fecthappointmentByid(); +onMounted(() => { + fecthappointmentByid(); });