ต่อ api รายละเอียดการประเมินของ
This commit is contained in:
parent
cab89c78f3
commit
4521f80918
17 changed files with 1226 additions and 191 deletions
|
|
@ -12,5 +12,22 @@ export default {
|
|||
meetingById: (id: string) => `${evaluation}/meeting/${id}`,
|
||||
|
||||
evaluationFilebyId:(volume:string,id:string,file:string) => `${evaluationFile}/${volume}/${id}/${file}`,
|
||||
evaluationFileListbyId:(volume:string,id:string) => `${evaluationFile}/${volume}/${id}`
|
||||
evaluationFileListbyId:(volume:string,id:string) => `${evaluationFile}/${volume}/${id}`,
|
||||
evaluationApproveDoc1:(id:string)=>`${evaluation}/doc1/approve/${id}`,
|
||||
|
||||
evaluationHistory: (id: string) => `${evaluation}/step-history/${id}`,
|
||||
|
||||
evaluationDateAnnounce:(id:string) => `${evaluation}/check-date/${id}`,
|
||||
|
||||
evaluationSigner:(id:string,num:number) => `${evaluation}/doc${num}-signer/${id}`,
|
||||
|
||||
evaluationSentToContact:(id:string) => `${evaluation}/contact/user/${id}`,
|
||||
|
||||
evaluationPatchData:(volume:string,id:string,file:string) => `${evaluationFile}/${volume}/${id}/${file}`,
|
||||
|
||||
evaluationChooseDirectors:(id:string) => `${evaluation}/choose-directors/${id}`,
|
||||
evaluationChooseMeeting:(id:string) => `${evaluation}/choose-meetings/${id}`,
|
||||
|
||||
evaluationListData:(id:string) =>`${evaluation}/director-meeting/${id}`
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref, reactive } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
|
||||
import type {
|
||||
FormCommand,
|
||||
|
|
@ -25,15 +26,19 @@ import ViewStep7 from "@/modules/12_evaluatePersonal/components/Detail/viewstep/
|
|||
import { useEvaluateDetailStore } from "@/modules/12_evaluatePersonal/store/EvaluateDetail";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import PopupHistory from "@/modules/12_evaluatePersonal/components/Detail/popupHistory.vue";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const store = useEvaluateDetailStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm } = mixin;
|
||||
|
||||
const $q = useQuasar();
|
||||
|
||||
const modalHistory = ref<boolean>(false);
|
||||
const externalLink =
|
||||
"https://accreditation.ocsc.go.th/accreditation/search/curriculum";
|
||||
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const formCommand = reactive<FormCommand>({
|
||||
elementaryFullName: "",
|
||||
elementaryPosition: "",
|
||||
|
|
@ -168,6 +173,10 @@ async function saveStep9() {
|
|||
console.log("Save 9");
|
||||
}
|
||||
|
||||
function onClickPopupHistory() {
|
||||
modalHistory.value = !modalHistory.value;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
store.step = 1;
|
||||
});
|
||||
|
|
@ -176,7 +185,20 @@ onMounted(() => {
|
|||
<template>
|
||||
<div class="row q-col-gutter-md">
|
||||
<div class="col-xs-12 col-sm-3">
|
||||
<div class="toptitle">ประเมินชำนาญการ</div>
|
||||
<div class="toptitle">
|
||||
ประเมินชำนาญการ
|
||||
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="primary"
|
||||
icon="history"
|
||||
@click="onClickPopupHistory"
|
||||
>
|
||||
<q-tooltip>ประวัติการประเมิน</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<Stepper />
|
||||
</div>
|
||||
|
||||
|
|
@ -199,11 +221,11 @@ onMounted(() => {
|
|||
: 'col-xs-12 col-sm-5 row'
|
||||
"
|
||||
>
|
||||
<q-card flat bordered class="col-12 ">
|
||||
<q-card flat bordered class="col-12">
|
||||
<q-card-section>
|
||||
<Step1 v-if="store.step === 1" />
|
||||
<Step2 v-if="store.step === 2" @update:form="updateformCommand" />
|
||||
<Step3 v-if="store.step === 3" :step="store.step"/>
|
||||
<Step3 v-if="store.step === 3" :step="store.step" />
|
||||
<Step4 v-if="store.step === 4" />
|
||||
<Step5 v-if="store.step === 5" />
|
||||
<Step6 v-if="store.step === 6" />
|
||||
|
|
@ -225,9 +247,10 @@ onMounted(() => {
|
|||
></q-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PopupHistory :modal="modalHistory" :close="onClickPopupHistory" :id="id" />
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
|
|
|||
|
|
@ -7,16 +7,44 @@ import CardMeet from "@/modules/12_evaluatePersonal/components/Detail/viewTab2/C
|
|||
|
||||
import { useEvaluateDetailStore } from "@/modules/12_evaluatePersonal/store/EvaluateDetail";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const store = useEvaluateDetailStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm } = mixin;
|
||||
const { dialogConfirm, showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
const director = ref<any[]>();
|
||||
const meeting = ref<any[]>();
|
||||
const $q = useQuasar();
|
||||
|
||||
// onMounted(() => {
|
||||
// store.step = 1;
|
||||
// });
|
||||
|
||||
function getList() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.evaluationListData(id.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
director.value = data.directors;
|
||||
meeting.value = data.meetings;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -24,8 +52,8 @@ const $q = useQuasar();
|
|||
<div class="toptitle">กรรมการและการประชุม</div>
|
||||
|
||||
<div class="row col-12 q-gutter-md">
|
||||
<CardDirector />
|
||||
<CardMeet />
|
||||
<CardDirector :data="director"/>
|
||||
<CardMeet :data="meeting"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,178 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import HeaderDialog from "@/components/DialogHeader.vue";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const mixins = useCounterMixin();
|
||||
const { showLoader, hideLoader, date2Thai } = mixins;
|
||||
|
||||
/** รับ props Tab 1 */
|
||||
const props = defineProps({
|
||||
id: {
|
||||
type: String,
|
||||
require: true,
|
||||
},
|
||||
modal: {
|
||||
type: Boolean,
|
||||
require: true,
|
||||
},
|
||||
close: {
|
||||
type: Function,
|
||||
default: () => "",
|
||||
},
|
||||
});
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "step",
|
||||
align: "left",
|
||||
label: "การแก้ไข",
|
||||
sortable: true,
|
||||
field: "step",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "lastUpdateFullName",
|
||||
align: "left",
|
||||
label: "ผู้ดำเนินการ",
|
||||
sortable: true,
|
||||
field: "lastUpdateFullName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "lastUpdatedAt",
|
||||
align: "left",
|
||||
label: "วันที่แก้ไข",
|
||||
sortable: true,
|
||||
field: "lastUpdatedAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
const row = ref<any>();
|
||||
|
||||
async function fetchListHistory(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.evaluationHistory(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
const list = data.map((e: any) => ({
|
||||
step: e.step,
|
||||
lastUpdateFullName: e.lastUpdateFullName,
|
||||
lastUpdatedAt: date2Thai(e.lastUpdatedAt),
|
||||
}));
|
||||
row.value = list;
|
||||
})
|
||||
.catch((err) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.modal,
|
||||
() => {
|
||||
props.modal && props.id && fetchListHistory(props.id);
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="props.modal">
|
||||
<q-card style="width: 700px; max-width: 80vw">
|
||||
<q-card-section>
|
||||
<HeaderDialog :tittle="'ประวัติการประเมิน'" :close="props.close" />
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-section class="q-pt-none">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 row q-col-gutter-md">
|
||||
<div class="col-12 q-mt-sm">
|
||||
<q-table
|
||||
ref="table"
|
||||
flat
|
||||
bordered
|
||||
class="custom-header-table"
|
||||
:columns="columns"
|
||||
:rows="row"
|
||||
dense
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>
|
||||
<span class="text-weight-medium" v-html="col.label" />
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.custom-header-table {
|
||||
height: auto;
|
||||
.q-table tr:nth-child(odd) td {
|
||||
background: white;
|
||||
}
|
||||
.q-table tr:nth-child(even) td {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.q-table thead tr {
|
||||
background: #ecebeb;
|
||||
}
|
||||
|
||||
.q-table thead tr th {
|
||||
position: sticky;
|
||||
z-index: 1;
|
||||
}
|
||||
/* this will be the loading indicator */
|
||||
.q-table thead tr:last-child th {
|
||||
/* height of all previous header rows */
|
||||
top: 48px;
|
||||
}
|
||||
.q-table thead tr:first-child th {
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -3,13 +3,16 @@ import { ref, reactive, onMounted } from "vue";
|
|||
import keycloak from "@/plugins/keycloak";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import genReport from "@/plugins/genreport";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import type { FormCommand } from "@/modules/12_evaluatePersonal/interface/index/evalute";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const $q = useQuasar();
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -96,7 +99,26 @@ async function onClickDowloadFile(
|
|||
await genReport(body, fileName);
|
||||
}
|
||||
|
||||
function getSigner() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.evaluationSigner(id.value, 1))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
formCommand.elementaryFullName = data.commanderFullname;
|
||||
formCommand.elementaryPosition = data.commanderPosition;
|
||||
formCommand.abovelevelFullname = data.commanderAboveFullname;
|
||||
formCommand.abovelevelPosition = data.commanderAbovePosition;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
onMounted(() => {
|
||||
getSigner();
|
||||
const ref = {
|
||||
elementaryFullNameRef: elementaryFullNameRef.value,
|
||||
elementaryPositonRef: elementaryPositonRef.value,
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ function getPDF(url: string,type:string) {
|
|||
messageError($q,e)
|
||||
})
|
||||
.finally(()=>{
|
||||
|
||||
store.log = 0
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,9 +8,17 @@ import keycloak from "@/plugins/keycloak";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import genReport from "@/plugins/genreport";
|
||||
import { useQuasar } from "quasar";
|
||||
import PopupReason from "@/components/Dialogs/PopupReason.vue";
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, showLoader, hideLoader, messageError,success } = mixin;
|
||||
const {
|
||||
date2Thai,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
|
@ -18,7 +26,7 @@ const id = ref<string>(route.params.id as string);
|
|||
const fullName = ref<string>(
|
||||
keycloak.tokenParsed ? keycloak.tokenParsed.name!.toString() : ""
|
||||
);
|
||||
const mesasger = ref<string>("");
|
||||
const messenger = ref<string>("");
|
||||
const title = ref<string>("");
|
||||
const modalEvaluation = ref<boolean>(false);
|
||||
const fileEvaluationUpload = ref<any>();
|
||||
|
|
@ -125,33 +133,24 @@ function getPDF(url: string, type: string, fileName: string) {
|
|||
}
|
||||
|
||||
/** ส่งไปประกาศบนเว็บไซต์ */
|
||||
function onWebSite() {}
|
||||
|
||||
// function getFileList() {
|
||||
// showLoader();
|
||||
// http
|
||||
// .get(config.API.evaluationFilebyId("เล่ม 1", id.value))
|
||||
// .then((res) => {
|
||||
// const fileList = res.data;
|
||||
// files.forEach((file, index) => {
|
||||
// const apiFile = fileList[index];
|
||||
// file.pathName = apiFile.pathname;
|
||||
// });
|
||||
|
||||
// console.log(files);
|
||||
// })
|
||||
// .catch((e) => {})
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
function onWebSite() {
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.evaluationApproveDoc1(id.value))
|
||||
.then((res) => {})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
success($q, "ส่งไปประกาศบนเว็บไซต์ สำเร็จ");
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function upLoadFile() {
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.evaluationFileListbyId("เล่ม 1", id.value), {
|
||||
fileList: {
|
||||
fileName: "4-แบบประเมินคุณลักษณะบุคคล",
|
||||
fileName: "10-ประกาศผลการคัดเลือกบุคคล (เอกสารหมายเลข 10)",
|
||||
metadata: {
|
||||
tag: "value",
|
||||
},
|
||||
|
|
@ -175,15 +174,39 @@ function upLoadFile() {
|
|||
}
|
||||
|
||||
function fileUpLoad(url: string) {
|
||||
axios.put(url, fileEvaluationUpload.value, {
|
||||
headers: { "Content-Type": fileEvaluationUpload.value?.type },
|
||||
onUploadProgress: (e) => console.log(e),
|
||||
}).catch((e)=>{
|
||||
messageError($q,e)
|
||||
}).finally(()=>{
|
||||
fileEvaluationUpload.value = null
|
||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||
})
|
||||
axios
|
||||
.put(url, fileEvaluationUpload.value, {
|
||||
headers: { "Content-Type": fileEvaluationUpload.value?.type },
|
||||
onUploadProgress: (e) => console.log(e),
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
fileEvaluationUpload.value = null;
|
||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||
});
|
||||
}
|
||||
|
||||
function sentMessenger() {
|
||||
dialogConfirm($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.evaluationSentToContact(id.value), {
|
||||
subject: title.value,
|
||||
body: messenger.value,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
modalEvaluation.value = false;
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
@ -338,7 +361,7 @@ function fileUpLoad(url: string) {
|
|||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
v-model="mesasger"
|
||||
v-model="messenger"
|
||||
label="ข้อความ"
|
||||
type="textarea"
|
||||
outlined
|
||||
|
|
@ -357,6 +380,7 @@ function fileUpLoad(url: string) {
|
|||
id="onSubmit"
|
||||
class="q-px-md q-py-xs"
|
||||
label="ส่งข้อความ"
|
||||
@click="sentMessenger"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,31 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
||||
import axios from "axios";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
const modalView = ref<boolean>(false);
|
||||
const fullName = ref<string>(
|
||||
keycloak.tokenParsed ? keycloak.tokenParsed.name!.toString() : ""
|
||||
);
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const numOfPages = ref<number>(0);
|
||||
const page = ref<number>(1);
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, showLoader, hideLoader, messageError, success } = mixin;
|
||||
const AnnouncementDate = ref<string | null>(date2Thai(new Date()));
|
||||
const AnnouncementStartDate = ref<string | null>();
|
||||
const AnnouncementEndDate = ref<string | null>();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
|
||||
|
||||
const pdfSrc = ref<any>();
|
||||
const fileEvaluation5 = ref<any>();
|
||||
const status = ref<string>("ANNOUNCE_WEB");
|
||||
const website = ref<string>("https://bma-ehr.frappet.com/");
|
||||
|
|
@ -24,17 +34,17 @@ const files = [
|
|||
{
|
||||
id: "file1",
|
||||
fileName: "แบบสรุปข้อมูลของผู้ขอรับการคัดเลือก (เอกสารหมายเลข 9)",
|
||||
pathName: "12",
|
||||
pathName: "5-แบบสรุปข้อมูลของผู้ขอรับการคัดเลือก (เอกสารหมายเลข 9)",
|
||||
},
|
||||
{
|
||||
id: "file2",
|
||||
fileName: "ประกาศผลการคัดเลือกบุคคล (เอกสารหมายเลข 10)",
|
||||
pathName: "12",
|
||||
pathName: "10-ประกาศผลการคัดเลือกบุคคล (เอกสารหมายเลข 10)",
|
||||
},
|
||||
{
|
||||
id: "file3",
|
||||
fileName: "เอกสารแสดงผลงานที่จะส่งประเมิน (เอกสารหมายเลข 11)",
|
||||
pathName: "12",
|
||||
fileName: "ผลงานที่จะส่งประเมิน (เอกสารหมายเลข 11)",
|
||||
pathName: "6-ผลงานที่จะส่งประเมิน (เอกสารหมายเลข 11)",
|
||||
},
|
||||
];
|
||||
|
||||
|
|
@ -106,19 +116,113 @@ function fileUpLoad(url: string) {
|
|||
});
|
||||
}
|
||||
|
||||
function copyLink(link: string) {
|
||||
navigator.clipboard
|
||||
.writeText(link)
|
||||
.then(() => {
|
||||
console.log(`Copied link for file: ${link}`);
|
||||
function getFileName(fileName: string) {
|
||||
if (fileName && fileName.lastIndexOf(".") !== -1) {
|
||||
const index = fileName.indexOf("(");
|
||||
if (index !== -1) {
|
||||
return fileName.substring(0, index).trim();
|
||||
} else {
|
||||
// กรณีไม่มีวงเล็บ
|
||||
return fileName.split(".").slice(0, -1).join(".");
|
||||
}
|
||||
} else {
|
||||
// ในกรณีที่ไม่มีนามสกุล
|
||||
return fileName;
|
||||
}
|
||||
}
|
||||
|
||||
/** ไปหน้าต่อไปของรายงาน */
|
||||
function nextPage() {
|
||||
if (page.value < numOfPages.value) {
|
||||
page.value++;
|
||||
}
|
||||
}
|
||||
|
||||
/** กลับหน้าก่อนหน้าของรายงาน */
|
||||
function backPage() {
|
||||
if (page.value !== 1) {
|
||||
page.value--;
|
||||
}
|
||||
}
|
||||
|
||||
function copyLink(name: string) {
|
||||
console.log(name);
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.evaluationFilebyId("เล่ม 1", id.value, name))
|
||||
.then((res) => {
|
||||
console.log(res.data);
|
||||
const link = res.data.downloadUrl;
|
||||
navigator.clipboard.writeText(link);
|
||||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
success($q, "คัดลอก URL สำเร็จ");
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function getDate() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.evaluationDateAnnounce(id.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
AnnouncementStartDate.value = date2Thai(data.dateStartAnnounce);
|
||||
const endDate = new Date(data.dateEndAnnounce);
|
||||
endDate.setDate(endDate.getDate() + 30);
|
||||
AnnouncementEndDate.value = date2Thai(endDate);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
success($q, "คัดลอกสำเร็จ");
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
// function linkCopy(link: string) {
|
||||
// navigator.clipboard
|
||||
// .writeText(link)
|
||||
// .then(() => {
|
||||
// console.log(`Copied link for file: ${link}`);
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// success($q, "คัดลอกสำเร็จ");
|
||||
// });
|
||||
// }
|
||||
|
||||
async function onClickDowloadFile(
|
||||
tp: string,
|
||||
templateName: string,
|
||||
fileName: string
|
||||
) {
|
||||
showLoader();
|
||||
const data = Object.assign(
|
||||
{ fullName: fullName.value },
|
||||
tp === "EV1_005" || tp === "EV1_007" ? { organizationName: "-" } : null,
|
||||
tp === "EV1_007" ? { positionName: "-" } : null,
|
||||
tp === "EV1_007" ? { positionLeaveName: "-" } : null
|
||||
);
|
||||
const body = {
|
||||
template: tp,
|
||||
reportName: templateName,
|
||||
data: data,
|
||||
};
|
||||
console.log(body);
|
||||
await genReport(body, fileName);
|
||||
}
|
||||
|
||||
function onClickViewPDF(file: any) {
|
||||
// pdfSrc.value = file.webkitRelativePath;
|
||||
modalView.value = true;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDate();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -127,7 +231,8 @@ function copyLink(link: string) {
|
|||
<q-banner class="text-weight-bold text-red-14 bg-red-2 text-center">
|
||||
<div class="text-weight-bold">
|
||||
<q-icon name="info_outline" color="red-14" size="24px" />
|
||||
ประกาศเมื่อวันที่ {{ AnnouncementDate }}
|
||||
ประกาศเมื่อวันที่ {{ AnnouncementStartDate }} ถึงวันที่
|
||||
{{ AnnouncementEndDate }}
|
||||
</div>
|
||||
</q-banner>
|
||||
</div>
|
||||
|
|
@ -156,7 +261,7 @@ function copyLink(link: string) {
|
|||
round
|
||||
color="primary"
|
||||
icon="mdi-clipboard-outline"
|
||||
@click="copyLink(file.fileName)"
|
||||
@click="copyLink(file.pathName)"
|
||||
>
|
||||
<q-tooltip>คัดลอกลิ้งค์</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
@ -168,6 +273,80 @@ function copyLink(link: string) {
|
|||
</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">
|
||||
บันทึกแจ้งผลการประกาศคัดเลือก
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<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"
|
||||
@click="
|
||||
onClickDowloadFile(
|
||||
'EV1_005',
|
||||
'template-1',
|
||||
'แบบพิจารณาคุณสมบัติบุคคล'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-tooltip> ดาวน์โหลดต้นแบบ </q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 row">
|
||||
<q-btn
|
||||
v-if="fileEvaluation5"
|
||||
class="col-12"
|
||||
outline
|
||||
icon="visibility"
|
||||
label="ดูไฟล์เอกสาร"
|
||||
color="primary"
|
||||
@click="onClickViewPDF(fileEvaluation5)"
|
||||
>
|
||||
<q-tooltip> ดูไฟล์เอกสาร </q-tooltip></q-btn
|
||||
>
|
||||
</div> -->
|
||||
<div class="col-xs-12 col-sm-10 row">
|
||||
<q-file
|
||||
ref="fileEvaluation1Ref"
|
||||
v-model="fileEvaluation5"
|
||||
class="col-12"
|
||||
outlined
|
||||
dense
|
||||
label="อัปโหลดไฟล์"
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
accept=".pdf"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
<div class="col-2 self-center text-center q-pl-none">
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="primary"
|
||||
icon="mdi-upload"
|
||||
@click="upLoadFile"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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">
|
||||
บันทึกแจ้งผลการประกาศคัดเลือก
|
||||
|
|
@ -251,7 +430,7 @@ function copyLink(link: string) {
|
|||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-12">
|
||||
<div class="q-mt-xs q-gutter-md" align="right">
|
||||
<q-btn
|
||||
|
|
@ -263,6 +442,93 @@ function copyLink(link: string) {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<q-dialog
|
||||
v-model="modalView"
|
||||
persistent
|
||||
:maximized="true"
|
||||
transition-show="slide-up"
|
||||
transition-hide="slide-down"
|
||||
>
|
||||
<q-card class="bg-white">
|
||||
<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"
|
||||
v-close-popup
|
||||
/>
|
||||
</div>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row items- items-center">
|
||||
<VuePDF ref="vuePDFRef" :pdf="pdfSrc" :page="page" fit-parent />
|
||||
</div>
|
||||
<div class="row items- items-end">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,19 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue";
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import ViewPDF from "@/modules/12_evaluatePersonal/components/Detail/viewstep/viewPDF.vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import type { FormCommand } from "@/modules/12_evaluatePersonal/interface/index/evalute";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const $q = useQuasar();
|
||||
const AnnouncementStartDate = ref<string | null>();
|
||||
const AnnouncementEndDate = ref<string | null>();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, showLoader, hideLoader, messageError, success } = mixin;
|
||||
const AnnouncementDate = ref<string | null>(date2Thai(new Date()));
|
||||
|
|
@ -28,6 +37,49 @@ function onClickViewPDF(file: any) {
|
|||
const updateInput = (value: any) => {
|
||||
emit("update:form", value, ref);
|
||||
};
|
||||
|
||||
function getDate() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.evaluationDateAnnounce(id.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
AnnouncementStartDate.value = date2Thai(data.dateStartAnnounce);
|
||||
const endDate = new Date(data.dateEndAnnounce);
|
||||
endDate.setDate(endDate.getDate() + 30);
|
||||
AnnouncementEndDate.value = date2Thai(endDate);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function getSigner() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.evaluationSigner(id.value, 2))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
formCommand.elementaryFullName = data.commanderFullnameDoc2;
|
||||
formCommand.elementaryPosition = data.commanderPositionDoc2;
|
||||
formCommand.abovelevelFullname = data.commanderAboveFullnameDoc2;
|
||||
formCommand.abovelevelPosition = data.commanderAbovePositionDoc2;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getSigner();
|
||||
getDate();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -36,11 +88,12 @@ const updateInput = (value: any) => {
|
|||
<q-banner class="text-weight-bold text-red-14 bg-red-2 text-center">
|
||||
<div class="text-weight-bold">
|
||||
<q-icon name="info_outline" color="red-14" size="24px" />
|
||||
ประกาศเมื่อวันที่ {{ AnnouncementDate }}
|
||||
ประกาศเมื่อวันที่ {{ AnnouncementStartDate }} ถึงวันที่
|
||||
{{ AnnouncementEndDate }}
|
||||
</div>
|
||||
</q-banner>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<!-- <div class="col-6">
|
||||
<q-card bordered style="border: 1px solid #d6dee1">
|
||||
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">
|
||||
เอกสารเล่ม 2
|
||||
|
|
@ -49,7 +102,7 @@ const updateInput = (value: any) => {
|
|||
<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">
|
||||
<div class="col-xs-12 col-sm-6 row">
|
||||
<q-btn
|
||||
class="col-12"
|
||||
outline
|
||||
|
|
@ -59,7 +112,7 @@ const updateInput = (value: any) => {
|
|||
>
|
||||
<q-tooltip> ดาวน์โหลดต้นแบบ </q-tooltip></q-btn
|
||||
>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 row">
|
||||
<q-btn
|
||||
v-if="fileEvaluation1"
|
||||
|
|
@ -97,7 +150,7 @@ const updateInput = (value: any) => {
|
|||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="col-12">
|
||||
<q-card bordered style="border: 1px solid #d6dee1">
|
||||
|
|
@ -114,6 +167,7 @@ const updateInput = (value: any) => {
|
|||
</div>
|
||||
<div class="row col-12 q-col-gutter-md q-pa-sm">
|
||||
<q-input
|
||||
readonly
|
||||
ref="elementaryFullNameRef"
|
||||
dense
|
||||
class="col-xs-12 col-sm-6"
|
||||
|
|
@ -125,6 +179,7 @@ const updateInput = (value: any) => {
|
|||
lazy-rules
|
||||
/>
|
||||
<q-input
|
||||
readonly
|
||||
ref="elementaryPositonRef"
|
||||
class="col-xs-12 col-sm-6"
|
||||
dense
|
||||
|
|
@ -146,6 +201,7 @@ const updateInput = (value: any) => {
|
|||
</div>
|
||||
<div class="row col-12 q-col-gutter-md q-pa-sm">
|
||||
<q-input
|
||||
readonly
|
||||
ref="abovelevelFullnameRef"
|
||||
dense
|
||||
class="col-xs-12 col-sm-6"
|
||||
|
|
@ -160,6 +216,7 @@ const updateInput = (value: any) => {
|
|||
ref="abovelevelPositionRef"
|
||||
class="col-xs-12 col-sm-6"
|
||||
dense
|
||||
readonly
|
||||
outlined
|
||||
v-model="formCommand.abovelevelPosition"
|
||||
label="ตำแหน่ง"
|
||||
|
|
|
|||
|
|
@ -1,19 +1,98 @@
|
|||
<script setup lang="ts">
|
||||
import { reactive, ref } from "vue";
|
||||
|
||||
import { reactive, ref,onMounted } from "vue";
|
||||
import { VuePDF, usePDF } from "@tato30/vue-pdf";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useEvaluateDetailStore } from "@/modules/12_evaluatePersonal/store/EvaluateDetail";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import axios from "axios";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
|
||||
const store = useEvaluateDetailStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai } = mixin;
|
||||
|
||||
const { date2Thai, showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
const selectedItem = ref(1);
|
||||
|
||||
function handleItemClick(itemNumber: number) {
|
||||
store.tabPanels = itemNumber.toString();
|
||||
selectedItem.value = itemNumber;
|
||||
|
||||
getFile(itemNumber);
|
||||
}
|
||||
// evaluationFilebyId
|
||||
function getFile(volume: number) {
|
||||
const fileText = numToThai(volume);
|
||||
console.log(fileText)
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.evaluationFilebyId("เล่ม 2", id.value, fileText))
|
||||
.then((res) => {
|
||||
const link = res.data.downloadUrl;
|
||||
const type = res.data.fileType;
|
||||
console.log(link,type)
|
||||
getPDF(link, type);
|
||||
})
|
||||
.catch((e) => {
|
||||
// messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function getPDF(url: string, type: string) {
|
||||
axios
|
||||
.get(url, {
|
||||
method: "GET",
|
||||
responseType: "blob",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: type, // ถ้ามีการระบุเมื่ออัปโหลด
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
store.log = 0;
|
||||
console.log(res);
|
||||
const blob = new Blob([res.data]);
|
||||
const objectUrl = URL.createObjectURL(blob);
|
||||
|
||||
const pdfData = await usePDF(`${objectUrl}`);
|
||||
showLoader();
|
||||
setTimeout(() => {
|
||||
store.log = 1;
|
||||
store.pdfSrcStore = pdfData.pdf.value;
|
||||
store.numOfPagesStore = pdfData.pages.value;
|
||||
hideLoader();
|
||||
}, 1500);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
store.log = 0;
|
||||
});
|
||||
}
|
||||
|
||||
function numToThai(val: number) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
return "1-เอกสารเล่ม 2";
|
||||
default:
|
||||
return "1-เอกสารเล่ม 2";
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
getFile(1)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,24 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import axios from "axios";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
const fullName = ref<string>(
|
||||
keycloak.tokenParsed ? keycloak.tokenParsed.name!.toString() : ""
|
||||
);
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, showLoader, hideLoader, messageError, success } = mixin;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const modalConfirm = ref<boolean>(false);
|
||||
const modalView = ref<boolean>(false);
|
||||
const pdfSrc = ref<any>();
|
||||
|
|
@ -9,33 +27,26 @@ const nameOfWork = ref<string>("");
|
|||
const nameOfOwner = ref<string>("");
|
||||
const position = ref<string>("");
|
||||
const status = ref<string>("WAIT_CHECK_DOC_V2");
|
||||
const fileEvaluation91 = ref<any>();
|
||||
const fileEvaluation92 = ref<any>();
|
||||
const fileEvaluation93 = ref<any>();
|
||||
const fileEvaluation94 = ref<any>();
|
||||
const fileEvaluation95 = ref<any>();
|
||||
const fileEvaluation96 = ref<any>();
|
||||
const fileEvaluation81 = ref<any>();
|
||||
const fileEvaluation82 = ref<any>();
|
||||
const fileEvaluation83 = ref<any>();
|
||||
const fileEvaluation84 = ref<any>();
|
||||
const fileEvaluation85 = ref<any>();
|
||||
const fileEvaluation86 = ref<any>();
|
||||
|
||||
async function onClickDowloadFile(
|
||||
tp: string,
|
||||
templateName: string,
|
||||
fileName: string
|
||||
) {
|
||||
// showLoader();
|
||||
// const data = Object.assign(
|
||||
// { fullName: fullName.value },
|
||||
// tp === "EV1_005" || tp === "EV1_007"
|
||||
// ? { organizationName: "หน่วยงาน" }
|
||||
// : null,
|
||||
// tp === "EV1_007" ? { positionName: "ตำแหน่ง" } : null,
|
||||
// tp === "EV1_007" ? { positionLeaveName: "ระดับ" } : null
|
||||
// );
|
||||
// const body = {
|
||||
// template: tp,
|
||||
// reportName: templateName,
|
||||
// data: data,
|
||||
// };
|
||||
// await genReport(body, fileName);
|
||||
showLoader();
|
||||
|
||||
const body = {
|
||||
template: tp,
|
||||
reportName: templateName,
|
||||
data:{}
|
||||
};
|
||||
await genReport(body, fileName);
|
||||
}
|
||||
|
||||
function onClickViewPDF(file: any) {
|
||||
|
|
@ -46,6 +57,113 @@ function onClickViewPDF(file: any) {
|
|||
function openConfirmEvalution() {
|
||||
modalConfirm.value = true;
|
||||
}
|
||||
|
||||
function upLoadFile(name: string, file: any) {
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.evaluationFileListbyId("เล่ม 2", id.value), {
|
||||
fileList: {
|
||||
fileName: name,
|
||||
metadata: {
|
||||
tag: "value",
|
||||
},
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
const foundKey: any = Object.keys(res.data).find(
|
||||
(key) =>
|
||||
res.data[key]?.fileName !== undefined &&
|
||||
res.data[key]?.fileName !== ""
|
||||
);
|
||||
const link = res.data[foundKey]?.uploadUrl;
|
||||
fileUpLoad(link, file);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function fileUpLoad(url: string, file: any) {
|
||||
axios
|
||||
.put(url, file, {
|
||||
headers: { "Content-Type": file?.type },
|
||||
onUploadProgress: (e) => console.log(e),
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
fileEvaluation81.value = null;
|
||||
fileEvaluation82.value = null;
|
||||
fileEvaluation83.value = null;
|
||||
fileEvaluation84.value = null;
|
||||
fileEvaluation85.value = null;
|
||||
fileEvaluation86.value = null;
|
||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||
});
|
||||
}
|
||||
|
||||
function downloadFile() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.evaluationFilebyId("เล่ม 2", id.value, '2-เอกสารเล่ม 2 (ฉบับแก้ไข)'))
|
||||
.then((res) => {
|
||||
const link = res.data.downloadUrl;
|
||||
const type = res.data.fileType;
|
||||
const fileName = res.data.fileName;
|
||||
getPDF(link, type, fileName);
|
||||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function getPDF(url: string, type: string, fileName: string) {
|
||||
axios
|
||||
.get(url, {
|
||||
method: "GET",
|
||||
responseType: "blob",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: type, // ถ้ามีการระบุเมื่ออัปโหลด
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
console.log(res);
|
||||
const a = document.createElement("a");
|
||||
a.href = window.URL.createObjectURL(res.data);
|
||||
a.download = fileName;
|
||||
// a.download = res.data.fileName + `.${mime.getExtension(res.data.fileType)}`
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
function confirmApprove(){
|
||||
const data = {
|
||||
metadata: {
|
||||
additionalProp1: nameOfWork.value,
|
||||
additionalProp2: nameOfOwner.value,
|
||||
additionalProp3: position.value,
|
||||
},
|
||||
}
|
||||
showLoader()
|
||||
http
|
||||
.patch(config.API.evaluationPatchData('เล่ม 2',id.value,'2-เอกสารเล่ม 2 (ฉบับแก้ไข)'),data)
|
||||
.then((res)=>{
|
||||
console.log(res)
|
||||
}).catch((e)=>{
|
||||
messageError($q,e)
|
||||
}).finally(()=>{
|
||||
modalConfirm.value = false
|
||||
hideLoader()
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -78,9 +196,9 @@ function openConfirmEvalution() {
|
|||
color="primary"
|
||||
@click="
|
||||
onClickDowloadFile(
|
||||
'EV1_005',
|
||||
'template-1',
|
||||
'แบบพิจารณาคุณสมบัติบุคคล'
|
||||
'เอกสารแบบ ค',
|
||||
'template-4',
|
||||
'เอกสารแบบ ค'
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -89,20 +207,20 @@ function openConfirmEvalution() {
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-6 row">
|
||||
<q-btn
|
||||
v-if="fileEvaluation91"
|
||||
v-if="fileEvaluation81"
|
||||
class="col-12"
|
||||
outline
|
||||
icon="visibility"
|
||||
label="ดูไฟล์เอกสาร"
|
||||
color="primary"
|
||||
@click="onClickViewPDF(fileEvaluation91)"
|
||||
@click="onClickViewPDF(fileEvaluation81)"
|
||||
>
|
||||
<q-tooltip> ดูไฟล์เอกสาร </q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-10 row">
|
||||
<q-file
|
||||
v-model="fileEvaluation91"
|
||||
v-model="fileEvaluation81"
|
||||
class="col-12"
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -110,6 +228,7 @@ function openConfirmEvalution() {
|
|||
lazy-rules
|
||||
label="อัปโหลดไฟล์"
|
||||
accept=".pdf"
|
||||
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
|
|
@ -123,6 +242,12 @@ function openConfirmEvalution() {
|
|||
dense
|
||||
color="primary"
|
||||
icon="mdi-upload"
|
||||
@click="
|
||||
upLoadFile(
|
||||
'แบบตรวจสอบความถูกต้องครบถ้วนของข้อมูลประกอบการประเมินผลงาน (เอกสารแบบ ค)',
|
||||
fileEvaluation81
|
||||
)
|
||||
"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
|
|
@ -149,9 +274,9 @@ function openConfirmEvalution() {
|
|||
color="primary"
|
||||
@click="
|
||||
onClickDowloadFile(
|
||||
'EV1_005',
|
||||
'template-1',
|
||||
'แบบพิจารณาคุณสมบัติบุคคล'
|
||||
'เอกสารหมายเลข 15',
|
||||
'template-4',
|
||||
'เอกสารหมายเลข 15'
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -160,20 +285,20 @@ function openConfirmEvalution() {
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-6 row">
|
||||
<q-btn
|
||||
v-if="fileEvaluation92"
|
||||
v-if="fileEvaluation82"
|
||||
class="col-12"
|
||||
outline
|
||||
icon="visibility"
|
||||
label="ดูไฟล์เอกสาร"
|
||||
color="primary"
|
||||
@click="onClickViewPDF(fileEvaluation92)"
|
||||
@click="onClickViewPDF(fileEvaluation82)"
|
||||
>
|
||||
<q-tooltip> ดูไฟล์เอกสาร </q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-10 row">
|
||||
<q-file
|
||||
v-model="fileEvaluation92"
|
||||
v-model="fileEvaluation82"
|
||||
class="col-12"
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -181,6 +306,7 @@ function openConfirmEvalution() {
|
|||
lazy-rules
|
||||
label="อัปโหลดไฟล์"
|
||||
accept=".pdf"
|
||||
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
|
|
@ -194,6 +320,12 @@ function openConfirmEvalution() {
|
|||
dense
|
||||
color="primary"
|
||||
icon="mdi-upload"
|
||||
@click="
|
||||
upLoadFile(
|
||||
'บัญชีแสดงการรับ-ส่งผลงาน (เอกสารหมายเลข 15)',
|
||||
fileEvaluation82
|
||||
)
|
||||
"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
|
|
@ -220,9 +352,9 @@ function openConfirmEvalution() {
|
|||
color="primary"
|
||||
@click="
|
||||
onClickDowloadFile(
|
||||
'EV1_005',
|
||||
'template-1',
|
||||
'แบบพิจารณาคุณสมบัติบุคคล'
|
||||
'เอกสารหมายเลข 16',
|
||||
'template-4',
|
||||
'เอกสารหมายเลข 16'
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -231,20 +363,20 @@ function openConfirmEvalution() {
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-6 row">
|
||||
<q-btn
|
||||
v-if="fileEvaluation93"
|
||||
v-if="fileEvaluation83"
|
||||
class="col-12"
|
||||
outline
|
||||
icon="visibility"
|
||||
label="ดูไฟล์เอกสาร"
|
||||
color="primary"
|
||||
@click="onClickViewPDF(fileEvaluation93)"
|
||||
@click="onClickViewPDF(fileEvaluation83)"
|
||||
>
|
||||
<q-tooltip> ดูไฟล์เอกสาร </q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-10 row">
|
||||
<q-file
|
||||
v-model="fileEvaluation93"
|
||||
v-model="fileEvaluation83"
|
||||
class="col-12"
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -265,6 +397,12 @@ function openConfirmEvalution() {
|
|||
dense
|
||||
color="primary"
|
||||
icon="mdi-upload"
|
||||
@click="
|
||||
upLoadFile(
|
||||
'แบบประเมินผลงาน (เอกสารหมายเลข 16)',
|
||||
fileEvaluation83
|
||||
)
|
||||
"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
|
|
@ -291,9 +429,9 @@ function openConfirmEvalution() {
|
|||
color="primary"
|
||||
@click="
|
||||
onClickDowloadFile(
|
||||
'EV1_005',
|
||||
'template-1',
|
||||
'แบบพิจารณาคุณสมบัติบุคคล'
|
||||
'เอกสารหมายเลข 17',
|
||||
'template-4',
|
||||
'เอกสารหมายเลข 17'
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -302,20 +440,20 @@ function openConfirmEvalution() {
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-6 row">
|
||||
<q-btn
|
||||
v-if="fileEvaluation94"
|
||||
v-if="fileEvaluation84"
|
||||
class="col-12"
|
||||
outline
|
||||
icon="visibility"
|
||||
label="ดูไฟล์เอกสาร"
|
||||
color="primary"
|
||||
@click="onClickViewPDF(fileEvaluation94)"
|
||||
@click="onClickViewPDF(fileEvaluation84)"
|
||||
>
|
||||
<q-tooltip> ดูไฟล์เอกสาร </q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-10 row">
|
||||
<q-file
|
||||
v-model="fileEvaluation94"
|
||||
v-model="fileEvaluation84"
|
||||
class="col-12"
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -336,6 +474,12 @@ function openConfirmEvalution() {
|
|||
dense
|
||||
color="primary"
|
||||
icon="mdi-upload"
|
||||
@click="
|
||||
upLoadFile(
|
||||
'แบบแสดงการประเมินผลงาน (เอกสารหมายเลข 17)',
|
||||
fileEvaluation84
|
||||
)
|
||||
"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
|
|
@ -362,9 +506,9 @@ function openConfirmEvalution() {
|
|||
color="primary"
|
||||
@click="
|
||||
onClickDowloadFile(
|
||||
'EV1_005',
|
||||
'template-1',
|
||||
'แบบพิจารณาคุณสมบัติบุคคล'
|
||||
'เอกสารหมายเลข 18',
|
||||
'template-4',
|
||||
'เอกสารหมายเลข 18'
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -373,20 +517,20 @@ function openConfirmEvalution() {
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-6 row">
|
||||
<q-btn
|
||||
v-if="fileEvaluation95"
|
||||
v-if="fileEvaluation85"
|
||||
class="col-12"
|
||||
outline
|
||||
icon="visibility"
|
||||
label="ดูไฟล์เอกสาร"
|
||||
color="primary"
|
||||
@click="onClickViewPDF(fileEvaluation95)"
|
||||
@click="onClickViewPDF(fileEvaluation85)"
|
||||
>
|
||||
<q-tooltip> ดูไฟล์เอกสาร </q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-10 row">
|
||||
<q-file
|
||||
v-model="fileEvaluation95"
|
||||
v-model="fileEvaluation85"
|
||||
class="col-12"
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -407,6 +551,12 @@ function openConfirmEvalution() {
|
|||
dense
|
||||
color="primary"
|
||||
icon="mdi-upload"
|
||||
@click="
|
||||
upLoadFile(
|
||||
'แบบรายงานผลการประเมินบุคคล (เอกสารหมายเลข 18)',
|
||||
fileEvaluation85
|
||||
)
|
||||
"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
|
|
@ -433,9 +583,9 @@ function openConfirmEvalution() {
|
|||
color="primary"
|
||||
@click="
|
||||
onClickDowloadFile(
|
||||
'EV1_005',
|
||||
'template-1',
|
||||
'แบบพิจารณาคุณสมบัติบุคคล'
|
||||
'เอกสารแบบ ง',
|
||||
'template-4',
|
||||
'เอกสารแบบ ง'
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -444,20 +594,20 @@ function openConfirmEvalution() {
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-6 row">
|
||||
<q-btn
|
||||
v-if="fileEvaluation96"
|
||||
v-if="fileEvaluation86"
|
||||
class="col-12"
|
||||
outline
|
||||
icon="visibility"
|
||||
label="ดูไฟล์เอกสาร"
|
||||
color="primary"
|
||||
@click="onClickViewPDF(fileEvaluation96)"
|
||||
@click="onClickViewPDF(fileEvaluation86)"
|
||||
>
|
||||
<q-tooltip> ดูไฟล์เอกสาร </q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-10 row">
|
||||
<q-file
|
||||
v-model="fileEvaluation96"
|
||||
v-model="fileEvaluation86"
|
||||
class="col-12"
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -478,6 +628,12 @@ function openConfirmEvalution() {
|
|||
dense
|
||||
color="primary"
|
||||
icon="mdi-upload"
|
||||
@click="
|
||||
upLoadFile(
|
||||
'แบบสรุปผลการประเมิน (เอกสารแบบ ง)',
|
||||
fileEvaluation86
|
||||
)
|
||||
"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
|
|
@ -506,13 +662,7 @@ function openConfirmEvalution() {
|
|||
icon="download"
|
||||
label="ดาวน์โหลด"
|
||||
color="primary"
|
||||
@click="
|
||||
onClickDowloadFile(
|
||||
'EV1_005',
|
||||
'template-1',
|
||||
'แบบพิจารณาคุณสมบัติบุคคล'
|
||||
)
|
||||
"
|
||||
@click="downloadFile"
|
||||
>
|
||||
<q-tooltip> ดาวน์โหลดต้นแบบ </q-tooltip></q-btn
|
||||
>
|
||||
|
|
@ -591,6 +741,7 @@ function openConfirmEvalution() {
|
|||
id="onSubmit"
|
||||
class="q-px-md q-py-xs"
|
||||
label="ยืนยัน"
|
||||
@click="confirmApprove"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,19 +1,42 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { success } = mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const status = ref<string>("DONE");
|
||||
const link = ref<string>('https://bma-ehr-publish.frappet.synology.me')
|
||||
|
||||
function copyLink(){
|
||||
const linkById = `${link.value}/${id.value}`
|
||||
navigator.clipboard.writeText(linkById);
|
||||
success($q,'คัดลอกสำเร็จ')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<div>
|
||||
<p class="text-weight-bold" style="font-size: 18px;">Public URL</p>
|
||||
<a :href="link" target="_blank">{{ link }}</a>
|
||||
</div>
|
||||
|
||||
<q-btn
|
||||
class="q-mt-md"
|
||||
outline
|
||||
color="green"
|
||||
label="คัดลอก URL"
|
||||
class="q-pa-sm"
|
||||
style="font-size: 16px"
|
||||
/>
|
||||
icon="mdi-clipboard-outline"
|
||||
label="คัดลอกลิ้งค์"
|
||||
color="primary"
|
||||
@click="copyLink"
|
||||
>
|
||||
<q-tooltip> คัดลอกลิ้งค์ </q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { ref, onMounted, defineProps, watch } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
|
|
@ -15,11 +15,20 @@ import DialogDirector from "@/modules/12_evaluatePersonal/components/Detail/view
|
|||
|
||||
/** import store*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const mixin = useCounterMixin();
|
||||
const $q = useQuasar();
|
||||
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Array,
|
||||
default: [],
|
||||
},
|
||||
});
|
||||
const { showLoader, hideLoader, messageError, dialogConfirm } = mixin;
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
@ -49,15 +58,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "duty",
|
||||
align: "left",
|
||||
label: "หน้าที่",
|
||||
sortable: true,
|
||||
field: "duty",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "email",
|
||||
align: "left",
|
||||
|
|
@ -144,9 +144,82 @@ async function updatePaging(rpp: number, p: number) {
|
|||
*/
|
||||
function returnDirector(data: any) {
|
||||
const dataList = data.map((item: any) => item.id);
|
||||
rows.value = data;
|
||||
onClickClose();
|
||||
console.log(dataList);
|
||||
|
||||
dialogConfirm($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.evaluationChooseDirectors(id.value), {
|
||||
directors: dataList,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
onClickClose();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getList() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.evaluateDirectorMain())
|
||||
.then((res) => {
|
||||
// maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
|
||||
const data = res.data.result;
|
||||
|
||||
listDirector.value = data.map((item: any) => ({
|
||||
id: item.id,
|
||||
name: `${item.prefix}${item.firstName} ${item.lastName}`,
|
||||
createdAt: item.createdAt,
|
||||
createdUserId: item.createdUserId,
|
||||
lastUpdatedAt: item.lastUpdatedAt,
|
||||
lastUpdateUserId: item.lastUpdateUserId,
|
||||
createdFullName: item.createdFullName,
|
||||
lastUpdateFullName: item.lastUpdateFullName,
|
||||
prefix: item.prefix,
|
||||
firstName: item.firstName,
|
||||
lastName: item.lastName,
|
||||
phone: item.phone,
|
||||
email: item.email,
|
||||
position: item.position,
|
||||
}));
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.data,
|
||||
() => {
|
||||
if (props.data) {
|
||||
rows.value = props.data.map((item: any) => ({
|
||||
id:item.id,
|
||||
name:`${item.prefix}${item.firstName} ${item.lastName}`,
|
||||
prefix:item.prefix,
|
||||
firstName:item.firstName,
|
||||
lastName:item.lastName,
|
||||
position:item.position,
|
||||
positionName:item.positionName,
|
||||
email:item.email,
|
||||
phone:item.phone,
|
||||
}));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,25 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { ref, onMounted, watch, defineProps } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const mixin = useCounterMixin();
|
||||
const $q = useQuasar();
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Array,
|
||||
default: [],
|
||||
},
|
||||
});
|
||||
const { showLoader, hideLoader, messageError, dialogConfirm, date2Thai } =
|
||||
mixin;
|
||||
import DialogMeet from "@/modules/12_evaluatePersonal/components/Detail/viewTab2/DialogMeet.vue";
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -17,22 +35,22 @@ const columns = ref<QTableProps["columns"]>([
|
|||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "dateMeeting",
|
||||
name: "date",
|
||||
align: "left",
|
||||
label: "วันเวลาในการประชุม",
|
||||
sortable: true,
|
||||
field: "dateMeeting",
|
||||
field: "date",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "results",
|
||||
name: "result",
|
||||
align: "left",
|
||||
label: "ผลการพิจารณาของคณะกรรมการประเมินผลงานแต่ละคณะ",
|
||||
sortable: true,
|
||||
field: "results",
|
||||
field: "result",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -86,9 +104,89 @@ async function updatePaging(rpp: number, p: number) {
|
|||
*/
|
||||
function returnData(data: any) {
|
||||
const dataList = data.map((item: any) => item.id);
|
||||
rows.value = data;
|
||||
onClickClose();
|
||||
dialogConfirm($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.evaluationChooseMeeting(id.value), {
|
||||
meetings: dataList,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
onClickClose();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API
|
||||
.meeting
|
||||
// currentPage.value,
|
||||
// rowsPerPage.value,
|
||||
// filterKeyword.value
|
||||
()
|
||||
)
|
||||
.then((res) => {
|
||||
// maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
|
||||
const data = res.data.result;
|
||||
listMeet.value = data.map((item: any) => ({
|
||||
id: item.id,
|
||||
createdAt: item.createdAt,
|
||||
createdUserId: item.createdUserId,
|
||||
lastUpdatedAt: item.lastUpdatedAt,
|
||||
lastUpdateUserId: item.lastUpdateUserId,
|
||||
createdFullName: item.createdFullName,
|
||||
lastUpdateFullName: item.lastUpdateFullName,
|
||||
title: item.tittle,
|
||||
round: item.round,
|
||||
date: `${date2Thai(item.dateStart as Date, false, true)} - ${date2Thai(
|
||||
item.dateEnd as Date,
|
||||
false,
|
||||
true
|
||||
)}`,
|
||||
result: item.result,
|
||||
timePeriod: item.duration,
|
||||
}));
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.data,
|
||||
() => {
|
||||
if (props.data) {
|
||||
console.log(props.data)
|
||||
rows.value = props.data.map((item: any) => ({
|
||||
id: item.id,
|
||||
date: `${date2Thai(item.dateStart as Date, false, true)} - ${date2Thai(
|
||||
item.dateEnd as Date,
|
||||
false,
|
||||
true
|
||||
)}`,
|
||||
dateStart: item.dateStart,
|
||||
dateEnd: item.dateEnd,
|
||||
result: item.result,
|
||||
timePeriod: item.duration,
|
||||
}));
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<q-card bordered class="row col-12" style="border: 1px solid #d6dee1">
|
||||
|
|
|
|||
|
|
@ -15,15 +15,13 @@ const currentPage = ref<number>(1);
|
|||
/** ค้นหาคอลัม */
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
"dateMeeting",
|
||||
"results",
|
||||
"timePeriod",
|
||||
"name",
|
||||
"position",
|
||||
"email",
|
||||
"phone",
|
||||
"role",
|
||||
]);
|
||||
|
||||
/**ข้อมูลหัว ตาราง*/
|
||||
// หัวตาราง
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -33,42 +31,42 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "dateMeeting",
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "วันเวลาในการประชุม",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
sortable: true,
|
||||
field: "dateMeeting",
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "results",
|
||||
name: "position",
|
||||
align: "left",
|
||||
label: "ผลการพิจารณาของคณะกรรมการประเมินผลงานแต่ละคณะ",
|
||||
label: "ตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "results",
|
||||
field: "position",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
|
||||
{
|
||||
name: "timePeriod",
|
||||
name: "email",
|
||||
align: "left",
|
||||
label: "ระยะเวลาในการแก้ไขผลงาน",
|
||||
label: "อีเมล",
|
||||
sortable: true,
|
||||
field: "timePeriod",
|
||||
field: "email",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "phone",
|
||||
align: "left",
|
||||
label: "เบอร์โทรศัพท์",
|
||||
sortable: true,
|
||||
field: "phone",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -37,22 +37,22 @@ const columns = ref<QTableProps["columns"]>([
|
|||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "dateMeeting",
|
||||
name: "date",
|
||||
align: "left",
|
||||
label: "วันเวลาในการประชุม",
|
||||
sortable: true,
|
||||
field: "dateMeeting",
|
||||
field: "date",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "results",
|
||||
name: "result",
|
||||
align: "left",
|
||||
label: "ผลการพิจารณาของคณะกรรมการประเมินผลงานแต่ละคณะ",
|
||||
sortable: true,
|
||||
field: "results",
|
||||
field: "result",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@ watch(()=>store.log, () => {
|
|||
if(store.log === 1){
|
||||
numOfPages.value = store.numOfPagesStore;
|
||||
pdfSrc.value = store.pdfSrcStore;
|
||||
console.log('1',pdfSrc.value)
|
||||
console.log('2',numOfPages.value)
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue