แก้ดาวโหลดไฟล์

This commit is contained in:
setthawutttty 2024-01-09 17:19:04 +07:00
parent 75ada31f85
commit ba87a0de74
2 changed files with 6 additions and 1 deletions

View file

@ -51,7 +51,7 @@ interface FremData {
leaveTotal: number; //จำนวนวันที่ลา(Auto)
leavebirthDate: Date | null; //วันเดือนปีเกิด(Auto)
leavegovernmentDate: Date | null; //วันที่เข้ารับราชการ(Auto)
leaveSalary: string; //เงินเดือนปัจจุบัน(Auto)
leaveSalary: number; //เงินเดือนปัจจุบัน(Auto)
leaveSalaryText: String; //เงินเดือนปัจจุบัน(เขียนเป็นคำอ่าน)
leaveTypeDay: string; //ประเภทการลาในวันนั้นเช่น
wifeDayName: String; //ชื่อภรรยา(ลาไปช่วยเหลือภริยาที่คลอดบุตร)

View file

@ -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: {