Refactoring code module 12_evaluatePersonal
This commit is contained in:
parent
381ec04492
commit
490f02309e
33 changed files with 598 additions and 1036 deletions
|
|
@ -1,9 +1,12 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import axios from "axios";
|
||||
|
||||
import { useRoute } from "vue-router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useEvaluateDetailStore } from "@/modules/12_evaluatePersonal/store/EvaluateDetail";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
|
@ -12,8 +15,6 @@ import genReport from "@/plugins/genreport";
|
|||
import type { FileEvaluationRefRef } from "@/modules/12_evaluatePersonal/interface/index/evalute";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useEvaluateDetailStore } from "@/modules/12_evaluatePersonal/store/EvaluateDetail";
|
||||
|
||||
/** uer*/
|
||||
const store = useEvaluateDetailStore();
|
||||
|
|
@ -21,33 +22,25 @@ const $q = useQuasar();
|
|||
const mixin = useCounterMixin();
|
||||
const route = useRoute();
|
||||
|
||||
const {
|
||||
date2Thai,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
const { showLoader, hideLoader, messageError, success, dialogConfirm } = mixin;
|
||||
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const modalConfirm = ref<boolean>(false);
|
||||
const nameOfWork = ref<string>("");
|
||||
const nameOfOwner = ref<string>("");
|
||||
const position = ref<string>("");
|
||||
const fileEvaluation81 = ref<any>();
|
||||
const fileEvaluation82 = ref<any>();
|
||||
const fileEvaluation83 = ref<any>();
|
||||
const fileEvaluation84 = ref<any>();
|
||||
const fileEvaluation85 = ref<any>();
|
||||
const fileEvaluation86 = ref<any>();
|
||||
const fileEvaluation81 = ref<any>(); //แบบตรวจสอบความถูกต้องครบถ้วนของข้อมูลประกอบการประเมินผลงาน (เอกสารแบบ ค)
|
||||
const fileEvaluation82 = ref<any>(); //บัญชีแสดงการรับ-ส่งผลงาน (เอกสารหมายเลข 15)
|
||||
const fileEvaluation83 = ref<any>(); //แบบประเมินผลงาน (เอกสารหมายเลข 16)
|
||||
const fileEvaluation84 = ref<any>(); //แบบแสดงการประเมินผลงาน (เอกสารหมายเลข 17)
|
||||
const fileEvaluation85 = ref<any>(); //แบบรายงานผลการประเมินบุคคล (เอกสารหมายเลข 18)
|
||||
const fileEvaluation86 = ref<any>(); //แบบสรุปผลการประเมิน (เอกสารแบบ ง)
|
||||
const fileEvaluation81Ref = ref<object | null>(null);
|
||||
const fileEvaluation82Ref = ref<object | null>(null);
|
||||
const fileEvaluation83Ref = ref<object | null>(null);
|
||||
const fileEvaluation84Ref = ref<object | null>(null);
|
||||
const fileEvaluation85Ref = ref<object | null>(null);
|
||||
const fileEvaluation86Ref = ref<object | null>(null);
|
||||
const profile = ref<any>();
|
||||
const fileEvaluationRef: FileEvaluationRefRef = {
|
||||
fileEvaluation81: fileEvaluation81Ref,
|
||||
fileEvaluation82: fileEvaluation82Ref,
|
||||
|
|
@ -57,7 +50,9 @@ const fileEvaluationRef: FileEvaluationRefRef = {
|
|||
fileEvaluation86: fileEvaluation86Ref,
|
||||
};
|
||||
|
||||
/** function ดาวน์โหลดไฟล์ต้นแบบ*/
|
||||
/**
|
||||
* function ดาวน์โหลดไฟล์ต้นแบบ
|
||||
*/
|
||||
async function onClickDowloadFile(
|
||||
tp: string,
|
||||
templateName: string,
|
||||
|
|
@ -141,7 +136,9 @@ function fileUpLoad(url: string, file: any) {
|
|||
});
|
||||
}
|
||||
|
||||
/** function ยืนยันผลการพิจารณา*/
|
||||
/**
|
||||
* function ยืนยันผลการพิจารณา
|
||||
*/
|
||||
async function confirmApprove() {
|
||||
const fileEvaluationValues = [
|
||||
fileEvaluation81,
|
||||
|
|
@ -216,7 +213,9 @@ async function confirmApprove() {
|
|||
}, 100);
|
||||
}
|
||||
|
||||
/** function ยืนยันผลการพิจารณา*/
|
||||
/**
|
||||
* function ยืนยันผลการพิจารณา
|
||||
*/
|
||||
function nextStep() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -234,26 +233,10 @@ function nextStep() {
|
|||
});
|
||||
}
|
||||
|
||||
/** function เรียกข้แมูลคุณสมบัติ*/
|
||||
async function fetchProfile() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.evaluateGetDetail(id.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
profile.value = data;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
hideLoader();
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
|
||||
const downloadDocEditUrl = ref<string>("");
|
||||
/**
|
||||
* function ตรวจสอบไฟล์แก้ไข
|
||||
*/
|
||||
async function checkDocEdit() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -277,12 +260,13 @@ async function checkDocEdit() {
|
|||
});
|
||||
}
|
||||
|
||||
const downloadFile1 = ref<string>("");
|
||||
const downloadFile2 = ref<string>("");
|
||||
const downloadFile3 = ref<string>("");
|
||||
const downloadFile4 = ref<string>("");
|
||||
const downloadFile5 = ref<string>("");
|
||||
const downloadFile6 = ref<string>("");
|
||||
//ไฟล์โหล
|
||||
const downloadFile1 = ref<string>(""); //"แบบตรวจสอบความถูกต้องครบถ้วนของข้อมูลประกอบการประเมินผลงาน (เอกสารแบบ ค)
|
||||
const downloadFile2 = ref<string>(""); //บัญชีแสดงการรับ-ส่งผลงาน (เอกสารหมายเลข 15)"
|
||||
const downloadFile3 = ref<string>(""); //แบบประเมินผลงาน (เอกสารหมายเลข 16)
|
||||
const downloadFile4 = ref<string>(""); //แบบแสดงการประเมินผลงาน (เอกสารหมายเลข 17)
|
||||
const downloadFile5 = ref<string>(""); //แบบรายงานผลการประเมินบุคคล (เอกสารหมายเลข 18)
|
||||
const downloadFile6 = ref<string>(""); //แบบสรุปผลการประเมิน (เอกสารแบบ ง)
|
||||
|
||||
/**
|
||||
* function ดาวน์โหลดไฟล์
|
||||
|
|
@ -317,11 +301,13 @@ async function downloadFileList(fileName: string) {
|
|||
});
|
||||
}
|
||||
|
||||
const author = ref<string>("");
|
||||
const subject = ref<string>("");
|
||||
const assignedPosition = ref<string>("");
|
||||
const author = ref<string>(""); //เจ้าของผลงาน
|
||||
const subject = ref<string>(""); //ชื่อผลงาน
|
||||
const assignedPosition = ref<string>(""); //ตำแหน่ง
|
||||
|
||||
/** function เรียกข้อมูลผลงาน*/
|
||||
/**
|
||||
* function เรียกข้อมูลผลงาน
|
||||
*/
|
||||
async function fetchDataSigner() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -350,7 +336,6 @@ async function fetchDataSigner() {
|
|||
|
||||
onMounted(async () => {
|
||||
await Promise.all([
|
||||
fetchProfile(),
|
||||
fetchDataSigner(),
|
||||
downloadFileList(
|
||||
"แบบตรวจสอบความถูกต้องครบถ้วนของข้อมูลประกอบการประเมินผลงาน (เอกสารแบบ ค)"
|
||||
|
|
@ -663,6 +648,7 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<q-card bordered style="border: 1px solid #d6dee1">
|
||||
<div
|
||||
|
|
@ -758,6 +744,7 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<q-card bordered style="border: 1px solid #d6dee1">
|
||||
<div
|
||||
|
|
@ -855,6 +842,7 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<q-card bordered style="border: 1px solid #d6dee1">
|
||||
<div
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue