download file ทดลองงาน
This commit is contained in:
parent
c63539190d
commit
c014962eed
8 changed files with 85 additions and 77 deletions
|
|
@ -6,6 +6,8 @@ import { useQuasar } from "quasar";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
const $q = useQuasar();
|
||||
const isEdit = ref<boolean>(true);
|
||||
const router = useRouter();
|
||||
|
|
@ -917,21 +919,21 @@ function downloadFile(response: any, filename: string) {
|
|||
async function clickdownloadFile(type: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.reportAssign(type, assignId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
downloadFile(
|
||||
res,
|
||||
`แบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ-${fullname.value}.${type}`
|
||||
.get(config.API.reportAssign(type, assignId.value))
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
await genReport(
|
||||
data,
|
||||
`แบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ-${fullname.value}`,
|
||||
type
|
||||
);
|
||||
hideLoader();
|
||||
})
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
/** เช็ค จำนวนเดือน เเละ วันที่เริ่ม ไม่เท่ากับ undefined*/
|
||||
|
|
@ -1088,7 +1090,7 @@ onMounted(async () => {
|
|||
<div v-else class="col-12 row q-gutter-md">
|
||||
<div>แบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ</div>
|
||||
<q-btn
|
||||
v-if="!isEdit && !checkRoutePermisson"
|
||||
v-if="!isEdit"
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue