diff --git a/custom_ui/api/db/jobs.py b/custom_ui/api/db/jobs.py index 6e5678f..c1e4e2b 100644 --- a/custom_ui/api/db/jobs.py +++ b/custom_ui/api/db/jobs.py @@ -23,18 +23,19 @@ def get_job_task_table_data(filters={}, sortings={}, page=1, page_size=10): processed_filters, processed_sortings, is_or, page, page_size = process_query_conditions(filters, sortings, page, page_size) + print("DEBUG: Processed Filters:", processed_filters) + if is_or: - count = frappe.db.sql(*get_count_or_filters("Task", processed_filters))[0][0] + count = frappe.db.sql(*get_count_or_filters("Task", filters))[0][0] else: - count = frappe.db.count("Task", filters=processed_filters) + count = frappe.db.count("Task", filters=filters) print(f"DEBUG: Number of tasks returned: {count}") tasks = frappe.db.get_all( "Task", fields=["*"], - filters=processed_filters if not is_or else None, - or_filters=processed_filters if is_or else None, + filters=filters, limit=page_size, start=(page - 1) * page_size, order_by=processed_sortings diff --git a/frontend/src/api.js b/frontend/src/api.js index c53191e..a895290 100644 --- a/frontend/src/api.js +++ b/frontend/src/api.js @@ -320,7 +320,7 @@ class Api { console.log("DEBUG: API - Sending job task options to backend:", options); - const result = await this.request(FRAPPE_GET_JOB_TASK_LIST_METHOD, { options }); + const result = await this.request(FRAPPE_GET_JOB_TASK_LIST_METHOD, { options, filters }); return result; } diff --git a/frontend/src/components/pages/Job.vue b/frontend/src/components/pages/Job.vue index c88d52f..52a76c7 100644 --- a/frontend/src/components/pages/Job.vue +++ b/frontend/src/components/pages/Job.vue @@ -78,6 +78,7 @@ const taskList = ref(null); const columns = [ { label: "Task", fieldName: "subject", type: "text" }, { label: "ID", fieldName: "name", type: "text", sortable: true, filterable: true }, + { label: "Address", fieldname: "address", type: "text" }, { label: "Category", fieldName: "", type: "text", sortable: true, filterable: true }, { label: "Status", fieldName: "status", type: "text", sortable: true, filterable: true }, ];