From d801715c55bf95d23db1234f5e6a4298830d5271 Mon Sep 17 00:00:00 2001 From: waruneeta Date: Wed, 29 Nov 2023 11:52:01 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=9F=E0=B8=AD?= =?UTF-8?q?=E0=B8=A3=E0=B9=8C=E0=B8=A1=E0=B9=80=E0=B8=A3=E0=B8=B7=E0=B9=88?= =?UTF-8?q?=E0=B8=AD=E0=B8=87=E0=B8=A3=E0=B9=89=E0=B8=AD=E0=B8=87=E0=B9=80?= =?UTF-8?q?=E0=B8=A3=E0=B8=B5=E0=B8=A2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/1_Complaint/Form.vue | 47 +++++++++++-------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index fa2465987..2a683e665 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -74,12 +74,6 @@ const props = defineProps({ }, }); -const fileListOj = reactive({ - id: "", - pathName: "", - fileName: "", -}); - const formData = reactive({ id: "", respondentType: "", @@ -261,20 +255,20 @@ async function fileUploadDoc(documentFile: any) { */ function selectLevel(val: string) { let dayNum = 0; - if (val == "3") { + if (val == "VERY_URGENT") { dayNum = 15; // ด่วนมาก - } else if (val == "1") { + } else if (val == "URGENT") { dayNum = 30; // ด่วน } else { dayNum = 45; // ปกติ } // วันแจ้งเตือนล่วงหน้า - if (formData.dateConsideration) { - const currentDate = new Date(formData.dateConsideration); + if (formData.dateReceived) { + const currentDate = new Date(formData.dateReceived); const newDate = new Date( currentDate.getTime() + dayNum * 24 * 60 * 60 * 1000 ); - formData.dateNotification = newDate; + formData.dateConsideration = newDate; } } @@ -410,6 +404,7 @@ function upLoadFileDoc() { async function addPerson(data: any) { toggleModal(); + changeFormData(); await complainstStore.fetchComplainstAdd(data); } @@ -425,20 +420,24 @@ function deletePerson(id: string) { } function removePerson(id: string) { - isSave.value = true; + changeFormData(); const dataRow = complainstStore.rowsAdd; const updatedRows = dataRow.filter((item: any) => item.personId !== id); complainstStore.rowsAdd = updatedRows; } -function getList() { +function getListChannel() { http.get(config.API.complaintListOp()).then((res) => { complaintFromtoptions.value = res.data.result.data; }); } +function changeFormData() { + isSave.value = props.data != null ?? true; +} + onMounted(() => { - getList(); + getListChannel(); getOc(); complainstStore.columns = columns.value; complainstStore.visibleColumns = visibleColumns.value; @@ -487,6 +486,7 @@ onMounted(() => { @filter="(inputValue: any, doneFn: Function) => filterSelector(inputValue, doneFn, 'filterrespondentType' )" + @update:model-value="changeFormData()" >