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"
>
{{ year + 543 }}
{{
@@ -453,7 +452,7 @@ onMounted(async () => {
option-label="posTypeName"
use-input
fill-input
- @update:model-value="(value:string)=>(onUpdateFilter,updateLevel(value))"
+ @update:model-value="(value:string)=>(posLevel = '',onUpdateFilter(),updateLevel(value))"
@filter="(inputValue:any, doneFn:Function) =>
filterOption(inputValue, doneFn,'type')
"