Merge branch 'NiceDev' into develop
This commit is contained in:
parent
37bef4e836
commit
0b8b5d497c
13 changed files with 168 additions and 357 deletions
|
|
@ -1,28 +1,27 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import axios from "axios";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
import TableDirector from "@/modules/06_evaluate/components/directorandmeet/Table.vue";
|
||||
/** importStore*/
|
||||
import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/**use*/
|
||||
const store = useEvaluateStore();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const route = useRoute();
|
||||
|
||||
const { showLoader, hideLoader, messageError, success, date2Thai } = mixin;
|
||||
const { showLoader, hideLoader, messageError, success } = mixin;
|
||||
|
||||
const evaluateId = ref<string>(route.params.id.toString());
|
||||
|
||||
const status = ref<string>("WAIT_CHECK_DOC_V2");
|
||||
const tabMenu = ref<string>("director");
|
||||
|
||||
const fileEvaluationEdit = ref<any>();
|
||||
|
||||
|
|
@ -31,11 +30,6 @@ const numOfPages = ref<number>(0);
|
|||
const page = ref<number>(1);
|
||||
const pdfSrc = ref<any>();
|
||||
|
||||
function onClickViewPDF(file: any) {
|
||||
pdfSrc.value = file.webkitRelativePath;
|
||||
modalView.value = true;
|
||||
}
|
||||
|
||||
/** ไปหน้าต่อไปของรายงาน */
|
||||
function nextPage() {
|
||||
if (page.value < numOfPages.value) {
|
||||
|
|
@ -50,49 +44,13 @@ function backPage() {
|
|||
}
|
||||
}
|
||||
|
||||
async function onClickDowloadFile(
|
||||
tp: string,
|
||||
templateName: string,
|
||||
fileName: string
|
||||
) {
|
||||
const body = {
|
||||
template: tp,
|
||||
reportName: templateName,
|
||||
data: {},
|
||||
};
|
||||
await genReport(body, fileName);
|
||||
}
|
||||
|
||||
// const directorList = ref<any>();
|
||||
// const meetingList = ref<any>();
|
||||
|
||||
// async function fetchDirector() {
|
||||
// showLoader();
|
||||
// evaluateId.value &&
|
||||
// (await http
|
||||
// .get(config.API.evaluationDirectorMeetring(evaluateId.value))
|
||||
// .then((res) => {
|
||||
// const directors = res.data.result.directors;
|
||||
// const meetings = res.data.result.meetings;
|
||||
// directorList.value = directors.map((e: any) => ({
|
||||
// fullName: `${e.prefix}${e.firstName} ${e.lastName}`,
|
||||
// position: e.position ?? "-",
|
||||
// email: e.email ?? "-",
|
||||
// phone: e.phone ?? "-",
|
||||
// }));
|
||||
// meetingList.value = meetings.map((e: any) => ({
|
||||
// fullName: `${e.Prefix}${e.FirstName} ${e.LastName}`,
|
||||
// dateMeeting: `${date2Thai(e.dateStart)} - ${date2Thai(e.dateEnd)}`,
|
||||
// result: e.result ?? "-",
|
||||
// duration: e.duration ?? "-",
|
||||
// }));
|
||||
// })
|
||||
// .catch((err) => {})
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// }));
|
||||
// }
|
||||
|
||||
/**
|
||||
* function เรียก Path อัปโหลดไฟล์
|
||||
* @param volume เล่ม
|
||||
* @param id ประเมิน
|
||||
* @param type ชือไฟล์
|
||||
* @param file ไฟล์
|
||||
*/
|
||||
async function fetchPathUpload(
|
||||
volume: string,
|
||||
id: string | undefined,
|
||||
|
|
@ -123,6 +81,11 @@ async function fetchPathUpload(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param uploadUrl ลิงก์อัปโหลด
|
||||
* @param file ไฟล์
|
||||
*/
|
||||
async function uploadfile(uploadUrl: string, file: any) {
|
||||
await axios
|
||||
.put(uploadUrl, file, {
|
||||
|
|
@ -139,6 +102,7 @@ async function uploadfile(uploadUrl: string, file: any) {
|
|||
}
|
||||
|
||||
const downloadUrl = ref<string>("");
|
||||
/** function เช็คไฟล์อัปโหลด*/
|
||||
function checkDoc() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -152,17 +116,16 @@ function checkDoc() {
|
|||
.then((res: any) => {
|
||||
downloadUrl.value = res.data.downloadUrl;
|
||||
})
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
.catch((e) => {
|
||||
// messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
// await fetchDirector();
|
||||
checkDoc();
|
||||
await checkDoc();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue