ออกคำสั่ง => แนบท้าย

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-08 18:28:05 +07:00
parent f6ea889258
commit 45b04affa6

View file

@ -128,19 +128,19 @@ const downloadCover = async (type: string) => {
//
const downloadAttachment = async (type: string) => {
if (type === "xlsx") {
genReportXLSX(
dataAttachmentxlxs.value,
`เอกสารแนบท้าย คำสั่ง ${orderName.value}`,
type
);
} else {
genReport(
dataAttachment.value,
`เอกสารแนบท้าย คำสั่ง ${orderName.value}`,
type
);
}
// if (type === "xlsx") {
// genReportXLSX(
// dataAttachmentxlxs.value,
// ` ${orderName.value}`,
// type
// );
// } else {
genReport(
dataAttachment.value,
`เอกสารแนบท้าย คำสั่ง ${orderName.value}`,
type
);
// }
};
const dataCover = ref<any>();
@ -160,7 +160,7 @@ const fetchReportCover = async (type: string, orderId: string) => {
};
const dataAttachment = ref<any>();
const dataAttachmentxlxs = ref<any>();
// const dataAttachmentxlxs = ref<any>();
//
const fetchReportAttachment = async (type: string, orderId: string) => {
showLoader();
@ -175,16 +175,16 @@ const fetchReportAttachment = async (type: string, orderId: string) => {
hideLoader();
});
showLoader();
await http
.get(config.API.reportOrderAttachment("xlsx", orderId, code.value))
.then(async (res) => {
dataAttachmentxlxs.value = res.data.result;
})
.catch(async (e) => {
messageError($q, e);
hideLoader();
});
// showLoader();
// await http
// .get(config.API.reportOrderAttachment("xlsx", orderId, code.value))
// .then(async (res) => {
// dataAttachmentxlxs.value = res.data.result;
// })
// .catch(async (e) => {
// messageError($q, e);
// hideLoader();
// });
};
function genPDf(data: any) {
@ -552,15 +552,15 @@ const viewFileUpload = async (url: string) => {
<q-item
clickable
v-close-popup
@click="downloadAttachment('xlsx')"
@click="downloadAttachment('docx')"
>
<!-- type="a"
:href="orderAttachmentXlsx"
target="_blank" -->
<q-item-section avatar
><q-icon color="green-7" name="mdi-file-excel"
><q-icon color="blue" name="mdi-file-word"
/></q-item-section>
<q-item-section>ไฟล .xls</q-item-section>
<q-item-section>ไฟล .docx</q-item-section>
</q-item>
</q-list>
</q-menu>