fix command
This commit is contained in:
parent
c8a9dbb259
commit
2f1230ee1d
3 changed files with 5 additions and 4 deletions
|
|
@ -33,7 +33,7 @@ const textHeader = ref<string>("");
|
|||
const textBody = ref<string>("");
|
||||
const textFooter = ref<string>("");
|
||||
|
||||
function fetchData(data: DataTemplateDetail) {
|
||||
async function fetchData(data: DataTemplateDetail) {
|
||||
textHeader.value = data.detailHeader;
|
||||
textBody.value = data.detailBody;
|
||||
textFooter.value = data.detailFooter;
|
||||
|
|
|
|||
|
|
@ -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}`);
|
||||
|
|
|
|||
|
|
@ -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)]);
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue