Compare commits

...

5 commits

Author SHA1 Message Date
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
f054dd54a4 refactor: redirect to landing page on 404 permission error in messageError
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m51s
2026-07-20 10:15:32 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
34d39c7215 refactor(probation): replace Math.round with Math.trunc
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m50s
2026-07-13 17:57:13 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
4dfc9bf4d6 refactor(probation): calculate score4 score5
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m43s
2026-07-13 15:01:41 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
8272a2b291 refactror(probation): add Check Box other_training
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m56s
2026-07-13 10:25:08 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
6392659c23 refactor(recruiting): add filter to compete and disable Page import
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m48s
2026-07-02 10:52:22 +07:00
4 changed files with 53 additions and 16 deletions

View file

@ -56,6 +56,7 @@ const optionsStatus = ref<ExamResultOption[]>([
{ label: "ขาดสอบ", value: "missed_exam" }, { label: "ขาดสอบ", value: "missed_exam" },
{ label: "ผ่าน", value: "pass" }, { label: "ผ่าน", value: "pass" },
{ label: "ไม่ผ่าน", value: "notpass" }, { label: "ไม่ผ่าน", value: "notpass" },
{ label: "อื่น ๆ", value: "other" },
]); ]);
const emit = defineEmits([ const emit = defineEmits([

View file

@ -97,6 +97,8 @@ const develop_result_option = ref<any>([
const isCheckFile = ref<boolean>(false); const isCheckFile = ref<boolean>(false);
const isSelectionPartfour = ref<boolean>(false);
// score // score
const score1 = computed(() => { const score1 = computed(() => {
if ( if (
@ -212,20 +214,21 @@ const percent_sum: any = computed(() => {
}); });
const score4 = computed(() => { const score4 = computed(() => {
return ( return (
(Number(orientation.value) + Number(orientation.value) +
Number(self_learning.value) + Number(self_learning.value) +
Number(training_seminar.value) + Number(training_seminar.value) +
Number(other_training.value)) / (isSelectionPartfour.value ? Number(other_training.value) : 0)
4
); );
}); });
const score5 = computed(() => { const score5 = computed(() => {
const total = const rawTotal =
(Number(orientation_percent.value) + (Number(orientation_percent.value) +
Number(self_learning_percent.value) + Number(self_learning_percent.value) +
Number(training_seminar_percent.value) + Number(training_seminar_percent.value) +
Number(other_training_percent.value)) / Number(other_training_percent.value)) /
4; (isSelectionPartfour.value ? 4 : 3);
const total = Math.trunc(rawTotal);
develop_result.value = total > 60 ? 1 : 0; develop_result.value = total > 60 ? 1 : 0;
@ -1133,10 +1136,20 @@ onMounted(async () => {
<q-separator class="q-my-xs" /> <q-separator class="q-my-xs" />
<div class="row q-gutter-md align-center q-pl-md"> <div class="row q-gutter-md align-center q-pl-md">
<div class="col-8"> <div class="col-8">
<q-checkbox
class="q-mr-sm"
dense
v-model="isSelectionPartfour"
@update:model-value="
other_training = 0;
other_training_percent = 0;
"
/>
4. การอบรมอ ตามทหนวยงานกำหนด (าม) 4. การอบรมอ ตามทหนวยงานกำหนด (าม)
</div> </div>
<div class="col"> <div class="col">
<q-input <q-input
:disable="!isSelectionPartfour"
outlined outlined
dense dense
type="number" type="number"
@ -1148,6 +1161,7 @@ onMounted(async () => {
</div> </div>
<div class="col"> <div class="col">
<q-input <q-input
:disable="!isSelectionPartfour"
outlined outlined
dense dense
type="number" type="number"

View file

@ -90,6 +90,8 @@ const develop_result_option = ref<any>([
// footer // footer
const dateAutherise = ref<any>(null); const dateAutherise = ref<any>(null);
const isSelectionPartfour = ref<boolean>(false);
onMounted(() => { onMounted(() => {
fecthAssign(assignId.value); fecthAssign(assignId.value);
}); });
@ -239,20 +241,21 @@ const percent_sum: any = computed(() => {
}); });
const score4 = computed(() => { const score4 = computed(() => {
return ( return (
(Number(orientation.value) + Number(orientation.value) +
Number(self_learning.value) + Number(self_learning.value) +
Number(training_seminar.value) + Number(training_seminar.value) +
Number(other_training.value)) / (isSelectionPartfour.value ? Number(other_training.value) : 0)
4
); );
}); });
const score5 = computed(() => { const score5 = computed(() => {
const total = const rawTotal =
(Number(orientation_percent.value) + (Number(orientation_percent.value) +
Number(self_learning_percent.value) + Number(self_learning_percent.value) +
Number(training_seminar_percent.value) + Number(training_seminar_percent.value) +
Number(other_training_percent.value)) / Number(other_training_percent.value)) /
4; (isSelectionPartfour.value ? 4 : 3);
const total = Math.trunc(rawTotal);
develop_result.value = total > 60 ? 1 : 0; develop_result.value = total > 60 ? 1 : 0;
@ -1214,10 +1217,20 @@ watch(lengthdiscipline_level, (newLength) => {
<q-separator class="q-my-xs" /> <q-separator class="q-my-xs" />
<div class="row q-gutter-md align-center q-pl-md"> <div class="row q-gutter-md align-center q-pl-md">
<div class="col-8"> <div class="col-8">
<q-checkbox
class="q-mr-sm"
dense
v-model="isSelectionPartfour"
@update:model-value="
other_training = 0;
other_training_percent = 0;
"
/>
4. การอบรมอ ตามทหนวยงานกำหนด (าม) 4. การอบรมอ ตามทหนวยงานกำหนด (าม)
</div> </div>
<div class="col"> <div class="col">
<q-input <q-input
:disable="!isSelectionPartfour"
outlined outlined
dense dense
type="number" type="number"
@ -1231,6 +1244,7 @@ watch(lengthdiscipline_level, (newLength) => {
outlined outlined
dense dense
type="number" type="number"
:disable="!isSelectionPartfour"
v-model="other_training_percent" v-model="other_training_percent"
:rules="[(val:number) => val <= 100 || 'ร้อยละต้องไม่เกิน 100']" :rules="[(val:number) => val <= 100 || 'ร้อยละต้องไม่เกิน 100']"
hide-bottom-space hide-bottom-space

View file

@ -362,13 +362,21 @@ export const useCounterMixin = defineStore("mixin", () => {
const messageError = (q: any, e: any = "", msg: string = "") => { const messageError = (q: any, e: any = "", msg: string = "") => {
if (e.response !== undefined) { if (e.response !== undefined) {
if (e.response.data.status !== undefined) { if (e.response.data.status !== undefined) {
if (e.response.data.status == 401) { if (
e.response.data.status == 401 ||
(e.response.data.status == 404 &&
e.response.data.message == "ไม่พบข้อมูลสิทธิ์")
) {
//invalid_token //invalid_token
const msg =
e.response.data.status == 401
? "ล็อกอินหมดอายุ กรุณาล็อกอินใหม่อีกครั้ง"
: e.response.data.message;
q.dialog({ q.dialog({
component: CustomComponent, component: CustomComponent,
componentProps: { componentProps: {
title: `พบข้อผิดพลาด`, title: `พบข้อผิดพลาด`,
message: `ล็อกอินหมดอายุ กรุณาล็อกอินใหม่อีกครั้ง`, message: msg,
icon: "warning", icon: "warning",
color: "red", color: "red",
onlycancel: true, onlycancel: true,