ปรับ code ประเมิน
This commit is contained in:
parent
ab4189e6ed
commit
53cd8e593c
10 changed files with 171 additions and 226 deletions
|
|
@ -47,7 +47,7 @@ onMounted(async () => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="row col-12">
|
<div class="row col-12 q-pa-md">
|
||||||
<div class="toptitle">กรรมการและการประชุม</div>
|
<div class="toptitle">กรรมการและการประชุม</div>
|
||||||
|
|
||||||
<div class="row col-12 q-gutter-md">
|
<div class="row col-12 q-gutter-md">
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,21 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch } from "vue";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
import type { QTableProps } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
|
/** importComponents */
|
||||||
import HeaderDialog from "@/components/DialogHeader.vue";
|
import HeaderDialog from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
import type { QTableProps } from "quasar";
|
/** importStore*/
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
/**use*/
|
||||||
const mixins = useCounterMixin();
|
const mixins = useCounterMixin();
|
||||||
const { showLoader, hideLoader, date2Thai } = mixins;
|
const $q = useQuasar();
|
||||||
|
|
||||||
|
const { showLoader, hideLoader, date2Thai, messageError } = mixins;
|
||||||
|
|
||||||
/** รับ props Tab 1 */
|
/** รับ props Tab 1 */
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -91,7 +97,9 @@ async function fetchListHistory(id: string) {
|
||||||
}));
|
}));
|
||||||
row.value = list;
|
row.value = list;
|
||||||
})
|
})
|
||||||
.catch((err) => {})
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,9 @@ function getFile(volume: number) {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const link = res.data.downloadUrl;
|
const link = res.data.downloadUrl;
|
||||||
const type = res.data.fileType;
|
const type = res.data.fileType;
|
||||||
|
|
||||||
getPDF(link, type);
|
getPDF(link, type);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch(() => {
|
||||||
// messageError($q, e);
|
// messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
@ -116,8 +115,8 @@ function numToThai(val: number) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
getFile(selectedItem.value);
|
await getFile(selectedItem.value);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,25 +3,26 @@ import { ref, onMounted, defineProps, watch } from "vue";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
|
/** importType*/
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import type { Director } from "@/modules/11_discipline/interface/request/disciplinary";
|
import type { Director } from "@/modules/11_discipline/interface/request/disciplinary";
|
||||||
import type {
|
|
||||||
responseType,
|
|
||||||
directorType,
|
|
||||||
} from "@/modules/11_discipline/interface/index/Main";
|
|
||||||
|
|
||||||
|
/** importComponents*/
|
||||||
import DialogDirector from "@/modules/12_evaluatePersonal/components/Detail/viewTab2/DialogDirector.vue";
|
import DialogDirector from "@/modules/12_evaluatePersonal/components/Detail/viewTab2/DialogDirector.vue";
|
||||||
|
|
||||||
/** import store*/
|
/** import store*/
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
|
||||||
const router = useRouter();
|
/**use*/
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const id = ref<string>(route.params.id as string);
|
const id = ref<string>(route.params.id as string);
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
||||||
|
const { showLoader, hideLoader, messageError, dialogConfirm, success } = mixin;
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
|
@ -30,10 +31,10 @@ const props = defineProps({
|
||||||
fetchdata: {
|
fetchdata: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => "",
|
default: () => "",
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
const { showLoader, hideLoader, messageError, dialogConfirm, success } = mixin;
|
|
||||||
|
|
||||||
|
/** คอลัมน์ กรรมการ */
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "no",
|
name: "no",
|
||||||
|
|
@ -98,40 +99,6 @@ function onClickClose() {
|
||||||
modalAddDirector.value = false;
|
modalAddDirector.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** function เรียกรายชื่อกรรมการ*/
|
|
||||||
async function fetchDListDirector() {
|
|
||||||
// showLoader();
|
|
||||||
// await http
|
|
||||||
// .get(config.API.directorList(page.value, rowsPerPage.value, filter.value))
|
|
||||||
// .then((res) => {
|
|
||||||
// maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
|
|
||||||
// const data = res.data.result.data;
|
|
||||||
// let datalistDirector: responseType[] = data.map((e: directorType) => ({
|
|
||||||
// id: e.id,
|
|
||||||
// directorId: e.directorId,
|
|
||||||
// name: `${e.prefix}${e.firstName} ${e.lastName}`,
|
|
||||||
// prefix: e.prefix,
|
|
||||||
// firstName: e.firstName,
|
|
||||||
// lastName: e.lastName,
|
|
||||||
// position: e.position,
|
|
||||||
// email: e.email,
|
|
||||||
// phone: e.phone,
|
|
||||||
// total: e.total,
|
|
||||||
// duty: e.duty,
|
|
||||||
// }));
|
|
||||||
// // /** หารานชื่อกรรมการที่ไม่ซ้ำ*/
|
|
||||||
// listDirector.value = datalistDirector.filter(
|
|
||||||
// (i) => !rows.value.some((e) => e.directorId === i.id)
|
|
||||||
// );
|
|
||||||
// })
|
|
||||||
// .catch((err) => {
|
|
||||||
// messageError($q, err);
|
|
||||||
// })
|
|
||||||
// .finally(() => {
|
|
||||||
// hideLoader();
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function อัดเดท Paging กรรมการ
|
* function อัดเดท Paging กรรมการ
|
||||||
* @param rpp ต่อหน้า
|
* @param rpp ต่อหน้า
|
||||||
|
|
@ -154,28 +121,27 @@ function returnDirector(data: any) {
|
||||||
.put(config.API.evaluationChooseDirectors(id.value), {
|
.put(config.API.evaluationChooseDirectors(id.value), {
|
||||||
directors: dataList,
|
directors: dataList,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then(() => {
|
||||||
success($q, "บันทึกสำเร็จ")
|
success($q, "บันทึกสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
props.fetchdata();
|
||||||
props.fetchdata()
|
|
||||||
onClickClose();
|
onClickClose();
|
||||||
|
hideLoader();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getList() {
|
/** function เรียกรายชื่อกรรมการ*/
|
||||||
|
async function getList() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
await http
|
||||||
.get(config.API.evaluateDirectorMain())
|
.get(config.API.evaluateDirectorMain())
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
|
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
||||||
listDirector.value = data.map((item: any) => ({
|
listDirector.value = data.map((item: any) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: `${item.prefix}${item.firstName} ${item.lastName}`,
|
name: `${item.prefix}${item.firstName} ${item.lastName}`,
|
||||||
|
|
@ -206,15 +172,15 @@ watch(
|
||||||
() => {
|
() => {
|
||||||
if (props.data) {
|
if (props.data) {
|
||||||
rows.value = props.data.map((item: any) => ({
|
rows.value = props.data.map((item: any) => ({
|
||||||
id:item.id,
|
id: item.id,
|
||||||
name:`${item.prefix}${item.firstName} ${item.lastName}`,
|
name: `${item.prefix}${item.firstName} ${item.lastName}`,
|
||||||
prefix:item.prefix,
|
prefix: item.prefix,
|
||||||
firstName:item.firstName,
|
firstName: item.firstName,
|
||||||
lastName:item.lastName,
|
lastName: item.lastName,
|
||||||
position:item.position,
|
position: item.position,
|
||||||
positionName:item.positionName,
|
positionName: item.positionName,
|
||||||
email:item.email,
|
email: item.email,
|
||||||
phone:item.phone,
|
phone: item.phone,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -285,7 +251,6 @@ onMounted(() => {
|
||||||
:clickClose="onClickClose"
|
:clickClose="onClickClose"
|
||||||
:rows2="listDirector"
|
:rows2="listDirector"
|
||||||
v-model:filterKeyword2="filter"
|
v-model:filterKeyword2="filter"
|
||||||
:get-list="fetchDListDirector"
|
|
||||||
:rowsPerPage="rowsPerPage"
|
:rowsPerPage="rowsPerPage"
|
||||||
:page="page"
|
:page="page"
|
||||||
:maxPage="maxPage"
|
:maxPage="maxPage"
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,23 @@
|
||||||
import { ref, onMounted, watch, defineProps } from "vue";
|
import { ref, onMounted, watch, defineProps } from "vue";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useRoute } from "vue-router";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
const router = useRouter();
|
/** importComponents*/
|
||||||
|
import DialogMeet from "@/modules/12_evaluatePersonal/components/Detail/viewTab2/DialogMeet.vue";
|
||||||
|
|
||||||
|
/** importStore*/
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
/** use*/
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const id = ref<string>(route.params.id as string);
|
const id = ref<string>(route.params.id as string);
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
||||||
|
/** props*/
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
|
@ -20,11 +27,17 @@ const props = defineProps({
|
||||||
fetchdata: {
|
fetchdata: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => "",
|
default: () => "",
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
const { showLoader, hideLoader, messageError, dialogConfirm, date2Thai, success } =
|
|
||||||
mixin;
|
const {
|
||||||
import DialogMeet from "@/modules/12_evaluatePersonal/components/Detail/viewTab2/DialogMeet.vue";
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
dialogConfirm,
|
||||||
|
date2Thai,
|
||||||
|
success,
|
||||||
|
} = mixin;
|
||||||
|
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -90,8 +103,6 @@ function onClickClose() {
|
||||||
modalAdd.value = false;
|
modalAdd.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchListMeet() {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function อัดเดท Paging กรรมการ
|
* function อัดเดท Paging กรรมการ
|
||||||
* @param rpp ต่อหน้า
|
* @param rpp ต่อหน้า
|
||||||
|
|
@ -115,32 +126,25 @@ function returnData(data: any) {
|
||||||
meetings: dataList,
|
meetings: dataList,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
success($q, "บันทึกสำเร็จ")
|
success($q, "บันทึกสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
props.fetchdata();
|
||||||
props.fetchdata()
|
|
||||||
onClickClose();
|
onClickClose();
|
||||||
|
hideLoader();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** function เรียกข้อมูลการประชุม*/
|
||||||
async function getList() {
|
async function getList() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(
|
.get(config.API.meeting())
|
||||||
config.API
|
|
||||||
.meeting
|
|
||||||
// currentPage.value,
|
|
||||||
// rowsPerPage.value,
|
|
||||||
// filterKeyword.value
|
|
||||||
()
|
|
||||||
)
|
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
|
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
listMeet.value = data.map((item: any) => ({
|
listMeet.value = data.map((item: any) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
|
|
@ -168,15 +172,11 @@ async function getList() {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.data,
|
() => props.data,
|
||||||
() => {
|
() => {
|
||||||
if (props.data) {
|
if (props.data) {
|
||||||
console.log(props.data)
|
|
||||||
rows.value = props.data.map((item: any) => ({
|
rows.value = props.data.map((item: any) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
date: `${date2Thai(item.dateStart as Date, false, true)} - ${date2Thai(
|
date: `${date2Thai(item.dateStart as Date, false, true)} - ${date2Thai(
|
||||||
|
|
@ -192,6 +192,10 @@ watch(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await getList();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-card bordered class="row col-12" style="border: 1px solid #d6dee1">
|
<q-card bordered class="row col-12" style="border: 1px solid #d6dee1">
|
||||||
|
|
@ -253,7 +257,6 @@ watch(
|
||||||
:clickClose="onClickClose"
|
:clickClose="onClickClose"
|
||||||
:rows2="listMeet"
|
:rows2="listMeet"
|
||||||
v-model:filterKeyword2="filter"
|
v-model:filterKeyword2="filter"
|
||||||
:get-list="fetchListMeet"
|
|
||||||
:rowsPerPage="rowsPerPage"
|
:rowsPerPage="rowsPerPage"
|
||||||
:page="page"
|
:page="page"
|
||||||
:maxPage="maxPage"
|
:maxPage="maxPage"
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,50 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, watchEffect, watch, type PropType } from "vue";
|
import { ref, computed, watchEffect, watch, type PropType } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
/** importType*/
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import type { directorType } from "@/modules/11_discipline/interface/index/Main";
|
import type { directorType } from "@/modules/11_discipline/interface/index/Main";
|
||||||
|
|
||||||
|
/** importComponents*/
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
const $q = useQuasar();
|
|
||||||
const selected = ref<directorType[]>([]);
|
const selected = ref<directorType[]>([]);
|
||||||
const mixin = useCounterMixin();
|
|
||||||
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
|
/** รับ props มาจากหน้าหลัก */
|
||||||
|
const props = defineProps({
|
||||||
|
Modal: Boolean,
|
||||||
|
clickClose: Function,
|
||||||
|
getData: Function,
|
||||||
|
rows2: Array,
|
||||||
|
filterKeyword2: String,
|
||||||
|
filterTable: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
maxPage: {
|
||||||
|
type: Number,
|
||||||
|
require: true,
|
||||||
|
},
|
||||||
|
rowsPerPage: {
|
||||||
|
type: Number,
|
||||||
|
require: true,
|
||||||
|
},
|
||||||
|
page: {
|
||||||
|
type: Number,
|
||||||
|
require: true,
|
||||||
|
},
|
||||||
|
getList: {
|
||||||
|
type: Function,
|
||||||
|
default: () => "",
|
||||||
|
},
|
||||||
|
selectedRow: {
|
||||||
|
type: Array as PropType<directorType[]>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const currentPage = ref<number>(1);
|
const currentPage = ref<number>(1);
|
||||||
|
|
||||||
/** ค้นหาคอลัม */
|
/** ค้นหาคอลัม */
|
||||||
const visibleColumns2 = ref<string[]>([
|
const visibleColumns2 = ref<string[]>([
|
||||||
"no",
|
"no",
|
||||||
|
|
@ -70,39 +103,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** รับ props มาจากหน้าหลัก */
|
|
||||||
const props = defineProps({
|
|
||||||
Modal: Boolean,
|
|
||||||
clickClose: Function,
|
|
||||||
getData: Function,
|
|
||||||
rows2: Array,
|
|
||||||
filterKeyword2: String,
|
|
||||||
filterTable: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
maxPage: {
|
|
||||||
type: Number,
|
|
||||||
require: true,
|
|
||||||
},
|
|
||||||
rowsPerPage: {
|
|
||||||
type: Number,
|
|
||||||
require: true,
|
|
||||||
},
|
|
||||||
page: {
|
|
||||||
type: Number,
|
|
||||||
require: true,
|
|
||||||
},
|
|
||||||
getList: {
|
|
||||||
type: Function,
|
|
||||||
default: () => "",
|
|
||||||
},
|
|
||||||
selectedRow: {
|
|
||||||
type: Array as PropType<directorType[]>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
/** แสดงจำนวนในตาราง */
|
/** แสดงจำนวนในตาราง */
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
descending: true,
|
descending: true,
|
||||||
|
|
@ -146,7 +146,6 @@ function updateProp(newPagination: any, page: number) {
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
if (props.Modal === true) {
|
if (props.Modal === true) {
|
||||||
selected.value = props.selectedRow;
|
selected.value = props.selectedRow;
|
||||||
props.getList();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,55 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, watchEffect, watch, type PropType } from "vue";
|
import { ref, computed, watchEffect, watch, type PropType } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
/** importType*/
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import type { directorType } from "@/modules/11_discipline/interface/index/Main";
|
import type { directorType } from "@/modules/11_discipline/interface/index/Main";
|
||||||
|
|
||||||
|
/** importComponents*/
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
const $q = useQuasar();
|
|
||||||
const selected = ref<directorType[]>([]);
|
const selected = ref<directorType[]>([]);
|
||||||
const mixin = useCounterMixin();
|
|
||||||
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
|
|
||||||
const currentPage = ref<number>(1);
|
const currentPage = ref<number>(1);
|
||||||
/** ค้นหาคอลัม */
|
|
||||||
const visibleColumns2 = ref<string[]>([
|
/** รับ props มาจากหน้าหลัก */
|
||||||
"no",
|
const props = defineProps({
|
||||||
"name",
|
Modal: Boolean,
|
||||||
"position",
|
clickClose: Function,
|
||||||
"duty",
|
getData: Function,
|
||||||
"email",
|
rows2: Array,
|
||||||
"phone",
|
filterKeyword2: String,
|
||||||
"role",
|
filterTable: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
maxPage: {
|
||||||
|
type: Number,
|
||||||
|
require: true,
|
||||||
|
},
|
||||||
|
rowsPerPage: {
|
||||||
|
type: Number,
|
||||||
|
require: true,
|
||||||
|
},
|
||||||
|
page: {
|
||||||
|
type: Number,
|
||||||
|
require: true,
|
||||||
|
},
|
||||||
|
getList: {
|
||||||
|
type: Function,
|
||||||
|
default: () => "",
|
||||||
|
},
|
||||||
|
selectedRow: {
|
||||||
|
type: Array as PropType<directorType[]>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
/** emit*/
|
||||||
|
const emit = defineEmits([
|
||||||
|
"update:filterKeyword2",
|
||||||
|
"update:selected",
|
||||||
|
"update:pagination",
|
||||||
|
"returnDirector",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/**ข้อมูลหัว ตาราง*/
|
/**ข้อมูลหัว ตาราง*/
|
||||||
|
|
@ -72,39 +101,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** รับ props มาจากหน้าหลัก */
|
|
||||||
const props = defineProps({
|
|
||||||
Modal: Boolean,
|
|
||||||
clickClose: Function,
|
|
||||||
getData: Function,
|
|
||||||
rows2: Array,
|
|
||||||
filterKeyword2: String,
|
|
||||||
filterTable: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
maxPage: {
|
|
||||||
type: Number,
|
|
||||||
require: true,
|
|
||||||
},
|
|
||||||
rowsPerPage: {
|
|
||||||
type: Number,
|
|
||||||
require: true,
|
|
||||||
},
|
|
||||||
page: {
|
|
||||||
type: Number,
|
|
||||||
require: true,
|
|
||||||
},
|
|
||||||
getList: {
|
|
||||||
type: Function,
|
|
||||||
default: () => "",
|
|
||||||
},
|
|
||||||
selectedRow: {
|
|
||||||
type: Array as PropType<directorType[]>,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
/** แสดงจำนวนในตาราง */
|
/** แสดงจำนวนในตาราง */
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
descending: true,
|
descending: true,
|
||||||
|
|
@ -118,13 +114,6 @@ const checkSelected = computed(() => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits([
|
|
||||||
"update:filterKeyword2",
|
|
||||||
"update:selected",
|
|
||||||
"update:pagination",
|
|
||||||
"returnDirector",
|
|
||||||
]);
|
|
||||||
|
|
||||||
/** เลือกกรรมการ */
|
/** เลือกกรรมการ */
|
||||||
async function onClickAddMeet() {
|
async function onClickAddMeet() {
|
||||||
emit("returnDirector", selected.value);
|
emit("returnDirector", selected.value);
|
||||||
|
|
@ -148,7 +137,6 @@ function updateProp(newPagination: any, page: number) {
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
if (props.Modal === true) {
|
if (props.Modal === true) {
|
||||||
selected.value = props.selectedRow;
|
selected.value = props.selectedRow;
|
||||||
props.getList();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
|
||||||
const pdfSrcStore = ref<any>();
|
const pdfSrcStore = ref<any>();
|
||||||
const numOfPagesStore = ref<any>();
|
const numOfPagesStore = ref<any>();
|
||||||
|
|
||||||
|
/** คอลัมน์ ใบอนุญาตประกอบวิชาชีพ*/
|
||||||
const columnsCertificates = ref<QTableProps["columns"]>([
|
const columnsCertificates = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "certificateType",
|
name: "certificateType",
|
||||||
|
|
@ -74,6 +75,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
/** คอลัมน์ ประวัติการรับราชการ*/
|
||||||
const columnSalaries = ref<QTableProps["columns"]>([
|
const columnSalaries = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "date",
|
name: "date",
|
||||||
|
|
@ -167,6 +169,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
/** คอลัมน์ ประวัติการฝึกอบรมดูงาน*/
|
||||||
const columnTraining = ref<QTableProps["columns"]>([
|
const columnTraining = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "name",
|
name: "name",
|
||||||
|
|
@ -233,6 +236,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
/** คอลัมน์ ผลงานที่เคยเสนอขอประเมิน*/
|
||||||
const columnProjectsProposed = ref<QTableProps["columns"]>([
|
const columnProjectsProposed = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "receivedDate",
|
name: "receivedDate",
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import type {
|
|
||||||
DataResponseList,
|
|
||||||
MainList,
|
|
||||||
} from "@/modules/12_evaluatePersonal/interface/index/meeting";
|
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
|
|
||||||
// store ระบบวินัย >> ข้อมูลพื้นฐาน >> กรรมการ
|
// store ระบบวินัย >> ข้อมูลพื้นฐาน >> กรรมการ
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { useRouter } from "vue-router";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
|
/** importType*/
|
||||||
import type { OptionStatus } from "@/modules/12_evaluatePersonal/interface/index/Main";
|
import type { OptionStatus } from "@/modules/12_evaluatePersonal/interface/index/Main";
|
||||||
|
|
||||||
/** importStore*/
|
/** importStore*/
|
||||||
|
|
@ -18,6 +19,7 @@ const mixin = useCounterMixin();
|
||||||
const store = useEvalutuonStore();
|
const store = useEvalutuonStore();
|
||||||
const { showLoader, hideLoader, messageError } = mixin;
|
const { showLoader, hideLoader, messageError } = mixin;
|
||||||
|
|
||||||
|
/** request body*/
|
||||||
const currentPage = ref<number>(1);
|
const currentPage = ref<number>(1);
|
||||||
const maxPage = ref<number>(0);
|
const maxPage = ref<number>(0);
|
||||||
const page = ref<number>(1);
|
const page = ref<number>(1);
|
||||||
|
|
@ -92,13 +94,13 @@ function resetFilter() {
|
||||||
|
|
||||||
/** function เรียกรายการคำขอประเมิน*/
|
/** function เรียกรายการคำขอประเมิน*/
|
||||||
async function fetchEvaluteList() {
|
async function fetchEvaluteList() {
|
||||||
|
showLoader();
|
||||||
const body = {
|
const body = {
|
||||||
page: currentPage.value,
|
page: currentPage.value,
|
||||||
pageSize: pageSize.value,
|
pageSize: pageSize.value,
|
||||||
keyword: filter.value,
|
keyword: filter.value,
|
||||||
status: selectedStatus.value,
|
status: selectedStatus.value,
|
||||||
};
|
};
|
||||||
showLoader();
|
|
||||||
await http
|
await http
|
||||||
.put(config.API.evaluationMain(), body)
|
.put(config.API.evaluationMain(), body)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
|
|
@ -109,7 +111,7 @@ async function fetchEvaluteList() {
|
||||||
store.fetchData(data);
|
store.fetchData(data);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
// messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
@ -269,47 +271,15 @@ onMounted(async () => {
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
@update:pagination="updatePagination"
|
@update:pagination="updatePagination"
|
||||||
>
|
>
|
||||||
<template v-slot:pagination="scope">
|
|
||||||
ทั้งหมด {{ total }} รายการ
|
|
||||||
<q-pagination
|
|
||||||
v-model="currentPage"
|
|
||||||
active-color="primary"
|
|
||||||
color="dark"
|
|
||||||
:max="Number(maxPage)"
|
|
||||||
size="sm"
|
|
||||||
boundary-links
|
|
||||||
direction-links
|
|
||||||
></q-pagination>
|
|
||||||
</template>
|
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
<q-th auto-width></q-th>
|
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
</q-th>
|
</q-th>
|
||||||
<q-th auto-width></q-th>
|
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<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'">
|
|
||||||
{{ (page - 1) * rowsPerPage + props.rowIndex + 1 }}
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
{{ col.value }}
|
|
||||||
</div>
|
|
||||||
</q-td> -->
|
|
||||||
<q-td auto-width>
|
|
||||||
<q-icon
|
|
||||||
v-if="props.row.isDefault === true"
|
|
||||||
name="mdi-bookmark"
|
|
||||||
size="xs"
|
|
||||||
color="primary"
|
|
||||||
>
|
|
||||||
<q-tooltip>เวลา Default</q-tooltip>
|
|
||||||
</q-icon>
|
|
||||||
</q-td>
|
|
||||||
<q-td
|
<q-td
|
||||||
v-for="col in props.cols"
|
v-for="col in props.cols"
|
||||||
:key="col.name"
|
:key="col.name"
|
||||||
|
|
@ -325,6 +295,18 @@ onMounted(async () => {
|
||||||
</q-td>
|
</q-td>
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-slot:pagination="scope">
|
||||||
|
ทั้งหมด {{ total }} รายการ
|
||||||
|
<q-pagination
|
||||||
|
v-model="currentPage"
|
||||||
|
active-color="primary"
|
||||||
|
color="dark"
|
||||||
|
:max="Number(maxPage)"
|
||||||
|
size="sm"
|
||||||
|
boundary-links
|
||||||
|
direction-links
|
||||||
|
></q-pagination>
|
||||||
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue