diff --git a/src/api/09_leave/api.leave.ts b/src/api/09_leave/api.leave.ts
index 369549925..764503896 100644
--- a/src/api/09_leave/api.leave.ts
+++ b/src/api/09_leave/api.leave.ts
@@ -20,5 +20,6 @@ export default {
/** รายการลา*/
leaveType: () => `${leave}/type`,
leaveList: () => `${leave}/admin`,
+ leaveListDelete: () => `${leave}/admin/delete`,
leaveListById: (id: string) => `${leave}/admin/${id}`,
};
diff --git a/src/api/11_discipline/api.discipline.ts b/src/api/11_discipline/api.discipline.ts
index 093b52c26..292bb3a4b 100644
--- a/src/api/11_discipline/api.discipline.ts
+++ b/src/api/11_discipline/api.discipline.ts
@@ -2,6 +2,7 @@ import env from "../index";
const disciplineMain = `${env.API_URI}/discipline`;
const discipline = `${env.API_URI}/discipline/disciplinary`;
const investigate = `${env.API_URI}/discipline/investigate`;
+const suspend = `${env.API_URI}/discipline/suspend`;
export default {
directorList: (page: number, pageSize: number, keyword: string) =>
@@ -65,4 +66,10 @@ export default {
/** รายการผลการพิจารณาทางวินัย*/
listResult: () => `${disciplineMain}/result`,
listResultById: (id: string) => `${disciplineMain}/result/${id}`,
+
+ /** ผู้ถูกพักราชการ */
+ suspendMain:(page: number, pageSize: number, keyword: string) => `${suspend}?page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
+ suspendById: (id: string) => `${suspend}/${id}`,
+
+ suspendReport: () => `${suspend}/report`,
};
diff --git a/src/modules/09_leave/components/1_Work/TableList.vue b/src/modules/09_leave/components/1_Work/TableList.vue
index e72e5e330..b23e09053 100644
--- a/src/modules/09_leave/components/1_Work/TableList.vue
+++ b/src/modules/09_leave/components/1_Work/TableList.vue
@@ -122,7 +122,13 @@ function updateRowsPerPagen(newPagination: any) {
@click.prevent="clickDetail(props.row)"
>
- {{ props.rowIndex + 1 }}
+
+
+ {{
+ (currentPage - 1) * Number(pagination.rowsPerPage) +
+ props.rowIndex +
+ 1
+ }}
diff --git a/src/modules/09_leave/components/2_Leave/Tab1.vue b/src/modules/09_leave/components/2_Leave/Tab1.vue
index c40561b04..82cf89ef0 100644
--- a/src/modules/09_leave/components/2_Leave/Tab1.vue
+++ b/src/modules/09_leave/components/2_Leave/Tab1.vue
@@ -1,5 +1,8 @@
@@ -182,19 +180,6 @@ onMounted(async () => {
-
{
hideLoader();
})
.finally(async () => {
+ SpecialTimeStore.fetchData();
hideLoader();
});
};
diff --git a/src/modules/09_leave/interface/request/specialTime.ts b/src/modules/09_leave/interface/request/specialTime.ts
index fa44490f8..f11b3a282 100644
--- a/src/modules/09_leave/interface/request/specialTime.ts
+++ b/src/modules/09_leave/interface/request/specialTime.ts
@@ -13,4 +13,9 @@ interface ListData {
checkOut: string;
checkIn: string;
}
-export type { ListData };
+
+interface DataDateMonthObject {
+ month: number;
+ year: number;
+}
+export type { ListData, DataDateMonthObject };
diff --git a/src/modules/09_leave/stores/SpecialTimeStore.ts b/src/modules/09_leave/stores/SpecialTimeStore.ts
index 0735dcdaa..ecdd6ffd8 100644
--- a/src/modules/09_leave/stores/SpecialTimeStore.ts
+++ b/src/modules/09_leave/stores/SpecialTimeStore.ts
@@ -2,12 +2,14 @@ import { defineStore } from "pinia";
import { ref, watch, defineEmits } from "vue";
import type { QTableProps } from "quasar";
import type { DataRows } from "@/modules/09_leave/interface/response/specialTime";
-import type { ListData } from "@/modules/09_leave/interface/request/specialTime";
+import type { DataDateMonthObject } from "@/modules/09_leave/interface/request/specialTime";
+
import { useCounterMixin } from "@/stores/mixin";
import type { DataOption } from "@/modules/09_leave/interface/index/Main";
import http from "@/plugins/http";
import config from "@/app.config";
import { useQuasar } from "quasar";
+import { mount } from "@vue/test-utils";
const $q = useQuasar();
const mixin = useCounterMixin();
@@ -45,32 +47,6 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
const pageSize = ref(10);
const filter = ref(""); //search data table
const maxPage = ref(0);
- // Pagination - update rowsPerPage
- // async function updatePagination(newPagination: any) {
- // initialPagination.value = newPagination;
- // // currentPage.value = 1;
- // console.log("updatePagination");
- // }
-
- // Pagination - initial pagination
- const initialPagination = ref({
- sortBy: null,
- descending: false,
- page: 1,
- // rowsPerPage: pageSize,
- });
-
- /**
- * ฟังก์ชั่น api เปลี่ยนหน้า
- * @param pageVal page
- * @param pageSizeVal pagesize
- */
- async function changePage(pageVal: number, pageSizeVal: number) {
- page.value = await pageVal;
- pageSize.value = await pageSizeVal;
- console.log("changePage");
- fetchData();
- }
/**
* ฟังชั้นเรียกดูข้อมูล
@@ -126,6 +102,19 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
});
};
+ /**
+ * ฟังก์ชั่น api เปลี่ยนหน้า
+ * @param pageVal page
+ * @param pageSizeVal pagesize
+ */
+ async function changePage(pageVal: number, pageSizeVal: number) {
+ page.value = await pageVal;
+ pageSize.value = await pageSizeVal;
+ console.log(pageSize.value);
+
+ fetchData();
+ }
+
//--------------|ฟิลเตอร์|--------------------------------------//
const searchFilterTable = async (searchDate: any) => {
rows.value = [];
@@ -268,5 +257,7 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
page,
pageSize,
month,
+ filter,
+ // changeMonth,
};
});
diff --git a/src/modules/09_leave/views/SpecialTimeMain.vue b/src/modules/09_leave/views/SpecialTimeMain.vue
index 42021a04e..3868106c5 100644
--- a/src/modules/09_leave/views/SpecialTimeMain.vue
+++ b/src/modules/09_leave/views/SpecialTimeMain.vue
@@ -8,7 +8,7 @@ import DialogReason from "@/components/Dialogs/PopupReason.vue";
import DialogApprove from "@/modules/09_leave/components/4_specialTime/DialogApprove.vue";
import http from "@/plugins/http";
import config from "@/app.config";
-
+import type { DataDateMonthObject } from "@/modules/09_leave/interface/request/specialTime";
import { useRouter } from "vue-router";
import { identity } from "@fullcalendar/core/internal";
@@ -28,6 +28,7 @@ const name = ref("");
const id = ref("");
const dateDialog = ref("");
const dateFixDialog = ref("");
+const dateYear = ref(new Date().getFullYear());
/**ฟังก์ชั่นไม่อนุมัติ */
const unapprove = async (fullname: string, personId: string) => {
@@ -35,6 +36,7 @@ const unapprove = async (fullname: string, personId: string) => {
dialogTitle.value = " ไม่อนุมัติการลงเวลาพิเศษของ" + fullname;
name.value = fullname;
modalUnapprove.value = true;
+
// rejectData();
};
@@ -79,35 +81,20 @@ const clickSave = async (reason: string) => {
.catch((e) => {
messageError($q, e);
})
- .finally(async () => {});
+ .finally(async () => {
+ dataSpecialTime.fetchData();
+ });
+
console.log(reason);
};
-// ค้นหาในตาราง
-const filterKeyword = ref("");
-const filterRef = ref(null);
-const resetFilter = () => {
- filterKeyword.value = "";
- if (filterRef.value) {
- filterRef.value.focus();
- }
-};
-
// paging
-const page = ref(1);
const pageSize = ref(10);
-const filter = ref(""); //search data table
/**
* ฟังก์ชั่น api เปลี่ยนหน้า
* @param pageVal page
* @param pageSizeVal pagesize
*/
-async function changePage(pageVal: number, pageSizeVal: number) {
- // page.value = await pageVal;
- // pageSize.value = await pageSizeVal;
- // dataSpecialTime.fetchData();
- console.log("test");
-}
// Pagination - initial pagination
const initialPagination = ref({
sortBy: null,
@@ -123,21 +110,36 @@ watch(
async () => {
dataSpecialTime.page = currentPage.value;
await dataSpecialTime.fetchData();
- // emit(
- // "update:change-page",
- // currentPage.value,
- // initialPagination.value.rowsPerPage,
- // true
- // );
}
);
+
// Pagination - update rowsPerPage
-async function updatePagination(newPagination: any) {
+async function updatePagination(initialPagination: any) {
currentPage.value = 1;
- dataSpecialTime.pageSize = initialPagination.value.rowsPerPage;
+ dataSpecialTime.pageSize = initialPagination.rowsPerPage;
dataSpecialTime.page = 1; // set current page เป็น 1 เสมอเมื่อเปลี่ยน per row
}
+// ค้นหาในตาราง
+const filterKeyword = ref("");
+const filterRef = ref(null);
+const resetFilter = () => {
+ filterKeyword.value = "";
+ dataSpecialTime.filter = filterKeyword.value;
+ dataSpecialTime.fetchData();
+ if (filterRef.value) {
+ filterRef.value.focus();
+ }
+};
+/** function ค้นหาข้อมูลแล้วอัปเดท*/
+function filterFn() {
+ updatePagination(filterKeyword.value);
+ console.log(filterKeyword.value);
+ dataSpecialTime.filter = filterKeyword.value;
+ dataSpecialTime.pageSize = pageSize.value;
+ dataSpecialTime.fetchData();
+}
+
/**Hook */
onMounted(async () => {
console.log("test");
@@ -145,11 +147,23 @@ onMounted(async () => {
});
/** Function Date */
-const selectedDate = ref("");
const dateMonth = ref({
month: new Date().getMonth(),
year: new Date().getFullYear(),
});
+const updateMonth = async (e: DataDateMonthObject) => {
+ // console.log(dateMonth.value);
+ if (e != null) {
+ dateYear.value = e.year;
+ dateYear.value = dataSpecialTime.year;
+ dataSpecialTime.month = dateMonth.value.month + 1;
+ dataSpecialTime.year = dateMonth.value.year;
+ // filterKeyword.value = "";
+ }
+ await dataSpecialTime.fetchData();
+};
+
+//แปลงเดือนเป็นไทย
const monthYearThai = (val: any) => {
if (val == null) return "";
else return monthYear2Thai(val.month, val.year);
@@ -164,11 +178,12 @@ const monthYearThai = (val: any) => {
{{ year + 543 }}
{{
@@ -205,7 +220,8 @@ const monthYearThai = (val: any) => {
ref="filterRef"
outlined
debounce="300"
- placeholder="ค้นหา"
+ placeholder="ค้นหาชื่อ-นามสกุล"
+ @keydown.enter.prevent="filterFn"
>
@@ -246,7 +262,7 @@ const monthYearThai = (val: any) => {
:paging="false"
dense
:visible-columns="dataSpecialTime.visibleColumns"
- :rows-per-page-options="[5, 10, 25, 50, 100]"
+ :rows-per-page-options="[10, 25, 50, 100]"
v-model:pagination="initialPagination"
@update:pagination="updatePagination"
>
@@ -275,7 +291,11 @@ const monthYearThai = (val: any) => {
- {{ props.rowIndex + 1 }}
+ {{
+ (dataSpecialTime.page - 1) * dataSpecialTime.pageSize +
+ props.rowIndex +
+ 1
+ }}
{{ col.value }}
diff --git a/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue b/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue
index e341c4d56..08aff7b6d 100644
--- a/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue
+++ b/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue
@@ -1,5 +1,5 @@
@@ -205,15 +189,26 @@ watchEffect(() => {
selection="multiple"
v-model:selected="selected"
>
-
-
+
+
+
+
+
+
+ {{ col.label }}
+
+
-
@@ -224,31 +219,14 @@ watchEffect(() => {
v-model="props.selected"
/>
-
- {{ props.rowIndex + 1 }}
-
-
- {{ props.row.fullname }}
-
-
- {{ props.row.position }}
-
-
- {{ props.row.positionLevel }}
-
-
-
- {{ props.row.organizationPositionOld }}
+
+
+ {{ props.rowIndex + 1 }}
-
-
-
- {{ props.row.organization }}
+
+ {{ col.value }}
-
- {{ props.row.statustext }}
-
diff --git a/src/modules/11_discipline/components/7_ListSuspend/DismissOrder.vue b/src/modules/11_discipline/components/7_ListSuspend/DismissOrder.vue
index 781416f10..d90e9ea76 100644
--- a/src/modules/11_discipline/components/7_ListSuspend/DismissOrder.vue
+++ b/src/modules/11_discipline/components/7_ListSuspend/DismissOrder.vue
@@ -1,5 +1,5 @@
- รายชื่อผู้ถูกพักราชการ
+
+ รายชื่อผู้ถูกพักราชการ
+
@@ -259,7 +261,7 @@ const pagination = ref({
+
+
+
{{ col.label }}
-
+
- {{ props.rowIndex + 1 }}
-
-
- {{ props.row.fullname }}
-
-
- {{ props.row.position }}
-
-
- {{ props.row.positionLevel }}
-
-
-
- {{ props.row.organizationPositionOld }}
+
+ {{ props.rowIndex + 1 }}
-
-
-
+
{{ props.row.organization }}
-
-
- {{ props.row.createdAt }}
-
-
- {{ props.row.statustext }}
-
-
-
- ลบข้อมูล
-
+
+ {{ col.value }}
+
@@ -376,7 +340,7 @@ const pagination = ref({
:closeModal="closeModal"
:rows2="rows2"
v-model:filterKeyword2="filterKeyword2"
- :fecthlistRecevice="getData"
+ @returnPerson="onSubmit"
/>
diff --git a/src/modules/11_discipline/components/7_ListSuspend/OutRegistry.vue b/src/modules/11_discipline/components/7_ListSuspend/OutRegistry.vue
index 0608a1301..c74a2df5d 100644
--- a/src/modules/11_discipline/components/7_ListSuspend/OutRegistry.vue
+++ b/src/modules/11_discipline/components/7_ListSuspend/OutRegistry.vue
@@ -1,5 +1,5 @@