Merge branch 'develop' into dev-tee
This commit is contained in:
commit
9ea5056e36
1 changed files with 42 additions and 14 deletions
|
|
@ -150,14 +150,12 @@ const visibleColumns = ref<string[]>([
|
|||
|
||||
const action = ref<string>("");
|
||||
const fileUpload = ref<any>(null);
|
||||
const clickOpenDownloadPDF =() =>{window.open(orderCoverPdf.value);}
|
||||
const clickOpenDownloadDoc =() =>{window.open(orderCoverDocs.value);}
|
||||
|
||||
onMounted(() => {
|
||||
retireld.value = retireld_params.toString();
|
||||
fecthlistprofile(retireld.value);
|
||||
fetchReportCover("pdf", retireld.value);
|
||||
fetchReportCover("docx", retireld.value);
|
||||
// fetchReportCover("pdf", retireld.value);
|
||||
// fetchReportCover("docx", retireld.value);
|
||||
});
|
||||
const round = ref<number>();
|
||||
const typeReport = ref<string>("");
|
||||
|
|
@ -325,24 +323,54 @@ const uploadFile = async (event: any) => {
|
|||
});
|
||||
};
|
||||
|
||||
const fetchReportCover = async (type: string, orderId: string) => {
|
||||
const downloadAttachment = async (type: string, id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.reportRetireList(type, orderId))
|
||||
.get(config.API.reportRetireList(type, id), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (type == "pdf") {
|
||||
orderCoverPdf.value = res.data.result;
|
||||
} else {
|
||||
orderCoverDocs.value = res.data.result;
|
||||
}
|
||||
const data = res.data.result;
|
||||
console.log(data);
|
||||
let list: any[] = [];
|
||||
downloadFile(res, `${id}.${type}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
// messageError($q, e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const downloadFile = (response: any, filename: string) => {
|
||||
const link = document.createElement("a");
|
||||
var fileName = filename;
|
||||
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
||||
link.setAttribute("download", fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
|
||||
|
||||
// const fetchReportCover = async (type: string, orderId: string) => {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.reportRetireList(type, orderId))
|
||||
// .then(async (res) => {
|
||||
// if (type == "pdf") {
|
||||
// orderCoverPdf.value = res.data.result;
|
||||
// } else {
|
||||
// orderCoverDocs.value = res.data.result;
|
||||
// }
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// // messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// };
|
||||
|
||||
// const classrow = (prop: any) => {
|
||||
// if (profileId.value !== "" && prop.profileId === profileId.value) {
|
||||
|
|
@ -402,7 +430,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
clickable
|
||||
v-close-popup
|
||||
type="a"
|
||||
@click="clickOpenDownloadPDF"
|
||||
@click="downloadAttachment('pdf', retireld)"
|
||||
target="_blank"
|
||||
>
|
||||
<q-item-section avatar
|
||||
|
|
@ -414,7 +442,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
clickable
|
||||
v-close-popup
|
||||
type="a"
|
||||
@click="clickOpenDownloadDoc"
|
||||
@click="downloadAttachment('docx', retireld)"
|
||||
target="_blank"
|
||||
>
|
||||
<q-item-section avatar
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue