แก้รายงาน วินัย

This commit is contained in:
setthawutttty 2024-12-18 16:56:33 +07:00
parent 32c608879e
commit 8222905658

View file

@ -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"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
@ -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')
"