add type generate report
This commit is contained in:
parent
624f9cbd47
commit
a34a6f96c2
1 changed files with 12 additions and 6 deletions
|
|
@ -10,15 +10,21 @@ const { showLoader, hideLoader, messageError } = mixin;
|
|||
const apiGenReport =
|
||||
"https://report-server.frappet.synology.me/api/v1/report-template/docx";
|
||||
|
||||
async function genReport(data: any, fileName: string) {
|
||||
async function genReport(data: any, fileName: string, type: string = "docx") {
|
||||
showLoader();
|
||||
await axios
|
||||
.post(apiGenReport, data, {
|
||||
headers: {
|
||||
accept:
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
"content-Type": "application/json",
|
||||
},
|
||||
headers:
|
||||
type == "docx"
|
||||
? {
|
||||
accept:
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
"content-Type": "application/json",
|
||||
}
|
||||
: {
|
||||
accept: "application/pdf",
|
||||
"content-Type": "application/json",
|
||||
},
|
||||
responseType: "arraybuffer",
|
||||
})
|
||||
.then((res) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue