diff --git a/src/modules/04_registry/components/Coin.vue b/src/modules/04_registry/components/Coin.vue index 9d5be1c33..4f78aa308 100644 --- a/src/modules/04_registry/components/Coin.vue +++ b/src/modules/04_registry/components/Coin.vue @@ -25,11 +25,12 @@ @click="selectData(props)" class="cursor-pointer" > -
- {{ col.value == null ? null : date2Thai(col.value) }} +
+ {{ + props.row.isDate == "true" + ? date2Thai(props.row.issueDate2) + : col.value + 543 + }}
{{ col.value }} @@ -89,7 +90,6 @@ />
- { id: e.id, issuer: e.issuer, detail: e.detail, + isDate: e.isDate == null ? null : e.isDate.toString(), issueDate: new Date(e.issueDate).getFullYear(), issueDate2: new Date(e.issueDate), refCommandNo: e.refCommandNo == "" ? "-" : e.refCommandNo, @@ -619,6 +620,7 @@ const getData = () => { const row = rows.value[rowIndex.value]; issuer.value = row.issuer; detail.value = row.detail; + isDate.value = row.isDate; issueDate.value = row.issueDate; issueDate2.value = row.issueDate2; refCommandNo.value = row.refCommandNo; @@ -684,6 +686,7 @@ const saveData = async () => { id: id.value, issuer: issuer.value, detail: detail.value, + isDate: isDate.value == "true" ? true : false, issueDate: isDate.value == "true" ? dateToISO(issueDate2.value) @@ -717,6 +720,7 @@ const editData = async () => { id: id.value, issuer: issuer.value, detail: detail.value, + isDate: isDate.value == "true" ? true : false, issueDate: isDate.value == "true" ? dateToISO(issueDate2.value) @@ -806,8 +810,11 @@ const selectData = async (props: DataProps) => { issuer.value = props.row.issuer; detail.value = props.row.detail; issueDate.value = props.row.issueDate; + isDate.value = props.row.isDate; + issueDate2.value = props.row.issueDate2; refCommandNo.value = props.row.refCommandNo; - refCommandDate.value = props.row.refCommandDate == '-' ? null:props.row.refCommandDate; + refCommandDate.value = + props.row.refCommandDate == "-" ? null : props.row.refCommandDate; id.value = props.row.id; await checkRowPage(); }; diff --git a/src/modules/04_registry/components/Education.vue b/src/modules/04_registry/components/Education.vue index 32783d601..2266bb578 100644 --- a/src/modules/04_registry/components/Education.vue +++ b/src/modules/04_registry/components/Education.vue @@ -1141,16 +1141,16 @@ const fetchData = async () => { id: e.id, level: e.educationLevel, levelId: e.educationLevelId, - positionPath: e.positionPath ? e.positionPath : "-", + positionPath: e.positionPath, isEducation: e.isEducation, - institute: e.institute ? e.institute : "-", - degree: e.degree ? e.degree : "-", - field: e.field ? e.field : "-", - gpa: e.gpa ? e.gpa : "-", - country: e.country ? e.country : "-", - duration: e.duration ? e.duration : "-", + institute: e.institute, + degree: e.degree, + field: e.field, + gpa: e.gpa, + country: e.country, + duration: e.duration, durationYear: e.durationYear, - other: e.other ? e.other : "-", + other: e.other, fundName: e.fundName, isDate: e.isDate == null ? null : e.isDate.toString(), finishDate: e.finishDate ? new Date(e.finishDate) : null, diff --git a/src/modules/04_registry/components/Insignia.vue b/src/modules/04_registry/components/Insignia.vue index 79a35768a..f607ccda0 100644 --- a/src/modules/04_registry/components/Insignia.vue +++ b/src/modules/04_registry/components/Insignia.vue @@ -526,9 +526,9 @@ const volume = ref(); const section = ref(); const page = ref(); const receiveDate = ref(new Date()); -const dateAnnounce = ref(null); +const dateAnnounce = ref(null); 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 @@ -969,17 +969,17 @@ const fetchData = async () => { insignia: e.insignia == null ? null : e.insignia.name, insigniaId: e.insignia == null ? null : e.insignia.id, insigniaType: e.insigniaType, - year: e.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 : "-", + year: e.year, + no: e.no, + issue: e.issue, + volumeNo: e.volumeNo, + volume: e.volume, + section: e.section, + page: e.page, receiveDate: new Date(e.receiveDate), - dateAnnounce: e.dateAnnounce ? new Date(e.dateAnnounce) : "-", - refCommandNo: e.refCommandNo ? e.refCommandNo : "-", - refCommandDate: e.refCommandDate ? new Date(e.refCommandDate) : "-", + dateAnnounce: e.dateAnnounce, + refCommandNo: e.refCommandNo, + refCommandDate: e.refCommandDate, createdFullName: e.createdFullName, createdAt: new Date(e.createdAt), }); @@ -1102,10 +1102,14 @@ const saveData = async () => { section: section.value, page: page.value, receiveDate: dateToISO(receiveDate.value), - dateAnnounce: dateAnnounce.value ? dateToISO(dateAnnounce.value as Date) : null, + dateAnnounce: dateAnnounce.value + ? dateToISO(dateAnnounce.value as Date) + : null, 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, "บันทึกข้อมูลสำเร็จ"); @@ -1138,10 +1142,14 @@ const editData = async () => { section: section.value, page: page.value, receiveDate: dateToISO(receiveDate.value), - dateAnnounce: dateAnnounce.value ? dateToISO(dateAnnounce.value as Date) : null, + dateAnnounce: dateAnnounce.value + ? dateToISO(dateAnnounce.value as Date) + : null, 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, "บันทึกข้อมูลสำเร็จ"); @@ -1229,9 +1237,11 @@ 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 == '-' ? null:props.row.dateAnnounce; + dateAnnounce.value = + props.row.dateAnnounce == "-" ? null : props.row.dateAnnounce; refCommandNo.value = props.row.refCommandNo; - refCommandDate.value = props.row.refCommandDate == '-'? null:props.row.refCommandDate; + refCommandDate.value = + props.row.refCommandDate == "-" ? null : props.row.refCommandDate; id.value = props.row.id; await checkRowPage(); }; diff --git a/src/modules/04_registry/components/Leave.vue b/src/modules/04_registry/components/Leave.vue index 3a4deaa7b..90284075b 100644 --- a/src/modules/04_registry/components/Leave.vue +++ b/src/modules/04_registry/components/Leave.vue @@ -1157,13 +1157,13 @@ const clickSave = async () => { myFormAdd.value.validate().then(async (result: boolean) => { if (result) { if (modalEdit.value) { - await dialogConfirm($q, () => { + // await dialogConfirm($q, () => { editData(); - }); + // }); } else { - await dialogConfirm($q, () => { + // await dialogConfirm($q, () => { saveData(); - }); + // }); } } }); diff --git a/src/modules/04_registry/components/Train.vue b/src/modules/04_registry/components/Train.vue index 1e83e0ebb..6fc15f829 100644 --- a/src/modules/04_registry/components/Train.vue +++ b/src/modules/04_registry/components/Train.vue @@ -23,18 +23,26 @@ @click="selectData(props)" class="cursor-pointer" > -
+
+ {{ + props.row.isDate == "true" + ? date2Thai(props.row.startDate2) + : col.value + 543 + }} +
+
+ {{ + props.row.isDate == "true" + ? date2Thai(props.row.endDate2) + : col.value + 543 + }} +
+ +
{{ date2Thai(col.value) }}
- {{ col.value + 543 }} + {{ col.value ? col.value + 543 : "" }}
{{ col.value }} @@ -958,6 +966,7 @@ const getData = () => { department.value = row.department; numberOrder.value = row.numberOrder; dateOrder.value = row.dateOrder; + isDate.value = row.isDate; startDate.value = row.startDate; endDate.value = row.endDate; startDate2.value = row.startDate2; @@ -1029,6 +1038,7 @@ const saveData = async () => { department: department.value, numberOrder: numberOrder.value, dateOrder: dateOrder.value, + isDate: isDate.value == "true" ? true : false, startDate: isDate.value == "true" ? dateToISO(startDate2.value) @@ -1161,8 +1171,11 @@ const selectData = async (props: DataProps) => { department.value = props.row.department; numberOrder.value = props.row.numberOrder; dateOrder.value = props.row.dateOrder; + isDate.value = props.row.isDate; startDate.value = props.row.startDate; endDate.value = props.row.endDate; + startDate2.value = props.row.startDate2; + endDate2.value = props.row.endDate2; id.value = props.row.id; await checkRowPage(); };