Merge branch 'NiceDev' into develop

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-01-08 14:19:08 +07:00
parent 37bef4e836
commit 0b8b5d497c
13 changed files with 168 additions and 357 deletions

View file

@ -1,28 +1,25 @@
<script setup lang="ts">
import { reactive, onMounted, ref, watch } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { reactive, onMounted, ref } from "vue";
/**importTyep*/
import type {
PersonInformation,
FormSpec,
} from "@/modules/06_evaluate/interface/evalute";
/** importComponents*/
import PopupCheckFeatures from "@/modules/06_evaluate/components/PopupCheckFeatures.vue";
/** importStores*/
import { useCounterMixin } from "@/stores/mixin";
import { useEvaluateStore } from "@/modules/06_evaluate/store";
/** use*/
const mixin = useCounterMixin();
const $q = useQuasar();
const store = useEvaluateStore();
const { showLoader, hideLoader, messageError } = mixin;
/** props จาก Tab1.vue*/
const props = defineProps({
educations: Array,
data: {
type: Array,
type: Object as () => PersonInformation,
},
});
@ -31,7 +28,7 @@ const emit = defineEmits(["update:spec"]);
const modal = ref<boolean>(false);
const show = ref<boolean>(false);
const formData = reactive<any>({
const formData = reactive<FormSpec>({
isEducationalQft: false, //
isGovermantServiceHtr: false, //
isOperatingExp: false, //
@ -48,14 +45,9 @@ async function updateValue() {
/**
* function fetchData ตรวจสอบคณสมบ
* @param id ประเม
* @param data ตรวจสอบคณสมบ
*/
async function fetchCheckSpec(data: any) {
// showLoader();
// await http
// .get(config.API.evaluationCheckspecByid(id))
// .then((res) => {
// const data = res.data.result;
async function fetchCheckSpec(data: PersonInformation) {
formData.isEducationalQft = data.isEducationalQft;
formData.isGovermantServiceHtr = data.isGovermantServiceHtr;
formData.isOperatingExp = data.isOperatingExp;
@ -63,13 +55,6 @@ async function fetchCheckSpec(data: any) {
formData.isHaveSpecificQft = data.isHaveSpecificQft;
formData.isHaveProLicense = data.isHaveProLicense;
formData.isHaveMinPeriodOrHoldPos = data.isHaveMinPeriodOrHoldPos;
// })
// .catch((err) => {
// messageError($q, err);
// })
// .finally(() => {
// hideLoader();
// });
}
/**
@ -88,8 +73,6 @@ function closeModal() {
/**hook lifecycle*/
onMounted(() => {
// setTimeout(() => {
// }, 1000);
props.data && fetchCheckSpec(props.data);
});
</script>

View file

@ -25,7 +25,6 @@ const route = useRoute();
const { showLoader, hideLoader, date2Thai, messageError, success } = mixin;
const evaluateId = ref<string>(route.params.id.toString());
const statusUpload = ref<boolean>(false);
/** emit */
const emit = defineEmits(["update:form"]);
@ -103,11 +102,6 @@ const page = ref<number>(1);
const pdfSrc = ref<any>();
const profile = ref<any>();
function onClickViewPDF(file: any) {
// pdfSrc.value = file.webkitRelativePath;
modalView.value = true;
}
/** function ไปหน้าต่อไปของรายงาน */
function nextPage() {
if (page.value < numOfPages.value) {

View file

@ -1,27 +1,26 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useRoute } from "vue-router";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useQuasar } from "quasar";
import axios from "axios";
/** importStroe*/
import { useCounterMixin } from "@/stores/mixin";
import { useEvaluateStore } from "@/modules/06_evaluate/store";
/** use*/
const $q = useQuasar();
const store = useEvaluateStore();
const mixin = useCounterMixin();
const route = useRoute();
const { showLoader, hideLoader, messageError } = mixin;
/** id ประเมิน*/
const evaluateId = ref<string>(route.params.id.toString());
// const props = defineProps({
// evaluateId: {
// type: String,
// },
// });
/** emit*/
const emit = defineEmits(["update:file"]);
const selectedItem = ref(1);
@ -34,13 +33,22 @@ const fileName = ref([
"6-ผลงานที่จะส่งประเมิน (เอกสารหมายเลข 11)",
]);
/**
* function กดเลอกแสดงเอกสาน
* @param itemNumber เอกสาร
*/
function handleItemClick(itemNumber: number) {
store.tabPanels = itemNumber.toString();
selectedItem.value = itemNumber;
fetchDocument(fileName.value[itemNumber - 1]);
}
/**
* function เรกยเอกสาร
* @param fileName อเอกสาร
*/
async function fetchDocument(fileName: string) {
// showLoader();
showLoader();
evaluateId.value &&
(await http
.get(config.API.loadFileDocument("เล่ม 1", evaluateId.value, fileName))
@ -52,6 +60,10 @@ async function fetchDocument(fileName: string) {
}));
}
/**
* function ดาวนโหลดไฟล
* @param url งกดาวนโหลดไฟล
*/
async function downloadFile(url: string) {
await axios
.get(url, {
@ -77,6 +89,7 @@ async function downloadFile(url: string) {
});
}
/** HooK lifecycle*/
onMounted(async () => {
await fetchDocument(fileName.value[selectedItem.value - 1]);
});

View file

@ -1,22 +1,27 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useRoute } from "vue-router";
import { useQuasar } from "quasar";
import config from "@/app.config";
import http from "@/plugins/http";
import { useQuasar } from "quasar";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
/** use*/
const mixins = useCounterMixin();
const $q = useQuasar();
const route = useRoute();
const { date2Thai, success } = mixins;
/** id ประเมิน*/
const evaluateId = ref<string>(route.params.id.toString());
const dateStartAnnounce = ref<string | null>(date2Thai(new Date()));
const dateEndAnnounce = ref<string | null>(date2Thai(new Date()));
const statusFile = ref<boolean>(false);
/** เอกสารประกาศผลการคัดเลือกบุคคล*/
const items = ref<any>([
{
label: "แบบสรุปข้อมูลของผู้ขอรับการคัดเลือก (เอกสารหมายเลข 9)",
@ -32,8 +37,7 @@ const items = ref<any>([
},
]);
const statusFile = ref<boolean>(false);
/** fuinction เรียกข้อมูลลิงก์ดาวนฺโหลด*/
async function onClickfetchDocument(fileName: string, type: string) {
evaluateId.value &&
(await http
@ -43,22 +47,17 @@ async function onClickfetchDocument(fileName: string, type: string) {
type === "COPPY" && coppyLink(downloadUrl);
type === "CHECK" && (statusFile.value = true);
})
.catch((err) => {}));
.catch(() => {}));
}
/** function คัดลอหลิงก์ดาวน์โหลด */
async function coppyLink(link: string) {
const linkById = link;
navigator.clipboard.writeText(linkById);
success($q, "คัดลอกสำเร็จ");
// const textarea = document.createElement("textarea");
// textarea.value = link;
// document.body.appendChild(textarea);
// textarea.select();
// document.execCommand("copy");
// success($q, "");
}
/** function เรียกข้อมูลวันที่ประกาศ*/
async function fetchCheckDate() {
evaluateId.value &&
(await http
@ -70,9 +69,10 @@ async function fetchCheckDate() {
endDate.setDate(endDate.getDate() + 30);
dateEndAnnounce.value = date2Thai(endDate);
})
.catch((err) => {}));
.catch(() => {}));
}
/** Hook lifecycle*/
onMounted(async () => {
fetchCheckDate();
await onClickfetchDocument("บันทึกแจ้งผลการประกาศคัดเลือก", "CHECK");
@ -88,19 +88,9 @@ onMounted(async () => {
ประกาศเมอวนท {{ dateStartAnnounce }} {{ dateEndAnnounce }}
</div>
</q-banner>
<!-- <q-badge
v-if="status == 'ANNOUNCE_WEB'"
outline
color="primary"
label="ประกาศบนเว็บไซต์"
class="q-pa-sm"
style="font-size: 16px"
/>
<div> -->
<!-- <a :href="website" target="_blank">{{ website }}</a> -->
<!-- </div> -->
</div>
<!-- เอกสารประกาศผลการคดเลอกบคคล -->
<div class="col-12">
<q-card bordered style="border: 1px solid #d6dee1">
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">
@ -133,6 +123,7 @@ onMounted(async () => {
</q-card>
</div>
<!-- นทกแจงผลการประกาศคดเลอก -->
<div class="col-12" v-if="statusFile">
<q-card bordered style="border: 1px solid #d6dee1">
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">

View file

@ -1,18 +1,23 @@
<script setup lang="ts">
import { ref, reactive, watch, onMounted } from "vue";
import keycloak from "@/plugins/keycloak";
import { useRoute } from "vue-router";
import { useQuasar } from "quasar";
import keycloak from "@/plugins/keycloak";
import http from "@/plugins/http";
import config from "@/app.config";
import axios from "axios";
import { useQuasar } from "quasar";
import ViewPDF from "@/modules/06_evaluate/components/viewstep/viewPDF.vue";
/** importType*/
import type { FormCommand } from "@/modules/06_evaluate/interface/evalute";
/** importComponents*/
import ViewPDF from "@/modules/06_evaluate/components/viewstep/viewPDF.vue";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
import { useEvaluateStore } from "@/modules/06_evaluate/store";
/** use*/
const $q = useQuasar();
const store = useEvaluateStore();
const mixins = useCounterMixin();
@ -20,17 +25,19 @@ const route = useRoute();
const { date2Thai, showLoader, hideLoader, messageError, success } = mixins;
/** id ประเมิน*/
const evaluateId = ref<string>(route.params.id.toString());
/** emit*/
const emit = defineEmits(["update:form"]);
const fileEvaluation1 = ref<any>();
const pdfSrc = ref<any>();
const performance = ref<string>("");
const performanceOwner = ref<string>("");
const position = ref<string>("");
/** form จัดเตรียมเอกสารเล่ม 2*/
const formCommand = reactive<FormCommand>({
commanderFullname: "",
commanderPosition: "",
@ -40,7 +47,7 @@ const formCommand = reactive<FormCommand>({
subject: "",
assignedPosition: "",
});
/** ref input*/
const commanderFullnameRef = ref<object | null>(null);
const commanderPositionRef = ref<object | null>(null);
const commanderAboveFullnameRef = ref<object | null>(null);
@ -51,12 +58,9 @@ const performanceOwnerRef = ref<object | null>(null);
const assignedPositionRef = ref<object | null>(null);
const modalView = ref<boolean>(false);
function onClickViewPDF(file: any) {
pdfSrc.value = file.webkitRelativePath;
modalView.value = true;
}
const updateInput = (value: any) => {
/** function อัปเดท ผลงาน,ผู้เซ็นเอกสาร*/
function updateInput(value: any) {
const ref = {
commanderFullnameRef: commanderFullnameRef.value,
commanderPositionRef: commanderPositionRef.value,
@ -69,8 +73,15 @@ const updateInput = (value: any) => {
assignedPosition: assignedPositionRef.value,
};
emit("update:form", value, ref);
};
}
/**
* function เรยก Path ปโหลดไฟล
* @param volume เล
* @param id ประเม
* @param type อไฟล
* @param file ไฟล
*/
async function fetchPathUpload(
volume: string,
id: string | undefined,
@ -108,6 +119,11 @@ async function fetchPathUpload(
}
}
/**
*
* @param uploadUrl งกปโหลด
* @param file ไฟล
*/
async function uploadfile(uploadUrl: string, file: any) {
await axios
.put(uploadUrl, file, {
@ -124,6 +140,10 @@ async function uploadfile(uploadUrl: string, file: any) {
});
}
/**
* function เรยกขอม ผลงาน,เชนเอกสาร
* @param id ประเม
*/
async function fetcheSigner(id: string) {
showLoader();
await http
@ -148,27 +168,24 @@ async function fetcheSigner(id: string) {
});
}
// const dateStartPrepareDoc2 = ref<string | null>(date2Thai(new Date()));
const dateEndPrepareDoc2 = ref<string | null>(date2Thai(new Date()));
/** functoin เรียกข้อมูลวันสุดท้ายของการส่งผลงาน*/
async function fetchCheckDate() {
evaluateId.value &&
(await http
.get(config.API.evaluationCheckDate(evaluateId.value))
.then((res) => {
const data = res.data.result;
// dateStartPrepareDoc2.value = date2Thai(data.dateStartPrepareDoc2);
const endDate = new Date(data.dateEndAnnounce);
endDate.setDate(endDate.getDate() + 180);
dateEndPrepareDoc2.value = date2Thai(endDate);
// dateEndPrepareDoc2.value = data.dateEndPrepareDoc2
// ? date2Thai(data.dateEndPrepareDoc2)
// : dateEndPrepareDoc2.value;
})
.catch((err) => {}));
}
const downloadUrl = ref<string>("");
/** function เช็คไฟล์อัปโหลด*/
function checkDoc() {
showLoader();
http
@ -178,9 +195,7 @@ function checkDoc() {
.then((res: any) => {
downloadUrl.value = res.data.downloadUrl;
})
// .catch((e) => {
// messageError($q, e);
// })
.catch(() => {})
.finally(() => {
hideLoader();
const ref = {
@ -199,6 +214,7 @@ function checkDoc() {
});
}
/** hook lifecycle*/
onMounted(async () => {
if (keycloak.tokenParsed != null) {
formCommand.author = keycloak.tokenParsed.name;
@ -208,8 +224,6 @@ onMounted(async () => {
fetcheSigner(evaluateId.value);
}
await fetchCheckDate();
// props.evaluateId && (await fetchPathUpload(" 2", props.evaluateId));
});
watch(
@ -240,6 +254,7 @@ watch(
</div>
</q-banner>
</div>
<!-- ผลงาน -->
<div class="col-12">
<q-card bordered style="border: 1px solid #d6dee1">
@ -249,9 +264,6 @@ watch(
<div class="col-12 q-pa-sm">
<div class="row q-col-gutter-md col-12">
<div class="col-xs-12 col-sm-12 row">
<!-- <div class="text-weight-medium q-py-sm">
งคบบญชาชนต
</div> -->
<div class="row col-12 q-col-gutter-md q-pa-sm">
<q-input
:readonly="store.currentStep != 6"
@ -299,6 +311,7 @@ watch(
</q-card>
</div>
<!-- ปไฟล -->
<div class="col-6" v-if="store.statusUpload && store.currentStep === 6">
<q-card bordered style="border: 1px solid #d6dee1">
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">
@ -308,17 +321,6 @@ watch(
<div class="row">
<div class="col-12 q-pa-sm">
<div class="row q-col-gutter-md col-12">
<!-- <div class="col-xs-12 col-sm-6 row">
<q-btn
class="col-12"
outline
icon="download"
label="ดาวน์โหลดต้นแบบ"
color="primary"
>
<q-tooltip> ดาวนโหลดตนแบบ </q-tooltip></q-btn
>
</div> -->
<div class="col-xs-12 col-sm-6 row">
<q-btn
v-if="downloadUrl"
@ -380,6 +382,7 @@ watch(
</q-card>
</div>
<!-- เลอกผเซนเอกสาร -->
<div class="col-12">
<q-card bordered style="border: 1px solid #d6dee1">
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">

View file

@ -1,33 +1,30 @@
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { useRoute } from "vue-router";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useQuasar } from "quasar";
import axios from "axios";
/** importStroe*/
import { useCounterMixin } from "@/stores/mixin";
import { useEvaluateStore } from "@/modules/06_evaluate/store";
const store = useEvaluateStore();
/** use*/
const mixin = useCounterMixin();
const $q = useQuasar();
const route = useRoute();
const evaluateId = ref<string>(route.params.id.toString());
const { showLoader, hideLoader, messageError } = mixin;
const props = defineProps({
evaluateId: {
type: String,
},
});
/** emit*/
const emit = defineEmits(["update:file"]);
/** id ประเมิน*/
const evaluateId = ref<string>(route.params.id.toString());
const selectedItem = ref(1);
/** function เรีกยเอกสาร*/
async function fetchDocument() {
showLoader();
evaluateId.value &&
@ -47,6 +44,10 @@ async function fetchDocument() {
}));
}
/**
* function ดาวนโหลดไฟล
* @param url งกดาวนโหลดไฟล
*/
async function downloadFile(url: string) {
await axios
.get(url, {
@ -69,6 +70,7 @@ async function downloadFile(url: string) {
});
}
/** HooK lifecycle*/
onMounted(async () => {
await fetchDocument();
});

View file

@ -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>

View file

@ -1,41 +1,33 @@
<script setup lang="ts">
import { ref } from "vue";
import { useQuasar } from "quasar";
import { useEvaluateStore } from "@/modules/06_evaluate/store";
import { useCounterMixin } from "@/stores/mixin";
import env from "@/api";
/** importStore*/
import { useEvaluateStore } from "@/modules/06_evaluate/store";
import { useCounterMixin } from "@/stores/mixin";
/** use*/
const mixin = useCounterMixin();
const stroe = useEvaluateStore();
const $q = useQuasar();
const { success } = mixin;
const link = ref<string>(env.LINK_EVALUATE_PUBLISH);
/** function คัดลอกชื้่อลิงก์*/
function copyLink() {
const linkById = `${link.value}/${stroe.evaluateId}`;
navigator.clipboard.writeText(linkById);
success($q, "คัดลอกสำเร็จ");
}
// async function onClickCopyLink() {
// const textarea = document.createElement("textarea");
// textarea.value = link.value;
// document.body.appendChild(textarea);
// textarea.select();
// document.execCommand("copy");
// success($q, "");
// }
</script>
<template>
<div class="row">
<div class="col-12 text-center">
<!-- <div> -->
<p class="text-weight-bold q-mb-none">Public URL</p>
<!-- <a :href="link + '/' + id" target="_blank">{{ `${link}/${id}` }}</a> -->
<!-- </div> -->
<q-btn
class="q-mt-md"