Compare commits

..

No commits in common. "dev" and "v1.1.155" have entirely different histories.

10 changed files with 40 additions and 265 deletions

View file

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

View file

@ -46,7 +46,6 @@ interface RequestPeriodCompete {
year: number;
announcementDate: string | null;
rootDnaId: string;
scoreExpireDate: string | null;
}
interface RequestPeriodDisable {
@ -66,7 +65,6 @@ interface RequestPeriodDisable {
year: number;
announcementDate: string | null;
rootDnaId: string;
scoreExpireDate: string | null;
}
interface RequestPosition {

View file

@ -56,7 +56,6 @@ const fileImgDataUpload = ref<File[]>([]);
const fileImgs = ref<UploadType[]>([]);
const id = ref<string>("");
const edit = ref<boolean>(false);
const scoreExpireDate = ref<Date | null>(null); //
/** กลับไปหน้าหลัก */
function clickBack() {
@ -102,7 +101,6 @@ async function fetchData() {
fileDocs.value = files;
fileImgs.value = images;
scoreExpireDate.value = data.scoreExpireDate;
})
.catch((e) => {
messageError($q, e);
@ -258,11 +256,7 @@ function sendData() {
year: yearly.value,
announcementDate:
dateAnnounce.value !== null ? convertDateToAPI(dateAnnounce.value) : null,
scoreExpireDate:
scoreExpireDate.value !== null
? convertDateToAPI(scoreExpireDate.value)
: null,
rootDnaId: !edit.value ? dataPositionKeycloak.value.rootDnaId : undefined,
rootDnaId: !edit.value ? dataPositionKeycloak.value.rootDnaId : undefined,
};
return valueData;
}
@ -365,13 +359,6 @@ function dateThaiRange(val: [Date, Date]) {
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`;
}
}
function onUpdateScoreExpireDate(val: Date | null) {
if (val) {
const newDate = new Date(val);
newDate.setFullYear(newDate.getFullYear() + 2);
scoreExpireDate.value = newDate;
}
}
watch(organizationShortName, (count: DataOption2, prevCount: DataOption2) => {
organizationNameOptions.value = [];
@ -468,7 +455,6 @@ onMounted(async () => {
</template>
</datepicker>
</div>
<div class="col-xs-12 col-sm-4 col-md-2" v-if="announcementExam">
<q-input
outlined
@ -484,7 +470,6 @@ onMounted(async () => {
input-class="text-right"
></q-input>
</div>
<div class="col-xs-12 col-sm-4 col-md-3" v-if="announcementExam">
<datepicker
v-model="dateExam"
@ -520,7 +505,6 @@ onMounted(async () => {
</template>
</datepicker>
</div>
<div class="col-xs-12 col-sm-3 col-md-3">
<datepicker
v-model="dateAnnouncement"
@ -563,7 +547,6 @@ onMounted(async () => {
</template>
</datepicker>
</div>
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
<datepicker
v-model="dateRegister"
@ -589,7 +572,6 @@ onMounted(async () => {
dateRegister != null ? dateThaiRange(dateRegister) : null
"
:label="`${'วันที่สมัคร'}`"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
@ -603,7 +585,6 @@ onMounted(async () => {
</template>
</datepicker>
</div>
<div
class="col-xs-12 col-sm-3 col-md-3"
v-if="announcementExam && isFeeNotZero"
@ -633,7 +614,6 @@ onMounted(async () => {
"
:label="`${'วันที่ชำระเงิน'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่ชำระเงิน'}`]"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
@ -656,7 +636,6 @@ onMounted(async () => {
borderless
:enableTimePicker="false"
week-start="0"
@update:model-value="onUpdateScoreExpireDate"
>
<template #year="{ year }">
{{ year + 543 }}
@ -674,48 +653,6 @@ onMounted(async () => {
"
:label="`${'วันประกาศผลสอบ'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันประกาศผลสอบ'}`]"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
<datepicker
v-model="scoreExpireDate"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
class="full-width datepicker q-mb-md"
:model-value="
scoreExpireDate != null ? date2Thai(scoreExpireDate) : null
"
:label="`${'วันหมดอายุบัญชี'}`"
clearable
@clear="scoreExpireDate = null"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon

View file

@ -47,7 +47,7 @@ const positionPathOptions = ref<DataOption2[]>([]);
const organizationShortName = ref<DataOption2>({ id: "", name: "" });
const organizationName = ref<DataOption2>({ id: "", name: "" });
const organizationNameOptions = ref<DataOption2[]>([]);
const scoreExpireDate = ref<Date | null>(null); //
const fileDocDataUpload = ref<File[]>([]);
const fileDocs = ref<UploadType[]>([]);
const fileImgDataUpload = ref<File[]>([]);
@ -93,7 +93,6 @@ async function fetchData() {
data.announcementDate != null ? new Date(data.announcementDate) : null;
fileDocs.value = data.documents;
fileImgs.value = data.images;
scoreExpireDate.value = data.scoreExpireDate;
})
.catch((e) => {
messageError($q, e);
@ -164,10 +163,6 @@ function sendData() {
announcementDate:
dateAnnounce.value !== null ? convertDateToAPI(dateAnnounce.value) : null,
rootDnaId: !edit.value ? dataPositionKeycloak.value.rootDnaId : undefined,
scoreExpireDate:
scoreExpireDate.value !== null
? convertDateToAPI(scoreExpireDate.value)
: null,
};
return valueData;
}
@ -357,14 +352,6 @@ function dateThaiRange(val: [Date, Date] | null) {
}
}
function onUpdateScoreExpireDate(val: Date | null) {
if (val) {
const newDate = new Date(val);
newDate.setFullYear(newDate.getFullYear() + 2);
scoreExpireDate.value = newDate;
}
}
watch(organizationShortName, (count: DataOption2, prevCount: DataOption2) => {
organizationNameOptions.value = [];
});
@ -403,7 +390,7 @@ onMounted(async () => {
<q-form ref="myForm">
<q-card-section class="q-pa-md">
<div class="col-xs-12 col-sm-8"></div>
<div class="col-12 row q-col-gutter-sm">
<div class="col-12 row items-center q-col-gutter-x-sm">
<div class="col-xs-12 col-sm-6">
<q-input
outlined
@ -415,10 +402,8 @@ onMounted(async () => {
(val:string) =>
!!val || `${'กรุณากรอกชื่อรอบคัดเลือก/ชื่อประกาศ'}`,
]"
hide-bottom-space
></q-input>
</div>
<div class="col-xs-12 col-sm-4 col-md-1" v-if="announcementExam">
<q-input
outlined
@ -428,10 +413,8 @@ onMounted(async () => {
dense
lazy-rules
:rules="[(val:number) => val > 0 || `${'กรุณากรอกรอบการสอบให้ถูกต้อง'}`]"
hide-bottom-space
></q-input>
</div>
<div class="col-xs-12 col-sm-4 col-md-1" v-if="announcementExam">
<datepicker
v-model="yearly"
@ -452,7 +435,6 @@ onMounted(async () => {
:model-value="yearly + 543"
:rules="[(val:string) => !!val || `${'กรุณาเลือกปีงบประมาณ'}`]"
:label="`${'ปีงบประมาณ'}`"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
@ -478,7 +460,6 @@ onMounted(async () => {
:rules="[
(val:any) => val >= 0 || `${'กรุณากรอกค่าธรรมเนียมให้ถูกต้อง'}`,
]"
hide-bottom-space
></q-input>
</div>
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
@ -503,7 +484,6 @@ onMounted(async () => {
:model-value="dateExam != null ? date2Thai(dateExam) : null"
:label="`${'วันที่สอบ'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่สอบ'}`]"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
@ -537,11 +517,10 @@ onMounted(async () => {
<q-input
outlined
dense
class="full-width datepicker"
class="full-width datepicker q-mb-md"
:model-value="dateThaiRange(dateAnnouncement)"
:label="`${'วันที่ประกาศ'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่ประกาศ'}`]"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
@ -575,11 +554,10 @@ onMounted(async () => {
<q-input
outlined
dense
class="full-width datepicker"
class="full-width datepicker q-mb-md"
:model-value="dateThaiRange(dateRegister)"
:label="`${'วันที่สมัคร'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่สมัคร'}`]"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
@ -616,13 +594,12 @@ onMounted(async () => {
<q-input
outlined
dense
class="full-width datepicker"
class="full-width datepicker q-mb-md"
:model-value="
datePayment != null ? dateThaiRange(datePayment) : null
"
:label="`${'วันที่ชำระเงิน'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่ชำระเงิน'}`]"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
@ -645,7 +622,6 @@ onMounted(async () => {
borderless
:enableTimePicker="false"
week-start="0"
@update:model-value="onUpdateScoreExpireDate"
>
<template #year="{ year }">
{{ year + 543 }}
@ -657,54 +633,12 @@ onMounted(async () => {
<q-input
outlined
dense
class="full-width datepicker"
class="full-width datepicker q-mb-md"
:model-value="
dateAnnounce != null ? date2Thai(dateAnnounce) : null
"
:label="`${'วันประกาศผลสอบ'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันประกาศผลสอบ'}`]"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
<datepicker
v-model="scoreExpireDate"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
class="full-width datepicker"
:model-value="
scoreExpireDate != null ? date2Thai(scoreExpireDate) : null
"
:label="`${'วันหมดอายุบัญชี'}`"
clearable
@clear="scoreExpireDate = null"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon

View file

@ -93,7 +93,6 @@ const examTypeOptions = [
{ name: "แพทย์", id: "docter" },
];
const category = ref<string>("");
const scoreExpireDate = ref<Date | null>(null);
const fileDocDataUpload = ref<File[]>([]);
const fileDocs = ref<UploadType[]>([]);
@ -334,7 +333,6 @@ async function fetchData() {
refNo1.value = data.refNo1;
reason.value = data.reason;
graduationYearLock.value = data.graduationYearLock;
scoreExpireDate.value = data.scoreExpireDate;
})
.catch((e) => {
messageError($q, e);
@ -508,10 +506,6 @@ function sendData() {
refNo1: refNo1.value,
reason: reason.value,
graduationYearLock: Number(graduationYearLock.value),
scoreExpireDate:
scoreExpireDate.value != null
? convertDateToAPI(scoreExpireDate.value)
: null,
};
return valueData;
}
@ -945,14 +939,6 @@ watch(
}
);
function onUpdateScoreExpireDate(val: Date | null) {
if (val) {
const newDate = new Date(val);
newDate.setFullYear(newDate.getFullYear() + 2);
scoreExpireDate.value = newDate;
}
}
onMounted(async () => {
hideLoader();
if (route.params.id != undefined) {
@ -1256,7 +1242,6 @@ onMounted(async () => {
borderless
:enableTimePicker="false"
week-start="0"
@update:model-value="onUpdateScoreExpireDate"
>
<template #year="{ year }">
{{ year + 543 }}
@ -1290,63 +1275,21 @@ onMounted(async () => {
</template>
</datepicker>
</div>
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
<datepicker
v-model="scoreExpireDate"
:locale="'th'"
autoApply
:readonly="checkRoutePermisson"
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
:readonly="checkRoutePermisson"
dense
class="full-width datepicker q-mb-md"
:model-value="
scoreExpireDate != null ? date2Thai(scoreExpireDate) : null
"
:label="`${'วันหมดอายุบัญชี'}`"
clearable
@clear="scoreExpireDate = null"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-xs-12 col-sm-2 col-md-2" v-if="announcementExam">
<q-input
outlined
v-model="graduationYearLock"
label="ล็อกวันที่สำเร็จการศึกษา (ปี)"
dense
:readonly="checkRoutePermisson"
lazy-rules
:rules="[
<div class="row col-12" v-if="announcementExam">
<div class="col-xs-12 col-md-2">
<q-input
outlined
v-model="graduationYearLock"
label="ล็อกวันที่สำเร็จการศึกษา (ปี)"
dense
:readonly="checkRoutePermisson"
lazy-rules
:rules="[
(val:string) => !!val || `${'กรุณากรอกล็อกวันที่สำเร็จการศึกษา (ปี)'}`,
]"
type="number"
></q-input>
type="number"
></q-input>
</div>
</div>
<div class="col-12" v-if="announcementExam">

View file

@ -341,7 +341,7 @@ watch(
keep-color
color="primary"
dense
:disable="!commandType ? true : false"
:disable="commandType"
v-model="scope.selected"
/>
</template>
@ -352,7 +352,7 @@ watch(
keep-color
color="primary"
dense
:disable="!commandType ? true : false"
:disable="commandType"
v-model="props.selected"
/>
</q-td>

View file

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

View file

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

View file

@ -51,7 +51,7 @@ const isPermissionTab4 = computed(() => {
name="3"
label="ประมวลผลการขาดราชการ/มาสาย"
/>
<q-tab v-if="isPermissionTab4" name="4" label="รอประมวลผล" />
<q-tab v-if="isPermissionTab4" name="4" label="รอประมวลผล/มาสาย" />
<!-- เพมแทบใหม -->
</q-tabs>

View file

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