diff --git a/src/modules/04_registry/components/Insignia.vue b/src/modules/04_registry/components/Insignia.vue index 5e6747074..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="กรุณากรอก ปี ที่ยื่นขอพระราชทานเครื่องราชฯ" /> - + +
+ +
@@ -576,8 +587,10 @@ const Ops = ref({ const OpsFilter = ref({ insigniaOptions: [], }); + +const note = ref(); const insigniaType = ref(); -const year = ref(0); +const year = ref(0); const no = ref(); const issue = ref(); const volumeNo = ref(); @@ -623,6 +636,7 @@ profileData.insignia.columns.length == 0 "dateAnnounce", "refCommandNo", "refCommandDate", + "note", "createdAt", ]) : (visibleColumns.value = profileData.insignia.columns); @@ -770,7 +784,19 @@ const columns = ref([ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { + name: "note", + align: "left", + label: "หมายเหตุ", + sortable: true, + field: "note", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, ]); + const columnsHistory = ref([ { name: "year", @@ -1021,7 +1047,6 @@ const fetchData = async () => { .get(config.API.profileInsignId(profileId.value)) .then((res) => { let data = res.data.result; - console.log(data); rows.value = []; data.map((e: any) => { rows.value.push({ @@ -1042,9 +1067,9 @@ const fetchData = async () => { refCommandDate: e.refCommandDate, createdFullName: e.createdFullName, createdAt: e.createdAt, + note: e.note, }); }); - console.log(data) }) .catch((e) => { messageError($q, e); @@ -1083,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; @@ -1095,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) : ""; @@ -1185,6 +1211,7 @@ const saveData = async () => { refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date), + note: note.value, }) .then((res) => { success($q, "บันทึกข้อมูลสำเร็จ"); @@ -1225,6 +1252,7 @@ const editData = async () => { refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date), + note: note.value, }) .then((res) => { success($q, "บันทึกข้อมูลสำเร็จ"); @@ -1297,7 +1325,6 @@ const clickClose = async () => { * @param props ค่า props ใน row ที่เลือก */ const selectData = async (props: DataProps) => { - console.log(props.row); modalEdit.value = true; modal.value = true; edit.value = false; @@ -1305,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; @@ -1320,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) @@ -1467,8 +1495,7 @@ watch( } else { dateAnnounceInput.value = ""; } - } - else if (value.length === 0) { + } else if (value.length === 0) { dateAnnounce.value = null; } } @@ -1483,8 +1510,7 @@ watch( } else { refCommandDateInput.value = ""; } - } - else if (value.length === 0) { + } else if (value.length === 0) { refCommandDate.value = null; } } @@ -1513,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; } } diff --git a/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue b/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue index 0c955d58d..38ada04f5 100644 --- a/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue +++ b/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue @@ -8,6 +8,7 @@ import config from "@/app.config"; import type { DataOption, ObjectSalaryRef, + FormData } from "@/modules/13_salary/interface/index/Main"; import type { SalaryPosType, @@ -46,7 +47,7 @@ const props = defineProps({ }); const salaryId = ref(""); -const formData = reactive({ +const formData = reactive({ salaryType: "", //*ประเภทผัง (OFFICER->"ข้าราชการกรุงเทพมหานครสามัญ",EMPLOYEE->"ลูกจ้างประจำกรุงเทพมหานคร") posTypeId: "", //*ประเภทของตำแหน่ง posLevelId: "", //*ระดับของตำแหน่ง @@ -168,7 +169,11 @@ watch( if (salaryPosTypeOption.value.length === 0) { await fetchPosType(); } - + if (props.typeAction === "add") { + formData.date = new Date() + formData.startDate = new Date() + formData.endDate = new Date() + } if (props.typeAction === "edit") { await showLoader(); if (props.data) { @@ -237,9 +242,6 @@ function createSalary() { }); } - - - /** function checkEndDate*/ function checkEndDate() { if (formData.endDate !== null && formData.startDate !== null) { @@ -286,10 +288,10 @@ async function downloadFile(url: string, type: string, fileName: string) {
- +
-
+
{ const month = dateMoment.format(isFullMonth ? "MMMM" : "MMM"); const year = +dateMoment.format("YYYY") + 543; return `${day} ${month} ${year}${ - isTime ? dateMoment.format(" hh:mm น.") : "" + isTime ? dateMoment.format(" HH:mm น.") : "" }`; }