diff --git a/backend/routers/submissions.py b/backend/routers/submissions.py index 43621a3..c9b68ee 100644 --- a/backend/routers/submissions.py +++ b/backend/routers/submissions.py @@ -194,6 +194,11 @@ def update_submission( } # 更新字段 + if req.project_id is not None: + project = db.query(Project).filter(Project.id == req.project_id).first() + if not project: + raise HTTPException(status_code=404, detail="项目不存在") + sub.project_id = req.project_id if req.project_phase is not None: sub.project_phase = PhaseGroup(req.project_phase) if req.work_type is not None: @@ -221,7 +226,7 @@ def update_submission( # 产出时长校验:前期内容不需要,中期/后期内容必须 > 0 NO_DURATION_TYPES = {'策划案', '大纲/梗概', '概念设计图', '测试片', '剧本', '分镜', '人设图', '场景图', '道具图', '培训', '招聘面试', '内部其他'} content_val = sub.content_type.value if hasattr(sub.content_type, 'value') else sub.content_type - if content_val not in PRE_PHASE_TYPES and sub.total_seconds <= 0: + if content_val not in NO_DURATION_TYPES and sub.total_seconds <= 0: raise HTTPException(status_code=422, detail="请填写产出时长") # 保存新数据 diff --git a/backend/schemas.py b/backend/schemas.py index 8278042..4071d1b 100644 --- a/backend/schemas.py +++ b/backend/schemas.py @@ -174,6 +174,7 @@ class SubmissionCreate(BaseModel): class SubmissionUpdate(BaseModel): + project_id: Optional[int] = None project_phase: Optional[str] = None work_type: Optional[str] = None content_type: Optional[str] = None diff --git a/frontend/src/views/Submissions.vue b/frontend/src/views/Submissions.vue index 8569e31..25b234a 100644 --- a/frontend/src/views/Submissions.vue +++ b/frontend/src/views/Submissions.vue @@ -156,8 +156,10 @@ - - + + + +