เพิ่ม Report โครงสร้าง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-11-18 13:31:35 +07:00
parent e3c835228c
commit a55820297a
3 changed files with 68 additions and 5 deletions

View file

@ -117,13 +117,19 @@ const baseDocument = ref<DataDocument[]>([
name: "บัญชี 3",
val: "report3",
},
{
name: "รายงานสรุปจำนวนกรอบอัตรากำลังของข้าราชการกรุงเทพมหานครสามัญ",
val: "report4",
},
]);
const document = computed(() => {
if (store.typeOrganizational === "draft") {
return baseDocument.value;
} else {
return baseDocument.value.filter((e: DataDocument) => e.val === "report2");
return baseDocument.value.filter(
(e: DataDocument) => e.val === "report2" || e.val === "report4"
);
}
});
@ -456,14 +462,17 @@ async function onClickDownloadReport(val: string, name: string) {
showLoader();
await http
.get(config.API.orgReport(val) + `/${orgRootId.value}`)
.then((res) => {
.then(async (res) => {
const data = res.data.result;
if (data) {
genreport(data, name);
await genreport(data, name);
}
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
@ -487,7 +496,7 @@ watch(
<!-- TOOLBAR -->
<div class="col-12">
<q-toolbar style="padding: 0">
<div v-if="store.typeOrganizational === 'draft'&& !store.isLosck">
<div v-if="store.typeOrganizational === 'draft' && !store.isLosck">
<q-btn
flat
round
@ -602,7 +611,7 @@ watch(
<q-tr :props="props">
<q-td>
<q-btn
v-if="store.typeOrganizational === 'draft' && !store.isLosck"
v-if="store.typeOrganizational === 'draft' && !store.isLosck"
flat
color="secondary"
icon="mdi-dots-horizontal-circle-outline"