สเตป4
This commit is contained in:
parent
f02ddcf93a
commit
2ef5a7b845
2 changed files with 443 additions and 100 deletions
|
|
@ -12,4 +12,9 @@ export default {
|
||||||
`${reportOrder}/attachment/${fileType}/${id}`,
|
`${reportOrder}/attachment/${fileType}/${id}`,
|
||||||
reportRetireList: (fileType: string, id: string) =>
|
reportRetireList: (fileType: string, id: string) =>
|
||||||
`${reportRetire}/${fileType}/${id}`,
|
`${reportRetire}/${fileType}/${id}`,
|
||||||
|
|
||||||
|
fileCover: (format: string, fileType: string, id: string) =>
|
||||||
|
`${reportOrder}/${format}/cover/${fileType}/${id}`,
|
||||||
|
fileAttachment: (format: string, fileType: string, id: string) =>
|
||||||
|
`${reportOrder}/${format}/attachment/${fileType}/${id}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,14 @@ import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai, messageError, showLoader, hideLoader, dialogConfirm, success } = mixin;
|
const {
|
||||||
|
date2Thai,
|
||||||
|
messageError,
|
||||||
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
dialogConfirm,
|
||||||
|
success,
|
||||||
|
} = mixin;
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
||||||
|
|
@ -21,6 +28,7 @@ const splitterModel = ref<number>(70);
|
||||||
const tab = ref<string>("main");
|
const tab = ref<string>("main");
|
||||||
|
|
||||||
const order = ref<string>("");
|
const order = ref<string>("");
|
||||||
|
const code = ref<string>("");
|
||||||
const years = ref<number>(new Date().getDate());
|
const years = ref<number>(new Date().getDate());
|
||||||
const date = ref<Date>(new Date());
|
const date = ref<Date>(new Date());
|
||||||
const fileOrder = ref<any>(null);
|
const fileOrder = ref<any>(null);
|
||||||
|
|
@ -39,21 +47,69 @@ const statusOrder = ref<string>();
|
||||||
const orderId = ref<string>(orderId_params.toString());
|
const orderId = ref<string>(orderId_params.toString());
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
if (orderId.value) {
|
if (orderId.value) {
|
||||||
fetchReportCover('pdf', orderId.value);
|
fetchReportCover("pdf", orderId.value);
|
||||||
fetchReportCover('docx', orderId.value);
|
fetchReportCover("docx", orderId.value);
|
||||||
fetchReportAttachment('pdf', orderId.value);
|
fetchReportAttachment("pdf", orderId.value);
|
||||||
fetchReportAttachment('xlsx', orderId.value);
|
fetchReportAttachment("xlsx", orderId.value);
|
||||||
fetchAttachment(orderId.value);
|
fetchAttachment(orderId.value);
|
||||||
fecthstatusOrder(orderId.value);
|
fecthstatusOrder(orderId.value);
|
||||||
|
getType();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const getType = async () => {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.detailOrder(orderId.value))
|
||||||
|
.then(async (res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
const orderTypeCode = data.orderTypeCode;
|
||||||
|
code.value = orderTypeCode ?? "";
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const downloadCover = async (type: string) => {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.fileCover(code.value, type, orderId.value))
|
||||||
|
.then(async (res) => {
|
||||||
|
downloadFile(res.data.result, "คำสั่ง");
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const downloadAttachment = async (type: string) => {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.fileCover(code.value, type, orderId.value))
|
||||||
|
.then(async (res) => {
|
||||||
|
downloadFile(res.data.result, "เอกสารแนบท้าย");
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const fetchReportCover = async (type: string, orderId: string) => {
|
const fetchReportCover = async (type: string, orderId: string) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.reportOrderCover(type, orderId))
|
.get(config.API.reportOrderCover(type, orderId))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
if (type == 'pdf') {
|
if (type == "pdf") {
|
||||||
orderCoverPdf.value = res.data.result;
|
orderCoverPdf.value = res.data.result;
|
||||||
viewPDF(orderCoverPdf.value);
|
viewPDF(orderCoverPdf.value);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -73,7 +129,7 @@ const fetchReportAttachment = async (type: string, orderId: string) => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.reportOrderAttachment(type, orderId))
|
.get(config.API.reportOrderAttachment(type, orderId))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
if (type == 'pdf') {
|
if (type == "pdf") {
|
||||||
orderAttachmentPdf.value = res.data.result;
|
orderAttachmentPdf.value = res.data.result;
|
||||||
} else {
|
} else {
|
||||||
orderAttachmentXlsx.value = res.data.result;
|
orderAttachmentXlsx.value = res.data.result;
|
||||||
|
|
@ -183,21 +239,27 @@ const onchangePage = (val: any) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const downloadFile = (response: any, filename: string) => {
|
||||||
|
const link = document.createElement("a");
|
||||||
|
var fileName = filename;
|
||||||
|
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
||||||
|
link.setAttribute("download", fileName);
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
};
|
||||||
|
|
||||||
const save = () => {
|
const save = () => {
|
||||||
if (myForm.value !== null) {
|
if (myForm.value !== null) {
|
||||||
myForm.value!.validate().then((success: Boolean) => {
|
myForm.value!.validate().then((success: Boolean) => {
|
||||||
if (success) {
|
if (success) {
|
||||||
dialogConfirm(
|
dialogConfirm($q, async () => {
|
||||||
$q,
|
await putOrderData();
|
||||||
async () => {
|
await postfileOrder();
|
||||||
await putOrderData();
|
await postfileTailer();
|
||||||
await postfileOrder();
|
await fetchAttachment(orderId.value);
|
||||||
await postfileTailer();
|
await fecthstatusOrder(orderId.value);
|
||||||
await fetchAttachment(orderId.value);
|
});
|
||||||
await fecthstatusOrder(orderId.value);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -222,15 +284,20 @@ const putOrderData = async () => {
|
||||||
const postfileOrder = async () => {
|
const postfileOrder = async () => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("File", fileOrder.value);
|
formData.append("File", fileOrder.value);
|
||||||
await http.post(config.API.attachmentOrderId(orderId.value), formData).then(() => {
|
await http
|
||||||
// fileOrder.value = null
|
.post(config.API.attachmentOrderId(orderId.value), formData)
|
||||||
});
|
.then(() => {
|
||||||
|
// fileOrder.value = null
|
||||||
|
});
|
||||||
};
|
};
|
||||||
const postfileTailer = async () => {
|
const postfileTailer = async () => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("File", fileTailer.value);
|
formData.append("File", fileTailer.value);
|
||||||
await http.post(config.API.attachmentFileId(orderId.value), formData).then(() => { //fileTailer.value = null
|
await http
|
||||||
});
|
.post(config.API.attachmentFileId(orderId.value), formData)
|
||||||
|
.then(() => {
|
||||||
|
//fileTailer.value = null
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const clickExecute = async (id: string) => {
|
const clickExecute = async (id: string) => {
|
||||||
|
|
@ -247,7 +314,7 @@ const clickExecute = async (id: string) => {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
"ยืนยันการออกคำสั่ง",
|
"ยืนยันการออกคำสั่ง",
|
||||||
"ต้องการยืนยันการออกคำสั่งนี้ใช่หรือไม่?",
|
"ต้องการยืนยันการออกคำสั่งนี้ใช่หรือไม่?"
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -270,32 +337,60 @@ const setTab = (val: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const viewFileUpload = async (url: string) => {
|
const viewFileUpload = async (url: string) => {
|
||||||
pdfFileUploadSrc.value = undefined
|
pdfFileUploadSrc.value = undefined;
|
||||||
await viewPDFUpload(url);
|
await viewPDFUpload(url);
|
||||||
|
|
||||||
dialogFileUpload.value = true
|
dialogFileUpload.value = true;
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div style="min-height: 70vh">
|
<div style="min-height: 70vh">
|
||||||
<q-splitter v-model="splitterModel" style="height: 70vh" @update:model-value="onchangePage">
|
<q-splitter
|
||||||
|
v-model="splitterModel"
|
||||||
|
style="height: 70vh"
|
||||||
|
@update:model-value="onchangePage"
|
||||||
|
>
|
||||||
<template v-slot:before>
|
<template v-slot:before>
|
||||||
<div class="space">
|
<div class="space">
|
||||||
<div @click="setTab('main')" :class="getClass(tab == 'main')">
|
<div @click="setTab('main')" :class="getClass(tab == 'main')">
|
||||||
<div class="q-pr-sm">คำสั่ง</div>
|
<div class="q-pr-sm">คำสั่ง</div>
|
||||||
<q-btn size="12px" flat dense icon="mdi-download" :disable="tab !== 'main'"
|
<q-btn
|
||||||
:color="tab !== 'main' ? 'grey' : 'add'">
|
size="12px"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
icon="mdi-download"
|
||||||
|
:disable="tab !== 'main'"
|
||||||
|
:color="tab !== 'main' ? 'grey' : 'add'"
|
||||||
|
>
|
||||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<q-list style="min-width: 150px">
|
<q-list style="min-width: 150px">
|
||||||
<q-item clickable v-close-popup type="a" :href="orderCoverPdf" target="_blank">
|
<q-item
|
||||||
<q-item-section avatar><q-icon color="red" name="mdi-file-pdf" /></q-item-section>
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="downloadCover('pdf')"
|
||||||
|
>
|
||||||
|
<!-- type="a"
|
||||||
|
:href="orderCoverPdf"
|
||||||
|
target="_blank" -->
|
||||||
|
<q-item-section avatar
|
||||||
|
><q-icon color="red" name="mdi-file-pdf"
|
||||||
|
/></q-item-section>
|
||||||
<q-item-section>ไฟล์ .PDF</q-item-section>
|
<q-item-section>ไฟล์ .PDF</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item clickable v-close-popup type="a" :href="orderCoverDocs" target="_blank">
|
<q-item
|
||||||
<q-item-section avatar><q-icon color="blue" name="mdi-file-word" /></q-item-section>
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="downloadCover('docx')"
|
||||||
|
>
|
||||||
|
<!-- type="a"
|
||||||
|
:href="orderCoverDocs"
|
||||||
|
target="_blank" -->
|
||||||
|
<q-item-section avatar
|
||||||
|
><q-icon color="blue" name="mdi-file-word"
|
||||||
|
/></q-item-section>
|
||||||
<q-item-section>ไฟล์ .docx</q-item-section>
|
<q-item-section>ไฟล์ .docx</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
|
|
@ -304,17 +399,41 @@ const viewFileUpload = async (url: string) => {
|
||||||
</div>
|
</div>
|
||||||
<div @click="setTab('second')" :class="getClass(tab == 'second')">
|
<div @click="setTab('second')" :class="getClass(tab == 'second')">
|
||||||
<div class="q-pr-sm">เอกสารแนบท้าย</div>
|
<div class="q-pr-sm">เอกสารแนบท้าย</div>
|
||||||
<q-btn size="12px" flat dense :color="tab !== 'second' ? 'grey' : 'add'" icon="mdi-download"
|
<q-btn
|
||||||
:disable="tab !== 'second'">
|
size="12px"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
:color="tab !== 'second' ? 'grey' : 'add'"
|
||||||
|
icon="mdi-download"
|
||||||
|
:disable="tab !== 'second'"
|
||||||
|
>
|
||||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<q-list style="min-width: 150px">
|
<q-list style="min-width: 150px">
|
||||||
<q-item clickable v-close-popup type="a" :href="orderAttachmentPdf" target="_blank">
|
<q-item
|
||||||
<q-item-section avatar><q-icon color="red" name="mdi-file-pdf" /></q-item-section>
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="downloadAttachment('pdf')"
|
||||||
|
>
|
||||||
|
<!-- type="a"
|
||||||
|
:href="orderAttachmentPdf"
|
||||||
|
target="_blank" -->
|
||||||
|
<q-item-section avatar
|
||||||
|
><q-icon color="red" name="mdi-file-pdf"
|
||||||
|
/></q-item-section>
|
||||||
<q-item-section>ไฟล์ .PDF</q-item-section>
|
<q-item-section>ไฟล์ .PDF</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item clickable v-close-popup type="a" :href="orderAttachmentXlsx" target="_blank">
|
<q-item
|
||||||
<q-item-section avatar><q-icon color="green-7" name="mdi-file-excel" /></q-item-section>
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="downloadAttachment('xlsx')"
|
||||||
|
>
|
||||||
|
<!-- type="a"
|
||||||
|
:href="orderAttachmentXlsx"
|
||||||
|
target="_blank" -->
|
||||||
|
<q-item-section avatar
|
||||||
|
><q-icon color="green-7" name="mdi-file-excel"
|
||||||
|
/></q-item-section>
|
||||||
<q-item-section>ไฟล์ .xls</q-item-section>
|
<q-item-section>ไฟล์ .xls</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
|
|
@ -322,12 +441,24 @@ const viewFileUpload = async (url: string) => {
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-btn class="text-dark" flat dense icon="mdi-fullscreen" color="add" @click="dialog = true" />
|
<q-btn
|
||||||
|
class="text-dark"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
icon="mdi-fullscreen"
|
||||||
|
color="add"
|
||||||
|
@click="dialog = true"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<q-separator style="margin-top: -1px; z-index: 1" />
|
<q-separator style="margin-top: -1px; z-index: 1" />
|
||||||
<q-card bordered class="card-pdf q-ma-md q-pa-md">
|
<q-card bordered class="card-pdf q-ma-md q-pa-md">
|
||||||
<div class="justify-between items-center align-center q-pb-sm row">
|
<div class="justify-between items-center align-center q-pb-sm row">
|
||||||
<q-btn class="text-dark bg-grey-4" flat dense @click="page = page > 1 ? page - 1 : page">
|
<q-btn
|
||||||
|
class="text-dark bg-grey-4"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
@click="page = page > 1 ? page - 1 : page"
|
||||||
|
>
|
||||||
<q-icon name="mdi-chevron-left" />
|
<q-icon name="mdi-chevron-left" />
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
|
@ -335,7 +466,12 @@ const viewFileUpload = async (url: string) => {
|
||||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<q-btn class="text-dark bg-grey-4" flat dense @click="page = page < numOfPages ? page + 1 : page">
|
<q-btn
|
||||||
|
class="text-dark bg-grey-4"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
@click="page = page < numOfPages ? page + 1 : page"
|
||||||
|
>
|
||||||
<q-icon name="mdi-chevron-right" />
|
<q-icon name="mdi-chevron-right" />
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -344,7 +480,12 @@ const viewFileUpload = async (url: string) => {
|
||||||
<!-- <VuePdf :key="page" :src="pdfSrc" :page="page" /> -->
|
<!-- <VuePdf :key="page" :src="pdfSrc" :page="page" /> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="justify-between items-center align-center q-pt-sm row">
|
<div class="justify-between items-center align-center q-pt-sm row">
|
||||||
<q-btn class="text-dark bg-grey-4" flat dense @click="page = page > 1 ? page - 1 : page">
|
<q-btn
|
||||||
|
class="text-dark bg-grey-4"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
@click="page = page > 1 ? page - 1 : page"
|
||||||
|
>
|
||||||
<q-icon name="mdi-chevron-left" />
|
<q-icon name="mdi-chevron-left" />
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
|
@ -352,7 +493,12 @@ const viewFileUpload = async (url: string) => {
|
||||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<q-btn class="text-dark bg-grey-4" flat dense @click="page = page < numOfPages ? page + 1 : page">
|
<q-btn
|
||||||
|
class="text-dark bg-grey-4"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
@click="page = page < numOfPages ? page + 1 : page"
|
||||||
|
>
|
||||||
<q-icon name="mdi-chevron-right" />
|
<q-icon name="mdi-chevron-right" />
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -360,7 +506,12 @@ const viewFileUpload = async (url: string) => {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:separator>
|
<template v-slot:separator>
|
||||||
<q-avatar color="primary" text-color="white" size="30px" icon="drag_indicator" />
|
<q-avatar
|
||||||
|
color="primary"
|
||||||
|
text-color="white"
|
||||||
|
size="30px"
|
||||||
|
icon="drag_indicator"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:after>
|
<template v-slot:after>
|
||||||
|
|
@ -372,17 +523,39 @@ const viewFileUpload = async (url: string) => {
|
||||||
<div>
|
<div>
|
||||||
<label class="text-file">คำสั่ง</label>
|
<label class="text-file">คำสั่ง</label>
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<q-btn size="12px" flat dense color="primary" icon="mdi-eye"
|
<q-btn
|
||||||
@click="viewFileUpload(OrderPDFUpload)">
|
size="12px"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
color="primary"
|
||||||
|
icon="mdi-eye"
|
||||||
|
@click="viewFileUpload(OrderPDFUpload)"
|
||||||
|
>
|
||||||
<q-tooltip>ดูไฟล์คำสั่ง</q-tooltip>
|
<q-tooltip>ดูไฟล์คำสั่ง</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-btn type="a" :href="OrderPDFUpload" size="12px" flat dense color="red" icon="mdi-download"
|
<q-btn
|
||||||
target="_blank">
|
type="a"
|
||||||
|
:href="OrderPDFUpload"
|
||||||
|
size="12px"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
color="red"
|
||||||
|
icon="mdi-download"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
<q-tooltip>ดาวน์โหลดเอกสารแนบท้าย</q-tooltip>
|
<q-tooltip>ดาวน์โหลดเอกสารแนบท้าย</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
<q-file outlined dense v-model="fileOrder" label="เลือกไฟล์คำสั่ง" hide-bottom-space lazy-rules
|
<q-file
|
||||||
:rules="[(val) => val || 'กรุณาเลือกไฟล์เอกสารแนบท้าย']" accept=".pdf">
|
outlined
|
||||||
|
dense
|
||||||
|
v-model="fileOrder"
|
||||||
|
label="เลือกไฟล์คำสั่ง"
|
||||||
|
hide-bottom-space
|
||||||
|
lazy-rules
|
||||||
|
:rules="[(val) => val || 'กรุณาเลือกไฟล์เอกสารแนบท้าย']"
|
||||||
|
accept=".pdf"
|
||||||
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon name="attach_file" />
|
<q-icon name="attach_file" />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -391,18 +564,40 @@ const viewFileUpload = async (url: string) => {
|
||||||
<div>
|
<div>
|
||||||
<label class="text-file">เอกสารแนบท้าย</label>
|
<label class="text-file">เอกสารแนบท้าย</label>
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<q-btn size="12px" flat dense color="primary" icon="mdi-eye"
|
<q-btn
|
||||||
@click="viewFileUpload(TailerPDFUpload)">
|
size="12px"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
color="primary"
|
||||||
|
icon="mdi-eye"
|
||||||
|
@click="viewFileUpload(TailerPDFUpload)"
|
||||||
|
>
|
||||||
<q-tooltip>ดูไฟล์คำสั่ง</q-tooltip>
|
<q-tooltip>ดูไฟล์คำสั่ง</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-btn type="a" :href="TailerPDFUpload" size="12px" flat dense color="red" icon="mdi-download"
|
<q-btn
|
||||||
target="_blank">
|
type="a"
|
||||||
|
:href="TailerPDFUpload"
|
||||||
|
size="12px"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
color="red"
|
||||||
|
icon="mdi-download"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
<q-tooltip>ดาวน์โหลดเอกสารแนบท้าย</q-tooltip>
|
<q-tooltip>ดาวน์โหลดเอกสารแนบท้าย</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-file outlined dense v-model="fileTailer" label="เลือกไฟล์เอกสารแนบท้าย" hide-bottom-space
|
<q-file
|
||||||
lazy-rules :rules="[(val) => val || 'กรุณาเลือกไฟล์เอกสารแนบท้าย']" accept=".pdf">
|
outlined
|
||||||
|
dense
|
||||||
|
v-model="fileTailer"
|
||||||
|
label="เลือกไฟล์เอกสารแนบท้าย"
|
||||||
|
hide-bottom-space
|
||||||
|
lazy-rules
|
||||||
|
:rules="[(val) => val || 'กรุณาเลือกไฟล์เอกสารแนบท้าย']"
|
||||||
|
accept=".pdf"
|
||||||
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon name="attach_file" />
|
<q-icon name="attach_file" />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -416,24 +611,51 @@ const viewFileUpload = async (url: string) => {
|
||||||
<div class="q-gutter-y-md q-mb-md">
|
<div class="q-gutter-y-md q-mb-md">
|
||||||
<div>
|
<div>
|
||||||
<label class="text-file">เลขที่คำสั่ง</label>
|
<label class="text-file">เลขที่คำสั่ง</label>
|
||||||
<q-input :outlined="true" dense lazy-rules :readonly="!true" :borderless="!true" v-model="order"
|
<q-input
|
||||||
:rules="[(val) => !!val || `${'กรุณากรอกเลขที่คำสั่ง'}`]" hide-bottom-space
|
:outlined="true"
|
||||||
:label="`${'เลขที่คำสั่ง'}`" />
|
dense
|
||||||
|
lazy-rules
|
||||||
|
:readonly="!true"
|
||||||
|
:borderless="!true"
|
||||||
|
v-model="order"
|
||||||
|
:rules="[(val) => !!val || `${'กรุณากรอกเลขที่คำสั่ง'}`]"
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'เลขที่คำสั่ง'}`"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="text-file">ปีที่ออกคำสั่ง</label>
|
<label class="text-file">ปีที่ออกคำสั่ง</label>
|
||||||
<datepicker menu-class-name="modalfix" v-model="years" :locale="'th'" autoApply year-picker
|
<datepicker
|
||||||
:enableTimePicker="false" week-start="0">
|
menu-class-name="modalfix"
|
||||||
|
v-model="years"
|
||||||
|
:locale="'th'"
|
||||||
|
autoApply
|
||||||
|
year-picker
|
||||||
|
:enableTimePicker="false"
|
||||||
|
week-start="0"
|
||||||
|
>
|
||||||
<template #year="{ year }">{{ year + 543 }}</template>
|
<template #year="{ year }">{{ year + 543 }}</template>
|
||||||
<template #year-overlay-value="{ value }">{{
|
<template #year-overlay-value="{ value }">{{
|
||||||
parseInt(value + 543)
|
parseInt(value + 543)
|
||||||
}}</template>
|
}}</template>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<q-input outlined dense lazy-rules :model-value="years + 543" :rules="[
|
<q-input
|
||||||
(val) => !!val || `${'กรุณาเลือกปีที่ออกคำสั่ง'}`,
|
outlined
|
||||||
]" hide-bottom-space :label="`${'ปีที่ออกคำสั่ง'}`">
|
dense
|
||||||
|
lazy-rules
|
||||||
|
:model-value="years + 543"
|
||||||
|
:rules="[
|
||||||
|
(val) => !!val || `${'กรุณาเลือกปีที่ออกคำสั่ง'}`,
|
||||||
|
]"
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'ปีที่ออกคำสั่ง'}`"
|
||||||
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon name="event" class="cursor-pointer" style="color: var(--q-grey)">
|
<q-icon
|
||||||
|
name="event"
|
||||||
|
class="cursor-pointer"
|
||||||
|
style="color: var(--q-grey)"
|
||||||
|
>
|
||||||
</q-icon>
|
</q-icon>
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
|
|
@ -442,8 +664,15 @@ const viewFileUpload = async (url: string) => {
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="text-file">วันที่ลงนาม</label>
|
<label class="text-file">วันที่ลงนาม</label>
|
||||||
<datepicker menu-class-name="modalfix" v-model="date" :locale="'th'" autoApply borderless
|
<datepicker
|
||||||
:enableTimePicker="false" week-start="0">
|
menu-class-name="modalfix"
|
||||||
|
v-model="date"
|
||||||
|
:locale="'th'"
|
||||||
|
autoApply
|
||||||
|
borderless
|
||||||
|
:enableTimePicker="false"
|
||||||
|
week-start="0"
|
||||||
|
>
|
||||||
<template #year="{ year }">
|
<template #year="{ year }">
|
||||||
{{ year + 543 }}
|
{{ year + 543 }}
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -451,13 +680,23 @@ const viewFileUpload = async (url: string) => {
|
||||||
{{ parseInt(value + 543) }}
|
{{ parseInt(value + 543) }}
|
||||||
</template>
|
</template>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<q-input outlined dense class="full-width datepicker" hide-bottom-space
|
<q-input
|
||||||
:model-value="date != null ? date2Thai(date) : null" :label="`${'วันที่ลงนาม'}`" :rules="[
|
outlined
|
||||||
(val) =>
|
dense
|
||||||
!!val || `${'กรุณาเลือกวันที่ลงนาม'}`,
|
class="full-width datepicker"
|
||||||
]">
|
hide-bottom-space
|
||||||
|
:model-value="date != null ? date2Thai(date) : null"
|
||||||
|
:label="`${'วันที่ลงนาม'}`"
|
||||||
|
:rules="[
|
||||||
|
(val) => !!val || `${'กรุณาเลือกวันที่ลงนาม'}`,
|
||||||
|
]"
|
||||||
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon name="event" class="cursor-pointer" style="color: var(--q-grey)">
|
<q-icon
|
||||||
|
name="event"
|
||||||
|
class="cursor-pointer"
|
||||||
|
style="color: var(--q-grey)"
|
||||||
|
>
|
||||||
</q-icon>
|
</q-icon>
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
|
|
@ -467,9 +706,20 @@ const viewFileUpload = async (url: string) => {
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class="flex justify-around">
|
<div class="flex justify-around">
|
||||||
<q-btn unelevated label="ออกคำสั่ง" :color="validateForm() ? 'public' : 'grey'"
|
<q-btn
|
||||||
:disable="statusOrder == 'N'" @click="clickExecute(orderId)" />
|
unelevated
|
||||||
<q-btn class="text-dark" unelevated label="ส่งไปลงนาม" color="grey" :disable="statusOrder == 'N'" />
|
label="ออกคำสั่ง"
|
||||||
|
:color="validateForm() ? 'public' : 'grey'"
|
||||||
|
:disable="statusOrder == 'N'"
|
||||||
|
@click="clickExecute(orderId)"
|
||||||
|
/>
|
||||||
|
<q-btn
|
||||||
|
class="text-dark"
|
||||||
|
unelevated
|
||||||
|
label="ส่งไปลงนาม"
|
||||||
|
color="grey"
|
||||||
|
:disable="statusOrder == 'N'"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-form>
|
</q-form>
|
||||||
|
|
@ -478,23 +728,53 @@ const viewFileUpload = async (url: string) => {
|
||||||
</div>
|
</div>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<div class="flex justify-end q-pa-sm q-gutter-sm">
|
<div class="flex justify-end q-pa-sm q-gutter-sm">
|
||||||
<q-btn dense outline color="primary" icon="chevron_left" @click="previous" class="q-pr-md"
|
<q-btn
|
||||||
label="เลือกรายชื่อส่งสำเนา">
|
dense
|
||||||
|
outline
|
||||||
|
color="primary"
|
||||||
|
icon="chevron_left"
|
||||||
|
@click="previous"
|
||||||
|
class="q-pr-md"
|
||||||
|
label="เลือกรายชื่อส่งสำเนา"
|
||||||
|
>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-btn unelevated label="บันทึก" :color="validateForm() ? 'public' : 'grey'" :disable="!validateForm()"
|
<q-btn
|
||||||
@click="save">
|
unelevated
|
||||||
|
label="บันทึก"
|
||||||
|
:color="validateForm() ? 'public' : 'grey'"
|
||||||
|
:disable="!validateForm()"
|
||||||
|
@click="save"
|
||||||
|
>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-dialog v-model="dialog" persistent :maximized="true" transition-show="slide-up" transition-hide="slide-down">
|
<q-dialog
|
||||||
|
v-model="dialog"
|
||||||
|
persistent
|
||||||
|
:maximized="true"
|
||||||
|
transition-show="slide-up"
|
||||||
|
transition-hide="slide-down"
|
||||||
|
>
|
||||||
<q-card class="bg-white text-white">
|
<q-card class="bg-white text-white">
|
||||||
<div class="flex justify-end items-center align-center q-mr-md q-mt-sm">
|
<div class="flex justify-end items-center align-center q-mr-md q-mt-sm">
|
||||||
<q-btn icon="close" unelevated round dense style="color: #ff8080; background-color: #ffdede" size="12px"
|
<q-btn
|
||||||
v-close-popup />
|
icon="close"
|
||||||
|
unelevated
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
style="color: #ff8080; background-color: #ffdede"
|
||||||
|
size="12px"
|
||||||
|
v-close-popup
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<q-card-section bordered class="card-pdf q-ma-md q-pa-md">
|
<q-card-section bordered class="card-pdf q-ma-md q-pa-md">
|
||||||
<div class="justify-between items-center align-center q-pb-sm row">
|
<div class="justify-between items-center align-center q-pb-sm row">
|
||||||
<q-btn class="text-dark bg-grey-4" flat dense @click="page = page > 1 ? page - 1 : page">
|
<q-btn
|
||||||
|
class="text-dark bg-grey-4"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
@click="page = page > 1 ? page - 1 : page"
|
||||||
|
>
|
||||||
<q-icon name="mdi-chevron-left" />
|
<q-icon name="mdi-chevron-left" />
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
|
@ -502,16 +782,32 @@ const viewFileUpload = async (url: string) => {
|
||||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<q-btn class="text-dark bg-grey-4" flat dense @click="page = page < numOfPages ? page + 1 : page">
|
<q-btn
|
||||||
|
class="text-dark bg-grey-4"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
@click="page = page < numOfPages ? page + 1 : page"
|
||||||
|
>
|
||||||
<q-icon name="mdi-chevron-right" />
|
<q-icon name="mdi-chevron-right" />
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
<div class="pdfWidth">
|
<div class="pdfWidth">
|
||||||
<VuePDF ref="vuePDFRef" :pdf="pdfSrc" :page="page" fit-parent :scale="0.1" />
|
<VuePDF
|
||||||
|
ref="vuePDFRef"
|
||||||
|
:pdf="pdfSrc"
|
||||||
|
:page="page"
|
||||||
|
fit-parent
|
||||||
|
:scale="0.1"
|
||||||
|
/>
|
||||||
<!-- <VuePdf :key="page" :src="pdfSrc" :page="page" /> -->
|
<!-- <VuePdf :key="page" :src="pdfSrc" :page="page" /> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="justify-between items-center align-center q-pt-sm row">
|
<div class="justify-between items-center align-center q-pt-sm row">
|
||||||
<q-btn class="text-dark bg-grey-4" flat dense @click="page = page > 1 ? page - 1 : page">
|
<q-btn
|
||||||
|
class="text-dark bg-grey-4"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
@click="page = page > 1 ? page - 1 : page"
|
||||||
|
>
|
||||||
<q-icon name="mdi-chevron-left" />
|
<q-icon name="mdi-chevron-left" />
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
|
@ -519,7 +815,12 @@ const viewFileUpload = async (url: string) => {
|
||||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<q-btn class="text-dark bg-grey-4" flat dense @click="page = page < numOfPages ? page + 1 : page">
|
<q-btn
|
||||||
|
class="text-dark bg-grey-4"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
@click="page = page < numOfPages ? page + 1 : page"
|
||||||
|
>
|
||||||
<q-icon name="mdi-chevron-right" />
|
<q-icon name="mdi-chevron-right" />
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -527,16 +828,33 @@ const viewFileUpload = async (url: string) => {
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
||||||
<q-dialog v-model="dialogFileUpload" persistent :maximized="true" transition-show="slide-up"
|
<q-dialog
|
||||||
transition-hide="slide-down">
|
v-model="dialogFileUpload"
|
||||||
|
persistent
|
||||||
|
:maximized="true"
|
||||||
|
transition-show="slide-up"
|
||||||
|
transition-hide="slide-down"
|
||||||
|
>
|
||||||
<q-card class="bg-white text-white">
|
<q-card class="bg-white text-white">
|
||||||
<div class="flex justify-end items-center align-center q-mr-md q-mt-sm">
|
<div class="flex justify-end items-center align-center q-mr-md q-mt-sm">
|
||||||
<q-btn icon="close" unelevated round dense style="color: #ff8080; background-color: #ffdede" size="12px"
|
<q-btn
|
||||||
v-close-popup />
|
icon="close"
|
||||||
|
unelevated
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
style="color: #ff8080; background-color: #ffdede"
|
||||||
|
size="12px"
|
||||||
|
v-close-popup
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<q-card-section bordered class="card-pdf q-ma-md q-pa-md">
|
<q-card-section bordered class="card-pdf q-ma-md q-pa-md">
|
||||||
<div class="justify-between items-center align-center q-pb-sm row">
|
<div class="justify-between items-center align-center q-pb-sm row">
|
||||||
<q-btn class="text-dark bg-grey-4" flat dense @click="page = page > 1 ? page - 1 : page">
|
<q-btn
|
||||||
|
class="text-dark bg-grey-4"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
@click="page = page > 1 ? page - 1 : page"
|
||||||
|
>
|
||||||
<q-icon name="mdi-chevron-left" />
|
<q-icon name="mdi-chevron-left" />
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
|
@ -544,16 +862,32 @@ const viewFileUpload = async (url: string) => {
|
||||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<q-btn class="text-dark bg-grey-4" flat dense @click="page = page < numOfPages ? page + 1 : page">
|
<q-btn
|
||||||
|
class="text-dark bg-grey-4"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
@click="page = page < numOfPages ? page + 1 : page"
|
||||||
|
>
|
||||||
<q-icon name="mdi-chevron-right" />
|
<q-icon name="mdi-chevron-right" />
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
<div class="pdfWidth">
|
<div class="pdfWidth">
|
||||||
<VuePDF ref="vuePDFRef" :pdf="pdfFileUploadSrc" :page="page" fit-parent :scale="0.1" />
|
<VuePDF
|
||||||
|
ref="vuePDFRef"
|
||||||
|
:pdf="pdfFileUploadSrc"
|
||||||
|
:page="page"
|
||||||
|
fit-parent
|
||||||
|
:scale="0.1"
|
||||||
|
/>
|
||||||
<!-- <VuePdf :key="page" :src="pdfSrc" :page="page" /> -->
|
<!-- <VuePdf :key="page" :src="pdfSrc" :page="page" /> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="justify-between items-center align-center q-pt-sm row">
|
<div class="justify-between items-center align-center q-pt-sm row">
|
||||||
<q-btn class="text-dark bg-grey-4" flat dense @click="page = page > 1 ? page - 1 : page">
|
<q-btn
|
||||||
|
class="text-dark bg-grey-4"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
@click="page = page > 1 ? page - 1 : page"
|
||||||
|
>
|
||||||
<q-icon name="mdi-chevron-left" />
|
<q-icon name="mdi-chevron-left" />
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
|
@ -561,14 +895,18 @@ const viewFileUpload = async (url: string) => {
|
||||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<q-btn class="text-dark bg-grey-4" flat dense @click="page = page < numOfPages ? page + 1 : page">
|
<q-btn
|
||||||
|
class="text-dark bg-grey-4"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
@click="page = page < numOfPages ? page + 1 : page"
|
||||||
|
>
|
||||||
<q-icon name="mdi-chevron-right" />
|
<q-icon name="mdi-chevron-right" />
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue