diff --git a/src/api/registry/api.registry.ts b/src/api/registry/api.registry.ts index 0cbfc086e..06e0a356a 100644 --- a/src/api/registry/api.registry.ts +++ b/src/api/registry/api.registry.ts @@ -39,15 +39,11 @@ 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`, @@ -64,8 +60,6 @@ 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`, @@ -75,10 +69,9 @@ export default { `${registryNew}${type}/assessments/${dataId}`, profileNewAssessmentsHisById: (dataId: string, type: string) => `${registryNew}${type}/assessments/admin/history/${dataId}`, - profileDevelopmentUpdateDelete: (type: string) => - `${registryNew}${type}/development/update-delete/`, - profileNewAssessmentsUpdateDelete: (type: string) => - `${registryNew}${type}/assessments/update-delete/`, + profileDevelopmentUpdateDelete: `${registryNew}/development/update-delete/`, + + // การฝึกอบรม profileNewTraining: (type: string) => `${registryNew}${type}/training`, profileNewTrainingByProfileId: (profileId: string, type: string) => @@ -87,8 +80,7 @@ export default { `${registryNew}${type}/training/${trainingId}`, profileNewTrainingHisByTrainingId: (trainingId: string, type: string) => `${registryNew}${type}/training/admin/history/${trainingId}`, - profileTrainingUpdate: (type: string) => - `${registryNew}${type}/training/update-delete/`, + profileTrainingUpdate: `${registryNew}/training/update-delete/`, // ประวัติการศึกษา profileNewEducation: (type: string) => `${registryNew}${type}/educations`, @@ -101,8 +93,6 @@ 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`, @@ -112,8 +102,6 @@ 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`, @@ -125,8 +113,6 @@ 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`, @@ -136,8 +122,6 @@ 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`, @@ -158,8 +142,6 @@ 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`, @@ -169,8 +151,6 @@ 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`, @@ -191,8 +171,6 @@ 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) => @@ -227,16 +205,12 @@ 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}`, @@ -261,8 +235,7 @@ export default { `${registryNew}${type}/actposition/${id}`, profileActpositionHistory: (id: string, type: string) => `${registryNew}${type}/actposition/history/${id}`, - profileActpositionUpdateDelete: (type: string) => - `${registryNew}${type}/actposition/update-delete/`, + profileActpositionUpdateDelete: `${registryNew}/actposition/update-delete/`, //ช่วยราชการ profileAssistance: (type: string, id: string) => @@ -270,6 +243,4 @@ 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 e52e3851e..46c8b1076 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/01_ProfessionalLicense.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/01_ProfessionalLicense.vue @@ -30,7 +30,6 @@ const { pathRegistryEmp, onSearchDataTable, convertDateToAPI, - dialogRemove, } = mixin; const { createPathUploadFlie, getPathUploadFlie, uploadFile } = useRegistryNewDataStore(); @@ -361,23 +360,6 @@ function serchDataTable() { ); } -function handleDelete(rowId: string) { - 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(); - } - }); -} - /** * ทำงานเมื่อ Components ถูกเรียกใช้งาน */ @@ -513,17 +495,6 @@ onMounted(() => { > แก้ไขข้อมูล - - ลบข้อมูล - { > แก้ไขข้อมูล - - ลบข้อมูล - 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 e8c2a2b69..cebac03a3 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/02_Train.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/02_Train.vue @@ -356,8 +356,8 @@ async function fetchData(id: string) { await http .get(config.API.profileNewTrainingByProfileId(id, empType.value)) .then(async (res) => { + rows.value = await res.data.result; rowsMain.value = await res.data.result; - serchDataTable(); }) .catch((err) => { messageError($q, err); @@ -405,7 +405,7 @@ function onDelete(rowId: string) { dialogRemove($q, async () => { showLoader(); try { - await http.patch(config.API.profileTrainingUpdate(empType.value) + `${rowId}`); + await http.patch(config.API.profileTrainingUpdate + `${rowId}`); await fetchData(id.value); await success($q, "ลบข้อมูลสำเร็จ"); } catch (err) { @@ -567,11 +567,7 @@ onMounted(() => { { (false); @@ -318,8 +317,8 @@ async function fetchData() { const res = await http.get( config.API.profileNewInsignByProfileId(profileId.value, empType.value) ); + rows.value = res.data.result; rowsMain.value = res.data.result; - serchDataTable(); } catch (error) { messageError($q, error); } finally { @@ -334,6 +333,8 @@ async function getInsigniaActive() { .get(config.API.orgInsigniaActive()) .then((res) => { const data = res.data.result; + console.log(data); + mapInsigniaOption(data); }) .catch((e) => { @@ -645,23 +646,6 @@ function serchDataTable() { ); } -function handleDelete(rowId: string) { - 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 ถูกเรียกใช้งาน*/ onMounted(async () => { await fetchData(); @@ -789,18 +773,6 @@ onMounted(async () => { > แก้ไขข้อมูล - - - ลบข้อมูล - { > ประวัติแก้ไขเครื่องราชอิสริยาภรณ์ - { icon="edit" @click="onClickOpenDialog(true, props.row)" > - แก้ไขข้อมูล - - - - ลบข้อมูล + แก่ไขข้อมุล 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 df987e6c6..290145b0a 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue @@ -33,7 +33,6 @@ const { pathRegistryEmp, onSearchDataTable, convertDateToAPI, - dialogRemove, } = mixin; const profileId = ref( @@ -204,8 +203,8 @@ async function fetchData() { const res = await http.get( config.API.profileNewHonorByProfileId(profileId.value, empType.value) ); + rows.value = res.data.result; rowsMain.value = res.data.result; - serchDataTable(); } catch (error) { messageError($q, error); } finally { @@ -215,7 +214,7 @@ async function fetchData() { /** * บันทึกข้อมูลประกาศเกียรติคุณ - * @param editStatus แก้ไข,เพิ่ม + * @param editStatus แก่ไข,เพิ่ม */ async function addEditData(editStatus: boolean = false) { if (!profileId.value) return; @@ -446,23 +445,6 @@ function serchDataTable() { ); } -function handleDelete(rowId: string) { - 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 ถูกเรียกใช้งาน*/ onMounted(() => { fetchData(); @@ -585,18 +567,6 @@ onMounted(() => { > แก้ไขข้อมูล - - - ลบข้อมูล - { icon="edit" @click="onClickOpenDialog(true, props.row)" > - แก้ไขข้อมูล - - - - ลบข้อมูล + แก่ไขข้อมุล 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 ec8e70cb6..3b7a9fe66 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue @@ -356,9 +356,8 @@ async function fetchData() { empType.value ) ); - + rows.value = res.data.result; rowsMain.value = res.data.result; - serchDataTable(); } catch (error) { messageError($q, error); } finally { @@ -518,17 +517,11 @@ function serchDataTable() { ); } -/** - * ลบข้อมูลการพัฒนารายบุคคล (Individual Development Plan) - * @param rowId ที่ต้องการลบข้อมูล - */ function onDelete(rowId: string) { dialogRemove($q, async () => { showLoader(); try { - await http.patch( - config.API.profileDevelopmentUpdateDelete(empType.value) + `${rowId}` - ); + await http.patch(config.API.profileDevelopmentUpdateDelete + `${rowId}`); empType.value !== "-temp" && (await getDevelop()); await success($q, "ลบข้อมูลสำเร็จ"); } catch (err) { @@ -539,27 +532,6 @@ function onDelete(rowId: string) { }); } -/** - * ผลการประเมินการปฏิบัติราชการ - * @param rowId ที่ต้องการลบข้อมูล - */ -function handleDelete(rowId: string) { - 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 () => { await fetchData(); empType.value !== "-temp" && (await getDevelop()); @@ -696,18 +668,6 @@ onMounted(async () => { > แก้ไขข้อมูล - - - ลบข้อมูล -
@@ -745,18 +705,6 @@ onMounted(async () => { > แก้ไขข้อมุล - - - ลบข้อมูล - diff --git a/src/modules/04_registryPerson/components/detail/Employee/02_Employment.vue b/src/modules/04_registryPerson/components/detail/Employee/02_Employment.vue index 2168cd5ee..0a745c916 100644 --- a/src/modules/04_registryPerson/components/detail/Employee/02_Employment.vue +++ b/src/modules/04_registryPerson/components/detail/Employee/02_Employment.vue @@ -159,7 +159,7 @@ function fetchDataEmployment(id: string) { /** * function เปิด dialog Form ข้อมูลการจ้าง - * @param statusEdit สถานะการ สร้าง หรือ แก้ไข + * @param statusEdit สถานะการ สร้าง หรือ แก่ไข * @param id รายการการจ้าง */ function onOpenDialog(statusEdit: boolean = false, id: string = "") { 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 a726a067f..3ee03f658 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_Discipline.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_Discipline.vue @@ -1,6 +1,7 @@