From f73184531e03d31a8fd09a098ba860419e896614 Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Tue, 26 Sep 2023 13:14:57 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=20=E0=B8=81=E0=B8=A3=E0=B8=93=E0=B8=B5=20=E0=B9=81=E0=B8=81?= =?UTF-8?q?=E0=B9=89=E0=B9=84=E0=B8=82=20+=20=E0=B8=A2=E0=B8=81=E0=B9=80?= =?UTF-8?q?=E0=B8=A5=E0=B8=B4=E0=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ค่าที่เราแก้ไขต้องกลับมาเหมือนก่อนที่เราจะแก้ --- .../components/Discharged/dischargedRegistry.vue | 7 ++++++- .../components/DismissOrder/outRegistry.vue | 9 +++++++-- .../components/Expulsion/expulsionRegistry.vue | 7 ++++++- .../06_retirement/components/resign/ResignByid.vue | 7 ++++++- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/modules/06_retirement/components/Discharged/dischargedRegistry.vue b/src/modules/06_retirement/components/Discharged/dischargedRegistry.vue index a781f114c..53648002f 100644 --- a/src/modules/06_retirement/components/Discharged/dischargedRegistry.vue +++ b/src/modules/06_retirement/components/Discharged/dischargedRegistry.vue @@ -105,6 +105,11 @@ const getData = async () => { }); }; +const clickCancel = async () => { + await getData(); + edit.value = false; +}; + const conditionSave = async () => { if (myForm.value !== null) { myForm.value.validate().then((success) => { @@ -265,7 +270,7 @@ const getClass = (val: boolean) => { class="q-px-sm" label="ยกเลิก" style="width: 80px" - @click="edit = !edit" + @click="clickCancel" /> diff --git a/src/modules/06_retirement/components/DismissOrder/outRegistry.vue b/src/modules/06_retirement/components/DismissOrder/outRegistry.vue index b5afa0ca5..04a432054 100644 --- a/src/modules/06_retirement/components/DismissOrder/outRegistry.vue +++ b/src/modules/06_retirement/components/DismissOrder/outRegistry.vue @@ -68,7 +68,7 @@ const getData = async () => { showLoader(); await http .get(config.API.outByid(dataId)) - .then((res: any) => { + .then((res) => { const data = res.data.result; responseData.value.personId = data.profileId; responseData.value.createdAt = data.createdAt; @@ -106,6 +106,11 @@ const getData = async () => { }); }; +const clickCancel = async () => { + await getData(); + edit.value = false; +}; + const conditionSave = async () => { if (myForm.value !== null) { myForm.value.validate().then((success) => { @@ -267,7 +272,7 @@ const getClass = (val: boolean) => { class="q-px-sm" label="ยกเลิก" style="width: 80px" - @click="edit = !edit" + @click="clickCancel" /> diff --git a/src/modules/06_retirement/components/Expulsion/expulsionRegistry.vue b/src/modules/06_retirement/components/Expulsion/expulsionRegistry.vue index bdee70e84..68da50b67 100644 --- a/src/modules/06_retirement/components/Expulsion/expulsionRegistry.vue +++ b/src/modules/06_retirement/components/Expulsion/expulsionRegistry.vue @@ -108,6 +108,11 @@ const getData = async () => { }); }; +const clickCancel = async () => { + await getData(); + edit.value = false; +}; + const conditionSave = async () => { if (myForm.value !== null) { myForm.value.validate().then((success) => { @@ -267,7 +272,7 @@ const getClass = (val: boolean) => { class="q-px-sm" label="ยกเลิก" style="width: 80px" - @click="edit = !edit" + @click="clickCancel" /> diff --git a/src/modules/06_retirement/components/resign/ResignByid.vue b/src/modules/06_retirement/components/resign/ResignByid.vue index 6e2c8469b..ff5a8ad2b 100644 --- a/src/modules/06_retirement/components/resign/ResignByid.vue +++ b/src/modules/06_retirement/components/resign/ResignByid.vue @@ -258,6 +258,11 @@ const redirectToRegistry = (id: string) => { router.push(`/registry/${id}`); }; +const clickCancel = async () => { + await fetchData(id.value); + edit.value = false; +}; + const conditionSave = () => { if (myForm.value !== null) { myForm.value.validate().then((success) => { @@ -665,7 +670,7 @@ const statusOrder = (val: boolean) => { class="q-px-sm" label="ยกเลิก" style="width: 80px" - @click="edit = !edit" + @click="clickCancel" />