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 =
|
const apiGenReport =
|
||||||
"https://report-server.frappet.synology.me/api/v1/report-template/docx";
|
"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();
|
showLoader();
|
||||||
await axios
|
await axios
|
||||||
.post(apiGenReport, data, {
|
.post(apiGenReport, data, {
|
||||||
headers: {
|
headers:
|
||||||
accept:
|
type == "docx"
|
||||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
? {
|
||||||
"content-Type": "application/json",
|
accept:
|
||||||
},
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||||
|
"content-Type": "application/json",
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
accept: "application/pdf",
|
||||||
|
"content-Type": "application/json",
|
||||||
|
},
|
||||||
responseType: "arraybuffer",
|
responseType: "arraybuffer",
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue