Connected data for Projects/Jobs.

This commit is contained in:
rocketdebris 2025-11-06 09:39:16 -05:00
parent b6d6a8b788
commit ac3c05cb78
2 changed files with 22 additions and 9 deletions

View File

@ -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<Object[]>}
*/
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,

View File

@ -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