From 17b801eedea53e6d939d15c1654e472d6196b431 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 4 Jul 2024 13:44:29 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A7=E0=B8=B4=E0=B8=99=E0=B8=B1=E0=B8=A2?= =?UTF-8?q?=20=3D>=20fix=20=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Dialogs/AddPersonal.vue | 16 +++-- .../components/1_Complaint/MainPage.vue | 12 +++- .../2_InvestigateFacts/EditPage.vue | 43 +++++++----- .../components/2_InvestigateFacts/Form.vue | 7 +- .../2_InvestigateFacts/MainPage.vue | 9 ++- .../3_InvestigateDisciplinary/Table.vue | 12 +++- .../components/4_Result/EditPage.vue | 1 + .../components/4_Result/Table.vue | 16 +++-- .../6_BasicInformation/Director/Form.vue | 67 ++++++++++--------- .../components/8_AppealComplain/MainPage.vue | 26 +++++-- .../components/9_Order/MainPage.vue | 28 +++++++- .../components/PopupSendToNext.vue | 4 +- .../store/InvestigateFactStore.ts | 34 ++++++---- src/modules/11_discipline/store/main.ts | 6 +- src/style/quasar-variables.sass | 6 ++ 15 files changed, 197 insertions(+), 90 deletions(-) diff --git a/src/components/Dialogs/AddPersonal.vue b/src/components/Dialogs/AddPersonal.vue index 52d10a313..d5581e8c7 100644 --- a/src/components/Dialogs/AddPersonal.vue +++ b/src/components/Dialogs/AddPersonal.vue @@ -15,7 +15,7 @@ const totalList = ref(1); const $q = useQuasar(); const mixin = useCounterMixin(); -const { dialogMessageNotify, showLoader, hideLoader } = mixin; +const { dialogMessageNotify, showLoader, hideLoader, messageError } = mixin; const pagination = ref({ sortBy: "createdAt", @@ -97,14 +97,14 @@ const emit = defineEmits(["returnData"]); /** ปิด dialog */ async function close() { - console.log("close"); props.close(); + rows.value = []; + search.value = ""; } /** เปิด dialog ยืนยัน */ function savePost() { if (selected.value.length != 0) { - // dialogConfirm($q, () => saveData()); saveData(); } else { dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 รายการ"); @@ -185,7 +185,7 @@ async function getSearch() { rows.value = list; }) .catch((err) => { - console.log(err); + messageError($q, err); }) .finally(() => { hideLoader(); @@ -205,7 +205,6 @@ watch( ); function updatePagination(newPagination: any) { - console.log("🚀 ~ updatePagination ~ newPagination:", newPagination) pagination.value.page = 1; pagination.value.rowsPerPage = newPagination.rowsPerPage; } @@ -373,7 +372,12 @@ watch( - +
{{ props.btnTitle }}
diff --git a/src/modules/11_discipline/components/1_Complaint/MainPage.vue b/src/modules/11_discipline/components/1_Complaint/MainPage.vue index 76818f859..27b8ed54c 100644 --- a/src/modules/11_discipline/components/1_Complaint/MainPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/MainPage.vue @@ -92,7 +92,7 @@ onMounted(async () => {
-
+
{ option-value="id" :options="complainstStore.statusOptions" @update:model-value="getList()" - /> + > + +
({ async function getDataComplaint() { showLoader(); await http - .get(config.API.complaintbyId(data.idComplaint)) + .get( + config.API.complaintbyId( + data.idComplaint ? data.idComplaint : store.complaintId + ) + ) .then((res) => { const dataList = res.data.result; dataComplaints.id = dataList.id; @@ -148,6 +152,7 @@ function getData() { const dataList = res.data.result; data.id = dataList.id; data.idComplaint = dataList.idComplaint; + store.complaintId = dataList.idComplaint; data.respondentType = dataList.respondentType; data.organizationId = dataList.organizationId; data.organization = dataList.organization; @@ -191,15 +196,15 @@ async function onSubmit(data: any) { showLoader(); http .put(config.API.investigateById(id.value), data) - .then((res) => { - getData(); - success($q, "บันทึกข้อมูลสำเร็จ"); + .then(async (res) => { + await getData(); + await success($q, "บันทึกข้อมูลสำเร็จ"); // router.push(`/discipline/complaints`); }) .catch((e) => { messageError($q, e); }) - .finally(async () => { + .finally(() => { hideLoader(); }); // router.push(`/discipline/investigatefacts`); @@ -225,14 +230,15 @@ function sentConfirmNoPerson() { .put(config.API.investigateApprove(id.value), { persons: [], }) - .then((res) => {}) + .then((res) => { + getData(); + router.push(`/discipline/investigatefacts`); + }) .catch((e) => { messageError($q, e); }) .finally(() => { hideLoader(); - getData(); - router.push(`/discipline/investigatefacts`); }); } @@ -265,14 +271,13 @@ function confirmEndInvestigate() { showLoader(); http .get(config.API.investigateReject(id.value)) - .then((res) => { - success($q, "ยุติเรื่องสำเร็จ"); + .then(async () => { + await getData(); + await success($q, "ยุติเรื่องสำเร็จ"); }) .catch((e) => { messageError($q, e); - }) - .finally(async () => { - await getData(); + hideLoader(); }); } @@ -281,15 +286,15 @@ function confirmCancelInvestigate() { showLoader(); http .get(config.API.investigateResume(id.value)) - .then((res) => { - getData(); + .then(async () => { + await getData(); + await success($q, "ยกเลิกยุติเรื่องสำเร็จ"); }) .catch((e) => { messageError($q, e); }) .finally(() => { hideLoader(); - success($q, "ยกเลิกยุติเรื่องสำเร็จ"); }); } @@ -300,8 +305,7 @@ function emitPerson(data: FormData[]) { .put(config.API.investigateApprove(id.value), { persons: dataMapId, }) - - .then((res) => { + .then(() => { router.push(`/discipline/investigatefacts`); }) .catch((e) => { @@ -315,6 +319,9 @@ function emitPerson(data: FormData[]) { /** โหลดข้อมูลเมื่อเข้าหน้านี้ */ onMounted(() => { getData(); + if (store.tabMenu == "complaints") { + getDataComplaint(); + } }); watch( diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue index 691f2e749..b3baa7101 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue @@ -902,7 +902,7 @@ onMounted(async () => { {{ props.row.salary.toLocaleString() }}
- {{ col.value }} + {{ col.value ?? "-" }}
@@ -1268,7 +1268,7 @@ onMounted(async () => { {{ props.rowIndex + 1 }}
- {{ col.value }} + {{ col.value ?? "-" }}
@@ -1545,6 +1545,7 @@ onMounted(async () => { v-if="!isReadonly && formData.id !== ''" class="col-12 row" > + { v-model="formData.documentFile" @added="uploadFile" label="ไฟล์เอกสารหลักฐาน" - accept=".pdf,.xlsx,.docx" + clearable >