diff --git a/static/app.js b/static/app.js index 675ad03..d5097eb 100644 --- a/static/app.js +++ b/static/app.js @@ -174,52 +174,39 @@ window.createFinance = (event) => createResource(event, "finance"); window.switchTab = switchTab; function renderProjects() { - // Merge sales_leads and operation_projects into one table - const salesItems = state.data.sales.map((x) => ({ - name: x.target_customer, - version: "", - type: "opportunity", - status: x.status, - amount: 0, - stage: "", - files: 0, - followup: x.latest_follow_up_record, - resource: "sales", - id: x.id, - })); - const opItems = state.data.operations.map((x) => ({ - name: x.project_name, - version: x.project_version, - type: x.project_type, - status: x.project_status, - amount: x.expected_contract_amount || 0, - stage: x.current_stage || x.sop_stage, - files: x.files.length, - followup: x.latest_follow_up_record, - resource: "operations", - id: x.id, - })); - const allItems = [...salesItems, ...opItems]; - const items = state.opFilter === "all" ? allItems : allItems.filter((x) => x.type === state.opFilter || (state.opFilter === "opportunity" && x.type === "opportunity")); - const rows = items.map((x) => [`${x.name}${x.version ? `
${x.version}
` : ""}`, badge(x.type), badge(x.status), x.amount ? money(x.amount) : "—", text(x.stage), text(x.followup)]); - const clicks = items.map((x) => ({ resource: x.resource, id: x.id })); + const items = state.data.operations; + const rows = items.map((x) => [ + `${x.project_name}${x.project_version}
`, + text(x.customer_need || x.notes), + badge(x.current_stage || x.project_status), + x.expected_contract_amount ? money(x.expected_contract_amount) : "—", + text(x.owner || "—"), + `` + ]); document.querySelector("#projects").innerHTML = `${phase}
⚠ ${t.blockers}
` : ""; - return `${t.milestone ? t.milestone + ":": ""}${t.task}${due}${owner}
${blocker}下一步:${text(f.next_action)}
` : ""}