แสดง เหตุผลการขอลงเวลาพิเศษ ใน popup

This commit is contained in:
setthawutttty 2025-04-08 15:30:35 +07:00
parent 4b2e332849
commit 7396f538bb
2 changed files with 26 additions and 5 deletions

View file

@ -24,6 +24,7 @@ const props = defineProps({
modal: { type: Boolean, default: "" }, modal: { type: Boolean, default: "" },
editCheck: { type: String, default: "" }, editCheck: { type: String, default: "" },
date: { type: String, default: "" }, date: { type: String, default: "" },
description: { type: String, default: "" },
dateFix: { type: String, default: "" }, dateFix: { type: String, default: "" },
id: { type: String, default: "" }, id: { type: String, default: "" },
checkInStatus: { type: String, default: "" }, checkInStatus: { type: String, default: "" },
@ -215,6 +216,20 @@ watch(
/> />
</div> </div>
</div> </div>
<div
class="col q-ma-md q-pa-sm bg-white border-custom text-weight-medium"
>
<p style="color: #06884d; font-size: 14px" class="q-mb-xs">
เหตผลการขอลงเวลาพเศษ
</p>
<q-input
dense
outlined
readonly
autogrow
:model-value="props.description ? props.description : '-'"
></q-input>
</div>
<div <div
v-if="formData.checkInEdit" v-if="formData.checkInEdit"
class="col q-ma-md q-pa-sm bg-white border-custom text-weight-medium" class="col q-ma-md q-pa-sm bg-white border-custom text-weight-medium"
@ -299,9 +314,9 @@ watch(
class="col-12 bg-white q-ma-md inputgreen" class="col-12 bg-white q-ma-md inputgreen"
outlined outlined
stack-label stack-label
:rules="[(val:string) => !!val || 'กรุณาเหตุผล']" :rules="[(val:string) => !!val || 'กรุณาเหตุผลการอนุมัติ']"
v-model="formData.note" v-model="formData.note"
label="เหตุผล" label="เหตุผลการอนุมัติ"
hide-bottom-space hide-bottom-space
type="textarea" type="textarea"
></q-input> ></q-input>

View file

@ -37,6 +37,7 @@ const yearToday = toDay.value.getFullYear();
const month = ref<number>(monthToday + 1); const month = ref<number>(monthToday + 1);
const year = ref<number>(yearToday); const year = ref<number>(yearToday);
const description = ref<string>('')
/**ตัวแปรที่ใช้ */ /**ตัวแปรที่ใช้ */
const modalUnapprove = ref<boolean>(false); const modalUnapprove = ref<boolean>(false);
@ -137,7 +138,7 @@ const columns = ref<QTableProps["columns"]>([
{ {
name: "description", name: "description",
align: "left", align: "left",
label: "เหตุผล", label: "เหตุผลการขอลงเวลาพิเศษ",
sortable: true, sortable: true,
field: "description", field: "description",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
@ -163,11 +164,13 @@ function openModal(
check: string, check: string,
date: string, date: string,
dateFix: string, dateFix: string,
personId: string personId: string,
detail: string,
) { ) {
id.value = personId; id.value = personId;
modalApprove.value = true; modalApprove.value = true;
dateDialog.value = date; dateDialog.value = date;
description.value= detail
dateFixDialog.value = dateFix; dateFixDialog.value = dateFix;
editCheck.value = check; editCheck.value = check;
if (check === "PENDING") { if (check === "PENDING") {
@ -179,6 +182,7 @@ function openModal(
function closeDialog() { function closeDialog() {
modalUnapprove.value = false; modalUnapprove.value = false;
modalApprove.value = false; modalApprove.value = false;
description.value = '';
editCheck.value = "PENDING"; editCheck.value = "PENDING";
} }
@ -443,7 +447,8 @@ onMounted(async () => {
'PENDING', 'PENDING',
props.row.date, props.row.date,
props.row.dateFix, props.row.dateFix,
props.row.id props.row.id,
props.row.description
) )
" "
>อน</q-btn >อน</q-btn
@ -517,6 +522,7 @@ onMounted(async () => {
:date="dateDialog" :date="dateDialog"
:dateFix="dateFixDialog" :dateFix="dateFixDialog"
:id="id" :id="id"
:description="description"
:editCheck="editCheck" :editCheck="editCheck"
:detailData="detailData" :detailData="detailData"
:fetch-data="fetchData" :fetch-data="fetchData"