diff --git a/frontend/src/api.js b/frontend/src/api.js index 3984a89..0d056a1 100644 --- a/frontend/src/api.js +++ b/frontend/src/api.js @@ -194,10 +194,23 @@ class Api { } static async getJobDetails() { - const data = DataUtils.dummyJobData.map((job) => ({ - ...job, - stepProgress: DataUtils.calculateStepProgress(job.steps), - })); + //const data = DataUtils.dummyJobData.map((job) => ({ + // ...job, + // stepProgress: DataUtils.calculateStepProgress(job.steps), + //})); + const projects = await this.getDocsList("Project") + const data = []; + for (let prj of projects) { + let project = await this.getDetailedDoc("Project", prj.name); + const tableRow = { + name: project.name, + customInstallationAddress: project.custom_installation_address, + customer: project.customer, + status: project.status, + percentComplete: project.percent_complete + }; + data.push(tableRow); + } console.log("DEBUG: API - getJobDetails result: ", data); return data; } @@ -260,7 +273,7 @@ class Api { * @param {Object} filters * @returns {Promise} */ - static async getDocsList(doctype, fields = [], filters = {}, page = 0, pageLength = 600) { + static async getDocsList(doctype, fields = [], filters = {}, page = 0, pageLength = 0) { const docs = await frappe.db.get_list(doctype, { fields, filters, diff --git a/frontend/src/components/pages/Jobs.vue b/frontend/src/components/pages/Jobs.vue index b675497..fa34ac3 100644 --- a/frontend/src/components/pages/Jobs.vue +++ b/frontend/src/components/pages/Jobs.vue @@ -30,11 +30,11 @@ const totalRecords = ref(0); const isLoading = ref(false); const columns = [ - { label: "Job ID", fieldName: "jobId", type: "text", sortable: true, filterable: true }, - { label: "Address", fieldName: "address", type: "text", sortable: true }, + { label: "Job ID", fieldName: "name", type: "text", sortable: true, filterable: true }, + { label: "Address", fieldName: "customInstallationAddress", type: "text", sortable: true }, { label: "Customer", fieldName: "customer", type: "text", sortable: true, filterable: true }, - { label: "Overall Status", fieldName: "overAllStatus", type: "status", sortable: true }, - { label: "Progress", fieldName: "stepProgress", type: "text", sortable: true }, + { label: "Overall Status", fieldName: "status", type: "status", sortable: true }, + { label: "Progress", fieldName: "percentComplete", type: "text", sortable: true }, ]; // Handle lazy loading events from DataTable