แก้ไขชื่อไฟล์ตอน โหลดไฟล

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-10-03 09:24:29 +07:00
parent f70a20497d
commit 77e4294ec5

View file

@ -66,7 +66,7 @@ const fecthlistRound = async () => {
year: e.period_year, year: e.period_year,
name: e.period_name, name: e.period_name,
})); }));
filterOtion.value = optionsList.value filterOtion.value = optionsList.value;
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -119,7 +119,10 @@ const downloadReport = async (
}) })
.then(async (res) => { .then(async (res) => {
if (download) { if (download) {
downloadFile(res, `${titleReport} ${selectList.value.name}.${type}`); downloadFile(
res,
`${titleReport.value} ${selectList.value.name}.${type}`
);
} else { } else {
const url = URL.createObjectURL(new Blob([res.data])); const url = URL.createObjectURL(new Blob([res.data]));
showDocument(url); showDocument(url);
@ -135,15 +138,13 @@ const downloadReport = async (
const filterSelector = (val: any, update: Function, name: any) => { const filterSelector = (val: any, update: Function, name: any) => {
update(() => { update(() => {
const needle = val.toLowerCase(); const needle = val.toLowerCase();
if (name === 'selectList') { if (name === "selectList") {
filterOtion.value = optionsList.value.filter( filterOtion.value = optionsList.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1 (v: any) => v.name.toLowerCase().indexOf(needle) > -1
); );
} }
});
} };
)
}
</script> </script>
<template> <template>
@ -166,7 +167,7 @@ const filterSelector = (val: any, update: Function, name: any) => {
<q-toolbar style="padding: 0"> <q-toolbar style="padding: 0">
<q-form ref="myForm" class="row items-center"> <q-form ref="myForm" class="row items-center">
<q-select <q-select
style="width: 400px;" style="width: 400px"
class="q-pa-none" class="q-pa-none"
use-input use-input
fill-input fill-input