แก้ไข itemlist download ไฟล์
- รายละเอียดการขอยกเลิกการลา - รายละเอียดการลา
This commit is contained in:
parent
8cfda78cb0
commit
7d90f443a0
3 changed files with 88 additions and 9 deletions
|
|
@ -48,6 +48,8 @@ const route = useRoute();
|
|||
const paramsId = route.params.id.toString();
|
||||
|
||||
const modalApprove = ref(false);
|
||||
const typeDocx = ref<string>("docx");
|
||||
const typePdf = ref<string>("pdf");
|
||||
const dialogTitleUnapprove = ref<string>("ไม่อนุมัติ");
|
||||
const dialogTitle = ref<string>("อนุมัติ");
|
||||
const dialogLabel = ref<string>("เหตุผล");
|
||||
|
|
@ -462,14 +464,15 @@ function clickSave(reason: string) {
|
|||
}
|
||||
}
|
||||
|
||||
async function onClickDownloadFile(id: string, fileName: string) {
|
||||
async function onClickDownloadFile(id: string, fileName: string, type: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.leaveReport(id))
|
||||
.then(async (res) => {
|
||||
console.log(res);
|
||||
const data = res.data.result;
|
||||
await genReport(data, fileName);
|
||||
await genReport(data, fileName, type);
|
||||
console.log(type);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -496,7 +499,7 @@ async function onClickDownloadFile(id: string, fileName: string) {
|
|||
รายละเอียดการลาของ {{ formData.fullName }}
|
||||
</div>
|
||||
<div>
|
||||
<q-btn
|
||||
<!-- <q-btn
|
||||
icon="mdi-download"
|
||||
unelevated
|
||||
round
|
||||
|
|
@ -506,7 +509,44 @@ async function onClickDownloadFile(id: string, fileName: string) {
|
|||
class="q-mr-sm"
|
||||
@click="onClickDownloadFile(formData.id, formData.leaveTypeName)"
|
||||
><q-tooltip>ดาวน์โหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
> -->
|
||||
<q-btn class="q-mr-sm" icon="mdi-download" round color="primary" flat>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
onClickDownloadFile(
|
||||
formData.id,
|
||||
formData.leaveTypeName,
|
||||
typeDocx
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section class="text-blue"
|
||||
>ดาวน์โหลดไฟล์ .docx</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
onClickDownloadFile(
|
||||
formData.id,
|
||||
formData.leaveTypeName,
|
||||
typePdf
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section class="text-red"
|
||||
>ดาวน์โหลดไฟล์ .pdf</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-space />
|
||||
<!-- <q-file
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ const router = useRouter();
|
|||
const route = useRoute();
|
||||
const paramsId = route.params.id.toString();
|
||||
|
||||
const typeDocx = ref<string>("docx");
|
||||
const typePdf = ref<string>("pdf");
|
||||
const modalApprove = ref(false);
|
||||
const dialogTitleUnapprove = ref<string>("ไม่อนุมัติ");
|
||||
const dialogTitle = ref<string>("อนุมัติ");
|
||||
|
|
@ -405,14 +407,14 @@ function clickSave(reason: string) {
|
|||
}
|
||||
}
|
||||
|
||||
async function onClickDownloadFile(id: string, fileName: string) {
|
||||
async function onClickDownloadFile(id: string, fileName: string, type: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.leaveReportReject(id))
|
||||
.then(async (res) => {
|
||||
console.log(res);
|
||||
const data = res.data.result;
|
||||
await genReport(data, fileName);
|
||||
await genReport(data, fileName, type);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -439,7 +441,7 @@ async function onClickDownloadFile(id: string, fileName: string) {
|
|||
รายละเอียดการขอยกเลิกของ {{ formData.fullName }}
|
||||
</div>
|
||||
<div>
|
||||
<q-btn
|
||||
<!-- <q-btn
|
||||
icon="mdi-download"
|
||||
unelevated
|
||||
round
|
||||
|
|
@ -449,7 +451,44 @@ async function onClickDownloadFile(id: string, fileName: string) {
|
|||
class="q-mr-sm"
|
||||
@click="onClickDownloadFile(formData.id, formData.leaveTypeName)"
|
||||
><q-tooltip>ดาวน์โหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
> -->
|
||||
<q-btn class="q-mr-sm" icon="mdi-download" round color="primary" flat>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
onClickDownloadFile(
|
||||
formData.id,
|
||||
formData.leaveTypeName,
|
||||
typeDocx
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section class="text-blue"
|
||||
>ดาวน์โหลดไฟล์ .docx</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
onClickDownloadFile(
|
||||
formData.id,
|
||||
formData.leaveTypeName,
|
||||
typePdf
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section class="text-red"
|
||||
>ดาวน์โหลดไฟล์ .pdf</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-space />
|
||||
<!-- <q-file
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue