{{
@@ -282,7 +285,7 @@ import { useCounterMixin } from "@/stores/mixin";
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
import http from "@/plugins/http";
import config from "@/app.config";
-import { useDataStore } from "@/stores/data";
+
import TableCandidate from "@/modules/03_recruiting/components/TableCandidate.vue";
import ExamFinished from "@/modules/03_recruiting/components/ExamFinished.vue";
import type { DataNumObject } from "@/modules/01_metadata/interface/request/Calendar";
@@ -290,9 +293,15 @@ import { useQuasar } from "quasar";
const $q = useQuasar();
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
-const { genColor15, dateToISO, date2Thai, messageError } = mixin;
-const dataStore = useDataStore();
-const { loaderPage } = dataStore;
+const {
+ genColor15,
+ dateToISO,
+ date2Thai,
+ messageError,
+ showLoader,
+ hideLoader,
+} = mixin;
+
const router = useRouter();
const route = useRoute();
const status = ref("all");
@@ -483,7 +492,7 @@ watch(status, (count: String, prevCount: String) => {
});
onMounted(async () => {
- loaderPage(false);
+ hideLoader();
await fetchDataCom();
});
@@ -502,7 +511,7 @@ const fetchDataCom = async () => {
};
const fetchData = async () => {
- loaderPage(true);
+ showLoader();
await http
.get(config.API.candidateOfPeriodExam(status.value, examId.value))
.then((res) => {
@@ -530,12 +539,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
};
const fetchPeriodExam = async () => {
- loaderPage(true);
+ showLoader();
await http
.get(config.API.periodExamStatus(examId.value))
.then((res) => {
@@ -550,7 +559,7 @@ const fetchPeriodExam = async () => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
};
@@ -559,7 +568,7 @@ const fetchPeriodExam = async () => {
*/
const fetchDataSummary = async () => {
dataNum.value = [];
- loaderPage(true);
+ showLoader();
await http
.get(config.API.countDashbordPeriodExam(examId.value))
.then((res) => {
@@ -577,12 +586,12 @@ const fetchDataSummary = async () => {
dataNum.value = [];
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
};
const downloadFileDashboard = async () => {
- loaderPage(true);
+ showLoader();
await http
.put(
config.API.periodExamDownloadDashboard(examId.value),
@@ -606,7 +615,7 @@ const downloadFileDashboard = async () => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
};
diff --git a/src/modules/03_recruiting/views/03_editor/index.vue b/src/modules/03_recruiting/views/03_editor/index.vue
index 8f372fe5e..167e0c0be 100644
--- a/src/modules/03_recruiting/views/03_editor/index.vue
+++ b/src/modules/03_recruiting/views/03_editor/index.vue
@@ -571,14 +571,13 @@ import http from "@/plugins/http";
import config from "@/app.config";
import HeaderTop from "@/modules/04_registry/components/Information/top.vue";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
-import { useDataStore } from "@/stores/data";
+
import { useQuasar } from "quasar";
const $q = useQuasar();
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
-const store = useDataStore();
-const { loaderPage } = store;
-const { date2Thai, messageError } = mixin;
+
+const { date2Thai, messageError, showLoader, hideLoader } = mixin;
const previous = ref(false);
const next = ref(false);
const addDialog = ref(false);
@@ -870,7 +869,7 @@ const saveEdit = async () => {
};
const saveDataAgency = async (data: DataLink[]) => {
- loaderPage(true);
+ showLoader();
await http
.post(config.API.cmsAgency, data)
.then((res) => {})
@@ -883,7 +882,7 @@ const saveDataAgency = async (data: DataLink[]) => {
};
const saveDataGoverment = async (data: DataLink[]) => {
- loaderPage(true);
+ showLoader();
await http
.post(config.API.cmsGoverment, data)
@@ -897,7 +896,7 @@ const saveDataGoverment = async (data: DataLink[]) => {
};
const fetchData = async () => {
- loaderPage(true);
+ showLoader();
await http
.get(config.API.cms)
.then((res) => {
@@ -952,12 +951,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
};
const takeLogo = async () => {
- loaderPage(true);
+ showLoader();
const formData = new FormData();
formData.append("FileData", imageFileLogo.value);
await http
@@ -974,7 +973,7 @@ const takeLogo = async () => {
};
const takeBanner = async () => {
- loaderPage(true);
+ showLoader();
const formData = new FormData();
formData.append("FileData", imageFile.value);
await http
@@ -999,7 +998,7 @@ const sendDataDetail = async () => {
description: web.value.descripstion,
shortName: web.value.by,
};
- loaderPage(true);
+ showLoader();
await http
.post(config.API.cmsDeatail, data)
.then((res) => {})
@@ -1026,7 +1025,7 @@ const sendDataAbout = async () => {
zipCode: address.value.code,
telephone: address.value.tel,
};
- loaderPage(true);
+ showLoader();
await http
.post(config.API.cmsAbout, data)
.then((res) => {})
@@ -1042,7 +1041,7 @@ const sendDataAbout = async () => {
};
const fetchProvince = async () => {
- loaderPage(true);
+ showLoader();
await http
.get(config.API.province)
.then((res) => {
@@ -1057,13 +1056,13 @@ const fetchProvince = async () => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
};
const fetchDistrict = async (id: string | null) => {
- if (id !== null) {
- loaderPage(true);
+ if (id !== null && id != "") {
+ showLoader();
await http
.get(config.API.listDistrict(id))
.then((res) => {
@@ -1078,14 +1077,14 @@ const fetchDistrict = async (id: string | null) => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
}
};
const fetchSubDistrict = async (id: string | null) => {
- if (id !== null) {
- loaderPage(true);
+ if (id !== null && id != "") {
+ showLoader();
await http
.get(config.API.listSubDistrict(id))
.then((res) => {
@@ -1104,7 +1103,7 @@ const fetchSubDistrict = async (id: string | null) => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
}
};
diff --git a/src/modules/04_registry/components/Assessment.vue b/src/modules/04_registry/components/Assessment.vue
index 5d42ad985..981e8cc44 100644
--- a/src/modules/04_registry/components/Assessment.vue
+++ b/src/modules/04_registry/components/Assessment.vue
@@ -308,7 +308,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useProfileDataStore } from "@/modules/04_registry/store";
-import { useDataStore } from "@/stores/data";
+
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@@ -338,10 +338,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
-const dataStore = useDataStore();
-const { loaderPage } = dataStore;
+
const mixin = useCounterMixin();
-const { date2Thai, success, dateToISO, messageError } = mixin;
+const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
+ mixin;
const route = useRoute();
const id = ref("");
const name = ref();
@@ -598,7 +598,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
- loaderPage(true);
+ showLoader();
await http
.get(config.API.profileAssessmentId(profileId.value))
.then((res) => {
@@ -624,7 +624,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
}
};
@@ -717,7 +717,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
- loaderPage(true);
+ showLoader();
await http
.post(config.API.profileAssessmentId(profileId.value), {
id: id.value,
@@ -747,7 +747,7 @@ const saveData = async () => {
* บันทึกแก้ไขข้อมูล
*/
const editData = async () => {
- loaderPage(true);
+ showLoader();
await http
.put(config.API.profileAssessmentId(id.value), {
id: id.value,
@@ -784,7 +784,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
- loaderPage(true);
+ showLoader();
await http
.delete(config.API.profileAssessmentId(id.value))
.then((res) => {
@@ -901,7 +901,7 @@ const clickEditRow = () => {
const clickHistory = async (row: RequestItemsObject) => {
tittleHistory.value = "ประวัติแก้ไขผลการประเมินการปฏิบัติราชการ";
modalHistory.value = true;
- loaderPage(true);
+ showLoader();
await http
.get(config.API.profileAssessmentHisId(row.id))
.then((res) => {
@@ -927,7 +927,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
};
diff --git a/src/modules/04_registry/components/Coin.vue b/src/modules/04_registry/components/Coin.vue
index a478b85b7..f189eff8b 100644
--- a/src/modules/04_registry/components/Coin.vue
+++ b/src/modules/04_registry/components/Coin.vue
@@ -264,7 +264,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useProfileDataStore } from "@/modules/04_registry/store";
-import { useDataStore } from "@/stores/data";
+
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@@ -294,10 +294,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
-const dataStore = useDataStore();
-const { loaderPage } = dataStore;
+
const mixin = useCounterMixin();
-const { date2Thai, success, dateToISO, messageError } = mixin;
+const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
+ mixin;
const route = useRoute();
const id = ref("");
const issuer = ref();
@@ -490,7 +490,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
- loaderPage(true);
+ showLoader();
await http
.get(config.API.profileHonorId(profileId.value))
.then((res) => {
@@ -514,7 +514,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
}
};
@@ -604,7 +604,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
- loaderPage(true);
+ showLoader();
await http
.post(config.API.profileHonorId(profileId.value), {
id: id.value,
@@ -632,7 +632,7 @@ const saveData = async () => {
* บันทึกแก้ไขข้อมูล
*/
const editData = async () => {
- loaderPage(true);
+ showLoader();
await http
.put(config.API.profileHonorId(id.value), {
id: id.value,
@@ -667,7 +667,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
- loaderPage(true);
+ showLoader();
await http
.delete(config.API.profileHonorId(id.value))
.then((res) => {
@@ -781,7 +781,7 @@ const clickHistory = async (row: RequestItemsObject) => {
? "ประวัติแก้ไขประกาศลูกจ้างดีเด่น"
: "ประวัติแก้ไขประกาศเกียรติคุณ";
modalHistory.value = true;
- loaderPage(true);
+ showLoader();
await http
.get(config.API.profileHonorHisId(row.id))
.then((res) => {
@@ -805,7 +805,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
};
diff --git a/src/modules/04_registry/components/Discipline.vue b/src/modules/04_registry/components/Discipline.vue
index ae43a8383..b2c4f2bc0 100644
--- a/src/modules/04_registry/components/Discipline.vue
+++ b/src/modules/04_registry/components/Discipline.vue
@@ -278,7 +278,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useProfileDataStore } from "@/modules/04_registry/store";
-import { useDataStore } from "@/stores/data";
+
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@@ -307,10 +307,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
-const dataStore = useDataStore();
-const { loaderPage } = dataStore;
+
const mixin = useCounterMixin();
-const { date2Thai, success, dateToISO, messageError } = mixin;
+const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
+ mixin;
const route = useRoute();
const id = ref("");
const level = ref();
@@ -590,7 +590,7 @@ const filterSelector = (val: string, update: Function, refData: string) => {
const fetchData = async () => {
if (profileId.value) {
- loaderPage(true);
+ showLoader();
await http
.get(config.API.profileDisId(profileId.value))
.then((res) => {
@@ -615,7 +615,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
}
};
@@ -706,7 +706,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
- loaderPage(true);
+ showLoader();
await http
.post(config.API.profileDisId(profileId.value), {
id: id.value,
@@ -735,7 +735,7 @@ const saveData = async () => {
* บันทึกแก้ไขข้อมูล
*/
const editData = async () => {
- loaderPage(true);
+ showLoader();
await http
.put(config.API.profileDisId(id.value), {
id: id.value,
@@ -771,7 +771,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
- loaderPage(true);
+ showLoader();
await http
.delete(config.API.profileDisId(id.value))
.then((res) => {
@@ -883,7 +883,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
- loaderPage(true);
+ showLoader();
await http
.get(config.API.profileDisHisId(row.id))
.then((res) => {
@@ -908,7 +908,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
};
diff --git a/src/modules/04_registry/components/Document.vue b/src/modules/04_registry/components/Document.vue
index 4b6bfe21b..f9f5f32fb 100644
--- a/src/modules/04_registry/components/Document.vue
+++ b/src/modules/04_registry/components/Document.vue
@@ -138,7 +138,7 @@ import { onMounted, computed, ref, watch } from "vue";
import { useQuasar, QForm } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRoute } from "vue-router";
-import { useDataStore } from "@/stores/data";
+
import HeaderTop from "@/modules/04_registry/components/Information/top.vue";
import http from "@/plugins/http";
import config from "@/app.config";
@@ -156,12 +156,10 @@ const props = defineProps({
});
const emit = defineEmits(["update:statusEdit"]);
-const dataStore = useDataStore();
-const { loaderPage } = dataStore;
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const route = useRoute();
-const { success, messageError } = mixin;
+const { success, messageError, showLoader, hideLoader } = mixin;
const profileId = ref(
route.params.id ? route.params.id.toString() : ""
);
@@ -177,7 +175,7 @@ onMounted(async () => {
const getData = async () => {
if (profileId.value) {
- loaderPage(true);
+ showLoader();
await http
.get(config.API.profilePaperId(profileId.value))
.then((res) => {
@@ -188,13 +186,13 @@ const getData = async () => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
}
};
const deleteData = async (id: string) => {
- loaderPage(true);
+ showLoader();
await http
.delete(config.API.profilePaperId(id))
.then((res) => {
@@ -219,7 +217,7 @@ const uploadData = async () => {
formData.append("avatar", newFile);
formData.append("moss", "newFile");
console.log(formData);
- loaderPage(true);
+ showLoader();
await http
.post(config.API.profilePaperId(profileId.value), formData)
.then((res) => {
diff --git a/src/modules/04_registry/components/Education.vue b/src/modules/04_registry/components/Education.vue
index e3c38afce..75756891b 100644
--- a/src/modules/04_registry/components/Education.vue
+++ b/src/modules/04_registry/components/Education.vue
@@ -582,7 +582,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
-import { useDataStore } from "@/stores/data";
+
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@@ -609,10 +609,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
-const dataStore = useDataStore();
-const { loaderPage } = dataStore;
+
const mixin = useCounterMixin();
-const { success, dateToISO, date2Thai, messageError } = mixin;
+const { success, dateToISO, date2Thai, messageError, showLoader, hideLoader } =
+ mixin;
const route = useRoute();
const id = ref("");
const levelId = ref();
@@ -1047,7 +1047,7 @@ onMounted(async () => {
});
const fetchLevel = async () => {
- loaderPage(true);
+ showLoader();
await http
.get(config.API.educationLevel)
.then((res) => {
@@ -1063,12 +1063,12 @@ const fetchLevel = async () => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
};
const fetchPositionPath = async () => {
- loaderPage(true);
+ showLoader();
await http
.get(config.API.positionPath)
.then((res) => {
@@ -1085,7 +1085,7 @@ const fetchPositionPath = async () => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
};
@@ -1113,7 +1113,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
const fetchData = async () => {
if (profileId.value) {
- loaderPage(true);
+ showLoader();
await http
.get(config.API.profileEduId(profileId.value))
.then((res) => {
@@ -1150,7 +1150,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
}
};
@@ -1258,7 +1258,7 @@ const saveData = async () => {
// (r: any) => r.id == isEducation.value
// );
if (profileId.value) {
- loaderPage(true);
+ showLoader();
await http
.post(config.API.profileEduId(profileId.value), {
id: id.value,
@@ -1308,7 +1308,7 @@ const editData = async () => {
// const filterPositionPath = OpsFilter.value.positionPathOptions.filter(
// (r: any) => r.id == isEducation.value
// );
- loaderPage(true);
+ showLoader();
await http
.put(config.API.profileEduId(id.value), {
id: id.value,
@@ -1359,7 +1359,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
- loaderPage(true);
+ showLoader();
await http
.delete(config.API.profileEduId(id.value))
.then((res) => {
@@ -1493,7 +1493,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
- loaderPage(true);
+ showLoader();
await http
.get(config.API.profileEduHisId(row.id))
.then((res) => {
@@ -1530,7 +1530,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
- loaderPage(false);
+ hideLoader();
});
};
diff --git a/src/modules/04_registry/components/Information/Address.vue b/src/modules/04_registry/components/Information/Address.vue
index 8b8ffbf67..95c6d657e 100644
--- a/src/modules/04_registry/components/Information/Address.vue
+++ b/src/modules/04_registry/components/Information/Address.vue
@@ -289,7 +289,7 @@
@@ -707,6 +742,20 @@ function findByPerson(element: any): any {
map-options
/>
+
diff --git a/src/modules/05_placement/components/PersonalList/Table.vue b/src/modules/05_placement/components/PersonalList/Table.vue
index aff05ffc6..bb19d36fa 100644
--- a/src/modules/05_placement/components/PersonalList/Table.vue
+++ b/src/modules/05_placement/components/PersonalList/Table.vue
@@ -1,5 +1,5 @@
+
+>
diff --git a/src/modules/05_placement/components/Receive/receiveMain.vue b/src/modules/05_placement/components/Receive/receiveMain.vue
index 9dd3924d4..007a3b7e8 100644
--- a/src/modules/05_placement/components/Receive/receiveMain.vue
+++ b/src/modules/05_placement/components/Receive/receiveMain.vue
@@ -292,6 +292,10 @@ const closeModalTree = async () => {
// await getTable();
modalTree.value = false;
};
+
+const nextPage = (id: string) => {
+ router.push(`/receive/${id}`);
+};
รายการรับโอน
@@ -367,25 +371,53 @@ const closeModalTree = async () => {
-
+
{{ props.rowIndex + 1 }}
-
+
{{ props.row.fullname }}
-
+
{{ props.row.position }}
-
+
{{ props.row.positionLevel }}
-
+
{{ props.row.oc }}
-
+
{{ props.row.agency }}
-
+
{{ props.row.status }}
diff --git a/src/modules/05_placement/components/RepatriationOrder/List.vue b/src/modules/05_placement/components/RepatriationOrder/List.vue
index 6aa4fe9e8..a63dda8e4 100644
--- a/src/modules/05_placement/components/RepatriationOrder/List.vue
+++ b/src/modules/05_placement/components/RepatriationOrder/List.vue
@@ -506,7 +506,7 @@ const clickDelete = (id: string) => {
};
// const deleteData = async (id: string) => {
-// loaderPage(true);
+// showLoader();
// await http
// .delete(config.API.orderReplace(id))
// .then((res) => {
@@ -516,7 +516,7 @@ const clickDelete = (id: string) => {
// messageError($q, e);
// })
// .finally(async () => {
-// loaderPage(false);
+// hideLoader();
// await fetchData();
// });
// };
diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue
index b78d8d0bf..54a5edc4c 100644
--- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue
+++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue
@@ -448,7 +448,13 @@ const putformData = () => {
1.7 อื่นๆ
-
@@ -658,7 +664,12 @@ const putformData = () => {
2.4 อื่นๆ
-
+
-import { ref, defineAsyncComponent } from "vue";
+import { ref, defineAsyncComponent, computed } from "vue";
import { useQuasar } from "quasar";
import { useProbationDataStore } from "@/modules/05_placement/store";
import { useCounterMixin } from "@/stores/mixin";
@@ -60,9 +60,6 @@ const dateToday = ref(new Date("10-10-2023"));
const dateEnd = ref(new Date("12-10-2023"));
const period = ref(1);
// part 1
-const knowledge_level = ref(0);
-const skill_level = ref(0);
-const competency_level = ref(0);
const learn_level = ref(0);
const apply_level = ref(0);
const success_level = ref(0);
@@ -74,39 +71,94 @@ const moral_level = ref([]);
const discipline_level = ref([]);
const etc2 = ref(false); // checkBox 2.4
const behavio_orther = ref([{ text: "", level: 0 }]);
-const behavio_strength_desc = ref("");
-const behavio_inprove_desc = ref("");
+
// part 3
-const orientation = ref(null);
-const self_learning = ref(null);
-const training_seminar = ref(null);
-const other_training = ref(null);
-//rules
-const behavio_strengthRef = ref(null);
-const behavio_strengthRules = [
- (val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
-];
-const behavio_inproveRef = ref(null);
-const behavio_inproveRules = [
- (val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลสิ่งที่ควรปรับปรุง",
-];
+const orientation = ref(null);
+const self_learning = ref(null);
+const training_seminar = ref(null);
+const other_training = ref(null);
+// footer
+const Autherise = ref(null);
+const dateAutherise = ref(new Date());
+const option = ref(["นาย ภูริณัฐ บุญขาว", "นาย พงศกร วรารักษ์"]);
+
+// score
+const score1 = computed(() => {
+ if (
+ etc.value === true &&
+ achievement_other.value.text !== undefined &&
+ achievement_other.value.level !== undefined
+ ) {
+ return (
+ learn_level.value +
+ apply_level.value +
+ success_level.value +
+ achievement_other.value.level
+ );
+ }
+ return learn_level.value + apply_level.value + success_level.value;
+});
+const score2 = computed(() => {
+ let sum_conduct = conduct_level.value.reduce(
+ (sum: number, level: number) => sum + level,
+ 0
+ );
+ let sum_moral = moral_level.value.reduce(
+ (sum: number, level: number) => sum + level,
+ 0
+ );
+ let sum_discipline = discipline_level.value.reduce(
+ (sum: number, level: number) => sum + level,
+ 0
+ );
+ if (
+ etc2.value === true &&
+ behavio_orther.value.text !== undefined &&
+ behavio_orther.value.level !== undefined
+ ) {
+ return (
+ sum_conduct + sum_moral + sum_discipline + behavio_orther.value.level
+ );
+ } else return sum_conduct + sum_moral + sum_discipline;
+});
+const percent_score1: number = computed(() => {
+ let num = 0;
+ if (etc.value === true) {
+ num = 20;
+ } else num = 15;
+ let percent1 = (score1.value / num) * 100;
+ return percent1.toFixed(2);
+});
+const percent_score2: number = computed(() => {
+ let num = 0;
+ if (etc2.value === true) {
+ num = 65;
+ } else num = 60;
+ let percent2 = (score2.value / num) * 100;
+ return percent2.toFixed(2);
+});
+const percent_sum: any = computed(() => {
+ let sum = (Number(percent_score1.value) + Number(percent_score2.value)) / 2;
+ return sum.toFixed(2);
+});
+const score4 = computed(() => {
+ return (
+ Number(orientation.value) +
+ Number(self_learning.value) +
+ Number(training_seminar.value) +
+ Number(other_training.value)
+ );
+});
const savaForm = () => {
let hasError = false;
- behavio_strengthRef.value.validate();
- behavio_inproveRef.value.validate();
if (
- knowledge_level.value === 0 ||
- skill_level.value === 0 ||
- competency_level.value === 0 ||
learn_level.value === 0 ||
apply_level.value === 0 ||
success_level.value === 0 ||
conduct_level.value.length < 4 ||
moral_level.value.length < 3 ||
discipline_level.value.length < 5 ||
- behavio_strength_desc.value === "" ||
- behavio_inprove_desc.value === "" ||
orientation.value === null ||
self_learning.value === null ||
training_seminar.value === null
@@ -133,9 +185,6 @@ const savaForm = () => {
};
const putformData = () => {
const data = {
- knowledge_level: knowledge_level.value,
- skill_level: skill_level.value,
- competency_level: competency_level.value,
learn_level: learn_level.value,
apply_level: apply_level.value,
success_level: success_level.value,
@@ -153,12 +202,12 @@ const putformData = () => {
discipline4_level: discipline_level.value[3],
discipline5_level: discipline_level.value[4],
behavio_orther: behavio_orther.value,
- behavio_strength_desc: behavio_strength_desc.value,
- behavio_inprove_desc: behavio_inprove_desc.value,
orientation: Number(orientation.value),
self_learning: Number(self_learning.value),
training_seminar: Number(training_seminar.value),
other_training: Number(other_training.value),
+ total_experiment: Number(score1.value),
+ total_behavior: Number(score2.value),
};
$q.dialog({
title: "ยืนยันการบันทึกข้อมูล",
@@ -331,7 +380,13 @@ const putformData = () => {
1.4 อื่นๆ
-
@@ -387,6 +442,24 @@ const putformData = () => {
+
+
+
+
+ คะแนนรวมผลสัมฤทธิ์ของการทดลองฯ
+
+
+
+
+
+ {{ score1 }}
+
+
+
+
+
+
+