From d3936e56b2587fea1f84c948c48a8811f71abf14 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 2 Jul 2026 10:40:54 +0700 Subject: [PATCH] refactor(recruiting): add ScoreExpireDate to compete, qualify, and disable period forms --- .../03_recruiting/interface/request/Period.ts | 2 + .../views/01_compete/PeriodAdd.vue | 65 ++++++++++++++- .../views/02_qualify/DisablePeriodAdd.vue | 78 +++++++++++++++-- .../views/02_qualify/PeriodAdd.vue | 83 ++++++++++++++++--- 4 files changed, 208 insertions(+), 20 deletions(-) diff --git a/src/modules/03_recruiting/interface/request/Period.ts b/src/modules/03_recruiting/interface/request/Period.ts index 420d0f7b8..ce31cae5d 100644 --- a/src/modules/03_recruiting/interface/request/Period.ts +++ b/src/modules/03_recruiting/interface/request/Period.ts @@ -46,6 +46,7 @@ interface RequestPeriodCompete { year: number; announcementDate: string | null; rootDnaId: string; + scoreExpireDate: string | null; } interface RequestPeriodDisable { @@ -65,6 +66,7 @@ interface RequestPeriodDisable { year: number; announcementDate: string | null; rootDnaId: string; + scoreExpireDate: string | null; } interface RequestPosition { diff --git a/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue b/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue index 4a3b9fcea..68d8df9ae 100644 --- a/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue +++ b/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue @@ -56,6 +56,7 @@ const fileImgDataUpload = ref([]); const fileImgs = ref([]); const id = ref(""); const edit = ref(false); +const scoreExpireDate = ref(null); //วันหมดอายุบัญชี /** กลับไปหน้าหลัก */ function clickBack() { @@ -101,6 +102,7 @@ async function fetchData() { fileDocs.value = files; fileImgs.value = images; + scoreExpireDate.value = data.scoreExpireDate; }) .catch((e) => { messageError($q, e); @@ -256,7 +258,11 @@ function sendData() { year: yearly.value, announcementDate: dateAnnounce.value !== null ? convertDateToAPI(dateAnnounce.value) : null, - rootDnaId: !edit.value ? dataPositionKeycloak.value.rootDnaId : undefined, + scoreExpireDate: + scoreExpireDate.value !== null + ? convertDateToAPI(scoreExpireDate.value) + : null, + rootDnaId: !edit.value ? dataPositionKeycloak.value.rootDnaId : undefined, }; return valueData; } @@ -359,6 +365,13 @@ 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 = []; @@ -455,6 +468,7 @@ onMounted(async () => { +
{ input-class="text-right" >
+
{
+
{
+
{ dateRegister != null ? dateThaiRange(dateRegister) : null " :label="`${'วันที่สมัคร'}`" + hide-bottom-space >
+
{ " :label="`${'วันที่ชำระเงิน'}`" :rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่ชำระเงิน'}`]" + hide-bottom-space >