diff --git a/src/api/registry/api.registry.ts b/src/api/registry/api.registry.ts index 06e0a356a..0cbfc086e 100644 --- a/src/api/registry/api.registry.ts +++ b/src/api/registry/api.registry.ts @@ -39,11 +39,15 @@ export default { `${registryNew}${type}/nopaid/${dataId}`, profileNewNoPaidHisById: (dataId: string, type: string) => `${registryNew}${type}/nopaid/history/${dataId}`, + profileNewNoPaidUpdateDelete: (type: string) => + `${registryNew}${type}/nopaid/update-delete/`, // เครื่องราชฯ profileNewInsign: (type: string) => `${registryNew}${type}/insignia`, profileNewInsignByProfileId: (profileId: string, type: string) => `${registryNew}${type}/insignia/${profileId}`, + profileNewInsignUpdateDelete: (type: string) => + `${registryNew}${type}/insignia/update-delete/`, orgInsigniaActive: () => `${org}/insignia/insignia-type/active`, @@ -60,6 +64,8 @@ export default { `${registryNew}${type}/honor/${dataId}`, profileNewHonorHisById: (dataId: string, type: string) => `${registryNew}${type}/honor/admin/history/${dataId}`, + profileNewHonorUpdateDelete: (type: string) => + `${registryNew}${type}/honor/update-delete/`, // ผลการประเมินการปฏิบัติราชการ profileNewAssessments: (type: string) => `${registryNew}${type}/assessments`, @@ -69,9 +75,10 @@ export default { `${registryNew}${type}/assessments/${dataId}`, profileNewAssessmentsHisById: (dataId: string, type: string) => `${registryNew}${type}/assessments/admin/history/${dataId}`, - profileDevelopmentUpdateDelete: `${registryNew}/development/update-delete/`, - - + profileDevelopmentUpdateDelete: (type: string) => + `${registryNew}${type}/development/update-delete/`, + profileNewAssessmentsUpdateDelete: (type: string) => + `${registryNew}${type}/assessments/update-delete/`, // การฝึกอบรม profileNewTraining: (type: string) => `${registryNew}${type}/training`, profileNewTrainingByProfileId: (profileId: string, type: string) => @@ -80,7 +87,8 @@ export default { `${registryNew}${type}/training/${trainingId}`, profileNewTrainingHisByTrainingId: (trainingId: string, type: string) => `${registryNew}${type}/training/admin/history/${trainingId}`, - profileTrainingUpdate: `${registryNew}/training/update-delete/`, + profileTrainingUpdate: (type: string) => + `${registryNew}${type}/training/update-delete/`, // ประวัติการศึกษา profileNewEducation: (type: string) => `${registryNew}${type}/educations`, @@ -93,6 +101,8 @@ export default { `${registryNew}${type}/educations/${educationId}`, profileNewEducationHisByEducationId: (educationsId: string, type: string) => `${registryNew}${type}/educations/admin/history/${educationsId}`, + profileEducationUpdateDelete: (type: string) => + `${registryNew}${type}/educations/update-delete/`, // ความสามารถพิเศษ profileNewAbility: (type: string) => `${registryNew}${type}/ability`, @@ -102,6 +112,8 @@ export default { `${registryNew}${type}/ability/${abilityId}`, profileNewAbilityHisByAbilityId: (abilityId: string, type: string) => `${registryNew}${type}/ability/admin/history/${abilityId}`, + profileAbilityUpdateDelete: (type: string) => + `${registryNew}${type}/ability/update-delete/`, // ใบอนุญาตประกอบวิชาชีพ profileNewCertificate: (type: string) => `${registryNew}${type}/certificate`, @@ -113,6 +125,8 @@ export default { certificateId: string, type: string ) => `${registryNew}${type}/certificate/admin/history/${certificateId}`, + profileCertificateUpdateDelete: (type: string) => + `${registryNew}${type}/certificate/update-delete/`, // ข้อมูลอื่นๆ profileNewOther: (type: string) => `${registryNew}${type}/other`, @@ -122,6 +136,8 @@ export default { `${registryNew}${type}/other/${dataId}`, profileNewOtherHisById: (dataId: string, type: string) => `${registryNew}${type}/other/admin/history/${dataId}`, + profileOtherUpdateDelete: (type: string) => + `${registryNew}${type}/other/update-delete/`, // ข้อมูลครอบครัว profileNewFamily: (type: string) => `${registryNew}${type}/family`, @@ -142,6 +158,8 @@ export default { `${registryNew}${type}/discipline/admin/history/${disciplineId}`, disciplineListCard: (profileId: string, type: string) => `${registryNew}${type}/discipline/admin/${profileId}`, // noPermission + profileNewDisciplineUpdateDelete: (type: string) => + `${registryNew}${type}/discipline/update-delete/`, // ปฏิบัติราชการพิเศษ profileNewDuty: (type: string) => `${registryNew}${type}/duty`, @@ -151,6 +169,8 @@ export default { `${registryNew}${type}/duty/${dutyId}`, profileNewDutyHisByDutyId: (dutyId: string, type: string) => `${registryNew}${type}/duty/admin/history/${dutyId}`, + profileDutyUpdateDelete: (type: string) => + `${registryNew}${type}/duty/update-delete/`, //ข้อมูลราชการ profileNewGovernment: (type: string) => `${registryNew}${type}/government`, @@ -171,6 +191,8 @@ export default { profileNewLeaveType: () => `${env.API_URI}/leave/type`, leaveListCard: (id: string, type: string) => `${registryNew}${type}/leave/admin/${id}`, //noPermission + profileNewLeaveUpdateDelete: (type: string) => + `${registryNew}${type}/leave/update-delete/`, /** ตำแหน่ง*/ profileSalaryPositionNew: (type: string) => @@ -205,12 +227,16 @@ export default { `${registryNew}${type}/changeName/${changeNameId}`, profileNewChangeNameHisByChangeNameId: (changeNameId: string, type: string) => `${registryNew}${type}/changeName/history/${changeNameId}`, + profileNewChangeNameUpdateDelete: (type: string) => + `${registryNew}${type}/changeName/update-delete/`, //ข้อมูลครอบครับ profileFamily: (empType: string, type: string) => `${registryNew}${empType}/family/${type}`, profileFamilyHistory: (id: string, empType: string, type: string) => `${registryNew}${empType}/family/${type}/history/${id}`, + profileFamilyUpdateDelete: (empType: string, type: string) => + `${registryNew}${empType}/family/${type}/update-delete/`, //ลูกจ้างชั่วคราว positionEmployee: (id: string) => `${registryNew}-employee/position/${id}`, @@ -235,7 +261,8 @@ export default { `${registryNew}${type}/actposition/${id}`, profileActpositionHistory: (id: string, type: string) => `${registryNew}${type}/actposition/history/${id}`, - profileActpositionUpdateDelete: `${registryNew}/actposition/update-delete/`, + profileActpositionUpdateDelete: (type: string) => + `${registryNew}${type}/actposition/update-delete/`, //ช่วยราชการ profileAssistance: (type: string, id: string) => @@ -243,4 +270,6 @@ export default { profileAssistanceHistory: (id: string, type: string) => `${registryNew}${type}/assistance/history/${id}`, profileAssistanceReturn: `${env.API_URI}/placement/repatriation`, + profileAssistanceUpdateDelete: (type: string) => + `${registryNew}${type}/assistance/update-delete/`, }; diff --git a/src/modules/04_registryPerson/components/detail/Achievement/01_ProfessionalLicense.vue b/src/modules/04_registryPerson/components/detail/Achievement/01_ProfessionalLicense.vue index 2e204649a..e52e3851e 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/01_ProfessionalLicense.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/01_ProfessionalLicense.vue @@ -30,6 +30,7 @@ const { pathRegistryEmp, onSearchDataTable, convertDateToAPI, + dialogRemove, } = mixin; const { createPathUploadFlie, getPathUploadFlie, uploadFile } = useRegistryNewDataStore(); @@ -361,18 +362,20 @@ function serchDataTable() { } function handleDelete(rowId: string) { - // dialogRemove($q, async () => { - // showLoader(); - // try { - // await http.delete(config.API.profileChangeNameUpdate + `${rowId}`); - // await fetchData(id.value); - // success($q, "ลบข้อมูลสำเร็จ"); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); + dialogRemove($q, async () => { + showLoader(); + try { + await http.patch( + config.API.profileCertificateUpdateDelete(empType.value) + `${rowId}` + ); + await fetchData(id.value); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); } /** diff --git a/src/modules/04_registryPerson/components/detail/Achievement/02_Train.vue b/src/modules/04_registryPerson/components/detail/Achievement/02_Train.vue index dcb513021..e8c2a2b69 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/02_Train.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/02_Train.vue @@ -405,7 +405,7 @@ function onDelete(rowId: string) { dialogRemove($q, async () => { showLoader(); try { - await http.patch(config.API.profileTrainingUpdate + `${rowId}`); + await http.patch(config.API.profileTrainingUpdate(empType.value) + `${rowId}`); await fetchData(id.value); await success($q, "ลบข้อมูลสำเร็จ"); } catch (err) { diff --git a/src/modules/04_registryPerson/components/detail/Achievement/03_Insignia.vue b/src/modules/04_registryPerson/components/detail/Achievement/03_Insignia.vue index 5425f40b0..5da6c11e0 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/03_Insignia.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/03_Insignia.vue @@ -37,6 +37,7 @@ const { dialogConfirm, pathRegistryEmp, onSearchDataTable, + dialogRemove, } = mixin; const isUpload = ref(false); @@ -333,8 +334,6 @@ async function getInsigniaActive() { .get(config.API.orgInsigniaActive()) .then((res) => { const data = res.data.result; - console.log(data); - mapInsigniaOption(data); }) .catch((e) => { @@ -647,18 +646,20 @@ function serchDataTable() { } function handleDelete(rowId: string) { - // dialogRemove($q, async () => { - // showLoader(); - // try { - // await http.delete(config.API.profileChangeNameUpdate + `${rowId}`); - // await fetchData(); - // success($q, "ลบข้อมูลสำเร็จ"); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); + dialogRemove($q, async () => { + showLoader(); + try { + await http.patch( + config.API.profileNewInsignUpdateDelete(empType.value) + `${rowId}` + ); + await fetchData(); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); } /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ diff --git a/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue b/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue index d424c3fc1..df987e6c6 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue @@ -33,6 +33,7 @@ const { pathRegistryEmp, onSearchDataTable, convertDateToAPI, + dialogRemove, } = mixin; const profileId = ref( @@ -446,18 +447,20 @@ function serchDataTable() { } function handleDelete(rowId: string) { - // dialogRemove($q, async () => { - // showLoader(); - // try { - // await http.delete(config.API.profileChangeNameUpdate + `${rowId}`); - // await fetchData(); - // success($q, "ลบข้อมูลสำเร็จ"); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); + dialogRemove($q, async () => { + showLoader(); + try { + await http.patch( + config.API.profileNewHonorUpdateDelete(empType.value) + `${rowId}` + ); + await fetchData(); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); } /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ diff --git a/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue b/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue index fb1bc8369..ec8e70cb6 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue @@ -526,7 +526,9 @@ function onDelete(rowId: string) { dialogRemove($q, async () => { showLoader(); try { - await http.patch(config.API.profileDevelopmentUpdateDelete + `${rowId}`); + await http.patch( + config.API.profileDevelopmentUpdateDelete(empType.value) + `${rowId}` + ); empType.value !== "-temp" && (await getDevelop()); await success($q, "ลบข้อมูลสำเร็จ"); } catch (err) { @@ -542,18 +544,20 @@ function onDelete(rowId: string) { * @param rowId ที่ต้องการลบข้อมูล */ function handleDelete(rowId: string) { - // dialogRemove($q, async () => { - // showLoader(); - // try { - // await http.delete(config.API.profileChangeNameUpdate + `${rowId}`); - // await fetchData(); - // success($q, "ลบข้อมูลสำเร็จ"); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); + dialogRemove($q, async () => { + showLoader(); + try { + await http.patch( + config.API.profileNewAssessmentsUpdateDelete(empType.value) + `${rowId}` + ); + await fetchData(); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); } onMounted(async () => { diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_Discipline.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_Discipline.vue index d7d83e5bb..a726a067f 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_Discipline.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_Discipline.vue @@ -35,6 +35,7 @@ const { pathRegistryEmp, onSearchDataTable, convertDateToAPI, + dialogRemove, } = mixin; const profileId = ref( @@ -461,18 +462,20 @@ function serchDataTable() { } function handleDelete(id: string) { - // dialogRemove($q, async () => { - // showLoader(); - // try { - // await http.delete(config.API.profileChangeNameUpdate + `${id}`); - // await fetchData(profileId.value); - // success($q, "ลบข้อมูลสำเร็จ"); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); + dialogRemove($q, async () => { + showLoader(); + try { + await http.patch( + config.API.profileNewDisciplineUpdateDelete(empType.value) + `${id}` + ); + await fetchData(profileId.value); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); } /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue index 65800bf1f..726ed821a 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue @@ -39,6 +39,7 @@ const { dateToISO, pathRegistryEmp, onSearchDataTable, + dialogRemove, } = mixin; const profileId = ref( @@ -477,18 +478,20 @@ function clickEditRowType() { } function handleDelete(id: string) { - // dialogRemove($q, async () => { - // showLoader(); - // try { - // await http.delete(config.API.profileChangeNameUpdate + `${id}`); - // await getData(); - // success($q, "ลบข้อมูลสำเร็จ"); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); + dialogRemove($q, async () => { + showLoader(); + try { + await http.patch( + config.API.profileNewLeaveUpdateDelete(empType.value) + `${id}` + ); + await getData(); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); } /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue index 1f20d23f0..7e35b8f24 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue @@ -31,6 +31,7 @@ const { pathRegistryEmp, onSearchDataTable, convertDateToAPI, + dialogRemove, } = mixin; const profileId = ref( @@ -448,19 +449,21 @@ function serchDataTable() { } function handleDelete(id: string) { - // dialogRemove($q, async () => { - // showLoader(); - // try { - // await http.delete(config.API.profileChangeNameUpdate + `${id}`); - // await fetchData(profileId.value); - // - // success($q, "ลบข้อมูลสำเร็จ"); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); + dialogRemove($q, async () => { + showLoader(); + try { + await http.patch( + config.API.profileDutyUpdateDelete(empType.value) + `${id}` + ); + await fetchData(profileId.value); + + success($q, "ลบข้อมูลสำเร็จ"); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); } /** ทำงานเมื่อ Components ถูกเรียกใช้งา*/ diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPos.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPos.vue index 37f6fcbd5..b13649a6f 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPos.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/05_ActingPos.vue @@ -299,7 +299,9 @@ function onDelete(rowId: string) { dialogRemove($q, async () => { showLoader(); try { - await http.patch(config.API.profileActpositionUpdateDelete + `${rowId}`); + await http.patch( + config.API.profileActpositionUpdateDelete(empType.value) + `${rowId}` + ); await fetchData(); await success($q, "ลบข้อมูลสำเร็จ"); } catch (err) { diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue index 15f2a0f5d..c97cbb2c3 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/06_HelpGovernment.vue @@ -35,6 +35,7 @@ const { pathRegistryEmp, onSearchDataTable, convertDateToAPI, + dialogRemove, } = mixin; const profileId = ref( @@ -439,18 +440,20 @@ async function onReturner(refId: string) { } function handleDelete(id: string) { - // dialogRemove($q, async () => { - // showLoader(); - // try { - // await http.delete(config.API.profileChangeNameUpdate + `${id}`); - // await fetchData(); - // success($q, "ลบข้อมูลสำเร็จ"); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); + dialogRemove($q, async () => { + showLoader(); + try { + await http.patch( + config.API.profileAssistanceUpdateDelete(empType.value) + `${id}` + ); + await fetchData(); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); } onMounted(() => { diff --git a/src/modules/04_registryPerson/components/detail/Other/01_OtherInformation.vue b/src/modules/04_registryPerson/components/detail/Other/01_OtherInformation.vue index e27a81761..bc87c4227 100644 --- a/src/modules/04_registryPerson/components/detail/Other/01_OtherInformation.vue +++ b/src/modules/04_registryPerson/components/detail/Other/01_OtherInformation.vue @@ -26,6 +26,7 @@ const { pathRegistryEmp, onSearchDataTable, convertDateToAPI, + dialogRemove, } = mixin; const id = ref(""); @@ -243,18 +244,20 @@ function serchDataTable() { } function handleDelete(rowId: string) { - // dialogRemove($q, async () => { - // showLoader(); - // try { - // await http.delete(config.API.profileChangeNameUpdate + `${rowId}`); - // await getData(); - // success($q, "ลบข้อมูลสำเร็จ"); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); + dialogRemove($q, async () => { + showLoader(); + try { + await http.patch( + config.API.profileOtherUpdateDelete(empType.value) + `${rowId}` + ); + await getData(); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); } onMounted(() => { diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/02_NameChangeHistory.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/02_NameChangeHistory.vue index 69999ffe6..cbe7f361e 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/02_NameChangeHistory.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/02_NameChangeHistory.vue @@ -368,18 +368,20 @@ function searchDataTable() { } function handleDelete(id: string) { - // dialogRemove($q, async () => { - // showLoader(); - // try { - // await http.delete(config.API.profileChangeNameUpdate + `${id}`); - // await fetchData(profileId.value); - // success($q, "ลบข้อมูลสำเร็จ"); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); + dialogRemove($q, async () => { + showLoader(); + try { + await http.patch( + config.API.profileNewChangeNameUpdateDelete(empType.value) + `${id}` + ); + await fetchData(profileId.value); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); } /** ดูการเปลี่ยนแปลงของข้อมูลฟอร์ท เปลี่ยนชื่อ-นามสกุล*/ diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue index 3eda0cf5b..4574f5e44 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue @@ -31,6 +31,7 @@ const { messageError, success, pathRegistryEmp, + dialogRemove, } = useCounterMixin(); /** props*/ @@ -508,18 +509,21 @@ async function fetchDataHistory() { } function handleDelete(id: string) { - // dialogRemove($q, async () => { - // showLoader(); - // try { - // await http.delete(config.API.profileChangeNameUpdate + `${id}`); - // await fetchDataCouple(); - // success($q, "ลบข้อมูลสำเร็จ"); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); + dialogRemove($q, async () => { + showLoader(); + try { + await http.patch( + config.API.profileFamilyUpdateDelete(empType.value, "children") + + `${id}` + ); + await fetchDataChildren(); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); } /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue index 793b17e1c..8a731e545 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue @@ -36,6 +36,7 @@ const { pathRegistryEmp, onSearchDataTable, convertDateToAPI, + dialogRemove, } = mixin; const id = ref(route.params.id.toString()); //id profile @@ -576,19 +577,21 @@ async function fetchDataHistory() { } } -function handleDelete(id: string) { - // dialogRemove($q, async () => { - // showLoader(); - // try { - // await http.delete(config.API.profileChangeNameUpdate + `${id}`); - // await fetchData(profileId.value); - // success($q, "ลบข้อมูลสำเร็จ"); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); +function handleDelete(rowId: string) { + dialogRemove($q, async () => { + showLoader(); + try { + await http.patch( + config.API.profileEducationUpdateDelete(empType.value) + `${rowId}` + ); + await fetchData(id.value); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); } /** ฟังก์ค้นหาข้อมูลรายการประวัติการศึกษา */ diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/06_SpecialSkill.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/06_SpecialSkill.vue index b9c7e5355..2de52e4cc 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/06_SpecialSkill.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/06_SpecialSkill.vue @@ -30,6 +30,7 @@ const { date2Thai, pathRegistryEmp, onSearchDataTable, + dialogRemove, } = mixin; const id = ref(route.params.id.toString()); //id profile @@ -404,18 +405,20 @@ function serchDataTable() { } function handleDelete(rowId: string) { - // dialogRemove($q, async () => { - // showLoader(); - // try { - // await http.delete(config.API.profileChangeNameUpdate + `${rowId}`); - // await fetchData(id.value); - // success($q, "ลบข้อมูลสำเร็จ"); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); + dialogRemove($q, async () => { + showLoader(); + try { + await http.patch( + config.API.profileAbilityUpdateDelete(empType.value) + `${rowId}` + ); + await fetchData(id.value); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); } /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ diff --git a/src/modules/04_registryPerson/components/detail/Salary/02_NotReceiveSalary.vue b/src/modules/04_registryPerson/components/detail/Salary/02_NotReceiveSalary.vue index 64756b5b1..5b9a69d3b 100644 --- a/src/modules/04_registryPerson/components/detail/Salary/02_NotReceiveSalary.vue +++ b/src/modules/04_registryPerson/components/detail/Salary/02_NotReceiveSalary.vue @@ -29,6 +29,7 @@ const { pathRegistryEmp, onSearchDataTable, convertDateToAPI, + dialogRemove, } = useCounterMixin(); const { createPathUploadFlie, getPathUploadFlie, uploadFile } = useRegistryNewDataStore(); @@ -336,18 +337,20 @@ function serchDataTable() { } function handleDelete(id: string) { - // dialogRemove($q, async () => { - // showLoader(); - // try { - // await http.delete(config.API.profileChangeNameUpdate + `${id}`); - // await getData(); - // success($q, "ลบข้อมูลสำเร็จ"); - // } catch (err) { - // messageError($q, err); - // } finally { - // hideLoader(); - // } - // }); + dialogRemove($q, async () => { + showLoader(); + try { + await http.patch( + config.API.profileNewNoPaidUpdateDelete(empType.value) + `${id}` + ); + await getData(); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } + }); } /** ทำงานเมื่อ Components ถูกเรียกใช้งาน */