fix ViewCommand
This commit is contained in:
parent
c33ece8586
commit
26a1270dd2
5 changed files with 113 additions and 41 deletions
|
|
@ -7,8 +7,6 @@ import { VuePDF, usePDF } from "@tato30/vue-pdf";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import genReport from "@/plugins/genreport";
|
||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
|
|
@ -21,7 +19,6 @@ const { showLoader, hideLoader, messageError } = useCounterMixin();
|
|||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const command = defineModel<string>("command", { required: true });
|
||||
const commandId = defineModel<string>("commandId", { required: true });
|
||||
const issue = ref<string | null>(null);
|
||||
const promises = ref<any>([]);
|
||||
|
||||
const tab = ref<string>("main"); //tab
|
||||
|
|
@ -80,21 +77,8 @@ async function checkAttachment() {
|
|||
async function downloadCover(type: string) {
|
||||
if (tab.value === "main") {
|
||||
window.open(dataCover.value?.downloadUrl, "_blank");
|
||||
|
||||
// genReport(
|
||||
// dataCover.value,
|
||||
// `คำสั่ง ${issue.value}`,
|
||||
// type,
|
||||
// "?folder=command"
|
||||
// );
|
||||
} else {
|
||||
window.open(dataAttachment.value?.downloadUrl, "_blank");
|
||||
// genReportXLSX(
|
||||
// dataAttachment.value,
|
||||
// `เอกสารแนบท้าย ${issue.value}`,
|
||||
// type,
|
||||
// "?folder=command"
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -161,11 +145,9 @@ watch(
|
|||
if (modal.value) {
|
||||
showLoader();
|
||||
promises.value = [checkAttachment(), fetchDataCommand("cover")];
|
||||
|
||||
await Promise.all(promises.value)
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
hideLoader();
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -177,9 +159,7 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* check tab เมื่อมีการเปลี่ยน tab
|
||||
*/
|
||||
/** check tab เมื่อมีการเปลี่ยน tab*/
|
||||
watch(
|
||||
() => tab.value,
|
||||
() => {
|
||||
|
|
@ -198,7 +178,7 @@ watch(
|
|||
<DialogHeader :tittle="`คำสั่ง ${command}`" :close="closeDialog" />
|
||||
<q-separator />
|
||||
|
||||
<q-card-section class="scroll" style="max-height: 90vh;">
|
||||
<q-card-section class="scroll" style="max-height: 90vh">
|
||||
<div class="space">
|
||||
<div @click="setTab('main')" :class="getClass(tab == 'main')">
|
||||
<div class="q-pr-sm">คำสั่ง</div>
|
||||
|
|
@ -231,6 +211,7 @@ watch(
|
|||
label="ดาวน์โหลดไฟล์ PDF"
|
||||
@click="downloadCover('pdf')"
|
||||
class="q-px-sm"
|
||||
:loading="!isLoadView"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue