diff --git a/src/modules/11_discipline/components/1_Complaint/MainPage.vue b/src/modules/11_discipline/components/1_Complaint/MainPage.vue
index cda75e312..ea5bb1766 100644
--- a/src/modules/11_discipline/components/1_Complaint/MainPage.vue
+++ b/src/modules/11_discipline/components/1_Complaint/MainPage.vue
@@ -158,7 +158,7 @@ onMounted(async () => {
{
-
+
-
+
-
+
-
+
{
-
+
(dataInvestigate.statusOptions);
+const attrs = ref(useAttrs());
+const option = ref(dataInvestigate.statusOptions);
/** ค้นหาข้อมูลในตาราง */
const filterKeyword = ref("");
-const filterRef = ref(null);
const statusFilter = ref("NEW");
-const toptitle = ref(0);
-
-const total = ref(0);
-const totalList = ref(1);
-const pagination = ref({
- sortBy: "createdAt",
- descending: true,
- page: 1,
- rowsPerPage: 10,
-});
-
-const attrs = ref(useAttrs());
/** ดึงข้อมูลบสวน */
-async function getList(page?: number) {
+async function getList() {
const body = {
- page: page ? page : pagination.value.page,
- pageSize: pagination.value.rowsPerPage,
+ ...params.value,
keyword: filterKeyword.value.trim(),
status: statusFilter.value,
...(store.formInvestigateFacts.respondentType && {
@@ -82,14 +73,9 @@ async function getList(page?: number) {
await http
.post(config.API.investigateMain(), body)
.then(async (res) => {
- totalList.value = Math.ceil(
- res.data.result.total / pagination.value.rowsPerPage
- );
- total.value = res.data.result.total;
- toptitle.value = res.data.result.total;
-
- const data = res.data.result.data;
- await dataInvestigate.fecthList(data);
+ const result = res.data.result;
+ pagination.value.rowsNumber = result.total;
+ await dataInvestigate.fecthList(result.data);
})
.catch((e) => {
messageError($q, e);
@@ -104,7 +90,7 @@ async function getList(page?: number) {
* @param id ไอดีเฉพาะ รายบุคคล
*/
async function editPage(id: string) {
- dataInvestigate.tabMenu = await "investigatefacts";
+ dataInvestigate.tabMenu = "investigatefacts";
router.push(`/discipline/investigatefacts/${id}`);
}
/**
@@ -112,7 +98,7 @@ async function editPage(id: string) {
* @param id ไอดีเฉพาะ รายบุคคล
*/
async function detailPage(id: string) {
- dataInvestigate.tabMenu = await "investigatefacts";
+ dataInvestigate.tabMenu = "investigatefacts";
router.push(`/discipline-detail/investigatefacts/${id}`);
}
@@ -129,27 +115,12 @@ function filterOptionFn(val: string, update: Function) {
});
}
-function updatePagination(newPagination: any) {
- pagination.value.page = 1;
- pagination.value.rowsPerPage = newPagination.rowsPerPage;
-}
-
-function getSerach() {
+function getSearch() {
pagination.value.page = 1;
getList();
}
-watch(
- () => pagination.value.rowsPerPage,
- async () => {
- getSerach();
- }
-);
-
-/**เมื่อเริ่มโหลดหน้า
- * ส่งข้อมูลจำลองไปยัง store
- */
-onMounted(async () => {
+onMounted(() => {
getList();
});
@@ -158,173 +129,175 @@ onMounted(async () => {
รายการสืบสวนข้อเท็จจริง
-
-
-
-
-
- ไม่มีข้อมูล
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-