diff --git a/src/modules/04_registryNew/components/detail/GovernmentInformation/01_Info.vue b/src/modules/04_registryNew/components/detail/GovernmentInformation/01_Info.vue index bcb0df7ac..695e07dca 100644 --- a/src/modules/04_registryNew/components/detail/GovernmentInformation/01_Info.vue +++ b/src/modules/04_registryNew/components/detail/GovernmentInformation/01_Info.vue @@ -102,8 +102,8 @@ const visibleColumnsHistory = ref([ "govAgeAbsent", "govAgePlus", "reasonSameDate", - "createdFullName", - "createdAt", + "lastUpdateFullName", + "lastUpdatedAt", ]); const columnsHistory = ref([ @@ -212,6 +212,7 @@ const columnsHistory = ref([ label: "วันที่บรรจุ", sortable: true, field: "dateAppoint", + format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -223,6 +224,7 @@ const columnsHistory = ref([ label: "เริ่มปฎิบัติราชการ", sortable: true, field: "dateStart", + format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -234,6 +236,7 @@ const columnsHistory = ref([ label: "วันเกษียณอายุ", sortable: true, field: "retireDate", + format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -284,22 +287,23 @@ const columnsHistory = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "createdFullName", + name: "lastUpdateFullName", align: "left", label: "ผู้ดำเนินการ", sortable: true, - field: "createdFullName", + field: "lastUpdateFullName", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "createdAt", + name: "lastUpdatedAt", align: "left", label: "วันที่แก้ไข", sortable: true, - field: "createdAt", + field: "lastUpdatedAt", + format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -311,9 +315,11 @@ const columnsHistory = ref([ function openDialogEdit() { modalEdit.value = true; - containDate.value = formMain.containDate ?formMain.containDate:null - workDate.value = formMain.workDate ?formMain.workDate:null - reasonSameDate.value = formMain.reasonSameDate ?formMain.reasonSameDate:null + containDate.value = formMain.containDate ? formMain.containDate : null; + workDate.value = formMain.workDate ? formMain.workDate : null; + reasonSameDate.value = formMain.reasonSameDate + ? formMain.reasonSameDate + : null; } function openDialogHistory() { @@ -352,7 +358,11 @@ function onSubmit() { .patch(config.API.profileNewGovernmentById(profileId.value), { dateAppoint: containDate.value, dateStart: workDate.value, - reasonSameDate: reasonSameDate.value, + reasonSameDate: + dateToISO(containDate.value as Date) === + dateToISO(workDate.value as Date) + ? "" + : reasonSameDate.value, }) .then((res) => { closeDialog(); @@ -375,7 +385,6 @@ function getData() { http .get(config.API.profileNewGovernmentById(profileId.value)) .then((res) => { - console.log(res.data.result); const data = res.data.result; formMain.ocId = data.org; //สังกัด formMain.positionId = data.position; //ตำแหน่ง @@ -431,6 +440,8 @@ function getDataHistory() { reasonSameDate: e.reasonSameDate, createdFullName: e.createdFullName, createdAt: new Date(e.createdAt), + lastUpdatedAt: e.lastUpdatedAt, + lastUpdateFullName: e.lastUpdateFullName, }); }); }) @@ -622,236 +633,246 @@ onMounted(() => { - +
- - - + + + + + + - - -
-
- - - - + +
+
+ +
-
- -
- -
- + + - - - บันทึกข้อมูล - - + + + + + บันทึกข้อมูล + + + -
+
- - - - - - - - -
- - - - - + + + -
- - - + + + + +
diff --git a/src/modules/04_registryNew/components/detail/GovernmentInformation/02_Discipline.vue b/src/modules/04_registryNew/components/detail/GovernmentInformation/02_Discipline.vue index cc2a6e99e..cc9a3603f 100644 --- a/src/modules/04_registryNew/components/detail/GovernmentInformation/02_Discipline.vue +++ b/src/modules/04_registryNew/components/detail/GovernmentInformation/02_Discipline.vue @@ -58,6 +58,10 @@ const formFilter = reactive({ const currentPage = ref(1); const maxPage = ref(1); +const pagination = ref({ + page: 1, + rowsPerPage: 10, +}); const visibleColumns = ref([ "level", @@ -408,18 +412,20 @@ onMounted(async () => { > - - + - - - + + + + + + - - -
-
- - - - - -
-
- -
-
- +
+
+ + + + + +
+
+ +
+
+ + /> +
+
+ +
+
+ + + +
+
+ + + + + +
-
- -
-
- - - -
-
- - - - - -
-
- - + + - - - บันทึกข้อมูล - - + + + + + บันทึกข้อมูล + + + - + diff --git a/src/modules/04_registryNew/components/detail/GovernmentInformation/02_DisciplineHistory.vue b/src/modules/04_registryNew/components/detail/GovernmentInformation/02_DisciplineHistory.vue index 5ba868aa4..fa760dacd 100644 --- a/src/modules/04_registryNew/components/detail/GovernmentInformation/02_DisciplineHistory.vue +++ b/src/modules/04_registryNew/components/detail/GovernmentInformation/02_DisciplineHistory.vue @@ -35,7 +35,10 @@ const formFilter = reactive({ isShowRetire: false, isProbation: false, }); - +const historyPagination = ref({ + page: 1, + rowsPerPage: 10, +}); const visibleColumns = ref([ "level", "detail", @@ -181,107 +184,105 @@ watch(modal, (status) => { diff --git a/src/modules/04_registryNew/components/detail/GovernmentInformation/03_Leave.vue b/src/modules/04_registryNew/components/detail/GovernmentInformation/03_Leave.vue index f372923bd..ce17ca0af 100644 --- a/src/modules/04_registryNew/components/detail/GovernmentInformation/03_Leave.vue +++ b/src/modules/04_registryNew/components/detail/GovernmentInformation/03_Leave.vue @@ -37,6 +37,10 @@ const { dateToISO, } = mixin; +const pagination = ref({ + page: 1, + rowsPerPage: 10, +}); const mode = ref("table"); const filterKeyword = ref(""); const currentPage = ref(1); @@ -203,7 +207,6 @@ function openDialogAdd() { http .get(config.API.profileNewLeaveType()) .then((res) => { - console.log(res.data.result); const dataOp = res.data.result.map((item: any) => ({ id: item.id, name: item.name, @@ -350,11 +353,13 @@ function validateForm() { } } if (hasError.every((result) => result === true)) { - if (edit.value == false) { - saveData(); - } else { - editData(); - } + dialogConfirm($q, async () => { + if (edit.value == false) { + saveData(); + } else { + editData(); + } + }); } } @@ -533,6 +538,7 @@ onMounted(() => { :rows="rows" :grid="mode === 'card'" :paging="true" + v-model:pagination="pagination" :rows-per-page-options="[10, 25, 50, 100]" :visible-columns="visibleColumns" :filter="filterKeyword" @@ -660,166 +666,165 @@ onMounted(() => {
- - +
- - - + + + + + + - - -
-
- +
+
+ -
-
- - - - - -
-
- -
-
- + + + + + +
+
+ +
+
+ + /> +
+
+ +
-
- -
-
- - + + - - - บันทึกข้อมูล - - + + + + + บันทึกข้อมูล + + + - + 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 6d0df53d4..582fdbc03 100644 --- a/src/modules/04_registryNew/components/detail/GovernmentInformation/03_LeaveHistory.vue +++ b/src/modules/04_registryNew/components/detail/GovernmentInformation/03_LeaveHistory.vue @@ -19,8 +19,6 @@ const $q = useQuasar(); const mixin = useCounterMixin(); const { showLoader, hideLoader, messageError, date2Thai } = mixin; -const currentPage = ref(1); -const maxPage = ref(1); const filterKeyword = ref(""); const rows = ref([]); //select data history const formFilter = reactive({ @@ -36,6 +34,10 @@ const formFilter = reactive({ isProbation: false, }); +const historyPagination = ref({ + page: 1, + rowsPerPage: 10, +}); const visibleColumns = ref([ "no", "typeLeave", @@ -212,118 +214,116 @@ watch(modal, (status) => { diff --git a/src/modules/04_registryNew/components/detail/GovernmentInformation/04_PerformSpecialWork.vue b/src/modules/04_registryNew/components/detail/GovernmentInformation/04_PerformSpecialWork.vue index 93f037156..dc2371b1a 100644 --- a/src/modules/04_registryNew/components/detail/GovernmentInformation/04_PerformSpecialWork.vue +++ b/src/modules/04_registryNew/components/detail/GovernmentInformation/04_PerformSpecialWork.vue @@ -52,6 +52,10 @@ const dutyData = reactive({ refCommandDate: null, }); +const pagination = ref({ + page: 1, + rowsPerPage: 10, +}); const rows = ref([]); const filterKeyword = ref(""); const mode = ref("table"); @@ -373,6 +377,7 @@ onMounted(async () => { :rows-per-page-options="[10, 25, 50, 100]" :visible-columns="visibleColumns" :filter="filterKeyword" + v-model:pagination="pagination" > > - - + - - - + + + + + + - - -
-
- - - - - -
-
- - - - - -
-
- -
-
- -
-
- - - -
-
- - - - + +
-
-
- + + - - - บันทึกข้อมูล - - + + + + + บันทึกข้อมูล + + +
-
+
diff --git a/src/modules/04_registryNew/components/detail/GovernmentInformation/04_PerformSpecialWorkHistory.vue b/src/modules/04_registryNew/components/detail/GovernmentInformation/04_PerformSpecialWorkHistory.vue index 53cd2d0df..5ba2bb390 100644 --- a/src/modules/04_registryNew/components/detail/GovernmentInformation/04_PerformSpecialWorkHistory.vue +++ b/src/modules/04_registryNew/components/detail/GovernmentInformation/04_PerformSpecialWorkHistory.vue @@ -36,6 +36,10 @@ const formFilter = reactive({ isProbation: false, }); +const historyPagination = ref({ + page: 1, + rowsPerPage: 10, +}); const visibleColumns = ref([ "dateStart", "dateEnd", @@ -43,8 +47,8 @@ const visibleColumns = ref([ "reference", "refCommandNo", "refCommandDate", - "createdFullName", - "createdAt", + "lastUpdateFullName", + "lastUpdatedAt", ]); const columns = ref([ { @@ -117,22 +121,22 @@ const columns = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "createdFullName", + name: "lastUpdateFullName", align: "left", label: "ผู้ดำเนินการ", sortable: true, - field: "createdFullName", + field: "lastUpdateFullName", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - 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), @@ -159,6 +163,8 @@ function getHistory() { e.refCommandDate == null ? null : new Date(e.refCommandDate), createdFullName: e.createdFullName, createdAt: new Date(e.createdAt), + lastUpdateFullName: e.lastUpdateFullName, + lastUpdatedAt: e.lastUpdatedAt, }); }); }) @@ -182,107 +188,105 @@ watch(modal, (status) => { diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/02_NameChangeHistory.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/02_NameChangeHistory.vue index 9f9e937d6..7b6e90a87 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/02_NameChangeHistory.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/02_NameChangeHistory.vue @@ -602,7 +602,7 @@ watch( :rows="rows" :columns="columns" :filter="filterSearch" - :rows-per-page-options="[0]" + :rows-per-page-options="[10, 25, 50, 100]" :visible-columns="visibleColumns" :virtual-scroll-sticky-size-start="48" > diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/03_Address.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/03_Address.vue index 8038a4515..10200e328 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/03_Address.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/03_Address.vue @@ -87,8 +87,8 @@ const visibleColumnsHistory = ref([ "registrationSame", "registrationSubDistrict", "registrationZipCode", - "createdFullName", - "createdAt", + "lastUpdateFullName", + "lastUpdatedAt", ]); const columnsHistory = ref([ @@ -224,22 +224,22 @@ const columnsHistory = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "createdFullName", + name: "lastUpdateFullName", align: "left", label: "ผู้ดำเนินการ", sortable: true, - field: "createdFullName", + field: "lastUpdateFullName", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - 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), diff --git a/src/modules/04_registryNew/interface/index/government.ts b/src/modules/04_registryNew/interface/index/government.ts index 8569a5983..305accb4a 100644 --- a/src/modules/04_registryNew/interface/index/government.ts +++ b/src/modules/04_registryNew/interface/index/government.ts @@ -32,6 +32,8 @@ interface MyObjectRef { } interface RequestItemsHistoryObject { + lastUpdatedAt: Date, + lastUpdateFullName: string, oc: string | null; position: string | null; positionPathSide: string | null; diff --git a/src/modules/04_registryNew/interface/index/performSpecialWork.ts b/src/modules/04_registryNew/interface/index/performSpecialWork.ts index fcef79e5d..a880350af 100644 --- a/src/modules/04_registryNew/interface/index/performSpecialWork.ts +++ b/src/modules/04_registryNew/interface/index/performSpecialWork.ts @@ -32,6 +32,8 @@ interface MyObjectRef { } interface ResponseObject { + lastUpdateFullName: string, + lastUpdatedAt: Date, id: string; dateStart: Date; dateEnd: Date;