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 textBody = ref<string>("");
|
||||||
const textFooter = ref<string>("");
|
const textFooter = ref<string>("");
|
||||||
|
|
||||||
function fetchData(data: DataTemplateDetail) {
|
async function fetchData(data: DataTemplateDetail) {
|
||||||
textHeader.value = data.detailHeader;
|
textHeader.value = data.detailHeader;
|
||||||
textBody.value = data.detailBody;
|
textBody.value = data.detailBody;
|
||||||
textFooter.value = data.detailFooter;
|
textFooter.value = data.detailFooter;
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,8 @@ const { fetchDataTemplate } = defineProps({
|
||||||
*/
|
*/
|
||||||
async function fetchDocumentTemplate(dataTemple: DataTemplateDetail) {
|
async function fetchDocumentTemplate(dataTemple: DataTemplateDetail) {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
isLoadPDF.value = false;
|
||||||
const reportName = await `${dataTemplateDetail.value.code}_${type.value}`;
|
const reportName = await `${dataTemplateDetail.value.code}_${type.value}`;
|
||||||
|
|
||||||
const body = {
|
const body = {
|
||||||
template: reportName,
|
template: reportName,
|
||||||
reportName: `${typeFile.value}-report`,
|
reportName: `${typeFile.value}-report`,
|
||||||
|
|
@ -78,6 +78,8 @@ async function fetchDocumentTemplate(dataTemple: DataTemplateDetail) {
|
||||||
commandExcecuteDate: "..................",
|
commandExcecuteDate: "..................",
|
||||||
name: "....................................",
|
name: "....................................",
|
||||||
position: "ผู้อำนวยการสำนัก/เขต",
|
position: "ผู้อำนวยการสำนัก/เขต",
|
||||||
|
authorizedUserFullName: "............",
|
||||||
|
authorizedPosition: "...................",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -94,7 +96,6 @@ async function fetchDocumentTemplate(dataTemple: DataTemplateDetail) {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
isLoadPDF.value = false;
|
|
||||||
const blob = new Blob([res.data]);
|
const blob = new Blob([res.data]);
|
||||||
const objectUrl = URL.createObjectURL(blob);
|
const objectUrl = URL.createObjectURL(blob);
|
||||||
const pdfData = await usePDF(`${objectUrl}`);
|
const pdfData = await usePDF(`${objectUrl}`);
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,7 @@ async function fetchDataCommandTypeId(id: string) {
|
||||||
await http
|
await http
|
||||||
.get(config.API.commandType + `/${id}`)
|
.get(config.API.commandType + `/${id}`)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result;
|
const data = await res.data.result;
|
||||||
dataTemplateDetail.value = data;
|
dataTemplateDetail.value = data;
|
||||||
await Promise.all([childTemplateDetailRef?.value?.fetchData(data)]);
|
await Promise.all([childTemplateDetailRef?.value?.fetchData(data)]);
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue