update detail ทุน
This commit is contained in:
parent
db363a7392
commit
9f01c9ac4c
1 changed files with 51 additions and 6 deletions
|
|
@ -401,12 +401,53 @@ function upDate(data: DataPerson) {
|
|||
}
|
||||
}
|
||||
|
||||
const fileBackReceived = ref<string>("");
|
||||
async function checkFileBackReceived(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.file("ระบบพัฒนาบุคคล", "ฟอร์มรายงานตัวกลับเข้ารับราชการ", id)
|
||||
)
|
||||
.then(async (res) => {
|
||||
fileBackReceived.value = res.data.length > 0 ? res.data[0].fileName : "";
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function downloadFileBackReceived() {
|
||||
showLoader();
|
||||
http
|
||||
.get(
|
||||
config.API.fileByFile(
|
||||
"ระบบพัฒนาบุคคล",
|
||||
"ฟอร์มรายงานตัวกลับเข้ารับราชการ",
|
||||
id,
|
||||
fileBackReceived.value
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.downloadUrl;
|
||||
window.open(data, "_blank");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (scholarshipId.value) {
|
||||
fetchDataDetail(scholarshipId.value);
|
||||
checkFileBackReceived(scholarshipId.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="row items-center">
|
||||
<div class="toptitle text-dark items-center">
|
||||
|
|
@ -422,13 +463,17 @@ onMounted(() => {
|
|||
{{ `${title}ข้าราชการฯที่ได้รับทุนการศึกษา/ฝึกอบรม` }}
|
||||
</div>
|
||||
<q-space />
|
||||
<q-icon
|
||||
name="download"
|
||||
class="cursor-pointer"
|
||||
size="sm"
|
||||
style="color: var(--q-primary)"
|
||||
<q-btn
|
||||
v-if="fileBackReceived != ''"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="download"
|
||||
color="blue"
|
||||
@click="downloadFileBackReceived()"
|
||||
>
|
||||
</q-icon>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<div class="row q-ml-md" v-if="scholarshipId">
|
||||
<div class="q-gutter-sm" v-if="isStatus === 'PENDING'">
|
||||
<q-btn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue