feat:view pdf

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-02-10 16:16:47 +07:00
parent 0c88ef429b
commit 0a3ce7b272
2 changed files with 337 additions and 1 deletions

View file

@ -42,6 +42,7 @@ const DialogResign = defineAsyncComponent(
const DialogTransfer = defineAsyncComponent(
() => import("@/modules/04_registryPerson/components/DialogTransfer.vue")
);
const ViewPDF = defineAsyncComponent(() => import("@/components/ViewPDF.vue"));
/** use*/
const $q = useQuasar();
@ -80,6 +81,10 @@ const formDetail = ref<ResponseObject>(); //ข้อมูลส่วนตั
const modalDialogResign = ref<boolean>(false); //
const modalDialogTransfer = ref<boolean>(false); //
const modalDialogRetired = ref<boolean>(false); //
const modalDialogViewPDF = ref<boolean>(false); // PDF
const selectedDataFile = ref<any | undefined>(undefined); // PDF
const titleDialogViewPDF = ref<string>(""); // PDF
//
const baseItemsMenu = ref<DataOptionSys[]>([
@ -436,7 +441,11 @@ async function onClickDownloadKp7(type: string) {
.get(url)
.then(async (res) => {
const data = await res.data.result;
await genReport(data, `${fileName}`, type);
selectedDataFile.value = data;
titleDialogViewPDF.value = fileName;
modalDialogViewPDF.value = true;
// await genReport(data, `${fileName}`, type);
})
.catch((err) => {
messageError($q, err);
@ -1257,6 +1266,12 @@ onMounted(async () => {
<DialogResign v-model:modal="modalDialogResign" />
<!-- ขอโอน -->
<DialogTransfer v-model:modal="modalDialogTransfer" />
<ViewPDF
v-model:modal="modalDialogViewPDF"
:dataFile="selectedDataFile"
:title="titleDialogViewPDF"
/>
</template>
<style scoped>