From 94afaca07be3cb46a32909a4fd8e326714edb5cc Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Tue, 7 May 2024 17:06:34 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A=20=E0=B8=9A=E0=B8=A3?= =?UTF-8?q?=E0=B8=A3=E0=B8=88=E0=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/AppointMent/Detail.vue | 173 ++-- .../05_placement/components/Other/Detail.vue | 13 +- .../PersonalDetail/DialogFooter.vue | 2 +- .../components/PersonalDetail/Education.vue | 21 +- .../PersonalDetail/Information/Address.vue | 136 +-- .../PersonalDetail/Information/Certicate.vue | 37 +- .../PersonalDetail/Information/Family.vue | 138 +-- .../Information/Information.vue | 99 +- .../PersonalDetail/Information/top.vue | 2 +- .../components/Receive/receiveDetail2.vue | 844 +++++++++--------- .../components/Receive/receiveMain.vue | 10 +- .../components/Repatriate/RepatriatebyId.vue | 12 +- .../components/Transfer/transferRegistry.vue | 17 +- 13 files changed, 770 insertions(+), 734 deletions(-) diff --git a/src/modules/05_placement/components/AppointMent/Detail.vue b/src/modules/05_placement/components/AppointMent/Detail.vue index 8bfbc92c5..968cc3b1d 100644 --- a/src/modules/05_placement/components/AppointMent/Detail.vue +++ b/src/modules/05_placement/components/AppointMent/Detail.vue @@ -67,8 +67,8 @@ const fecthappointmentByid = async () => { const data = res.data.result; profileId.value = data.profileId; - title.value.fullname = `${data.prefix}${data.firstname ?? "-"} ${ - data.lastname ?? "-" + title.value.fullname = `${data.prefix}${data.firstName ?? "-"} ${ + data.lastName ?? "-" }`; title.value.organizationPositionOld = data.organizationPositionOld ?? "-"; title.value.positionLevelOld = data.positionLevelOld ?? "-"; @@ -92,47 +92,39 @@ const fecthappointmentByid = async () => { }); }; -//ยืนยันการเเก้ไข -const clickSave = async () => { - if (myForm.value !== null) { - myForm.value.validate().then((success: any) => { - if (success) { - dialogConfirm( - $q, - async () => await putAppointment(), - "ต้องการแก้ไขข้อมูลหรือไม่?", - "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย" - ); - } - }); - } -}; // เเก้ไขข้อมูล -const putAppointment = async () => { - let data = { - educationOld: educationOld.value, - organizationPositionOld: organizationPositionOld.value, - positionTypeOld: positionTypeOld.value, - positionLevelOld: positionLevelOld.value, - positionNumberOld: posNo.value, - amountOld: Number(salary.value), - reason: reason.value, - positionDate: date.value, - }; - showLoader(); - await http - .put(config.API.appointmentByid(paramsId.toString()), data) - .then(() => { - success($q, "บันทึกข้อมูลสำเร็จ"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - fecthappointmentByid(); - edit.value = false; - }); -}; +function putAppointment() { + dialogConfirm( + $q, + () => { + let data = { + educationOld: educationOld.value, + organizationPositionOld: organizationPositionOld.value, + positionTypeOld: positionTypeOld.value, + positionLevelOld: positionLevelOld.value, + positionNumberOld: posNo.value, + amountOld: Number(salary.value), + reason: reason.value, + positionDate: date.value, + }; + showLoader(); + http + .put(config.API.appointmentByid(paramsId.toString()), data) + .then(() => { + success($q, "บันทึกข้อมูลสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + fecthappointmentByid(); + edit.value = false; + }); + }, + "ต้องการแก้ไขข้อมูลหรือไม่?", + "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย" + ); +} const cancel = () => { edit.value = false; fecthappointmentByid(); @@ -175,48 +167,54 @@ onMounted(async () => { -
-
- แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย -
- -
-
- + +
+
+ แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย
-
- - + +
+
+ +
+
+ + +
-
-
- +
+
วุฒิการศึกษา
@@ -311,12 +309,19 @@ onMounted(async () => {
-
diff --git a/src/modules/05_placement/components/Other/Detail.vue b/src/modules/05_placement/components/Other/Detail.vue index 3d5506a0c..9a914a036 100644 --- a/src/modules/05_placement/components/Other/Detail.vue +++ b/src/modules/05_placement/components/Other/Detail.vue @@ -304,12 +304,19 @@ onMounted(async () => {
-
diff --git a/src/modules/05_placement/components/PersonalDetail/DialogFooter.vue b/src/modules/05_placement/components/PersonalDetail/DialogFooter.vue index 991f13be7..516a68ec4 100644 --- a/src/modules/05_placement/components/PersonalDetail/DialogFooter.vue +++ b/src/modules/05_placement/components/PersonalDetail/DialogFooter.vue @@ -126,7 +126,7 @@ const clickPrevious = async () => { unelevated :disabled="!editvisible" :color="!editvisible ? 'grey-7' : 'public'" - @click="checkSave" + type="submit" label="บันทึก" > diff --git a/src/modules/05_placement/components/PersonalDetail/Education.vue b/src/modules/05_placement/components/PersonalDetail/Education.vue index 5541abe83..99ed48ec7 100644 --- a/src/modules/05_placement/components/PersonalDetail/Education.vue +++ b/src/modules/05_placement/components/PersonalDetail/Education.vue @@ -448,15 +448,11 @@ const clickAdd = async () => { * กดบันทึกใน dialog */ const clickSave = async () => { - myForm.value.validate().then(async (result: boolean) => { - if (result) { - if (modalEdit.value) { - await editData(); - } else { - await saveData(); - } - } - }); + if (modalEdit.value) { + await dialogConfirm($q, () => editData()); + } else { + await dialogConfirm($q, () => saveData()); + } }; /** @@ -662,10 +658,12 @@ const addData = () => { * ฟังก์ชันปุ่มยกเลิกการแก้ไขข้อมูล */ const clickCancel = async () => { + myForm.value.resetValidation() if (editRow.value == true) { dialogConfirm( $q, async () => { + edit.value = false; await checkRowPage(); await getData(); }, @@ -778,12 +776,12 @@ const getClass = (val: boolean) => { - +
{ (false); const addressData = ref(props.data); const myform = ref(); @@ -138,61 +145,54 @@ const getNewData = async () => { // บันทึกข้อมูล const editData = async () => { - const body = { - registrationSame: addressData.value.registSame == "1", - registrationAddress: addressData.value.registAddress, - registrationSubDistrictId: registAddress.subDistrictId, - registrationDistrictId: registAddress.districtId, - registrationProvinceId: registAddress.provinceId, - registrationZipCode: registAddress.provinceId, - currentAddress: - addressData.value.registSame == "1" - ? addressData.value.registAddress - : addressData.value.currentAddress, - currentSubDistrictId: - addressData.value.registSame == "1" - ? registAddress.subDistrictId - : currentAddress.subDistrictId, - currentDistrictId: - addressData.value.registSame == "1" - ? registAddress.districtId - : currentAddress.districtId, - currentProvinceId: - addressData.value.registSame == "1" - ? registAddress.provinceId - : currentAddress.provinceId, - currentZipCode: - addressData.value.registSame == "1" - ? registAddress.zipCode - : currentAddress.zipCode, - }; - showLoader(); - await http - .put( - config.API.placementAddressId(route.params.personalId.toString()), - body - ) - .then(() => { - success($q, "แก้ไขข้อมูลสำเร็จ"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(async () => { - edit.value = false; - emit("update:statusEdit", false); - await getNewData(); - await props.fetch(); - // await fetchProvince(); - }); -}; - -// เช็คข้อมูลก่อนบันทึก -const saveData = async () => { - myform.value.validate().then((success: boolean) => { - if (success) { - editData(); - } + dialogConfirm($q, async() => { + const body = { + registrationSame: addressData.value.registSame == "1", + registrationAddress: addressData.value.registAddress, + registrationSubDistrictId: registAddress.subDistrictId, + registrationDistrictId: registAddress.districtId, + registrationProvinceId: registAddress.provinceId, + registrationZipCode: registAddress.provinceId, + currentAddress: + addressData.value.registSame == "1" + ? addressData.value.registAddress + : addressData.value.currentAddress, + currentSubDistrictId: + addressData.value.registSame == "1" + ? registAddress.subDistrictId + : currentAddress.subDistrictId, + currentDistrictId: + addressData.value.registSame == "1" + ? registAddress.districtId + : currentAddress.districtId, + currentProvinceId: + addressData.value.registSame == "1" + ? registAddress.provinceId + : currentAddress.provinceId, + currentZipCode: + addressData.value.registSame == "1" + ? registAddress.zipCode + : currentAddress.zipCode, + }; + showLoader(); + await http + .put( + config.API.placementAddressId(route.params.personalId.toString()), + body + ) + .then(() => { + success($q, "แก้ไขข้อมูลสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + edit.value = false; + emit("update:statusEdit", false); + await getNewData(); + await props.fetch(); + // await fetchProvince(); + }); }); }; @@ -440,18 +440,18 @@ const getClass = (val: boolean) => {