diff --git a/src/modules/04_registry/components/Assessment.vue b/src/modules/04_registry/components/Assessment.vue
index 01b003642..bc3413908 100644
--- a/src/modules/04_registry/components/Assessment.vue
+++ b/src/modules/04_registry/components/Assessment.vue
@@ -24,14 +24,14 @@
class="cursor-pointer"
>
- {{ date2Thai(col.value) }}
+ {{ col.value ? date2Thai(col.value) : "-" }}
{{ textPoint(props.row.pointSum) }}
{{ textRangePoint(props.row.pointSum) }}
- {{ col.value }}
+ {{ col.value ? col.value : "-" }}
diff --git a/src/modules/04_registry/components/Coin.vue b/src/modules/04_registry/components/Coin.vue
index 68ecc631d..5d1ebdb1e 100644
--- a/src/modules/04_registry/components/Coin.vue
+++ b/src/modules/04_registry/components/Coin.vue
@@ -1,3 +1,4 @@
+a
@@ -36,10 +37,14 @@
v-else-if="col.name == 'refCommandDate'"
class="table_ellipsis"
>
- {{ date2Thai(props.row.refCommandDate) }}
+ {{
+ props.row.refCommandDate
+ ? date2Thai(props.row.refCommandDate)
+ : "-"
+ }}
- {{ col.value }}
+ {{ col.value ? col.value : "-" }}
@@ -357,10 +362,10 @@
"
class="table_ellipsis"
>
- {{ col.value == null ? null : date2Thai(col.value) }}
+ {{ col.value ? date2Thai(col.value) : "-" }}
- {{ col.value }}
+ {{ col.value ? col.value : "-" }}
@@ -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();
const issueDate = ref(new Date().getFullYear());
const issueDate2 = ref(new Date());
const refCommandNo = ref();
-const refCommandDate = ref(new Date());
+const refCommandDate = ref(new Date());
const myForm = ref(); //form data input
const edit = ref(false); //เช็คการกดปุ่มแก้ไขใน dialog
const modal = ref(false); //modal add detail
@@ -432,7 +436,7 @@ const rowIndex = ref(0); //indexข้อมูลเดิมที่
const previous = ref(); //แสดงปุ่มดูข้อมูลก่อนหน้า
const next = ref(); //แสดงปุ่มดูข้อมูลต่อไป
const editRow = ref(false); //เช็คมีการแก้ไขข้อมูล
-const rowsHistory = ref([]); //select data history
+const rowsHistory = ref([]); //select data history
const tittleHistory = ref("ประวัติแก้ไขประกาศเกียรติคุณ"); //
const filterHistory = ref(""); //search data table history
const modalHistory = ref(false); //modal ประวัติการแก้ไขข้อมูล
@@ -440,7 +444,7 @@ const checkValidate = ref(false); //validate data ผ่านหรื
const profileId = ref(
route.params.id ? route.params.id.toString() : ""
);
-const rows = ref([]);
+const rows = ref([]);
const filter = ref(""); //search data table
const visibleColumns = ref([]);
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,
diff --git a/src/modules/04_registry/components/Discipline.vue b/src/modules/04_registry/components/Discipline.vue
index 7e137e672..9aa55bdc8 100644
--- a/src/modules/04_registry/components/Discipline.vue
+++ b/src/modules/04_registry/components/Discipline.vue
@@ -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) : "-" }}
- {{ col.value }}
+ {{ col.value ? col.value : "-" }}
@@ -291,10 +291,10 @@
"
class="table_ellipsis"
>
- {{ col.value == null ? null : date2Thai(col.value) }}
+ {{ col.value ? date2Thai(col.value) : "-" }}
- {{ col.value }}
+ {{ col.value ? col.value : "-" }}
@@ -401,7 +401,7 @@ const OpsFilter = ref({
const detail = ref();
const unStigma = ref();
const refCommandNo = ref();
-const refCommandDate = ref(new Date());
+const refCommandDate = ref(new Date());
const date = ref(new Date());
const myForm = ref(); //form data input
const edit = ref(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);
diff --git a/src/modules/04_registry/components/Education.vue b/src/modules/04_registry/components/Education.vue
index 1653ceac2..0c3419413 100644
--- a/src/modules/04_registry/components/Education.vue
+++ b/src/modules/04_registry/components/Education.vue
@@ -44,7 +44,7 @@
{{ col.value ? "ใช่" : "ไม่ใช่" }}
- {{ col.value }}
+ {{ col.value ? col.value : "-" }}
@@ -392,7 +392,7 @@
dense
/>
- {{ date2Thai(col.value) }}
+ {{ col.value ? date2Thai(col.value) : "-" }}
{{ col.value ? "ใช่" : "ไม่ใช่" }}
- {{ col.value }}
+ {{ col.value ? col.value : "-" }}
@@ -734,7 +734,7 @@ const durationYear = ref(0);
const other = ref();
const fundName = ref();
const isDate = ref("true");
-const finishDate = ref(null);
+const finishDate = ref(null);
const startDate = ref(new Date().getFullYear());
const startDate2 = ref(new Date());
const endDate = ref(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 = "";
}
-
}
}
);
diff --git a/src/modules/04_registry/components/Insignia.vue b/src/modules/04_registry/components/Insignia.vue
index 232cbd54a..deeee17af 100644
--- a/src/modules/04_registry/components/Insignia.vue
+++ b/src/modules/04_registry/components/Insignia.vue
@@ -32,13 +32,13 @@
"
class="table_ellipsis"
>
- {{ col.value == null ? null : date2Thai(col.value) }}
+ {{ col.value ? date2Thai(col.value) : "-" }}
- {{ col.value + 543 }}
+ {{ col.value ? col.value + 543 : "-" }}
- {{ col.value }}
+ {{ col.value ? col.value : "-" }}
@@ -497,13 +497,13 @@
"
class="table_ellipsis"
>
- {{ col.value == null ? null : date2Thai(col.value) }}
+ {{ col.value ? date2Thai(col.value) : "-" }}
- {{ col.value + 543 }}
+ {{ col.value ? col.value + 543 : "-" }}
- {{ col.value }}
+ {{ col.value ? col.value : "-" }}
@@ -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;
diff --git a/src/modules/04_registry/components/Leave.vue b/src/modules/04_registry/components/Leave.vue
index 4fd368e9b..0539ab664 100644
--- a/src/modules/04_registry/components/Leave.vue
+++ b/src/modules/04_registry/components/Leave.vue
@@ -40,7 +40,7 @@
}}
- {{ statusLeave(col.value) }}
+ {{ col.value ? statusLeave(col.value) : "-" }}
- {{ col.value == null ? "" : col.value.toLocaleString("en-US") }}
+ {{
+ col.value == null ? "-" : col.value.toLocaleString("en-US")
+ }}
- {{ col.value }}
+ {{ col.value ? col.value : "-" }}