diff --git a/src/modules/17_acting/views/main.vue b/src/modules/17_acting/views/main.vue index 359aeba40..80c8f3c68 100644 --- a/src/modules/17_acting/views/main.vue +++ b/src/modules/17_acting/views/main.vue @@ -12,7 +12,6 @@ import { import { useCounterMixin } from "@/stores/mixin"; import { useActingStore } from "@/modules/17_acting/store/Main"; import { useStructureTree } from "@/stores/structureTree"; -import { usePagination } from "@/composables/usePagination"; /** importType*/ import type { QTableProps } from "quasar"; @@ -40,8 +39,6 @@ const { onSearchDataTable, } = useCounterMixin(); -const { pagination, params, onRequest } = usePagination("", fetchPosMaster); - /** โครงสร้าง*/ const expanded = ref>([]); const filter = ref(""); @@ -49,8 +46,6 @@ const nodeTree = ref([]); const posmasterId = ref(""); const isAll = ref(false); const modalCommand = ref(false); - -const isAllRoot = ref(false); /** * function เรียกข้อมูลโครงสร้าง แบบปัจุบัน */ @@ -83,11 +78,9 @@ const isLaod = ref(false); * @param data ข้อมูลตำแหน่ง */ async function updateSelected(data: PosMaster) { - isLaod.value = true; posmasterId.value = data.posmasterId; storeActing.rootId = data.orgTreeId; - pagination.value.page = 1; - pagination.value.rowsNumber = 10; + isLaod.value = true; // เรียกใช้ function fetch รายชื่อ ,fetch รายชื่อรักษาการ await Promise.all([fetchPosMaster(), fetchListAct()]).finally(() => { isLaod.value = false; @@ -171,17 +164,13 @@ const keyword = ref(""); async function fetchPosMaster() { await http .post(config.API.orgPosAct + `/search`, { - ...params.value, - // keyword: keyword.value.trim(), posmasterId: posmasterId.value, isAll: isAll.value, - isAllRoot: isAllRoot.value, }) .then((res) => { - const result = res.data.result; - pagination.value.rowsNumber = result.total; - rowPosition.value = result.data; - dataPosition.value = result.data; + const data = res.data.result; + rowPosition.value = data; + dataPosition.value = data; }) .catch((err) => { messageError($q, err); @@ -194,13 +183,6 @@ async function fetchPosMaster() { */ function updateIsAll(val: boolean) { isAll.value = val; - pagination.value.page = 1; - fetchPosMaster(); -} - -function updateIsAllRoot(val: boolean) { - pagination.value.page = 1; - isAllRoot.value = val; fetchPosMaster(); } @@ -303,8 +285,11 @@ async function getWorkFlow() { } function onSearchRowPosition() { - pagination.value.page = 1; - fetchPosMaster(); + rowPosition.value = onSearchDataTable( + keyword.value, + dataPosition.value, + columns.value ? columns.value : [] + ); } function onSearchListPerson() { @@ -490,18 +475,6 @@ onMounted(async () => {
-
- - แสดงทั้งหมดภายใต้หน่วยงาน - -
-
{
- - +