([
"no",
"fullName",
+ "profileType",
"checkInTime",
"checkInLocation",
"checkOutTime",
@@ -110,7 +120,9 @@ async function fetchListLogRecord() {
config.API.logRecord() +
`?startDate=${dateToISO(date)}&endDate=${dateToISO(date)}&page=${
page.value
- }&pageSize=${rowsPerPage.value}&keyword=${keyword.value}`
+ }&pageSize=${rowsPerPage.value}&keyword=${keyword.value}&profileType=${
+ roleStatus.value
+ }`
)
.then((res) => {
total.value = res.data.result.total;
@@ -160,7 +172,11 @@ onMounted(async () => {
});
-
+
{
+
+ {{
+ col.value == "OFFICER"
+ ? "ข้าราชการ กทม. สามัญ"
+ : "ลูกจ้างประจำ กทม."
+ }}
+
{{ col.value }}
diff --git a/src/modules/09_leave/components/02_WorkList/ToolBar.vue b/src/modules/09_leave/components/02_WorkList/ToolBar.vue
index 09b6bc8f5..f401aebff 100644
--- a/src/modules/09_leave/components/02_WorkList/ToolBar.vue
+++ b/src/modules/09_leave/components/02_WorkList/ToolBar.vue
@@ -27,6 +27,8 @@ const emit = defineEmits(["update:pagination"]);
const filetStatus = ref(
props.filetStatus?.toString() || "default-value"
);
+const roleStatus = defineModel("roleStatus", { required: true });
+
const keyword = ref("");
const optionMain = ref([
{ id: "ALL", name: "ทั้งหมด" },
@@ -34,7 +36,14 @@ const optionMain = ref([
{ id: "LATE", name: "สาย" },
{ id: "ABSENT", name: "ขาดราชการ" },
]);
+
+const roleMainOp = ref([
+ { id: "ALL", name: "ทั้งหมด" },
+ { id: "OFFICER", name: "ข้าราชการ กทม. สามัญ" },
+ { id: "EMPLOYEE", name: "ลูกจ้างประจำ กทม." },
+]);
const option = ref(optionMain.value);
+const roleOp = ref(roleMainOp.value);
/**
* function updateProps
@@ -57,12 +66,20 @@ function filterFn() {
* @param val คำค้นหา
* @param update function
*/
-function filterOptionFn(val: string, update: Function) {
- update(() => {
- option.value = optionMain.value.filter(
- (e: any) => e.name.search(val) !== -1
- );
- });
+function filterOptionFn(val: string, update: Function, type?: string) {
+ if (type == "role") {
+ update(() => {
+ roleOp.value = roleMainOp.value.filter(
+ (e: any) => e.name.search(val) !== -1
+ );
+ });
+ } else {
+ update(() => {
+ option.value = optionMain.value.filter(
+ (e: any) => e.name.search(val) !== -1
+ );
+ });
+ }
}
/** Functicon หาค่ามากสุดและปิดวันที่ไม่ให้เลือกวันล่วงหน้า*/
@@ -111,6 +128,41 @@ function calculateMaxDate() {
+
+ filterOptionFn(inputValue,doneFn,'role')"
+ >
+
+
+ ไม่มีข้อมูล
+
+
+
+
+
+
+
("roleStatus", { required: true });
const keyword = ref("");
const pagination = ref({
page: 1,
});
+const roleMainOp = ref([
+ { id: "ALL", name: "ทั้งหมด" },
+ { id: "OFFICER", name: "ข้าราชการ กทม. สามัญ" },
+ { id: "EMPLOYEE", name: "ลูกจ้างประจำ กทม." },
+]);
+const roleOp = ref(roleMainOp.value);
+
/**
* function updateProps
* @param newPagination paging
@@ -39,6 +49,19 @@ function calculateMaxDate() {
function filterFn() {
updateProp(pagination.value, keyword.value);
}
+
+/**
+ * function ค้นหาข้อมูลใน option
+ * @param val คำค้นหา
+ * @param update function
+ */
+function filterOptionFn(val: string, update: Function) {
+ update(() => {
+ roleOp.value = roleMainOp.value.filter(
+ (e: any) => e.name.search(val) !== -1
+ );
+ });
+}
@@ -79,6 +102,40 @@ function filterFn() {
+
+
+
+
+ ไม่มีข้อมูล
+
+
+
+
+
+
+