From 9d8f741771c7b3c6468d95098917bde1afb50401 Mon Sep 17 00:00:00 2001 From: a273825743 Date: Sun, 17 May 2026 01:24:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=BD=E5=B7=A5=E7=AE=A1=E7=90=86=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=B7=B2=E5=AE=8C=E6=88=90=E9=A1=B9=E7=9B=AE+?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/routes/construction.js | 2 +- .../construction/ConstructionOverview.tsx | 4 ++-- .../construction/ConstructionProgress.tsx | 22 +++++++++++++++---- frontend/src/pages/projects/ProjectsPage.tsx | 2 +- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/backend/routes/construction.js b/backend/routes/construction.js index d6f221e..f302c59 100644 --- a/backend/routes/construction.js +++ b/backend/routes/construction.js @@ -13,7 +13,7 @@ router.get('/my-projects', async (req, res) => { FROM projects p LEFT JOIN customers c ON p.customer_id = c.id LEFT JOIN users u ON p.project_manager_id = u.id - WHERE p.status IN ('active', 'in_progress', 'planning', 'pending') + WHERE p.status IN ('active', 'in_progress', 'planning', 'pending', 'completed') ORDER BY p.created_at DESC `); diff --git a/frontend/src/pages/construction/ConstructionOverview.tsx b/frontend/src/pages/construction/ConstructionOverview.tsx index 5116d8b..7647999 100644 --- a/frontend/src/pages/construction/ConstructionOverview.tsx +++ b/frontend/src/pages/construction/ConstructionOverview.tsx @@ -50,12 +50,12 @@ const ConstructionOverview: React.FC = () => { }; const getStatusColor = (status: string) => { - const map: Record = { active: 'green', planning: 'blue', completed: 'default', suspended: 'orange' }; + const map: Record = { active: 'green', in_progress: 'processing', planning: 'blue', completed: 'default', suspended: 'orange' }; return map[status] || 'default'; }; const getStatusText = (status: string) => { - const map: Record = { active: '施工中', planning: '待开工', completed: '已完工', suspended: '暂停' }; + const map: Record = { active: '施工中', in_progress: '施工中', planning: '待开工', completed: '已完工', suspended: '暂停' }; return map[status] || status; }; diff --git a/frontend/src/pages/construction/ConstructionProgress.tsx b/frontend/src/pages/construction/ConstructionProgress.tsx index c37c627..9c5e463 100644 --- a/frontend/src/pages/construction/ConstructionProgress.tsx +++ b/frontend/src/pages/construction/ConstructionProgress.tsx @@ -221,10 +221,24 @@ const ConstructionProgress: React.FC = () => { {!currentPhase && pendingPhases.length === 0 && completedPhases.length === 0 && (
- 此项目尚未初始化施工阶段 -
- -
+ {project?.status === 'completed' ? ( + <> + + 项目已完成 + 此项目已完工,无需施工阶段推进 +
+ +
+ + ) : ( + <> + 此项目尚未初始化施工阶段 + 请在项目详情中选择工程模板来初始化施工阶段 +
+ +
+ + )}
)} diff --git a/frontend/src/pages/projects/ProjectsPage.tsx b/frontend/src/pages/projects/ProjectsPage.tsx index 7961718..be81254 100644 --- a/frontend/src/pages/projects/ProjectsPage.tsx +++ b/frontend/src/pages/projects/ProjectsPage.tsx @@ -310,7 +310,7 @@ const ProjectsPage: React.FC = () => {