From 8222905658860d4a9c7007da89cc76662e273525 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Wed, 18 Dec 2024 16:56:33 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99=20=E0=B8=A7=E0=B8=B4?= =?UTF-8?q?=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/9_DisciplineReport/Main.vue | 57 +++++++++---------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/src/modules/11_discipline/components/9_DisciplineReport/Main.vue b/src/modules/11_discipline/components/9_DisciplineReport/Main.vue index ca9ea7f06..006ce806e 100644 --- a/src/modules/11_discipline/components/9_DisciplineReport/Main.vue +++ b/src/modules/11_discipline/components/9_DisciplineReport/Main.vue @@ -118,34 +118,32 @@ function onSelectedNode(id: string, level: number) { * @param download */ async function onUpdateFilter() { - if (nodeId.value && posType.value && posLevel.value) { - isLoadPDF.value = true; - pdfSrc.value = undefined; + isLoadPDF.value = true; + pdfSrc.value = undefined; - const body = { - nodeId: nodeId.value, - node: nodeLevel.value, - year: year.value, - offenseDetail: offenseDetail.value, - disciplinaryFaultLevel: disciplinaryFaultLevel.value, - status: status.value, - posType: posType.value, - posLevel: posLevel.value, - }; - await http - .post(config.API.disciplineReportByType(employeeClass.value), body) - .then(async (res) => { - const data = res.data.result; - detailReport.value = data; - data && (await genReportPreview(data)); - }) - .catch(async (e) => { - messageError($q, JSON.parse(await e.response.data.text())); - }) - .finally(() => { - isLoadPDF.value = false; - }); - } + const body = { + nodeId: nodeId.value, + node: nodeLevel.value, + year: year.value, + offenseDetail: offenseDetail.value, + disciplinaryFaultLevel: disciplinaryFaultLevel.value, + status: status.value, + posType: posType.value, + posLevel: posLevel.value, + }; + await http + .post(config.API.disciplineReportByType(employeeClass.value), body) + .then(async (res) => { + const data = res.data.result; + detailReport.value = data; + data && (await genReportPreview(data)); + }) + .catch(async (e) => { + messageError($q, JSON.parse(await e.response.data.text())); + }) + .finally(() => { + isLoadPDF.value = false; + }); } /** @@ -258,7 +256,7 @@ onMounted(async () => { dense v-model="employeeClass" :options="employeeClassOption" - label="ประเภท" + label="สภานภาพ" emit-value map-options option-label="name" @@ -354,6 +352,7 @@ onMounted(async () => { autoApply year-picker :enableTimePicker="false" + @update:model-value="onUpdateFilter" >