ทะเบียนประวัติ ปรับ 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

@ -24,14 +24,14 @@
class="cursor-pointer"
>
<div v-if="col.name == 'date'" class="table_ellipsis">
{{ date2Thai(col.value) }}
{{ col.value ? date2Thai(col.value) : "-" }}
</div>
<div v-else-if="col.name == 'name'" class="table_ellipsis">
{{ textPoint(props.row.pointSum) }}
{{ textRangePoint(props.row.pointSum) }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>

View file

@ -1,3 +1,4 @@
a
<!-- card ประกาศเกยรต -->
<template>
<q-card flat bordered class="col-12 q-px-lg q-pa-md">
@ -36,10 +37,14 @@
v-else-if="col.name == 'refCommandDate'"
class="table_ellipsis"
>
{{ date2Thai(props.row.refCommandDate) }}
{{
props.row.refCommandDate
? date2Thai(props.row.refCommandDate)
: "-"
}}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
@ -357,10 +362,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>
@ -380,7 +385,6 @@ import { useQuasar } from "quasar";
import type {
RequestItemsObject,
Columns,
DataProps,
} from "@/modules/04_registry/interface/request/Coin";
import type { ResponseObject } from "@/modules/04_registry/interface/response/Coin";
import HistoryTable from "@/components/TableHistory.vue";
@ -422,7 +426,7 @@ const detail = ref<string>();
const issueDate = ref<number>(new Date().getFullYear());
const issueDate2 = ref<Date>(new Date());
const refCommandNo = ref<string>();
const refCommandDate = ref<Date>(new Date());
const refCommandDate = ref<Date | null>(new Date());
const myForm = ref<any>(); //form data input
const edit = ref<boolean>(false); // dialog
const modal = ref<boolean>(false); //modal add detail
@ -432,7 +436,7 @@ const rowIndex = ref<number>(0); //indexข้อมูลเดิมที่
const previous = ref<boolean>(); //
const next = ref<boolean>(); //
const editRow = ref<boolean>(false); //
const rowsHistory = ref<RequestItemsObject[]>([]); //select data history
const rowsHistory = ref<any[]>([]); //select data history
const tittleHistory = ref<string>("ประวัติแก้ไขประกาศเกียรติคุณ"); //
const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal
@ -440,7 +444,7 @@ const checkValidate = ref<boolean>(false); //validate data ผ่านหรื
const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const rows = ref<RequestItemsObject[]>([]);
const rows = ref<any[]>([]);
const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]);
profileData.coined.columns.length == 0
@ -662,19 +666,18 @@ const fetchData = async () => {
.get(config.API.profileHonorId(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,
issuer: e.issuer == ''?'-':e.issuer,
issuer: e.issuer,
detail: e.detail,
isDate: e.isDate == null ? null : e.isDate.toString(),
issueDate: new Date(e.issueDate).getFullYear(),
isDate: e.isDate,
issueDate: e.issueDate ? new Date(e.issueDate).getFullYear() : null,
issueDate2: new Date(e.issueDate),
refCommandNo: e.refCommandNo == "" ? "-" : e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? "-" : new Date(e.refCommandDate),
refCommandNo: e.refCommandNo,
refCommandDate: e.refCommandDate,
createdAt: new Date(e.createdAt),
createdFullName: e.createdFullName,
});
@ -714,9 +717,10 @@ const clickNext = async () => {
*/
const getData = () => {
const row = rows.value[rowIndex.value];
console.log(row);
issuer.value = row.issuer;
detail.value = row.detail;
isDate.value = row.isDate;
isDate.value = row.isDate.toString();
issueDate.value = row.issueDate;
issueDate2.value = row.issueDate2;
refCommandNo.value = row.refCommandNo;
@ -897,7 +901,7 @@ const clickClose = async () => {
* กดเลอกขอมลทจะแกไข
* @param props props ใน row เลอก
*/
const selectData = async (props: DataProps) => {
const selectData = async (props: any) => {
modalEdit.value = true;
modal.value = true;
edit.value = false;
@ -915,7 +919,6 @@ const selectData = async (props: DataProps) => {
inputYear.value = props.row.issueDate + 543;
inputDate.value = convertDateDisplay(props.row.issueDate2);
inputDateRef.value = convertDateDisplay(props.row.refCommandDate);
console.log(refCommandDate.value);
await checkRowPage();
};
@ -984,7 +987,7 @@ const clickHistory = async (row: RequestItemsObject) => {
.then((res) => {
let data = res.data.result;
rowsHistory.value = [];
data.map((e: ResponseObject) => {
data.map((e: any) => {
rowsHistory.value.push({
id: e.id,
issuer: e.issuer,

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);

View file

@ -44,7 +44,7 @@
{{ col.value ? "ใช่" : "ไม่ใช่" }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
@ -392,7 +392,7 @@
dense
/>
<datepicker
v-else
v-else
menu-class-name="modalfix"
:readonly="!edit"
v-model="finishDate"
@ -644,13 +644,13 @@
v-else-if="col.name == 'finishDate' || col.name == 'createdAt'"
class="table_ellipsis"
>
{{ date2Thai(col.value) }}
{{ col.value ? date2Thai(col.value) : "-" }}
</div>
<div v-else-if="col.name == 'isEducation'" class="table_ellipsis">
{{ col.value ? "ใช่" : "ไม่ใช่" }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
@ -734,7 +734,7 @@ const durationYear = ref<number>(0);
const other = ref<string>();
const fundName = ref<string>();
const isDate = ref<string | null>("true");
const finishDate = ref<Date | null|string>(null);
const finishDate = ref<Date | null | string>(null);
const startDate = ref<Date | string | number>(new Date().getFullYear());
const startDate2 = ref<Date | string | null>(new Date());
const endDate = ref<number | string | Date>(new Date().getFullYear());
@ -1301,7 +1301,9 @@ const getData = () => {
inputEndDate.value = (Number(row.endDate) + 543).toLocaleString();
inputStartDate2.value = convertDateDisplay(row.startDate2);
inputEndDate2.value = convertDateDisplay(row.endDate2);
finishDateInput.value = row.finishDate ? convertDateDisplay(row.finishDate):'-';
finishDateInput.value = row.finishDate
? convertDateDisplay(row.finishDate)
: "-";
endDate2.value = row.endDate2;
id.value = row.id;
};
@ -1405,7 +1407,9 @@ const saveData = async () => {
other: other.value,
fundName: fundName.value,
isDate: isDate.value == "true" ? true : false,
finishDate: finishDate.value ? dateToISO(finishDate.value as Date) : null,
finishDate: finishDate.value
? dateToISO(finishDate.value as Date)
: null,
startDate:
isDate.value == "true"
? dateToISO(startDate2.value as Date)
@ -1536,7 +1540,7 @@ const clickClose = async () => {
* @param _props props ใน row เลอก
*/
const selectData = async (_props: DataProps) => {
console.log(_props)
console.log(_props);
modalEdit.value = true;
modal.value = true;
edit.value = false;
@ -1564,7 +1568,9 @@ const selectData = async (_props: DataProps) => {
inputEndDate.value = (Number(_props.row.endDate) + 543).toLocaleString();
inputStartDate2.value = convertDateDisplay(_props.row.startDate2);
inputEndDate2.value = convertDateDisplay(_props.row.endDate2);
finishDateInput.value = _props.row.finishDate ? convertDateDisplay(_props.row.finishDate):'-';
finishDateInput.value = _props.row.finishDate
? convertDateDisplay(_props.row.finishDate)
: "-";
await checkRowPage();
};
@ -1598,10 +1604,10 @@ const addData = () => {
inputEndDate.value = "";
finishDateInput.value = "";
dayChecked2.value = false
dayEndChecked2.value = false
dayChecked.value = false
dayEndChecked.value = false
dayChecked2.value = false;
dayEndChecked2.value = false;
dayChecked.value = false;
dayEndChecked.value = false;
};
/**
@ -1765,7 +1771,6 @@ watch(
} else {
finishDateInput.value = "";
}
}
}
);

View file

@ -32,13 +32,13 @@
"
class="table_ellipsis"
>
{{ col.value == null ? null : date2Thai(col.value) }}
{{ col.value ? date2Thai(col.value) : "-" }}
</div>
<div v-else-if="col.name == 'year'" class="table_ellipsis">
{{ col.value + 543 }}
{{ col.value ? col.value + 543 : "-" }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
@ -497,13 +497,13 @@
"
class="table_ellipsis"
>
{{ col.value == null ? null : date2Thai(col.value) }}
{{ col.value ? date2Thai(col.value) : "-" }}
</div>
<div v-else-if="col.name == 'year'" class="table_ellipsis">
{{ col.value + 543 }}
{{ col.value ? col.value + 543 : "-" }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
@ -1029,18 +1029,18 @@ const fetchData = async () => {
insigniaId: e.insignia == null ? null : e.insignia.id,
insigniaType: e.insigniaType,
year: e.year,
no: e.no == '' ? '-':e.no,
issue: e.issue == '' ? '-':e.issue,
volumeNo: e.volumeNo == '' ? '-':e.volumeNo,
volume: e.volume == '' ? '-':e.volume,
section: e.section == '' ? '-':e.section,
page: e.page == '' ? '-':e.page,
receiveDate: new Date(e.receiveDate),
dateAnnounce: e.dateAnnounce == null ? '-':e.dateAnnounce,
refCommandNo: e.refCommandNo == '' ? '-':e.refCommandNo,
refCommandDate: e.refCommandDate == null ? '-':e.refCommandDate,
no: e.no,
issue: e.issue,
volumeNo: e.volumeNo,
volume: e.volume,
section: e.section,
page: e.page,
receiveDate: e.receiveDate,
dateAnnounce: e.dateAnnounce,
refCommandNo: e.refCommandNo,
refCommandDate: e.refCommandDate,
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
createdAt: e.createdAt,
});
});
})
@ -1089,7 +1089,7 @@ const getData = () => {
section.value = row.section;
page.value = row.page;
receiveDate.value = row.receiveDate;
dateAnnounce.value = row.dateAnnounce == '-'?'':row.dateAnnounce;
dateAnnounce.value = row.dateAnnounce == "-" ? "" : row.dateAnnounce;
refCommandNo.value = row.refCommandNo;
refCommandDate.value = row.refCommandDate;
id.value = row.id;
@ -1311,13 +1311,13 @@ const selectData = async (props: DataProps) => {
section.value = props.row.section;
page.value = props.row.page;
receiveDate.value = props.row.receiveDate;
dateAnnounce.value = props.row.dateAnnounce == '-'? '':props.row.dateAnnounce;
dateAnnounce.value =
props.row.dateAnnounce == "-" ? "" : props.row.dateAnnounce;
refCommandNo.value = props.row.refCommandNo;
refCommandDate.value =
props.row.refCommandDate == "-" ? null : props.row.refCommandDate;
id.value = props.row.id;
console.log(dateAnnounce.value);
yearInput.value = (Number(props.row.year) + 543).toLocaleString();
receiveDateInput.value = convertDateDisplay(props.row.receiveDate);
dateAnnounceInput.value = props.row.dateAnnounce
@ -1353,9 +1353,9 @@ const addData = () => {
receiveDateInput.value = "";
dateAnnounceInput.value = "";
refCommandDateInput.value = "";
yearInput.value = ''
yearInput.value = "";
receiveDateCheck.value = false
receiveDateCheck.value = false;
};
/**
@ -1459,7 +1459,6 @@ watch(
() => dateAnnounceInput.value,
(value: string) => {
if (value.length === 10) {
const dateVal = convertDate(value);
if (dateVal.isValid) {
dateAnnounce.value = dateVal.value;

View file

@ -40,7 +40,7 @@
}}
</div>
<div v-else-if="col.name == 'status'" class="table_ellipsis">
{{ statusLeave(col.value) }}
{{ col.value ? statusLeave(col.value) : "-" }}
<!-- {{ col.value }} -->
</div>
<div
@ -51,10 +51,12 @@
"
class="table_ellipsis"
>
{{ col.value == null ? "" : col.value.toLocaleString("en-US") }}
{{
col.value == null ? "-" : col.value.toLocaleString("en-US")
}}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<!-- <q-td auto-width>
@ -387,12 +389,12 @@
>
{{
col.value == null
? ""
? "-"
: col.value.toLocaleString("en-US")
}}
</div>
<div v-else>
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
@ -434,13 +436,13 @@
"
class="table_ellipsis"
>
{{ col.value == null ? "" : col.value.toLocaleString("en-US") }}
{{ col.value == null ? "-" : col.value.toLocaleString("en-US") }}
</div>
<div v-else-if="col.name == 'status'" class="table_ellipsis">
{{ statusLeave(col.value) }}
{{ col.value ? statusLeave(col.value) : "-" }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>

View file

@ -24,10 +24,10 @@
class="cursor-pointer"
>
<div v-if="col.name == 'date'" class="table_ellipsis">
{{ date2Thai(col.value) }}
{{ col.value ? date2Thai(col.value) : "-" }}
</div>
<div v-else>
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
@ -163,10 +163,10 @@
v-if="col.name == 'date' || col.name == 'createdAt'"
class="table_ellipsis"
>
{{ 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>

View file

@ -27,10 +27,10 @@
v-if="col.name == 'date' || col.name == 'refCommandDate'"
class="table_ellipsis"
>
{{ col.value == null ? null : date2Thai(col.value) }}
{{ col.value == null ? "-" : date2Thai(col.value) }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
@ -275,10 +275,10 @@
"
class="table_ellipsis"
>
{{ col.value == null ? null : date2Thai(col.value) }}
{{ col.value == null ? "-" : date2Thai(col.value) }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
@ -333,7 +333,7 @@ const date = ref<Date>(new Date());
const detail = ref<string>();
const reference = ref<string>();
const refCommandNo = ref<string>();
const refCommandDate = ref<Date | null|string>(new Date());
const refCommandDate = ref<Date | null | string>(new Date());
const myForm = ref<any>(); //form data input
const edit = ref<boolean>(false); // dialog
const modal = ref<boolean>(false); //modal add detail
@ -567,7 +567,6 @@ const fetchData = async () => {
.get(config.API.profileNopaidId(profileId.value))
.then((res) => {
let data = res.data.result;
console.log(data)
rows.value = [];
data.map((e: ResponseObject) => {
rows.value.push({
@ -575,9 +574,9 @@ const fetchData = async () => {
date: new Date(e.date),
detail: e.detail,
reference: e.reference,
refCommandNo: e.refCommandNo == ''?'-':e.refCommandNo,
refCommandNo: e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? '-' : new Date(e.refCommandDate),
e.refCommandDate == null ? null : new Date(e.refCommandDate),
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
});
@ -686,7 +685,9 @@ const saveData = async () => {
reference: reference.value,
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date),
refCommandDate.value == null
? null
: dateToISO(refCommandDate.value as Date),
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
@ -714,7 +715,9 @@ const editData = async () => {
reference: reference.value,
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date),
refCommandDate.value == null
? null
: dateToISO(refCommandDate.value as Date),
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");

View file

@ -24,7 +24,7 @@
class="cursor-pointer"
>
<div class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
@ -149,10 +149,10 @@
<q-tr :props="props">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name == 'createdAt'" class="table_ellipsis">
{{ date2Thai(col.value) }}
{{ col.value ? date2Thai(col.value) : col.value }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>

View file

@ -39,13 +39,13 @@
</div>
<div v-else-if="col.name == 'dateOrder'" class="table_ellipsis">
{{ date2Thai(col.value) }}
{{ col.value ? date2Thai(col.value) : "-" }}
</div>
<div v-else-if="col.name == 'yearly'" class="table_ellipsis">
{{ col.value ? col.value + 543 : "" }}
{{ col.value ? col.value + 543 : "-" }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
@ -600,13 +600,13 @@
"
class="table_ellipsis"
>
{{ date2Thai(col.value) }}
{{ col.value ? date2Thai(col.value) : "-" }}
</div>
<div v-else-if="col.name == 'yearly'" class="table_ellipsis">
{{ col.value + 543 }}
{{ col.value ? col.value + 543 : "-" }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>

View file

@ -31,10 +31,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-td auto-width>
@ -334,10 +334,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>
@ -395,7 +395,7 @@ const detail = ref<string>();
const reference = ref<string>();
const minDate = ref<Date>();
const refCommandNo = ref<string>();
const refCommandDate = ref<Date | null|string>(new Date());
const refCommandDate = ref<Date | null | string>(new Date());
const myForm = ref<any>(); //form data input
const edit = ref<boolean>(false); // dialog
const modal = ref<boolean>(false); //modal add detail
@ -681,7 +681,7 @@ const fetchData = async () => {
reference: e.reference,
refCommandNo: e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? '-' : new Date(e.refCommandDate),
e.refCommandDate == null ? null : new Date(e.refCommandDate),
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
});
@ -726,7 +726,8 @@ const getData = () => {
detail.value = row.detail;
reference.value = row.reference;
refCommandNo.value = row.refCommandNo;
refCommandDate.value = row.refCommandDate == '-' ? '':row.refCommandDate as Date;
refCommandDate.value =
row.refCommandDate == "-" ? "" : (row.refCommandDate as Date);
id.value = row.id;
};
@ -792,7 +793,9 @@ const saveData = async () => {
reference: reference.value,
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date),
refCommandDate.value == null
? null
: dateToISO(refCommandDate.value as Date),
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
@ -821,7 +824,9 @@ const editData = async () => {
reference: reference.value,
refCommandNo: refCommandNo.value,
refCommandDate:
refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date),
refCommandDate.value == null
? null
: dateToISO(refCommandDate.value as Date),
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
@ -904,7 +909,8 @@ const selectData = async (props: DataProps) => {
detail.value = props.row.detail;
reference.value = props.row.reference;
refCommandNo.value = props.row.refCommandNo;
refCommandDate.value = props.row.refCommandDate =='-' ? '':props.row.refCommandDate as Date;
refCommandDate.value =
props.row.refCommandDate == "-" ? "" : (props.row.refCommandDate as Date);
id.value = props.row.id;
inputDateStart.value = convertDateDisplay(dateStart.value);

View file

@ -8,12 +8,13 @@ interface RequestItemsObject {
id: string;
issuer: string;
detail: string;
issueDate: number;
issueDate: number | null;
issueDate2: Date;
refCommandNo: string;
refCommandDate: Date | null | string;
createdFullName: string;
createdAt: Date;
isDate: string;
}
//columns
@ -29,4 +30,4 @@ interface Columns {
};
}
export type { RequestItemsObject, Columns, DataProps };
export type { RequestItemsObject, Columns };

View file

@ -9,6 +9,7 @@ interface ResponseObject {
refCommandDate: Date | null;
createdFullName: string;
createdAt: Date;
isDate: string;
}
export type { ResponseObject };