Refactoring code module 12_evaluatePersonal

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-09-20 13:13:43 +07:00
parent 381ec04492
commit 490f02309e
33 changed files with 598 additions and 1036 deletions

View file

@ -1,7 +1,10 @@
<script setup lang="ts">
import { onMounted, ref, reactive } from "vue";
import { onBeforeMount, ref, reactive } from "vue";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import { useEvaluateDetailStore } from "@/modules/12_evaluatePersonal/store/EvaluateDetail";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
@ -25,17 +28,17 @@ import ViewStep7 from "@/modules/12_evaluatePersonal/components/Detail/viewstep/
import PopupHistory from "@/modules/12_evaluatePersonal/components/Detail/popupHistory.vue";
/** importStor*/
import { useEvaluateDetailStore } from "@/modules/12_evaluatePersonal/store/EvaluateDetail";
import { useCounterMixin } from "@/stores/mixin";
/** use*/
const $q = useQuasar();
const route = useRoute();
const store = useEvaluateDetailStore();
const mixin = useCounterMixin();
const $q = useQuasar();
const { showLoader, hideLoader, messageError } = mixin;
/**
* props
*/
const props = defineProps({
data: {
type: Object,
@ -44,34 +47,19 @@ const props = defineProps({
});
const id = ref<string>(route.params.id as string); // id
const isLoadView = ref<boolean>(false);
const modalHistory = ref<boolean>(false);
const isLoadView = ref<boolean>(false); // view
const modalHistory = ref<boolean>(false); // popup
//
const formCommand = reactive<FormCommand>({
elementaryFullName: "",
elementaryPosition: "",
abovelevelFullname: "",
abovelevelPosition: "",
elementaryFullName: "", //
elementaryPosition: "", //
abovelevelFullname: "", // 1
abovelevelPosition: "", // 1
});
const elementaryFullNameRef = ref<object | null>(null);
const elementaryPositonRef = ref<object | null>(null);
const abovelevelFullnameRef = ref<object | null>(null);
const abovelevelPositionRef = ref<object | null>(null);
function updateformCommand(val: any, ref: any) {
formCommand.elementaryFullName = val.elementaryFullName;
formCommand.elementaryPosition = val.elementaryPosition;
formCommand.abovelevelFullname = val.abovelevelFullname;
formCommand.abovelevelPosition = val.abovelevelPosition;
elementaryFullNameRef.value = ref.elementaryFullNameRef;
elementaryPositonRef.value = ref.elementaryPositonRef;
abovelevelFullnameRef.value = ref.abovelevelFullnameRef;
abovelevelPositionRef.value = ref.abovelevelPositionRef;
}
/** function เช็คขั้นตอน*/
/**
* งกนเชคขนตอนการประเม
*/
async function fetchCheckStep() {
isLoadView.value = false;
showLoader();
@ -114,12 +102,28 @@ async function fetchCheckStep() {
});
}
/** function เปิด,ปิด ประวัติการประเมิน*/
/**
* งกนเป, popup ประวการประเม
*/
function onClickPopupHistory() {
modalHistory.value = !modalHistory.value;
}
onMounted(async () => {
/**
* งกนอปเดทขอมลผเซนเอกสาร
* @param val อมลผเซนเอกสาร
*/
function updateformCommand(val: FormCommand) {
formCommand.elementaryFullName = val.elementaryFullName;
formCommand.elementaryPosition = val.elementaryPosition;
formCommand.abovelevelFullname = val.abovelevelFullname;
formCommand.abovelevelPosition = val.abovelevelPosition;
}
/**
* ทำงานเม Components กเรยกใชงาน
*/
onBeforeMount(async () => {
await fetchCheckStep();
});
</script>
@ -196,14 +200,11 @@ onMounted(async () => {
class="col-xs-12 col-sm-7 row"
v-if="store.step === 1 || store.step === 3 || store.step === 7"
>
<!-- <q-card flat bordered class="col-12"> -->
<div class="col-12">
<ViewStep1 v-if="store.step === 1" :data="data" />
<ViewStep3 v-if="store.step === 3" />
<ViewStep7 v-if="store.step === 7" />
</div>
<!-- <q-card-section> </q-card-section -->
<!-- ></q-card> -->
</div>
</div>
</div>

View file

@ -1,35 +1,40 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import type {
Directors,
Meetings,
} from "@/modules/12_evaluatePersonal/interface/response/Main";
/** importComponents*/
import CardDirector from "@/modules/12_evaluatePersonal/components/Detail/viewTab2/CardDirector.vue";
import CardMeet from "@/modules/12_evaluatePersonal/components/Detail/viewTab2/CardMeet.vue";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
/** use*/
const $q = useQuasar();
const route = useRoute();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError } = mixin;
const id = ref<string>(route.params.id as string);
const director = ref<any[]>();
const meeting = ref<any[]>();
const id = ref<string>(route.params.id as string); //id
const director = ref<Directors[]>([]); //
const meeting = ref<Meetings[]>([]); //
/** function เรียกข้อมูลกรรมการ */
/**
* function เรยกขอมลกรรมการ
*/
async function getList() {
showLoader();
await http
.get(config.API.evaluationListData(id.value))
.then((res) => {
const data = res.data.result;
.then(async (res) => {
const data = await res.data.result;
director.value = data.directors;
meeting.value = data.meetings;
})
@ -51,8 +56,8 @@ onMounted(async () => {
<div class="toptitle">กรรมการและการประช</div>
<div class="row col-12 q-gutter-md">
<CardDirector :data="director" :fetchdata="getList" />
<CardMeet :data="meeting" :fetchdata="getList" />
<CardDirector :data="director" :fetch-data="getList" />
<CardMeet :data="meeting" :fetch-data="getList" />
</div>
</div>
</template>

View file

@ -1,10 +1,12 @@
<script setup lang="ts">
import { ref, watch } from "vue";
import { useQuasar } from "quasar";
import type { QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar";
/** importComponents */
import HeaderDialog from "@/components/DialogHeader.vue";
@ -14,7 +16,6 @@ import { useCounterMixin } from "@/stores/mixin";
/**use*/
const mixins = useCounterMixin();
const $q = useQuasar();
const { showLoader, hideLoader, date2Thai, messageError } = mixins;
/** รับ props Tab 1 */
@ -33,6 +34,7 @@ const props = defineProps({
},
});
const row = ref<any[]>([]); //
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -71,10 +73,9 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
]);
const row = ref<any>();
/**
* functio เรยกขอมลประวการประเม
* งกนเรยกขอมลประวการประเม
* @param id ประเม
*/
async function fetchListHistory(id: string) {
@ -105,6 +106,12 @@ async function fetchListHistory(id: string) {
});
}
/**
* การเปลยนแปลงของ modal
*
* เม modal เป true เรยก 'fetchListHistory' เพอดงขอมลประวการประเม
*/
watch(
() => props.modal,
() => {
@ -151,8 +158,8 @@ watch(
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div>
{{ col.value }}
<div v-else>
{{ col.value ?? "-" }}
</div>
</q-td>
</q-tr>

View file

@ -11,6 +11,7 @@ const props = defineProps({
},
});
//
const formData = reactive<FormFeature>({
isEducationalQft: props.data.isEducationalQft, //
isGovermantServiceHtr: props.data.isGovermantServiceHtr, //

View file

@ -9,23 +9,25 @@ import type { FormCommand } from "@/modules/12_evaluatePersonal/interface/index/
import { useCounterMixin } from "@/stores/mixin";
const route = useRoute();
const id = ref<string>(route.params.id as string);
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError } = mixin;
const id = ref<string>(route.params.id as string); //id
/** ฟรอมจัดเตรียมเอกสารเล่ม 1*/
const author = ref<string>("");
const subject = ref<string>("");
const subject = ref<string>(""); //
const author = ref<string>(""); //
const formCommand = reactive<FormCommand>({
elementaryFullName: "",
elementaryPosition: "",
abovelevelFullname: "",
abovelevelPosition: "",
elementaryFullName: "", //-
elementaryPosition: "", //
abovelevelFullname: "", //- 1
abovelevelPosition: "", // 1
});
/** function เรียกข้อมลผลงาน*/
/**
* function เรยกขอมลผลงาน
*/
async function fetchSigner() {
showLoader();
await http
@ -54,6 +56,10 @@ async function fetchSigner() {
}, 1000);
});
}
/**
* ทำงานเม Components กเรยกใชงาน
*/
onMounted(async () => {
await fetchSigner();
});

View file

@ -2,6 +2,7 @@
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import { usePDF } from "@tato30/vue-pdf";
import { useRoute } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
@ -16,11 +17,10 @@ const route = useRoute();
const $q = useQuasar();
const store = useEvaluateDetailStore();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError } = mixin;
const id = ref<string>(route.params.id as string);
const selectedItem = ref<number>(1);
const id = ref<string>(route.params.id as string); //id
const selectedItem = ref<number>(1); //
/**
* funtion เลอกไฟล
@ -36,19 +36,21 @@ function handleItemClick(itemNumber: number) {
* function เรยกไฟล
* @param volume index item
*/
function getFile(volume: number) {
async function getFile(volume: number) {
showLoader();
const fileText = numToThai(volume);
http
await http
.get(config.API.evaluationFilebyId("เล่ม 1", id.value, fileText))
.then((res) => {
.then(async (res) => {
const link = res.data.downloadUrl;
const type = res.data.fileType;
getPDF(link, type);
await getPDF(link, type);
})
.catch((e) => {
messageError($q, e);
hideLoader();
store.pdfSrcStore = undefined;
});
}
@ -57,7 +59,7 @@ function getFile(volume: number) {
* @param url linkLoadFile
* @param type ประเภทไฟล
*/
function getPDF(url: string, type: string) {
async function getPDF(url: string, type: string) {
axios
.get(url, {
method: "GET",

View file

@ -1,42 +1,33 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { checkPermission } from "@/utils/permissions";
import { useRoute } from "vue-router";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin";
import { useEvaluateDetailStore } from "@/modules/12_evaluatePersonal/store/EvaluateDetail";
import axios from "axios";
import http from "@/plugins/http";
import config from "@/app.config";
import genReport from "@/plugins/genreport";
/** importType*/
import type { PersonInformation } from "@/modules/12_evaluatePersonal/interface/response/evalute";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
import { useEvaluateDetailStore } from "@/modules/12_evaluatePersonal/store/EvaluateDetail";
/** use*/
const route = useRoute();
const $q = useQuasar();
const mixin = useCounterMixin();
const store = useEvaluateDetailStore();
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 id = ref<string>(route.params.id as string); //id
const profile = ref<any>();
const messenger = ref<string>("");
const title = ref<string>("");
const modalEvaluation = ref<boolean>(false);
const fileEvaluationUpload = ref<any>();
const myForm = ref<any>();
const subject = ref<string>(""); //
const author = ref<string>(""); //
const messenger = ref<string>(""); //
const title = ref<string>(""); //
const modalEvaluation = ref<boolean>(false); // popup
const fileEvaluationUpload = ref<any>(); //
const fileEvaluationUploadRef = ref<any>();
const files = [
{
@ -73,7 +64,9 @@ const files = [
},
];
/** function ดาวน์โหลดไฟล์ต้นแบบ*/
/**
* function ดาวนโหลดไฟลนแบบ
*/
async function onClickDowloadFile(
tp: string,
templateName: string,
@ -98,7 +91,9 @@ async function onClickDowloadFile(
.finally(() => {});
}
/** function เปิด popup ติดต่อผู้ขอประเมิน */
/**
* function เป popup ดตอผขอประเม
*/
function openPopUp() {
modalEvaluation.value = true;
}
@ -239,21 +234,20 @@ async function upLoadFile(file: any) {
},
},
})
.then((res) => {
.then(async (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);
await fileUpLoad(link);
})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {
// hideLoader();
hideLoader();
});
}
}
@ -262,25 +256,28 @@ async function upLoadFile(file: any) {
* function ปโหลดไฟล
* @param url link ปโหลด
*/
function fileUpLoad(url: string) {
async function fileUpLoad(url: string) {
showLoader();
axios
.put(url, fileEvaluationUpload.value, {
headers: { "Content-Type": fileEvaluationUpload.value?.type },
onUploadProgress: (e) => console.log(e),
})
.then(() => {
checkDoc10();
.then(async () => {
await checkDoc10();
success($q, "อัปโหลดไฟล์สำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
const myForm = ref<any>();
/** fiunction ส่งข้อความ*/
/**
* fiunction งขอความ
*/
async function sentMessenger() {
myForm.value.validate().then(async (result: boolean) => {
if (result) {
@ -307,7 +304,9 @@ async function sentMessenger() {
}
const download10Url = ref<string>("");
/** function เช็คไฟล์อัปโหลด*/
/**
* function เชคไฟลปโหลด
*/
async function checkDoc10() {
showLoader();
await http
@ -319,42 +318,16 @@ async function checkDoc10() {
)
)
.then(async (res) => {
download10Url.value = res.data.downloadUrl;
await fetchProfile();
})
.catch(() => {
// messageError($q, e);
download10Url.value = await res.data.downloadUrl;
})
.finally(() => {
setTimeout(() => {
hideLoader();
}, 2000);
hideLoader();
});
}
/** 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();
}, 1500);
});
}
const author = ref<string>("");
const subject = ref<string>("");
/** function เรียกข้อมูลผลงาน*/
/**
* function เรยกขอมลผลงาน
*/
async function fetchDataSigner() {
showLoader();
await http
@ -422,14 +395,14 @@ onMounted(async () => {
</div>
<!-- ประกาศผลการคดเลอกบคคล (เอกสารหมายเลข 10) -->
<div class="col-12">
<div class="col-12" v-if="store.currentStep == 4">
<q-card bordered style="border: 1px solid #d6dee1">
<div
class="text-weight-medium row col-12 bg-grey-1 q-py-sm q-px-md items-center"
>
<div>ประกาศผลการคดเลอกบคคล (เอกสารหมายเลข 10)</div>
<q-space />
<div v-if="store.currentStep == 4">
<div>
<q-btn
icon="download"
color="indigo"

View file

@ -1,10 +1,11 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import axios from "axios";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import axios from "axios";
import http from "@/plugins/http";
import config from "@/app.config";
@ -25,13 +26,11 @@ const {
success,
} = mixin;
const page = ref<number>(1);
const numOfPages = ref<number>(0);
const modalView = ref<boolean>(false);
const AnnouncementStartDate = ref<string | null>();
const AnnouncementEndDate = ref<string | null>();
const id = ref<string>(route.params.id as string);
const pdfSrc = ref<any>();
const id = ref<string>(route.params.id as string); //id
const author = ref<string>(""); //
const subject = ref<string>(""); //
const AnnouncementStartDate = ref<string | null>(); //
const AnnouncementEndDate = ref<string | null>(); //
const fileEvaluation5 = ref<any>();
const fileEvaluation5Ref = ref<any>();
const files = [
@ -59,7 +58,9 @@ const files = [
},
];
/** function บันทึกแจ้งผลการประกาศคัดเลือก*/
/**
* function นทกแจงผลการประกาศคดเลอก
*/
async function save() {
download10Url.value === ""
? (fileEvaluation5.value = "")
@ -70,7 +71,7 @@ async function save() {
download10Url.value !== ""
) {
dialogConfirm($q, async () => {
await showLoader();
showLoader();
http
.put(config.API.evaluationNext5To6(id.value))
.then(() => {
@ -144,20 +145,6 @@ function fileUpLoad(url: string) {
});
}
/** ไปหน้าต่อไปของรายงาน */
function nextPage() {
if (page.value < numOfPages.value) {
page.value++;
}
}
/** กลับหน้าก่อนหน้าของรายงาน */
function backPage() {
if (page.value !== 1) {
page.value--;
}
}
/**
* function ดลอก URL
* @param name อไฟล
@ -175,7 +162,9 @@ async function copyLink(name: string) {
});
}
/** function เรียกข้อมูลวันที่ประกาศ*/
/**
* function เรยกขอมลวนทประกาศ
*/
async function getDate() {
showLoader();
await http
@ -196,7 +185,9 @@ async function getDate() {
}
const download10Url = ref<string>("");
/** function เช็คไฟล์อัปโหลด*/
/**
* function เชคไฟลปโหลด
*/
async function checkDocResult() {
showLoader();
await http
@ -217,9 +208,9 @@ async function checkDocResult() {
});
}
const author = ref<string>("");
const subject = ref<string>("");
/** function เรียกข้อมูลผลงาน*/
/**
* function เรยกขอมลผลงาน
*/
async function fetchDataSigner() {
showLoader();
await http
@ -281,16 +272,6 @@ onMounted(async () => {
<q-item-section avatar>
<div class="row">
<div>
<!-- <q-btn
:href="file.pathName"
target="_blank"
flat
round
color="blue-6"
icon="mdi-download"
>
<q-tooltip>ดลอกลงค</q-tooltip>
</q-btn> -->
<q-btn
flat
round
@ -309,7 +290,7 @@ onMounted(async () => {
</q-card>
</div>
<div class="col-12">
<div class="col-12" v-if="download10Url != ''">
<q-card bordered style="border: 1px solid #d6dee1">
<div
class="text-weight-medium row col-12 bg-grey-1 q-py-sm q-px-md items-center"
@ -318,7 +299,6 @@ onMounted(async () => {
<q-space />
<div>
<q-btn
v-if="download10Url != ''"
:href="download10Url"
target="_blank"
class="col-12"
@ -384,93 +364,6 @@ onMounted(async () => {
</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>

View file

@ -1,36 +1,37 @@
<script setup lang="ts">
import { ref, reactive, onMounted } from "vue";
import { useRoute } from "vue-router";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
/** importType*/
import type { FormCommand } from "@/modules/12_evaluatePersonal/interface/index/evalute";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
/**use*/
const $q = useQuasar();
const route = useRoute();
const mixin = useCounterMixin();
const dateEndPrepareDoc2 = ref<string | null>();
const { date2Thai, showLoader, hideLoader, messageError } = mixin;
const id = ref<string>(route.params.id as string);
const id = ref<string>(route.params.id as string); //id
//
const formCommand = reactive<FormCommand>({
elementaryFullName: "",
elementaryPosition: "",
abovelevelFullname: "",
abovelevelPosition: "",
elementaryFullName: "", //-
elementaryPosition: "", //
abovelevelFullname: "", //- 1
abovelevelPosition: "", // 1
});
const author = ref<string>("");
const subject = ref<string>("");
const assignedPosition = ref<string>("");
const author = ref<string>(""); //
const subject = ref<string>(""); //
const assignedPosition = ref<string>(""); //
const dateEndPrepareDoc2 = ref<string | null>(); //
/** function เรียกข้อมูลวันที่ประกาศ*/
/**
* function เรยกขอมลวนทประกาศ
*/
async function getDate() {
showLoader();
await http
@ -51,7 +52,9 @@ async function getDate() {
});
}
/** function เรียกข้อมูลผลงาน*/
/**
* function เรยกขอมลผลงาน
*/
async function getSigner() {
showLoader();
await http

View file

@ -1,26 +1,24 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { usePDF } from "@tato30/vue-pdf";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { usePDF } from "@tato30/vue-pdf";
import axios from "axios";
/** importStore*/
import { useRoute } from "vue-router";
import { useEvaluateDetailStore } from "@/modules/12_evaluatePersonal/store/EvaluateDetail";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
/** use*/
const $q = useQuasar();
const route = useRoute();
const store = useEvaluateDetailStore();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError } = mixin;
const id = ref<string>(route.params.id as string);
const selectedItem = ref<number>(1);
const id = ref<string>(route.params.id as string); //id
const selectedItem = ref<number>(1); //
/**
* funtion เลอกไฟล
@ -36,11 +34,10 @@ function handleItemClick(itemNumber: number) {
* function เรยกไฟล
* @param volume index item
*/
function getFile(volume: number) {
async function getFile(volume: number) {
const fileText = numToThai(volume);
console.log(fileText);
showLoader();
http
await http
.get(config.API.evaluationFilebyId("เล่ม 2", id.value, fileText))
.then((res) => {
const link = res.data.downloadUrl;

View file

@ -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

View file

@ -1,27 +1,24 @@
<script setup lang="ts">
import { ref, watch } from "vue";
import { checkPermission } from "@/utils/permissions";
import http from "@/plugins/http";
import config from "@/app.config";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
/** importType*/
import type { QTableProps } from "quasar";
import type { Director } from "@/modules/11_discipline/interface/request/Disciplinary";
import type { Directors } from "@/modules/12_evaluatePersonal/interface/response/Main";
/** importComponents*/
import DialogDirector from "@/modules/12_evaluatePersonal/components/Detail/viewTab2/DialogDirector.vue";
/** import store*/
import { useCounterMixin } from "@/stores/mixin";
/**use*/
const route = useRoute();
const id = ref<string>(route.params.id as string);
const mixin = useCounterMixin();
const $q = useQuasar();
const route = useRoute();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, dialogConfirm, success } = mixin;
const props = defineProps({
@ -29,13 +26,16 @@ const props = defineProps({
type: Array,
default: [],
},
fetchdata: {
fetchData: {
type: Function,
default: () => "",
},
});
/** คอลัมน์ กรรมการ */
const id = ref<string>(route.params.id as string);
/** Table กรรมการ */
const rows = ref<Director[]>([]);
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -83,20 +83,26 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
]);
const rows = ref<Director[]>([]);
const modalAddDirector = ref<boolean>(false);
const filter = ref<string>("");
const page = ref<number>(1);
const rowsPerPage = ref<number>(10);
const maxPage = ref<number>(1);
const listDirector = ref<any>([]);
//
const modalAddDirector = ref<boolean>(false); // popup
const filter = ref<string>(""); //
const page = ref<number>(1); //
const rowsPerPage = ref<number>(10); //
const maxPage = ref<number>(1); //
const listDirector = ref<Directors[]>([]); //
/**
* งกเป popup เพมรายชอกรรมการ
*/
async function onClickAdd() {
modalAddDirector.value = true;
getList();
}
/**
* งก popup เพมรายชอกรรมการ
*/
function onClickClose() {
modalAddDirector.value = false;
}
@ -115,8 +121,8 @@ async function updatePaging(rpp: number, p: number) {
* function return รายชอกรรมการทเลอก
* @param data รายชอกรรมการทเลอก
*/
function returnDirector(data: any) {
const dataList = data.map((item: any) => item.id);
function returnDirector(data: Directors[]) {
const dataList = data.map((item: Directors) => item.id);
dialogConfirm($q, () => {
showLoader();
http
@ -124,7 +130,7 @@ function returnDirector(data: any) {
directors: dataList,
})
.then(async () => {
await props.fetchdata();
await props.fetchData();
await success($q, "บันทึกสำเร็จ");
onClickClose();
})
@ -137,14 +143,16 @@ function returnDirector(data: any) {
});
}
/** function เรียกรายชื่อกรรมการ*/
/**
* function เรยกรายชอกรรมการ
*/
async function getList() {
showLoader();
await http
.get(config.API.evaluateDirectorMain() + `/admin`)
.then((res) => {
const data = res.data.result;
listDirector.value = data.map((item: any) => ({
.then(async (res) => {
const data = await res.data.result;
listDirector.value = data.map((item: Directors) => ({
id: item.id,
name: `${item.prefix}${item.firstName} ${item.lastName}`,
createdAt: item.createdAt,
@ -168,6 +176,10 @@ async function getList() {
hideLoader();
});
}
/**
* ทำงานเม props.data การเปลยนแปลง
*/
watch(
() => props.data,
() => {
@ -245,16 +257,16 @@ watch(
</q-card>
<DialogDirector
v-model:Modal="modalAddDirector"
:clickClose="onClickClose"
:rows2="listDirector"
v-model:filterKeyword2="filter"
:rowsPerPage="rowsPerPage"
:page="page"
:maxPage="maxPage"
:selected-row="rows"
@update:pagination="updatePaging"
@returnDirector="returnDirector"
@return-director="returnDirector"
v-model:Modal="modalAddDirector"
v-model:filter-keyword2="filter"
:click-close="onClickClose"
:rows2="listDirector"
:rows-per-page="rowsPerPage"
:page="page"
:max-page="maxPage"
:selected-row="rows"
/>
</template>

View file

@ -10,27 +10,16 @@ import config from "@/app.config";
/** importComponents*/
import DialogMeet from "@/modules/12_evaluatePersonal/components/Detail/viewTab2/DialogMeet.vue";
import type { Meeting } from "@/modules/12_evaluatePersonal/interface/index/Main";
import type { Meetings } from "@/modules/12_evaluatePersonal/interface/response/Main";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
/** use*/
const route = useRoute();
const id = ref<string>(route.params.id as string);
const mixin = useCounterMixin();
const $q = useQuasar();
/** props*/
const props = defineProps({
data: {
type: Array,
default: [],
},
fetchdata: {
type: Function,
default: () => "",
},
});
const route = useRoute();
const mixin = useCounterMixin();
const {
showLoader,
hideLoader,
@ -40,6 +29,21 @@ const {
success,
} = mixin;
/** props*/
const props = defineProps({
data: {
type: Array,
default: [],
},
fetchData: {
type: Function,
default: () => "",
},
});
const id = ref<string>(route.params.id as string);
const rows = ref<Meeting[]>([]); //
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -109,26 +113,30 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const rows = ref<any[]>([]);
const modalAdd = ref<boolean>(false);
const filter = ref<string>("");
const page = ref<number>(1);
const rowsPerPage = ref<number>(10);
const maxPage = ref<number>(1);
const listMeet = ref<any>([]);
const modalAdd = ref<boolean>(false); //
const filter = ref<string>(""); //
const page = ref<number>(1); //
const rowsPerPage = ref<number>(10); //
const maxPage = ref<number>(1); //
const listMeet = ref<Meetings[]>([]); //
/**
* งกเป popup เพมการประช
*/
function onClickAdd() {
modalAdd.value = true;
getList();
}
/**
* งก popup เพมการประช
*/
function onClickClose() {
modalAdd.value = false;
}
/**
* function ดเดท Paging รรมการ
* function ดเดท Paging ารประช
* @param rpp อหน
* @param p หน
*/
@ -141,8 +149,8 @@ async function updatePaging(rpp: number, p: number) {
* function return รายชอกรรมการทเลอก
* @param data รายชอกรรมการทเลอก
*/
function returnData(data: any) {
const dataList = data.map((item: any) => item.id);
function returnData(data: Meetings[]) {
const dataList = data.map((item: Meetings) => item.id);
dialogConfirm($q, () => {
showLoader();
http
@ -150,9 +158,9 @@ function returnData(data: any) {
meetings: dataList,
})
.then(async () => {
await props.fetchdata();
await props.fetchData();
await success($q, "บันทึกสำเร็จ");
await onClickClose();
onClickClose();
})
.catch((e) => {
messageError($q, e);
@ -170,7 +178,7 @@ async function getList() {
.get(config.API.meeting() + `/admin`)
.then((res) => {
const data = res.data.result;
listMeet.value = data.map((item: any) => ({
listMeet.value = data.map((item: Meetings) => ({
id: item.id,
createdAt: item.createdAt,
createdUserId: item.createdUserId,

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, computed, watchEffect, watch, type PropType } from "vue";
import { ref, watchEffect, watch, type PropType } from "vue";
/** importType*/
import type { QTableProps } from "quasar";
@ -43,7 +43,7 @@ const props = defineProps({
},
});
const currentPage = ref<number>(1);
const currentPage = ref<number>(1); //
/** ค้นหาคอลัม */
const visibleColumns2 = ref<string[]>([
@ -53,7 +53,6 @@ const visibleColumns2 = ref<string[]>([
"email",
"phone",
]);
//
const columns2 = ref<QTableProps["columns"]>([
{
@ -109,13 +108,6 @@ const pagination = ref({
page: Number(props.page),
rowsPerPage: props.rowsPerPage,
});
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
const emit = defineEmits([
"update:filterKeyword2",
"update:selected",
@ -128,21 +120,34 @@ async function directorSave() {
emit("returnDirector", selected.value);
}
/**
* งกนอปเดทคำคนหา
* @param value คำคนหา
*/
function updateInput(value: any) {
emit("update:filterKeyword2", value);
}
/**รีเซ็ตค่าในช่องค้นหา */
/**
* เซตคาในชองคนหา
*/
function Reset() {
emit("update:filterKeyword2", "");
}
function updateProp(newPagination: any, page: number) {
/**
*
* @param newPagination
* @param page
*/
function updateProp(newPagination: number, page: number) {
// event parent component props
emit("update:pagination", newPagination, page);
}
/** เช็คค่า props.Modal === true */
/**
* เชคค props.Modal === true
*/
watchEffect(() => {
if (props.Modal === true) {
selected.value = props.selectedRow;
@ -152,7 +157,9 @@ watchEffect(() => {
watch(
() => currentPage.value,
() => {
updateProp(pagination.value.rowsPerPage, currentPage.value);
if (pagination.value.rowsPerPage) {
updateProp(pagination.value.rowsPerPage, currentPage.value);
}
}
);
@ -160,7 +167,9 @@ watch(
() => pagination.value.rowsPerPage,
() => {
currentPage.value = 1;
updateProp(pagination.value.rowsPerPage, currentPage.value);
if (pagination.value.rowsPerPage) {
updateProp(pagination.value.rowsPerPage, currentPage.value);
}
}
);
</script>
@ -241,7 +250,7 @@ watch(
<q-btn
label="เพิ่มรายชื่อกรรมการ"
@click="directorSave"
:disable="checkSelected"
:disable="selected.length === 0"
color="public"
/>
</q-card-actions>

View file

@ -1,16 +1,13 @@
<script setup lang="ts">
import { ref, computed, watchEffect, watch, type PropType } from "vue";
import { ref, watchEffect, watch, type PropType } from "vue";
/** importType*/
import type { QTableProps } from "quasar";
import type { directorType } from "@/modules/11_discipline/interface/index/Main";
import type { Meeting } from "@/modules/12_evaluatePersonal/interface/index/Main";
/** importComponents*/
import DialogHeader from "@/components/DialogHeader.vue";
const selected = ref<directorType[]>([]);
const currentPage = ref<number>(1);
/** รับ props มาจากหน้าหลัก */
const props = defineProps({
Modal: Boolean,
@ -39,7 +36,7 @@ const props = defineProps({
default: () => "",
},
selectedRow: {
type: Array as PropType<directorType[]>,
type: Array as PropType<Meeting[]>,
required: true,
},
});
@ -52,6 +49,9 @@ const emit = defineEmits([
"returnDirector",
]);
const selected = ref<Meeting[]>([]);
const currentPage = ref<number>(1);
/**ข้อมูลหัว ตาราง*/
const columns = ref<QTableProps["columns"]>([
{
@ -130,12 +130,6 @@ const pagination = ref({
rowsPerPage: props.rowsPerPage,
});
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
/** เลือกกรรมการ */
async function onClickAddMeet() {
emit("returnDirector", selected.value);
@ -150,7 +144,7 @@ function Reset() {
emit("update:filterKeyword2", "");
}
function updateProp(newPagination: any, page: number) {
function updateProp(newPagination: number, page: number) {
// event parent component props
emit("update:pagination", newPagination, page);
}
@ -165,7 +159,9 @@ watchEffect(() => {
watch(
() => currentPage.value,
() => {
updateProp(pagination.value.rowsPerPage, currentPage.value);
if (pagination.value.rowsPerPage) {
updateProp(pagination.value.rowsPerPage, currentPage.value);
}
}
);
@ -173,7 +169,9 @@ watch(
() => pagination.value.rowsPerPage,
() => {
currentPage.value = 1;
updateProp(pagination.value.rowsPerPage, currentPage.value);
if (pagination.value.rowsPerPage) {
updateProp(pagination.value.rowsPerPage, currentPage.value);
}
}
);
</script>
@ -253,7 +251,7 @@ watch(
<q-btn
label="เพิ่มการประชุม"
@click="onClickAddMeet"
:disable="checkSelected"
:disable="selected.length === 0"
color="public"
/>
</q-card-actions>

View file

@ -43,8 +43,10 @@ watch(
}
);
onMounted(() => {
numOfPages.value = store.numOfPagesStore;
pdfSrc.value = store.pdfSrcStore;
setTimeout(() => {
numOfPages.value = store.numOfPagesStore;
pdfSrc.value = store.pdfSrcStore;
}, 100);
});
</script>
@ -140,73 +142,6 @@ onMounted(() => {
</div>
</template>
</q-splitter>
<!-- <q-card class="bg-white">
<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> -->
</template>
<style scoped></style>

View file

@ -1,6 +1,9 @@
<script setup lang="ts">
import { onMounted, reactive } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useEvaluateDetailStore } from "@/modules/12_evaluatePersonal/store/EvaluateDetail";
/** importType*/
import type {
EducationForm,
@ -10,14 +13,9 @@ import type {
/** importComponents*/
import TableData from "@/modules/12_evaluatePersonal/components/Detail/viewstep/tableStep1.vue";
/** import Store*/
import { useCounterMixin } from "@/stores/mixin";
import { useEvaluateDetailStore } from "@/modules/12_evaluatePersonal/store/EvaluateDetail";
/** use*/
const mixin = useCounterMixin();
const store = useEvaluateDetailStore();
const {
columnsCertificates,
columnSalaries,
@ -26,6 +24,9 @@ const {
} = store;
const { date2Thai, showLoader, hideLoader } = mixin;
/**
* props
*/
const props = defineProps({
data: {
type: Object,
@ -33,22 +34,23 @@ const props = defineProps({
},
});
//
const formDetail = reactive({
citizenId: "",
prefix: "",
fullName: "",
position: "",
oc: "",
salary: "",
positionLevel: "",
posNo: "",
birthDate: "",
govAge: "",
educations: [] as EducationForm[],
certificates: [],
salaries: [],
trainings: [],
assessments: [],
citizenId: "", //
prefix: "", //
fullName: "", //
position: "", //
oc: "", //
salary: "", //
positionLevel: "", //,
posNo: "", //
birthDate: "", //
govAge: "", //
educations: [] as EducationForm[], //
certificates: [], //
salaries: [], //
trainings: [], //
assessments: [], //
});
function formattedNumber(x: number) {
@ -407,6 +409,7 @@ onMounted(() => {
</div>
</q-card>
</template>
<style scoped>
.cardSp1 {
border: 1px solid #d6dee1;

View file

@ -10,7 +10,7 @@ import { useEvaluateDetailStore } from "@/modules/12_evaluatePersonal/store/Eval
/** use*/
const store = useEvaluateDetailStore();
const modalPerview = ref<boolean>(false);
const modalPerview = ref<boolean>(false); // Popup
</script>
<template>