From 015d2d9857729db502dd67fa456b8e881c3b187a Mon Sep 17 00:00:00 2001 From: waruneeta Date: Fri, 19 Jan 2024 10:51:17 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=A7?= =?UTF-8?q?=E0=B8=B4=E0=B8=99=E0=B8=B1=E0=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/1_Complaint/EditPage.vue | 2 +- .../components/1_Complaint/Form.vue | 4 +-- .../2_InvestigateFacts/EditPage.vue | 2 +- .../components/2_InvestigateFacts/Form.vue | 33 ++++++++++--------- .../3_InvestigateDisciplinary/EditPage.vue | 28 +++++++--------- .../3_InvestigateDisciplinary/Form.vue | 4 +-- .../components/4_Result/Form.vue | 4 +-- .../components/8_AppealComplain/Form.vue | 4 +-- .../11_discipline/components/DialogDuty.vue | 4 +-- 9 files changed, 35 insertions(+), 50 deletions(-) diff --git a/src/modules/11_discipline/components/1_Complaint/EditPage.vue b/src/modules/11_discipline/components/1_Complaint/EditPage.vue index 9a4fdc218..06c4935e3 100644 --- a/src/modules/11_discipline/components/1_Complaint/EditPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/EditPage.vue @@ -200,13 +200,13 @@ async function onSubmit(data: any) { http .put(config.API.complaintbyId(id.value), data) .then((res) => { + getData(); success($q, "บันทึกข้อมูลสำเร็จ"); }) .catch((e) => { messageError($q, e); }) .finally(async () => { - getData(); hideLoader(); }); } diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index 48805fa17..7dea69fef 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -175,9 +175,7 @@ function onSubmit() { } await props.onSubmit(formData); isSave.value = false; - }, - "ยืนยันการบันทึกข้อมูล", - "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?" + } ); } diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue b/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue index 44596fb22..5d924f173 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue @@ -185,6 +185,7 @@ async function onSubmit(data: any) { http .put(config.API.investigateById(id.value), data) .then((res) => { + getData(); success($q, "บันทึกข้อมูลสำเร็จ"); // router.push(`/discipline/complaints`); }) @@ -193,7 +194,6 @@ async function onSubmit(data: any) { }) .finally(async () => { hideLoader(); - getData(); }); // router.push(`/discipline/investigatefacts`); } diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue index 8bd85a2d6..fa14fb397 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue @@ -137,10 +137,6 @@ const formData = reactive({ }); const rows = ref([]); -const rowsChack = ref([]); -const statusStep = computed(() => { - return route.name === "/discipline-disciplinaryEdit" ? true : false; -}); const dateEndInputStyle = computed(() => { const currentDate = new Date(); const investigationDateEnd = new Date(formData.investigationDateEnd as Date); @@ -150,7 +146,6 @@ const dateEndInputStyle = computed(() => { investigationDateEnd <= new Date(currentDate.getTime() + 7 * 24 * 60 * 60 * 1000); - console.log(isInNext7Days); return isInNext7Days ? "input-alert" : ""; }); @@ -173,7 +168,6 @@ function validateForm() { * หากยกเลิกจะกลับไปหน้าฟอร์ม */ function onSubmit() { - console.log(formData); dialogConfirm( $q, async () => { @@ -199,9 +193,7 @@ function onSubmit() { props.onSubmit(formData); isSave.value = false; investigationExtendStatus.value = false; - }, - "ยืนยันการบันทึกข้อมูล", - "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?" + } ); } @@ -621,10 +613,10 @@ watch( ); function calculateMinDate() { - const startDate = new Date(formData.investigationDateStart as Date); - startDate.setDate(startDate.getDate() + 1); - return startDate; - } + const startDate = new Date(formData.investigationDateStart as Date); + startDate.setDate(startDate.getDate() + 1); + return startDate; +} onMounted(async () => { mainStore.rowsAdd = []; @@ -1020,7 +1012,12 @@ onMounted(async () => {