แก้ดาวโหลดไฟล์
This commit is contained in:
parent
75ada31f85
commit
ba87a0de74
2 changed files with 6 additions and 1 deletions
|
|
@ -45,6 +45,7 @@ const orderAttachmentPdf = ref<string>("");
|
|||
const statusOrder = ref<string>();
|
||||
const orderName = ref<string>("");
|
||||
const orderStatusName = ref<string>("");
|
||||
const dataGen = ref<any>();
|
||||
|
||||
const orderId = ref<string>(orderId_params.toString());
|
||||
onMounted(async () => {
|
||||
|
|
@ -135,6 +136,8 @@ const downloadCover = async (type: string) => {
|
|||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
} else if (type === "docx") {
|
||||
genReport(dataGen.value, `คำสั่ง ${orderName.value}`, "docx");
|
||||
} else {
|
||||
const link = document.createElement("a");
|
||||
var fileName = `คำสั่ง ${orderName.value}.${
|
||||
|
|
@ -148,6 +151,7 @@ const downloadCover = async (type: string) => {
|
|||
hideLoader();
|
||||
}
|
||||
};
|
||||
|
||||
// โหลด เอกสารแนบท้าย
|
||||
const downloadAttachment = async (type: string) => {
|
||||
showLoader();
|
||||
|
|
@ -186,6 +190,7 @@ const fetchReportCover = async (type: string, orderId: string) => {
|
|||
}
|
||||
} else {
|
||||
// report template
|
||||
dataGen.value = res.data.result;
|
||||
await axios
|
||||
.post(`${config.API.reportTemplate}/docx`, res.data.result, {
|
||||
headers: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue