ต่อ api รายละเอียดการประเมินของ
This commit is contained in:
parent
cab89c78f3
commit
4521f80918
17 changed files with 1226 additions and 191 deletions
|
|
@ -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) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue