diff --git a/src/modules/04_registryNew/components/detail/Achievement/01_ProfessionalLicense.vue b/src/modules/04_registryNew/components/detail/Achievement/01_ProfessionalLicense.vue index 824728192..43b5377f7 100644 --- a/src/modules/04_registryNew/components/detail/Achievement/01_ProfessionalLicense.vue +++ b/src/modules/04_registryNew/components/detail/Achievement/01_ProfessionalLicense.vue @@ -91,6 +91,89 @@ const columns = ref([ }, ]); +const historyColumns = ref([ + { + name: "certificateType", + align: "left", + label: "ชื่อใบอนุญาต", + sortable: true, + field: "certificateType", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "issuer", + align: "left", + label: "หน่วยงานผู้ออกใบอนุญาต", + sortable: true, + field: "issuer", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "certificateNo", + align: "left", + label: "เลขที่ใบอนุญาต", + sortable: true, + field: "certificateNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "issueDate", + align: "left", + label: "วันที่ออกใบอนุญาต", + sortable: true, + field: "issueDate", + format: (v) => date2Thai(v), + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "expireDate", + align: "left", + label: "วันที่หมดอายุ", + sortable: true, + format: (v) => date2Thai(v), + field: "expireDate", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "lastUpdateFullName", + align: "left", + label: "ผู้ดำเนินการ", + sortable: true, + field: "lastUpdateFullName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "lastUpdatedAt", + align: "left", + label: "วันที่แก้ไข", + sortable: true, + field: "lastUpdatedAt", + format: (v) => date2Thai(v), + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, +]); + const profesLicenseData = reactive({ certificateType: "", issuer: "", @@ -122,6 +205,8 @@ const historyVisibleColumns = ref([ "certificateNo", "issueDate", "expireDate", + "lastUpdateFullName", + "lastUpdatedAt", ]); async function onSubmit() { @@ -249,7 +334,7 @@ onMounted(async () => { + @@ -632,7 +737,7 @@ onMounted(async () => { :display-value="$q.lang.table.columns" emit-value map-options - :options="columns" + :options="historyColumns" option-value="name" options-cover style="min-width: 150px" @@ -640,7 +745,7 @@ onMounted(async () => { { + diff --git a/src/modules/04_registryNew/components/detail/Achievement/02_Train.vue b/src/modules/04_registryNew/components/detail/Achievement/02_Train.vue index cd08799fe..e5e2dd0fc 100644 --- a/src/modules/04_registryNew/components/detail/Achievement/02_Train.vue +++ b/src/modules/04_registryNew/components/detail/Achievement/02_Train.vue @@ -144,6 +144,147 @@ const columns = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); +const historyColumns = ref([ + { + name: "name", + align: "left", + label: "ชื่อโครงการ/หลักสูตรการฝึกอบรม", + sortable: true, + field: "name", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "topic", + align: "left", + label: "หัวข้อการฝึกอบรม/ดูงาน", + sortable: true, + field: "topic", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "startDate", + align: "left", + label: "วันเริ่มต้นการฝึกอบรม/ดูงาน", + sortable: true, + field: (v) => + v.isDate + ? date2Thai(v.startDate) + : new Date(v.startDate).getFullYear() + 543, + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "endDate", + align: "left", + label: "วันสิ้นสุดการฝึกอบรม/ดูงาน", + sortable: true, + field: (v) => + v.isDate ? date2Thai(v.endDate) : new Date(v.endDate).getFullYear() + 543, + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "yearly", + align: "left", + label: "ปีที่อบรม (พ.ศ.)", + sortable: true, + field: "yearly", + format: (v) => v + 543, + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "place", + align: "left", + label: "สถานที่ฝึกอบรม/ดูงาน", + sortable: true, + field: "place", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "duration", + align: "left", + label: "รวมระยะเวลาในการฝึกอบรม/ดูงาน", + sortable: true, + field: "duration", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "department", + align: "left", + label: "หน่วยงานที่รับผิดชอบจัดการฝึกอบรม/ดูงาน", + sortable: true, + field: "department", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "numberOrder", + align: "left", + label: "เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ", + sortable: true, + field: "numberOrder", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "dateOrder", + align: "left", + label: "คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่", + sortable: true, + field: "dateOrder", + format: (v) => date2Thai(v), + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "lastUpdateFullName", + align: "left", + label: "ผู้ดำเนินการ", + sortable: true, + field: "lastUpdateFullName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "lastUpdatedAt", + align: "left", + label: "วันที่แก้ไข", + sortable: true, + field: "lastUpdatedAt", + format: (v) => date2Thai(v), + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, +]); const isDate = ref("false"); const dialogStatus = ref("create"); const historyDialog = ref(false); @@ -199,6 +340,8 @@ const historyVisibleColumns = ref([ "dateOrder", // คำสั่งลงวันที่ "startDate", // วันเริ่มต้น "endDate", // วันสิ้นสุด + "lastUpdateFullName", // แก้ไขโดย + "lastUpdatedAt", // แก้ไขเมื่อวันที่ ]); async function onSubmit() { @@ -548,6 +691,26 @@ onMounted(async () => { + @@ -964,7 +1127,7 @@ onMounted(async () => { :display-value="$q.lang.table.columns" emit-value map-options - :options="columns" + :options="historyColumns" option-value="name" options-cover style="min-width: 150px" @@ -972,7 +1135,7 @@ onMounted(async () => { { + diff --git a/src/modules/04_registryNew/components/detail/GovernmentInformation/03_LeaveHistory.vue b/src/modules/04_registryNew/components/detail/GovernmentInformation/03_LeaveHistory.vue index 8a6976523..c10b88c92 100644 --- a/src/modules/04_registryNew/components/detail/GovernmentInformation/03_LeaveHistory.vue +++ b/src/modules/04_registryNew/components/detail/GovernmentInformation/03_LeaveHistory.vue @@ -45,6 +45,8 @@ const visibleColumns = ref([ "totalLeave", "status", "reason", + "lastUpdateFullName", + "lastUpdatedAt", ]); const columns = ref([ { @@ -113,6 +115,29 @@ const columns = ref([ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { + name: "lastUpdateFullName", + align: "left", + label: "ผู้ดำเนินการ", + sortable: true, + field: "lastUpdateFullName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "lastUpdatedAt", + align: "left", + label: "วันที่แก้ไข", + sortable: true, + field: "lastUpdatedAt", + format: (v) => date2Thai(v), + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, ]); function getHistory() { showLoader(); @@ -123,6 +148,7 @@ function getHistory() { rows.value = []; data.map((e: any) => { rows.value.push({ + ...e, id: e.id, typeLeave: e.leaveType.name, code: e.leaveType.refCommandDate, @@ -150,7 +176,7 @@ function getHistory() { * แปลงช่วงวันที่ถ้า2ค่าเป็นวันเดียวกันจะโชววันเดียวแต่ถ้าไม่เท่ากันจะแสดงเป็นช่วง * @param val ช่วงวันที่ */ - function dateThaiRange(val: [Date, Date]) { +function dateThaiRange(val: [Date, Date]) { if (val === null) { } else if (date2Thai(val[0]) === date2Thai(val[1])) { return `${date2Thai(val[0])}`; @@ -159,7 +185,7 @@ function getHistory() { } } -function statusLeave(val: string){ +function statusLeave(val: string) { switch (val) { case "waitting": return "รออนุมัติ"; @@ -172,7 +198,7 @@ function statusLeave(val: string){ default: return "-"; } -}; +} watch(modal, (status) => { if (status == true) { @@ -276,8 +302,8 @@ watch(modal, (status) => { }}
- {{ statusLeave(col.value) }} -
+ {{ statusLeave(col.value) }} +
{{ col.value ? col.value : "-" }}
diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyHistory.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyHistory.vue index c4bcb93ac..2f0f0b731 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyHistory.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyHistory.vue @@ -32,7 +32,6 @@ async function fetchHistoryData(id: string) { await http .get(config.API.profileNewFamilyHisByFamilyId(id)) .then(async (res) => { - console.log(res.data.result); historyRows.value = res.data.result; }) .catch((err) => { diff --git a/src/modules/04_registryNew/components/detail/Salary/01_PositionSalary.vue b/src/modules/04_registryNew/components/detail/Salary/01_PositionSalary.vue index a392b5bf1..5996f9043 100644 --- a/src/modules/04_registryNew/components/detail/Salary/01_PositionSalary.vue +++ b/src/modules/04_registryNew/components/detail/Salary/01_PositionSalary.vue @@ -314,7 +314,6 @@ function onSubmit() { } async function submit() { - console.log(formDataSalary); const formData = { profileId: isStatusEdit.value ? undefined : profileId.value, date: formDataSalary.date, // วันที่ @@ -340,7 +339,6 @@ async function submit() { refCommandNo: formDataSalary.refCommandNo, // เลขที่คำสั่ง templateDoc: formDataSalary.doc, // เอกสารอ้างอิง }; - console.log(formData); try { const url = isStatusEdit.value @@ -398,7 +396,7 @@ onMounted(() => { }); + diff --git a/src/modules/04_registryNew/components/detail/Salary/01_PositionSalaryHistory.vue b/src/modules/04_registryNew/components/detail/Salary/01_PositionSalaryHistory.vue index 28f7b6530..ead04e503 100644 --- a/src/modules/04_registryNew/components/detail/Salary/01_PositionSalaryHistory.vue +++ b/src/modules/04_registryNew/components/detail/Salary/01_PositionSalaryHistory.vue @@ -173,20 +173,20 @@ const columns = ref([ style: "font-size: 14px", }, { - name: "createdFullName", + name: "lastUpdateFullName", align: "left", label: "ผู้ดำเนินการ", sortable: true, - field: "createdFullName", + field: "lastUpdateFullName", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "createdAt", + name: "lastUpdatedAt", align: "left", label: "วันที่แก้ไข", sortable: true, - field: "createdAt", + field: "lastUpdatedAt", headerStyle: "font-size: 14px", style: "font-size: 14px", format: (v) => date2Thai(v), @@ -209,8 +209,8 @@ const visibleColumns = ref([ "salaryClass", "templateDoc", "refCommandNo", - "createdFullName", - "createdAt", + "lastUpdateFullName", + "lastUpdatedAt", ]); const rows = ref([]); const pagination = ref({ @@ -321,6 +321,26 @@ watch( +