fixing response blob
This commit is contained in:
parent
a27091a81a
commit
74f1540203
25 changed files with 138 additions and 119 deletions
|
|
@ -158,8 +158,8 @@ const clickAccount1 = async () => {
|
|||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -185,8 +185,8 @@ const clickAccount2 = async () => {
|
|||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -211,8 +211,8 @@ const clickAccount3 = async () => {
|
|||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -502,8 +502,8 @@ const downloadFile = async () => {
|
|||
const data = res.data;
|
||||
downloadFilePDF(data, `Candidate__${dateToISO(new Date())}.xlsx`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -520,8 +520,8 @@ const downloadFileDetail = async () => {
|
|||
const data = res.data;
|
||||
downloadFilePDF(data, `Candidate_Detail_${dateToISO(new Date())}.xlsx`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -638,8 +638,8 @@ const downloadFileDashboard = async () => {
|
|||
`Candidate_Dashboard_${dateToISO(new Date())}.xlsx`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ const fileDownload = async (no: number, type: string, fileName: string) => {
|
|||
.then(async (res) => {
|
||||
downloadFile(res, `${fileName}.${type}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -950,8 +950,8 @@ async function clickdownloadFile(type: string) {
|
|||
`แบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ-${fullname.value}.${type}`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -160,8 +160,8 @@ async function clickdownloadFile(type: string) {
|
|||
.then((res) => {
|
||||
downloadFile(res, `แบบรายงานการประเมินฯ_${fullname.value}.${type}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -37,13 +37,15 @@ const dataRole = ref<string>("mentor");
|
|||
/** get ข้อมูล มอบหมาย
|
||||
* @param id person id
|
||||
*/
|
||||
async function fecthAssign(id: string){
|
||||
async function fecthAssign(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.formevaluate(id))
|
||||
.then(async (res: any) => {
|
||||
await fecthdataAssign(res.data.data);
|
||||
fullname.value = res.data.data.experimentee ? res.data.data.experimentee.name : "";
|
||||
fullname.value = res.data.data.experimentee
|
||||
? res.data.data.experimentee.name
|
||||
: "";
|
||||
dataArrayNumber.value = 1;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
|
|
@ -52,19 +54,19 @@ async function fecthAssign(id: string){
|
|||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* เปลี่ยน tab
|
||||
* @param tabVal type
|
||||
*/
|
||||
function changeTab(tabVal: string){
|
||||
function changeTab(tabVal: string) {
|
||||
tab.value = tabVal;
|
||||
dataArrayNumber.value = Number(tabVal.charAt(4));
|
||||
};
|
||||
}
|
||||
|
||||
/** convert file */
|
||||
function downloadFile(response: any, filename: string){
|
||||
function downloadFile(response: any, filename: string) {
|
||||
const link = document.createElement("a");
|
||||
var fileName = filename;
|
||||
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
||||
|
|
@ -72,10 +74,10 @@ function downloadFile(response: any, filename: string){
|
|||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
}
|
||||
|
||||
/** download file */
|
||||
async function FileDownload(type: string){
|
||||
async function FileDownload(type: string) {
|
||||
let numTab = probationStore.evaluate.find(
|
||||
(e: any) => e.no === dataArrayNumber.value
|
||||
);
|
||||
|
|
@ -92,8 +94,8 @@ async function FileDownload(type: string){
|
|||
`แบบบันทึกผล(ผู้ดูเเล)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -111,21 +113,21 @@ async function FileDownload(type: string){
|
|||
`แบบบันทึกผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/** ไปหน้า page add */
|
||||
function addData(){
|
||||
function addData() {
|
||||
router.push(
|
||||
`/probation/detail/addresult/${personalId.value}/${assignId.value}`
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await fecthAssign(assignId.value);
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ onMounted(async () => {
|
|||
|
||||
/**
|
||||
* get data
|
||||
* @param id person id
|
||||
* @param id person id
|
||||
*/
|
||||
async function fecthAssign(id: string){
|
||||
async function fecthAssign(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.formevaluateCommander(id))
|
||||
|
|
@ -59,19 +59,19 @@ async function fecthAssign(id: string){
|
|||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* เปลี่ยน tab
|
||||
* @param tabVal type
|
||||
* @param tabVal type
|
||||
*/
|
||||
function changeTab(tabVal: string){
|
||||
function changeTab(tabVal: string) {
|
||||
tab.value = tabVal;
|
||||
dataArrayNumber.value = Number(tabVal.charAt(4));
|
||||
};
|
||||
}
|
||||
|
||||
/** เปลี่ยน type file */
|
||||
function downloadFile(response: any, filename: string){
|
||||
function downloadFile(response: any, filename: string) {
|
||||
const link = document.createElement("a");
|
||||
var fileName = filename;
|
||||
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
||||
|
|
@ -79,13 +79,13 @@ function downloadFile(response: any, filename: string){
|
|||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* download file
|
||||
* @param type type
|
||||
*/
|
||||
async function FileDownload(type: string){
|
||||
async function FileDownload(type: string) {
|
||||
let numTab = probationStore.evaluate.find(
|
||||
(e: any) => e.no === dataArrayNumber.value
|
||||
);
|
||||
|
|
@ -102,8 +102,8 @@ async function FileDownload(type: string){
|
|||
`แบบบันทึกผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -121,21 +121,21 @@ async function FileDownload(type: string){
|
|||
`แบบบันทึกผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/** เปลี่ยนหน้า เพิ่ม */
|
||||
function addData(){
|
||||
function addData() {
|
||||
router.push(
|
||||
`/probation/detail/addevaluacommander/${personalId.value}/${assignId.value}`
|
||||
);
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -37,12 +37,12 @@ const evaluate = ref<any>([]);
|
|||
|
||||
/**
|
||||
* เปลี่ยน tab
|
||||
* @param tabVal type
|
||||
* @param tabVal type
|
||||
*/
|
||||
function changeTab(tabVal: string){
|
||||
function changeTab(tabVal: string) {
|
||||
tab.value = tabVal;
|
||||
dataArrayNumber.value = Number(tabVal.charAt(4));
|
||||
};
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fecthAssign(assignId.value);
|
||||
|
|
@ -50,9 +50,9 @@ onMounted(() => {
|
|||
|
||||
/**
|
||||
* get data
|
||||
* @param id person id
|
||||
* @param id person id
|
||||
*/
|
||||
async function fecthAssign(id: string){
|
||||
async function fecthAssign(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.createformCommader(id))
|
||||
|
|
@ -60,7 +60,9 @@ onMounted(() => {
|
|||
await fecthdataAssign(res.data.data);
|
||||
evaluate.value = probationStore.evaluate;
|
||||
tabs.value = evaluate.value;
|
||||
fullname.value = res.data.data.experimentee ? res.data.data.experimentee.name : "";
|
||||
fullname.value = res.data.data.experimentee
|
||||
? res.data.data.experimentee.name
|
||||
: "";
|
||||
dataArrayNumber.value = 1;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
|
|
@ -69,10 +71,10 @@ onMounted(() => {
|
|||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/** เปลี่ยน type file */
|
||||
function downloadFile(response: any, filename: string){
|
||||
function downloadFile(response: any, filename: string) {
|
||||
const link = document.createElement("a");
|
||||
var fileName = filename;
|
||||
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
||||
|
|
@ -80,13 +82,13 @@ function downloadFile(response: any, filename: string){
|
|||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* download file
|
||||
* @param type type
|
||||
*/
|
||||
async function FileDownload(type: string){
|
||||
async function FileDownload(type: string) {
|
||||
let numTab = evaluate.value.find((e: any) => e.no === dataArrayNumber.value);
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -99,20 +101,20 @@ function downloadFile(response: any, filename: string){
|
|||
`แบบประเมินผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/** เปลี่ยนหน้า เพิ่ม */
|
||||
function addData(){
|
||||
function addData() {
|
||||
router.push(
|
||||
`/probation/detail/addevalua/${personalId.value}/${assignId.value}`
|
||||
);
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -47,7 +47,9 @@ const fecthAssign = async (id: string) => {
|
|||
.then(async (res: any) => {
|
||||
await fecthdataAssign(res.data.data);
|
||||
evaluate.value = probationStore.evaluate;
|
||||
fullname.value = res.data.data.experimentee ? res.data.data.experimentee.name : "";
|
||||
fullname.value = res.data.data.experimentee
|
||||
? res.data.data.experimentee.name
|
||||
: "";
|
||||
tabs.value = evaluate.value;
|
||||
dataArrayNumber.value = 1;
|
||||
})
|
||||
|
|
@ -81,8 +83,8 @@ const FileDownload = async (type: string) => {
|
|||
`แบบประเมินผล(คณะกรรมการ)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -357,8 +357,8 @@ const downloadAttachment = async (type: string, id: string) => {
|
|||
.then(async (res) => {
|
||||
downloadFile(res, `${"รายชื่อผู้เกษียณอายุราชการ"}.${type}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -90,8 +90,8 @@ const fileDownload = async (type: string) => {
|
|||
`รายละเอียดบันทึกเวียนแจ้งการถึงแก่กรรม-${fullName}.${type}`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -403,8 +403,8 @@ const fileDownload = async (type: string, fileName: string) => {
|
|||
.then(async (res) => {
|
||||
downloadFile(res, `${fileName}.${type}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ async function downloadDocument(type: string) {
|
|||
);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -126,8 +126,8 @@ const downloadReport = async (
|
|||
showDocument(url);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ const downloadReport = async (
|
|||
showDocument(url);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -186,7 +186,7 @@ const filterSelector = (val: any, update: Function, name: any) => {
|
|||
@filter="(inputValue:any,doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn,'selectList') "
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
|
|
|
|||
|
|
@ -139,8 +139,8 @@ async function genReportXLSX(data: any) {
|
|||
const blob = new Blob([res.data]);
|
||||
downloadReport(blob, "xlsx");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -118,8 +118,8 @@ async function genReport(data: any) {
|
|||
hideLoader();
|
||||
}, 1500);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -144,8 +144,8 @@ async function genReportXLSX(data: any) {
|
|||
const blob = new Blob([res.data]);
|
||||
downloadReport(blob, "xlsx");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -129,8 +129,8 @@ const downloadCover = async (type: string) => {
|
|||
.then(async (res) => {
|
||||
downloadFile(res, `คำสั่ง ${orderName.value}.${type}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -161,8 +161,8 @@ const downloadAttachment = async (type: string) => {
|
|||
.then(async (res) => {
|
||||
downloadFile(res, `เอกสารแนบท้าย ${orderName.value}.${type}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -207,14 +207,16 @@ const fetchReportCover = async (type: string, orderId: string) => {
|
|||
viewPDF(orderCoverPdf.value);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
!genReportStatus.value
|
||||
? messageError($q, JSON.parse(await e.response.data.text()))
|
||||
: messageError($q, e);
|
||||
});
|
||||
};
|
||||
// เรียกไฟล์ เอกสารแนบท้าย
|
||||
|
|
@ -228,8 +230,8 @@ const fetchReportAttachment = async (type: string, orderId: string) => {
|
|||
const objectUrl = URL.createObjectURL(blob);
|
||||
orderAttachmentPdf.value = objectUrl;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ function getPDF(url: string, type: string) {
|
|||
hideLoader();
|
||||
}, 1500);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
store.log = 0;
|
||||
|
|
@ -138,7 +138,9 @@ onMounted(async () => {
|
|||
active-class="text-primary"
|
||||
@click="handleItemClick(2)"
|
||||
>
|
||||
<q-item-section class="q-py-sm">แบบแสดงรายละเอียดการเสนอผลงาน</q-item-section>
|
||||
<q-item-section class="q-py-sm"
|
||||
>แบบแสดงรายละเอียดการเสนอผลงาน</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
|
|
@ -147,7 +149,8 @@ onMounted(async () => {
|
|||
active-class="text-primary"
|
||||
@click="handleItemClick(3)"
|
||||
>
|
||||
<q-item-section class="q-py-sm">แบบตรวจสอบความถูกต้องครบถ้วนของข้อมูลเพื่อประกอบการคัดเลือกบุคคล
|
||||
<q-item-section class="q-py-sm"
|
||||
>แบบตรวจสอบความถูกต้องครบถ้วนของข้อมูลเพื่อประกอบการคัดเลือกบุคคล
|
||||
(เอกสารแบบ ก)</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
|
|
@ -158,7 +161,9 @@ onMounted(async () => {
|
|||
active-class="text-primary"
|
||||
@click="handleItemClick(4)"
|
||||
>
|
||||
<q-item-section class="q-py-sm"> แบบประเมินคุณลักษณะบุคคล </q-item-section>
|
||||
<q-item-section class="q-py-sm">
|
||||
แบบประเมินคุณลักษณะบุคคล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
|
|
@ -178,7 +183,9 @@ onMounted(async () => {
|
|||
active-class="text-primary"
|
||||
@click="handleItemClick(6)"
|
||||
>
|
||||
<q-item-section class="q-py-sm"> ผลงานที่จะส่งประเมิน (เอกสารหมายเลข 11) </q-item-section>
|
||||
<q-item-section class="q-py-sm">
|
||||
ผลงานที่จะส่งประเมิน (เอกสารหมายเลข 11)
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -159,7 +159,9 @@ async function getPDF(url: string, type: string, fileName: string) {
|
|||
a.download = fileName;
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {})
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,8 +86,8 @@ function getPDF(url: string, type: string) {
|
|||
hideLoader();
|
||||
}, 1500);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
store.log = 0;
|
||||
|
|
|
|||
|
|
@ -145,8 +145,8 @@ const downloadCover = async (type: string) => {
|
|||
.then(async (res) => {
|
||||
downloadFile(res, `คำสั่ง ${orderName.value}.${type}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -206,14 +206,16 @@ const fetchReportCover = async (type: string, orderId: string) => {
|
|||
viewPDF(orderCoverPdf.value);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
!genReportStatus.value
|
||||
? messageError($q, JSON.parse(await e.response.data.text()))
|
||||
: messageError($q, e);
|
||||
});
|
||||
};
|
||||
// เรียกไฟล์ เอกสารแนบท้าย
|
||||
|
|
@ -227,8 +229,8 @@ const fetchReportAttachment = async (type: string, orderId: string) => {
|
|||
const objectUrl = URL.createObjectURL(blob);
|
||||
orderAttachmentPdf.value = objectUrl;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -212,8 +212,8 @@ function downloadFile(url: string, type: string, fileName: string) {
|
|||
a.download = fileName;
|
||||
a.click();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -174,8 +174,8 @@ async function downloadFile(url: string, type: string, fileName: string) {
|
|||
a.download = fileName;
|
||||
a.click();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ async function genReportXLSX(
|
|||
URL.revokeObjectURL(url);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue