From 2f1230ee1d0328838bf046b82e7a642e35aa1d0a Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 9 Oct 2024 15:38:48 +0700 Subject: [PATCH] fix command --- src/modules/05_command/components/FormTemplate.vue | 2 +- src/modules/05_command/components/ViewPdf.vue | 5 +++-- src/modules/05_command/views/lists.vue | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/05_command/components/FormTemplate.vue b/src/modules/05_command/components/FormTemplate.vue index 9a11352f..e4e0d286 100644 --- a/src/modules/05_command/components/FormTemplate.vue +++ b/src/modules/05_command/components/FormTemplate.vue @@ -33,7 +33,7 @@ const textHeader = ref(""); const textBody = ref(""); const textFooter = ref(""); -function fetchData(data: DataTemplateDetail) { +async function fetchData(data: DataTemplateDetail) { textHeader.value = data.detailHeader; textBody.value = data.detailBody; textFooter.value = data.detailFooter; diff --git a/src/modules/05_command/components/ViewPdf.vue b/src/modules/05_command/components/ViewPdf.vue index 5dcf63f3..e4870717 100644 --- a/src/modules/05_command/components/ViewPdf.vue +++ b/src/modules/05_command/components/ViewPdf.vue @@ -59,8 +59,8 @@ const { fetchDataTemplate } = defineProps({ */ async function fetchDocumentTemplate(dataTemple: DataTemplateDetail) { showLoader(); + isLoadPDF.value = false; const reportName = await `${dataTemplateDetail.value.code}_${type.value}`; - const body = { template: reportName, reportName: `${typeFile.value}-report`, @@ -78,6 +78,8 @@ async function fetchDocumentTemplate(dataTemple: DataTemplateDetail) { commandExcecuteDate: "..................", name: "....................................", position: "ผู้อำนวยการสำนัก/เขต", + authorizedUserFullName: "............", + authorizedPosition: "...................", }, }; @@ -94,7 +96,6 @@ async function fetchDocumentTemplate(dataTemple: DataTemplateDetail) { } ) .then(async (res) => { - isLoadPDF.value = false; const blob = new Blob([res.data]); const objectUrl = URL.createObjectURL(blob); const pdfData = await usePDF(`${objectUrl}`); diff --git a/src/modules/05_command/views/lists.vue b/src/modules/05_command/views/lists.vue index 9fd91076..3d70a283 100644 --- a/src/modules/05_command/views/lists.vue +++ b/src/modules/05_command/views/lists.vue @@ -224,7 +224,7 @@ async function fetchDataCommandTypeId(id: string) { await http .get(config.API.commandType + `/${id}`) .then(async (res) => { - const data = res.data.result; + const data = await res.data.result; dataTemplateDetail.value = data; await Promise.all([childTemplateDetailRef?.value?.fetchData(data)]); })