Merge branch 'develop' into dev-tee
This commit is contained in:
commit
2f2bb3a670
20 changed files with 1555 additions and 1083 deletions
|
|
@ -69,14 +69,14 @@ const downloadFile = (response: any, filename: string) => {
|
|||
link.click();
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
const fileDownload = async (no: number, type: string) => {
|
||||
const fileDownload = async (no: number, type: string, fileName: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.reportTransferFile(no, type, id.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then(async (res) => {
|
||||
downloadFile(res, `_ครั้งที่.${type}`);
|
||||
downloadFile(res, `${fileName}.${type}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -464,7 +464,7 @@ onMounted(async () => {
|
|||
round
|
||||
color="red"
|
||||
icon="picture_as_pdf"
|
||||
@click="fileDownload(props.row.no, 'pdf')"
|
||||
@click="fileDownload(props.row.no, 'pdf', props.row.fileName)"
|
||||
>
|
||||
<q-tooltip>ไฟล์ PDF</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
@ -474,7 +474,7 @@ onMounted(async () => {
|
|||
round
|
||||
color="blue"
|
||||
icon="mdi-file-word"
|
||||
@click="fileDownload(props.row.no, 'docx')"
|
||||
@click="fileDownload(props.row.no, 'docx', props.row.fileName)"
|
||||
>
|
||||
<q-tooltip>ไฟล์ WORD</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue