ทะเบียนประวัติ ปรับ table

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-02-14 14:07:55 +07:00
parent fb5017b0e2
commit 0a6feb0c9c
13 changed files with 143 additions and 116 deletions

View file

@ -27,10 +27,10 @@
v-if="col.name == 'refCommandDate' || col.name == 'date'"
class="table_ellipsis"
>
{{ col.value == null ? null : date2Thai(col.value) }}
{{ col.value ? date2Thai(col.value) : "-" }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
@ -291,10 +291,10 @@
"
class="table_ellipsis"
>
{{ col.value == null ? null : date2Thai(col.value) }}
{{ col.value ? date2Thai(col.value) : "-" }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
@ -401,7 +401,7 @@ const OpsFilter = ref<DisciplineOps>({
const detail = ref<string>();
const unStigma = ref<string>();
const refCommandNo = ref<string>();
const refCommandDate = ref<Date | null|string>(new Date());
const refCommandDate = ref<Date | null | string>(new Date());
const date = ref<Date>(new Date());
const myForm = ref<any>(); //form data input
const edit = ref<boolean>(false); // dialog
@ -677,20 +677,21 @@ const fetchData = async () => {
.get(config.API.profileDisId(profileId.value))
.then((res) => {
let data = res.data.result;
console.log(data)
console.log(data);
rows.value = [];
data.map((e: ResponseObject) => {
rows.value.push({
id: e.id,
level: e.level,
detail: e.detail,
unStigma: e.unStigma == '' ? '-':e.unStigma,
unStigma: e.unStigma,
refCommandNo: e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? '-' : new Date(e.refCommandDate),
date: new Date(e.date),
refCommandDate: e.refCommandDate
? new Date(e.refCommandDate)
: null,
date: e.date,
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
createdAt: e.createdAt,
});
});
})
@ -732,7 +733,8 @@ const getData = () => {
detail.value = row.detail;
unStigma.value = row.unStigma;
refCommandNo.value = row.refCommandNo;
refCommandDate.value = row.refCommandDate == '-' ? '':row.refCommandDate as Date;
refCommandDate.value =
row.refCommandDate == "-" ? "" : (row.refCommandDate as Date);
date.value = row.date;
id.value = row.id;
};
@ -798,7 +800,9 @@ const saveData = async () => {
unStigma: unStigma.value,
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date),
refCommandDate.value == null
? null
: dateToISO(refCommandDate.value as Date),
date: dateToISO(date.value),
})
.then((res) => {
@ -829,7 +833,9 @@ const editData = async () => {
unStigma: unStigma.value,
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date),
refCommandDate.value == null
? null
: dateToISO(refCommandDate.value as Date),
date: dateToISO(date.value),
})
.then((res) => {
@ -912,7 +918,8 @@ const selectData = async (props: DataProps) => {
detail.value = props.row.detail;
unStigma.value = props.row.unStigma;
refCommandNo.value = props.row.refCommandNo;
refCommandDate.value = props.row.refCommandDate == '-' ? '':props.row.refCommandDate;
refCommandDate.value =
props.row.refCommandDate == "-" ? "" : props.row.refCommandDate;
date.value = props.row.date;
id.value = props.row.id;
inputDate.value = convertDateDisplay(props.row.date);