fix(pl): 按车辆类型统一派车日历卡片配色以区分自有三方和待派车。

This commit is contained in:
wuzilong committed 2026-11-01 13:42:54 +08:00
1 parent cb0344498a
commit 043e2ef661
11 files changed
+268 -27

No files matched your search

+6 -3
View File
@@ -64,21 +64,24 @@ def product_options(q: Optional[str] = None, page: int = Query(1, ge=1),
def create_record(body: CreateBody, db: Session = Depends(get_db),
user: DbUserContext = Depends(get_db_current_user)):
tenant = get_tenant_no(db, user.to_tenant_user_dict())
return svc._row_to_dict(svc.create_record(db, tenant, user, body))
row = svc.create_record(db, tenant, user, body)
return svc._row_to_dict(row)
@router.get("/{record_id}")
def get_record(record_id: str, db: Session = Depends(get_db),
user: DbUserContext = Depends(get_db_current_user)):
tenant = get_tenant_no(db, user.to_tenant_user_dict())
return svc._row_to_dict(svc.get_record(db, tenant, user, record_id))
row = svc.get_record(db, tenant, user, record_id)
return svc.serialize_records(db, tenant, user, [row])[0]
@router.put("/{record_id}", dependencies=[Depends(require_manage)])
def update_record(record_id: str, body: UpdateBody, db: Session = Depends(get_db),
user: DbUserContext = Depends(get_db_current_user)):
tenant = get_tenant_no(db, user.to_tenant_user_dict())
return svc._row_to_dict(svc.update_record(db, tenant, user, record_id, body))
row = svc.update_record(db, tenant, user, record_id, body)
return svc._row_to_dict(row)
@router.delete("/{record_id}", dependencies=[Depends(require_manage)])
+1 -1
View File
@@ -46,4 +46,4 @@ def get_record(record_id: str, db: Session = Depends(get_db),
row = svc.get_record(db, tenant, user, record_id)
if row.calendar_kind != "site":
raise HTTPException(status_code=404, detail="派车记录不存在或无权访问")
return svc._row_to_dict(row)
return svc.serialize_records(db, tenant, user, [row])[0]