From 7090a5d6ef2b55ae4f99cd4b264a90ec11ae2cb8 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Fri, 1 Mar 2024 09:36:42 +0700 Subject: [PATCH] readonly --- .../04_registry/components/Insignia.vue | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/modules/04_registry/components/Insignia.vue b/src/modules/04_registry/components/Insignia.vue index 6e0e7026b..c57a637d6 100644 --- a/src/modules/04_registry/components/Insignia.vue +++ b/src/modules/04_registry/components/Insignia.vue @@ -79,7 +79,7 @@ :error="yearInputCheck" error-message="กรุณากรอก ปี ที่ยื่นขอพระราชทานเครื่องราชฯ" /> - +
@@ -586,9 +588,9 @@ const OpsFilter = ref({ insigniaOptions: [], }); -const note = ref() +const note = ref(); const insigniaType = ref(); -const year = ref(0); +const year = ref(0); const no = ref(); const issue = ref(); const volumeNo = ref(); @@ -795,7 +797,6 @@ const columns = ref([ }, ]); - const columnsHistory = ref([ { name: "year", @@ -1107,7 +1108,7 @@ const getData = () => { const row = rows.value[rowIndex.value]; insigniaId.value = row.insigniaId; insigniaType.value = row.insigniaType; - year.value = row.year == null ? null:row.year; + year.value = row.year == null ? null : row.year; no.value = row.no; issue.value = row.issue; volumeNo.value = row.volumeNo; @@ -1119,7 +1120,8 @@ const getData = () => { refCommandNo.value = row.refCommandNo; refCommandDate.value = row.refCommandDate; id.value = row.id; - yearInput.value = row.year !== 0 ? (Number(row.year) + 543).toLocaleString():''; + yearInput.value = + row.year !== 0 ? (Number(row.year) + 543).toLocaleString() : ""; receiveDateInput.value = row.receiveDate ? convertDateDisplay(row.receiveDate) : ""; @@ -1209,7 +1211,7 @@ const saveData = async () => { refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date), - note:note.value + note: note.value, }) .then((res) => { success($q, "บันทึกข้อมูลสำเร็จ"); @@ -1250,7 +1252,7 @@ const editData = async () => { refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date), - note:note.value + note: note.value, }) .then((res) => { success($q, "บันทึกข้อมูลสำเร็จ"); @@ -1330,7 +1332,7 @@ const selectData = async (props: DataProps) => { rowIndex.value = props.rowIndex; insigniaId.value = props.row.insigniaId; insigniaType.value = props.row.insigniaType; - year.value = props.row.year == 0 ? 0:props.row.year; + year.value = props.row.year == 0 ? 0 : props.row.year; no.value = props.row.no; issue.value = props.row.issue; volumeNo.value = props.row.volumeNo; @@ -1345,7 +1347,8 @@ const selectData = async (props: DataProps) => { props.row.refCommandDate == "-" ? null : props.row.refCommandDate; id.value = props.row.id; - yearInput.value = props.row.year !== 0 ? (Number(props.row.year) + 543).toLocaleString():''; + yearInput.value = + props.row.year !== 0 ? (Number(props.row.year) + 543).toLocaleString() : ""; receiveDateInput.value = convertDateDisplay(props.row.receiveDate); dateAnnounceInput.value = props.row.dateAnnounce ? convertDateDisplay(props.row.dateAnnounce as Date) @@ -1492,8 +1495,7 @@ watch( } else { dateAnnounceInput.value = ""; } - } - else if (value.length === 0) { + } else if (value.length === 0) { dateAnnounce.value = null; } } @@ -1508,8 +1510,7 @@ watch( } else { refCommandDateInput.value = ""; } - } - else if (value.length === 0) { + } else if (value.length === 0) { refCommandDate.value = null; } } @@ -1538,8 +1539,7 @@ watch( const dateVal = Number(value) - 543; yearInputCheck.value = false; year.value = dateVal; - } - else if (value.length === 0) { + } else if (value.length === 0) { year.value = 0; } }