แก้ issue จาก เทส

This commit is contained in:
setthawutttty 2024-02-12 09:54:38 +07:00
parent 2a7051f5f6
commit dd0bd13d6f
4 changed files with 8 additions and 14 deletions

View file

@ -121,8 +121,6 @@
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
v-model="issuer" v-model="issuer"
:rules="[(val) => !!val || `${'กรุณากรอกผู้มีอำนาจลงนาม'}`]"
hide-bottom-space
:label="`${'ผู้มีอำนาจลงนาม'}`" :label="`${'ผู้มีอำนาจลงนาม'}`"
@update:modelValue="clickEditRow" @update:modelValue="clickEditRow"
/> />
@ -188,7 +186,7 @@
lazy-rules lazy-rules
:borderless="!edit" :borderless="!edit"
:model-value=" :model-value="
refCommandDate == null ? null : date2Thai(refCommandDate) refCommandDate == null ? null : date2Thai(refCommandDate as Date)
" "
hide-bottom-space hide-bottom-space
:label="`${'เอกสารอ้างอิง (ลงวันที่)'}`" :label="`${'เอกสารอ้างอิง (ลงวันที่)'}`"
@ -304,7 +302,7 @@ const issuer = ref<string>();
const detail = ref<string>(); const detail = ref<string>();
const issueDate = ref<Date>(new Date()); const issueDate = ref<Date>(new Date());
const refCommandNo = ref<string>(); const refCommandNo = ref<string>();
const refCommandDate = ref<Date | null>(new Date()); const refCommandDate = ref<Date | null|string>(new Date());
const myForm = ref<any>(); //form data input const myForm = ref<any>(); //form data input
const edit = ref<boolean>(false); // dialog const edit = ref<boolean>(false); // dialog
const modal = ref<boolean>(false); //modal add detail const modal = ref<boolean>(false); //modal add detail
@ -502,9 +500,9 @@ const fetchData = async () => {
issuer: e.issuer, issuer: e.issuer,
detail: e.detail, detail: e.detail,
issueDate: new Date(e.issueDate), issueDate: new Date(e.issueDate),
refCommandNo: e.refCommandNo, refCommandNo: e.refCommandNo == '' ? '-':e.refCommandNo,
refCommandDate: refCommandDate:
e.refCommandDate == null ? null : new Date(e.refCommandDate), e.refCommandDate == null ? '-' : new Date(e.refCommandDate),
createdAt: new Date(e.createdAt), createdAt: new Date(e.createdAt),
createdFullName: e.createdFullName, createdFullName: e.createdFullName,
}); });
@ -613,7 +611,7 @@ const saveData = async () => {
issueDate: dateToISO(issueDate.value), issueDate: dateToISO(issueDate.value),
refCommandNo: refCommandNo.value, refCommandNo: refCommandNo.value,
refCommandDate: refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value), refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date),
}) })
.then((res) => { .then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
@ -641,7 +639,7 @@ const editData = async () => {
issueDate: dateToISO(issueDate.value), issueDate: dateToISO(issueDate.value),
refCommandNo: refCommandNo.value, refCommandNo: refCommandNo.value,
refCommandDate: refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value), refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date),
}) })
.then((res) => { .then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");

View file

@ -26,7 +26,7 @@
<div v-if="col.name == 'date'" class="table_ellipsis"> <div v-if="col.name == 'date'" class="table_ellipsis">
{{ date2Thai(col.value) }} {{ date2Thai(col.value) }}
</div> </div>
<div v-else class="table_ellipsis"> <div v-else>
{{ col.value }} {{ col.value }}
</div> </div>
</q-td> </q-td>

View file

@ -87,16 +87,12 @@
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<q-input <q-input
:class="getClass(edit)" :class="getClass(edit)"
hide-bottom-space
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
v-model="topic" v-model="topic"
:rules="[
(val) => !!val || `${'กรุณากรอกหัวข้อการฝึกอบรม/ดูงาน'}`,
]"
:label="`${'หัวข้อการฝึกอบรม/ดูงาน'}`" :label="`${'หัวข้อการฝึกอบรม/ดูงาน'}`"
@update:modelValue="clickEditRow" @update:modelValue="clickEditRow"
/> />

View file

@ -10,7 +10,7 @@ interface RequestItemsObject {
detail: string; detail: string;
issueDate: Date; issueDate: Date;
refCommandNo: string; refCommandNo: string;
refCommandDate: Date | null; refCommandDate: Date | null | string;
createdFullName: string; createdFullName: string;
createdAt: Date; createdAt: Date;
} }