博客 / 详情

项目管理系统开发记录

2026.04.15
未分类
7556 Words
- Views
- Comments

数据表设计

项目表(project)

字段说明
id序号
p_name项目名称
p_subject项目主体
p_status项目状态(停止 / 暂停 / 建设中 / 完成)
p_remark项目备注
created_at创建时间
deleted_at删除时间

单位表(organization)

字段说明
id序号
o_name单位名称
o_type单位类型(民营 / 国营 / 事业单位 / 政府机构 / 其他)
o_remark单位备注
created_at创建时间

项目阶段表(project_stage)(⚠替代你原stage,核心优化)

字段说明
id序号
s_project_id所属项目
s_stage_type阶段类型(立项 / 可研 / 预算 / 招标 / 施工 / 监理 / 跟审 / 测试 / 验收)
s_main_organization_id主责任单位
s_start_date阶段开始时间
s_end_date阶段结束时间
s_status阶段状态(未开始 / 进行中 / 已完成 / 暂停 / 延期)
s_contract_amount合同金额
s_contract_time合同时间
s_contract_file合同文件
s_approval_file审批文件
s_result_file成果文件
s_remark阶段备注
created_at创建时间

项目单位角色表(project_organization_role)

字段说明
id序号
p_project_id所属项目
p_organization_id单位
role_type项目角色(业主 / 设计 / 施工 / 监理 / 招标代理 / 审计 / 咨询 / 其他)
s_project_stage_id关联阶段(可选)
role_remark备注
created_at创建时间

项目单位联系人表(project_organization_contact)

字段说明
id序号
p_project_id所属项目
p_organization_id单位
role_type项目角色(监理 / 审计 / 施工等)
s_project_stage_id关联阶段(可选)
contact_name联系人姓名
contact_phone联系电话
contact_email邮箱(可选)
contact_remark联系备注
created_at创建时间

支付表(payment)

字段说明
id序号
p_project_id所属项目
s_project_stage_id所属阶段
pay_type支付类型(预付款 / 进度款 / 结算款 / 保证金 / 其他)
p_organization_id支付单位
pay_amount支付金额
pay_time支付时间
invoice_file发票文件
approval_file审批文件
payment_proof_file支付凭证
pay_remark支付备注
created_at创建时间

文件表(file)

字段说明
id序号
p_project_id所属项目
s_project_stage_id所属阶段(可为空)
file_name文件名称
file_path文件路径
file_type文件类型(PDF / Word / Excel / 图片 / 其他)
file_remark文件备注
created_at创建时间

系统核心关系图(文字版)

项目(Project) ↓ 项目阶段(ProjectStage) ↓ 单位(Organization) ↓ 项目角色(ProjectOrganizationRole) ↓ 项目联系人(ProjectOrganizationContact) ↓ 支付(Payment) ↓ 文件(File)

ER图(可视化 / Mermaid)

erDiagram
PROJECT ||--o{ PROJECT_STAGE : contains
PROJECT ||--o{ PAYMENT : has
PROJECT ||--o{ FILE : has
PROJECT ||--o{ PROJECT_ORGANIZATION_ROLE : involves
PROJECT ||--o{ PROJECT_ORGANIZATION_CONTACT : contacts
ORGANIZATION ||--o{ PROJECT_STAGE : responsible_for
ORGANIZATION ||--o{ PROJECT_ORGANIZATION_ROLE : participates
ORGANIZATION ||--o{ PROJECT_ORGANIZATION_CONTACT : provides
ORGANIZATION ||--o{ PAYMENT : receives
PROJECT_STAGE ||--o{ FILE : contains
PROJECT_STAGE ||--o{ PAYMENT : triggers
PROJECT_STAGE ||--o{ PROJECT_ORGANIZATION_CONTACT : optional_link
PROJECT {
int id
string p_name
string p_subject
string p_status
string p_remark
datetime created_at
datetime deleted_at
}
ORGANIZATION {
int id
string o_name
string o_type
string o_remark
datetime created_at
}
PROJECT_STAGE {
int id
int s_project_id
string s_stage_type
int s_main_organization_id
date s_start_date
date s_end_date
string s_status
decimal s_contract_amount
date s_contract_time
string s_contract_file
string s_approval_file
string s_result_file
string s_remark
datetime created_at
}
PROJECT_ORGANIZATION_ROLE {
int id
int p_project_id
int p_organization_id
string role_type
int s_project_stage_id
string role_remark
datetime created_at
}
PROJECT_ORGANIZATION_CONTACT {
int id
int p_project_id
int p_organization_id
string role_type
int s_project_stage_id
string contact_name
string contact_phone
string contact_email
string contact_remark
datetime created_at
}
PAYMENT {
int id
int p_project_id
int s_project_stage_id
string pay_type
int p_organization_id
decimal pay_amount
date pay_time
string invoice_file
string approval_file
string payment_proof_file
string pay_remark
datetime created_at
}
FILE {
int id
int p_project_id
int s_project_stage_id
string file_name
string file_path
string file_type
string file_remark
datetime created_at
}

mermaid-diagram.png