From facadbd8371a4e870c69c4d3b4206d0c0f92a816 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Mon, 27 Nov 2023 16:16:04 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20?= =?UTF-8?q?=E0=B9=80=E0=B8=A3=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=87=E0=B8=A3?= =?UTF-8?q?=E0=B9=89=E0=B8=AD=E0=B8=87=E0=B9=80=E0=B8=A3=E0=B8=B5=E0=B8=A2?= =?UTF-8?q?=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/1_Complaint/EditPage.vue | 24 ++++++++- .../components/1_Complaint/Form.vue | 49 +++++++++++++++++-- .../components/1_Complaint/Popup.vue | 8 +-- .../components/1_Complaint/TableComplaint.vue | 1 + .../2_InvestigateFacts/MainPage.vue | 1 + .../interface/response/complaint.ts | 4 +- 6 files changed, 73 insertions(+), 14 deletions(-) diff --git a/src/modules/11_discipline/components/1_Complaint/EditPage.vue b/src/modules/11_discipline/components/1_Complaint/EditPage.vue index f791a63ae..c2b94d93b 100644 --- a/src/modules/11_discipline/components/1_Complaint/EditPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/EditPage.vue @@ -244,7 +244,6 @@ async function getData() { data.persons = dataList.persons; data.result = dataList.result; data.disciplineComplaintDocs = dataList.disciplineComplaintDocs; - }) .catch((e) => { messageError($q, e); @@ -272,7 +271,28 @@ async function onSubmit(data: any) { /** ยืนยัน มีมูลส่งไปสืบสวน */ function sentInvestigate() { - modalPopup.value = true; + if (complainstStore.rowsAdd.length > 0) { + modalPopup.value = true; + } else { + dialogConfirm($q,()=>sentConfirm(),'ยืนยันส่งไปสืบสวน','ต้องการยืนยันยืนยันส่งไปสืบสวนใช่หรือไม่?') + } +} + +function sentConfirm(){ + showLoader(); + http + .put(config.API.complaintApprove(id.value), { + persons: [], + }) + .then((res) => { + router.push(`/discipline/complaints`); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); } function closePopup() { diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index b5b4faf33..070f98757 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -366,7 +366,7 @@ function confirmDelete(id: string) { watch(props.data, async () => { fileList.value = props.data.disciplineComplaintDocs; complainstStore.fetchComplainstAdd(props.data.persons); - + formData.id = props.data.id; formData.respondentType = props.data.respondentType; formData.organizationId = props.data.organizationId; @@ -403,20 +403,22 @@ function upLoadFileDoc() { .then((res) => { console.log(res); success($q, "บันทึกข้อมูลสำเร็จ"); - router.push(`/discipline/complaints`); + props.getData(); }) .catch((e) => { messageError($q, e); }) .finally(async () => { hideLoader(); + formData.documentFile = null }); console.log("file", formData.documentFile, formData.id); } async function addPerson(data: any) { - await complainstStore.fetchComplainstAdd(data); toggleModal(); + console.log(data) + await complainstStore.fetchComplainstAdd(data); } function getOc() { @@ -425,6 +427,19 @@ function getOc() { complainstStore.ocListFn(data); }); } + +function deletePerson(id: string) { + dialogRemove($q, () => removePerson(id)); +} + +function removePerson(id: string) { + const dataRow = complainstStore.rowsAdd; + const updatedRows = dataRow.filter((item: any) => item.id !== id); + success($q,'ลบข้อมูลสำเร็จ') + complainstStore.rowsAdd = updatedRows; + +} + onMounted(() => { getOc(); complainstStore.columns = columns.value; @@ -575,6 +590,7 @@ onMounted(() => { col.label }} + @@ -978,6 +1013,7 @@ onMounted(() => { >ดาวน์โหลดไฟล์ { +
+ +

+ ไม่มีรายการเอกสาร +

+
+
diff --git a/src/modules/11_discipline/components/1_Complaint/Popup.vue b/src/modules/11_discipline/components/1_Complaint/Popup.vue index d04210303..41fcf0a9f 100644 --- a/src/modules/11_discipline/components/1_Complaint/Popup.vue +++ b/src/modules/11_discipline/components/1_Complaint/Popup.vue @@ -60,10 +60,6 @@ const initialPagination = ref({ }); function onclickSend() { - // inputRef.value.validate(); - // dialogConfirm($q, () => props.sentApprove()); - - if (selected.value.length > 0) { dialogConfirm( $q, async () => { @@ -75,9 +71,7 @@ function onclickSend() { `ยืนยันการส่ง${props.title}`, `ต้องการยืนยันการส่ง${props.title}หรือไม่` ); - } else { - dialogMessageNotify($q, "กรุณาเลือกรายชื่อ"); - } + } function onClickClose() { diff --git a/src/modules/11_discipline/components/1_Complaint/TableComplaint.vue b/src/modules/11_discipline/components/1_Complaint/TableComplaint.vue index 2f721d1f5..16f9f8b54 100644 --- a/src/modules/11_discipline/components/1_Complaint/TableComplaint.vue +++ b/src/modules/11_discipline/components/1_Complaint/TableComplaint.vue @@ -177,6 +177,7 @@ watch( class="custom-header-table" :visible-columns="complainstStore.visibleColumns" v-model:pagination="pagination" + :rows-per-page-options="[10, 25, 50, 100]" >