Refactoring code module 12_evaluatePersonal
This commit is contained in:
parent
381ec04492
commit
490f02309e
33 changed files with 598 additions and 1036 deletions
|
|
@ -15,7 +15,6 @@ import type { FormData } from "@/modules/12_evaluatePersonal/interface/index/mee
|
|||
/**
|
||||
* use
|
||||
*/
|
||||
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
const {
|
||||
|
|
@ -42,7 +41,7 @@ const props = defineProps({
|
|||
});
|
||||
const emit = defineEmits(["formDataReturn"]);
|
||||
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const id = ref<string>(route.params.id as string); //id การประชุม
|
||||
const routeName = ref<string>(route.name as string);
|
||||
const isReadonly = computed(() =>
|
||||
routeName.value === "evaluateMeetingdetail" ? true : false
|
||||
|
|
@ -50,17 +49,16 @@ const isReadonly = computed(() =>
|
|||
|
||||
const formData = reactive<FormData>({
|
||||
id: "",
|
||||
rounded: "",
|
||||
dateMeeting: "",
|
||||
dateMeetingStart: null,
|
||||
dateMeetingEnd: null,
|
||||
consider: "",
|
||||
period: "",
|
||||
title: "",
|
||||
rounded: "", //ครั้งที่
|
||||
dateMeetingStart: null, //วันเวลาเริ่มต้นการประชุม
|
||||
dateMeetingEnd: null, //วันเวลาสิ้นสุดการประชุม
|
||||
consider: "", //ผลการพิจารณาของคณะกรรมการประเมินผลงานแต่ละคณะ
|
||||
period: "", //ระยะเวลาในการแก้ไขผลงาน
|
||||
title: "", //หัวข้อการประชุม
|
||||
});
|
||||
const file = ref<any>();
|
||||
const fileData = ref<any>([]);
|
||||
const fileDataDownload = ref<any>([]);
|
||||
const file = ref<any>(); //ไฟล์อัปโหลด
|
||||
const fileData = ref<any[]>([]); //รายการเอกสาร
|
||||
const fileDataDownload = ref<any>([]); ///รายการเอกสาร
|
||||
|
||||
/** บันทึกข้อมูล */
|
||||
function submit() {
|
||||
|
|
@ -70,7 +68,7 @@ function submit() {
|
|||
/**
|
||||
* function fetch ข้อมูลไฟล์เอกสารหลักฐาน
|
||||
*/
|
||||
function fetchDataFile() {
|
||||
async function fetchDataFile() {
|
||||
if (id.value != undefined) {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -145,18 +143,18 @@ function uploadFile() {
|
|||
/**
|
||||
* function อัปโหลดไฟล์เอกสารหลักฐาน
|
||||
*/
|
||||
function uploadfileURL(uploadUrl: string, file: any) {
|
||||
function uploadfileURL(uploadUrl: string, newfile: any) {
|
||||
axios
|
||||
.put(uploadUrl, file, {
|
||||
.put(uploadUrl, newfile, {
|
||||
headers: {
|
||||
"Content-Type": file.type,
|
||||
"Content-Type": newfile.type,
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
setTimeout(async () => {
|
||||
await fetchDataFile();
|
||||
await success($q, "อัปโหลไฟล์สำเร็จ");
|
||||
file.value = null;
|
||||
file.value = undefined;
|
||||
}, 500);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import router from "@/router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
@ -56,13 +57,6 @@ function clickDelete(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
/**
|
||||
* ค้นหาในตาราง
|
||||
*/
|
||||
|
|
@ -83,6 +77,13 @@ const pagination = ref({
|
|||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">รายการการประชุม</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue