แก้ ui ดาวน์โหลด
This commit is contained in:
parent
0290f5cd77
commit
e89eeeaba3
3 changed files with 23 additions and 17 deletions
|
|
@ -686,7 +686,7 @@ const viewFileUpload = async (url: string) => {
|
|||
v-model="fileOrder"
|
||||
label="เลือกไฟล์คำสั่ง"
|
||||
hide-bottom-space
|
||||
:rules="[(val) => val || 'กรุณาเลือกไฟล์ไฟล์คำสั่ง']"
|
||||
:rules="[(val:string) => val || 'กรุณาเลือกไฟล์ไฟล์คำสั่ง']"
|
||||
accept=".pdf"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
|
|
@ -729,7 +729,7 @@ const viewFileUpload = async (url: string) => {
|
|||
v-model="fileTailer"
|
||||
label="เลือกไฟล์เอกสารแนบท้าย"
|
||||
hide-bottom-space
|
||||
:rules="[(val) => val || 'กรุณาเลือกไฟล์เอกสารแนบท้าย']"
|
||||
:rules="[(val:string) => val || 'กรุณาเลือกไฟล์เอกสารแนบท้าย']"
|
||||
accept=".pdf"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
|
|
@ -779,7 +779,7 @@ const viewFileUpload = async (url: string) => {
|
|||
:readonly="!true"
|
||||
:borderless="!true"
|
||||
v-model="order"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเลขที่คำสั่ง'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่คำสั่ง'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'เลขที่คำสั่ง'}`"
|
||||
:disable="orderStatusName == 'ออกคำสั่งแล้ว'"
|
||||
|
|
@ -814,7 +814,7 @@ const viewFileUpload = async (url: string) => {
|
|||
dense
|
||||
:model-value="years + 543"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกปีที่ออกคำสั่ง'}`,
|
||||
(val:string) => !!val || `${'กรุณาเลือกปีที่ออกคำสั่ง'}`,
|
||||
]"
|
||||
hide-bottom-space
|
||||
:label="`${'ปีที่ออกคำสั่ง'}`"
|
||||
|
|
@ -865,7 +865,7 @@ const viewFileUpload = async (url: string) => {
|
|||
:model-value="date != null ? date2Thai(date) : null"
|
||||
:label="`${'วันที่ลงนาม'}`"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกวันที่ลงนาม'}`,
|
||||
(val:string) => !!val || `${'กรุณาเลือกวันที่ลงนาม'}`,
|
||||
]"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ const {
|
|||
} = mixin;
|
||||
|
||||
const isChangeData = defineModel<boolean>("isChangeData", { required: true });
|
||||
const isAttachment = defineModel<boolean>("isAttachment", { required: true });
|
||||
const { onCheckChangeData } = defineProps({
|
||||
onCheckChangeData: { type: Function, required: true },
|
||||
});
|
||||
|
|
@ -33,7 +34,6 @@ const page = ref<number>(1);
|
|||
const numOfPages = ref<number>(0); //จำนวนหน้า pdf
|
||||
const pdfSrc = ref<PDFDocumentLoadingTask | undefined>(); // ตัวแปรเก็บ เเสดง pdf
|
||||
|
||||
const isAttachment = ref<boolean>(true);
|
||||
const dialog = ref<boolean>(false); // เปิด dialog
|
||||
|
||||
/**
|
||||
|
|
@ -178,7 +178,11 @@ onMounted(async () => {
|
|||
<div class="q-pr-sm">คำสั่ง</div>
|
||||
</div>
|
||||
|
||||
<div @click="setTab('second')" :class="getClass(tab == 'second')">
|
||||
<div
|
||||
v-if="isAttachment"
|
||||
@click="setTab('second')"
|
||||
:class="getClass(tab == 'second')"
|
||||
>
|
||||
<div class="q-pr-sm">เอกสารแนบท้าย</div>
|
||||
</div>
|
||||
<q-space />
|
||||
|
|
@ -195,24 +199,23 @@ onMounted(async () => {
|
|||
<div class="q-pa-sm">
|
||||
<div class="q-pa-sm row q-gutter-sm">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="red"
|
||||
icon="mdi-file-pdf"
|
||||
icon-right="mdi-file-pdf"
|
||||
label="ดาวน์โหลด ไฟล์ .PDF"
|
||||
@click="downloadCover('pdf')"
|
||||
class="q-pa-sm"
|
||||
>
|
||||
<q-tooltip>ไฟล์ .PDF</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
flat
|
||||
class="q-pa-sm"
|
||||
dense
|
||||
round
|
||||
color="blue"
|
||||
icon="mdi-file-word"
|
||||
icon-right="mdi-file-word"
|
||||
label="ดาวน์โหลด ไฟล์ .docx"
|
||||
@click="downloadCover('docx')"
|
||||
>
|
||||
<q-tooltip>ไฟล์ .docx</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-card bordered class="card-pdf q-mx-sm q-pa-md">
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ const router = useRouter();
|
|||
const route = useRoute();
|
||||
const commandId = ref<string>(route.params.id.toString()); //ID คำสั่ง
|
||||
const store = useCommandDetail();
|
||||
const isMomFirst = ref<boolean>(false);
|
||||
const isAttachment = ref<boolean>(true);
|
||||
|
||||
const childDetailRef = ref<InstanceType<typeof Detail> | null>(null); //ref components รายละเอียดคำสั่ง
|
||||
const childListPersonsRef = ref<InstanceType<typeof ListPersons> | null>(null); //ref components รายชื่อผู้ออกคำสั่ง
|
||||
|
|
@ -86,7 +86,9 @@ async function fetchDataCommandList() {
|
|||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
formCommandList = data;
|
||||
isChangeData.value = false;
|
||||
//รอ API ส่งมา isAttachment.value = data.isAttachment ;
|
||||
isAttachment.value = true; // จำลอง
|
||||
isChangeData.value = false; //จำลอง
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -215,6 +217,7 @@ onMounted(async () => {
|
|||
ref="childAttachedRef"
|
||||
v-model:is-change-data="isChangeData"
|
||||
:on-check-change-data="onCheckChangeData"
|
||||
v-model:is-attachment="isAttachment"
|
||||
/>
|
||||
</q-card>
|
||||
</q-tab-panel>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue