สรรหาแก้ไขวันที่สมัครให้แสดงเวลา

This commit is contained in:
Warunee Tamkoo 2025-11-25 17:20:38 +07:00
parent d72551f90b
commit 5aa48d73d3
2 changed files with 32 additions and 15 deletions

View file

@ -260,13 +260,17 @@ async function deleteData(id: string) {
* แปลงชวงวนทา2คาเปนวนเดยวกนจะโชววนเดยวแตาไมเทากนจะแสดงเปนชวง * แปลงชวงวนทา2คาเปนวนเดยวกนจะโชววนเดยวแตาไมเทากนจะแสดงเปนชวง
* @param val วงวนท * @param val วงวนท
*/ */
function dateThaiRange(val: [Date, Date]) { function dateThaiRange(val: [Date, Date], time: boolean = false) {
if (val === null) { if (val === null) {
return "-"; return "-";
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) { } else if (date2Thai(val[0], true) === date2Thai(val[1], true)) {
return `${date2Thai(val[0], true)}`; return `${date2Thai(val[0], true, time)}`;
} else { } else {
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`; return `${date2Thai(val[0], true, time)} - ${date2Thai(
val[1],
true,
time
)}`;
} }
} }
@ -355,11 +359,15 @@ onMounted(async () => {
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
</div> </div>
<div
v-else-if="col.name == 'dateRegister'"
class="table_ellipsis2"
>
{{ dateThaiRange(col.value, true) }}
</div>
<div <div
v-else-if=" v-else-if="
col.name == 'dateRegister' || col.name == 'datePayment' || col.name == 'dateAnnouncement'
col.name == 'datePayment' ||
col.name == 'dateAnnouncement'
" "
class="table_ellipsis2" class="table_ellipsis2"
> >

View file

@ -768,13 +768,19 @@ function clickDeletePosition(row: any) {
* แปลงชวงวนทา2คาเปนวนเดยวกนจะโชววนเดยวแตาไมเทากนจะแสดงเปนชวง * แปลงชวงวนทา2คาเปนวนเดยวกนจะโชววนเดยวแตาไมเทากนจะแสดงเปนชวง
* @param val วงวนท * @param val วงวนท
*/ */
function dateThaiRange(val: [Date, Date] | null) { function dateThaiRange(val: [Date, Date] | null, showTime: boolean = false) {
if (val === null) { if (val === null) {
return ""; return "";
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) { } else if (
return `${date2Thai(val[0], true)}`; date2Thai(val[0], true, showTime) === date2Thai(val[1], true, showTime)
) {
return `${date2Thai(val[0], true, showTime)}`;
} else { } else {
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`; return `${date2Thai(val[0], true, showTime)} - ${date2Thai(
val[1],
true,
showTime
)}`;
} }
} }
@ -1145,6 +1151,11 @@ onMounted(async () => {
borderless borderless
range range
week-start="0" week-start="0"
:enableTimePicker="true"
:start-time="[
{ hours: 8, minutes: 0 },
{ hours: 16, minutes: 0 },
]"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
@ -1158,8 +1169,9 @@ onMounted(async () => {
dense dense
:readonly="checkRoutePermisson" :readonly="checkRoutePermisson"
class="full-width datepicker q-mb-md" class="full-width datepicker q-mb-md"
:model-value="dateThaiRange(dateRegister)" :model-value="dateThaiRange(dateRegister, true)"
:label="`${'วันที่สมัคร'}`" :label="`${'วันที่สมัคร'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่สมัคร'}`]"
clearable clearable
@clear="clearDateRegister" @clear="clearDateRegister"
hide-bottom-space hide-bottom-space
@ -1488,10 +1500,7 @@ onMounted(async () => {
<q-separator size="5px" color="grey-2" class="q-mt-lg" /> <q-separator size="5px" color="grey-2" class="q-mt-lg" />
</div> </div>
<div <div class="col-12 q-mt-lg" v-if="shouldShowPaymentFields">
class="col-12 q-mt-lg"
v-if="shouldShowPaymentFields"
>
<div class="text-bold text-subtitle2 q-pb-md"> <div class="text-bold text-subtitle2 q-pb-md">
เลอกวการชำระเง เลอกวการชำระเง
</div> </div>