From 2cfd9672d0819e6b6444ce754b6932eb2aa3cfb5 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Fri, 1 Mar 2024 09:34:06 +0700 Subject: [PATCH 1/5] =?UTF-8?q?=E0=B8=AB=E0=B8=A1=E0=B8=B2=E0=B8=A2?= =?UTF-8?q?=E0=B9=80=E0=B8=AB=E0=B8=95=E0=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../04_registry/components/Insignia.vue | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/modules/04_registry/components/Insignia.vue b/src/modules/04_registry/components/Insignia.vue index 5e6747074..6e0e7026b 100644 --- a/src/modules/04_registry/components/Insignia.vue +++ b/src/modules/04_registry/components/Insignia.vue @@ -457,6 +457,15 @@ +
+ +
@@ -576,6 +585,8 @@ const Ops = ref({ const OpsFilter = ref({ insigniaOptions: [], }); + +const note = ref() const insigniaType = ref(); const year = ref(0); const no = ref(); @@ -623,6 +634,7 @@ profileData.insignia.columns.length == 0 "dateAnnounce", "refCommandNo", "refCommandDate", + "note", "createdAt", ]) : (visibleColumns.value = profileData.insignia.columns); @@ -770,7 +782,20 @@ 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 +1046,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 +1066,9 @@ const fetchData = async () => { refCommandDate: e.refCommandDate, createdFullName: e.createdFullName, createdAt: e.createdAt, + note: e.note, }); }); - console.log(data) }) .catch((e) => { messageError($q, e); @@ -1185,6 +1209,7 @@ const saveData = async () => { refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date), + note:note.value }) .then((res) => { success($q, "บันทึกข้อมูลสำเร็จ"); @@ -1225,6 +1250,7 @@ const editData = async () => { refCommandDate.value == null ? null : dateToISO(refCommandDate.value as Date), + note:note.value }) .then((res) => { success($q, "บันทึกข้อมูลสำเร็จ"); @@ -1297,7 +1323,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; From 7090a5d6ef2b55ae4f99cd4b264a90ec11ae2cb8 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Fri, 1 Mar 2024 09:36:42 +0700 Subject: [PATCH 2/5] 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; } } From e2edb1d6b4c03c9510bcd820fd6d519cc7c9e35d Mon Sep 17 00:00:00 2001 From: Oat Date: Fri, 1 Mar 2024 09:45:29 +0700 Subject: [PATCH 3/5] =?UTF-8?q?date2thai:=20=E0=B9=81=E0=B8=81=E0=B9=89?= =?UTF-8?q?=E0=B9=80=E0=B8=9B=E0=B9=87=E0=B8=9924=E0=B8=8A=E0=B8=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/mixin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/mixin.ts b/src/stores/mixin.ts index 12864d305..48ca0e791 100644 --- a/src/stores/mixin.ts +++ b/src/stores/mixin.ts @@ -84,7 +84,7 @@ export const useCounterMixin = defineStore("mixin", () => { 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 น.") : "" }`; } From 32ae1f2dc9f297c0a8651f37785bf7c985502a17 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Fri, 1 Mar 2024 10:17:42 +0700 Subject: [PATCH 4/5] =?UTF-8?q?=E0=B8=84=E0=B9=88=E0=B8=B2=E0=B9=80?= =?UTF-8?q?=E0=B8=A3=E0=B8=B4=E0=B9=88=E0=B8=A1=E0=B8=95=E0=B9=89=E0=B8=99?= =?UTF-8?q?=20=E0=B8=9B=E0=B8=B1=E0=B8=88=E0=B8=88=E0=B8=B8=E0=B8=9A?= =?UTF-8?q?=E0=B8=B1=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../13_salary/components/SalaryChart/DialogFormMain.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue b/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue index 0c955d58d..a8196f64b 100644 --- a/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue +++ b/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue @@ -51,9 +51,9 @@ const formData = reactive({ posTypeId: "", //*ประเภทของตำแหน่ง posLevelId: "", //*ระดับของตำแหน่ง isActive: false, //*สถานะการใช้งาน - date: null, //ให้ไว้ ณ วันที่ - startDate: null, //วันที่มีผลบังคับใช้ - endDate: null, //วันที่สิ้นสุดบังคับใช้ + date: new Date(), //ให้ไว้ ณ วันที่ + startDate: new Date(), //วันที่มีผลบังคับใช้ + endDate: new Date(), //วันที่สิ้นสุดบังคับใช้ details: "", //คำอธิบาย isSpecial: false, }); From d15a24c80e2983cbe6b1675b1044444c87ae08b6 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Fri, 1 Mar 2024 10:30:04 +0700 Subject: [PATCH 5/5] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=83?= =?UTF-8?q?=E0=B8=AB=E0=B8=A1=E0=B9=88=20=E0=B8=A7=E0=B8=B1=E0=B8=99?= =?UTF-8?q?=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B9=80=E0=B8=A3=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=E0=B8=95=E0=B9=89=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/SalaryChart/DialogFormMain.vue | 22 ++++++++++--------- src/modules/13_salary/interface/index/Main.ts | 14 +++++++++++- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue b/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue index a8196f64b..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,14 +47,14 @@ const props = defineProps({ }); const salaryId = ref(""); -const formData = reactive({ +const formData = reactive({ salaryType: "", //*ประเภทผัง (OFFICER->"ข้าราชการกรุงเทพมหานครสามัญ",EMPLOYEE->"ลูกจ้างประจำกรุงเทพมหานคร") posTypeId: "", //*ประเภทของตำแหน่ง posLevelId: "", //*ระดับของตำแหน่ง isActive: false, //*สถานะการใช้งาน - date: new Date(), //ให้ไว้ ณ วันที่ - startDate: new Date(), //วันที่มีผลบังคับใช้ - endDate: new Date(), //วันที่สิ้นสุดบังคับใช้ + date: null, //ให้ไว้ ณ วันที่ + startDate: null, //วันที่มีผลบังคับใช้ + endDate: null, //วันที่สิ้นสุดบังคับใช้ details: "", //คำอธิบาย isSpecial: false, }); @@ -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) {
- +
-
+