项目管理系统开发记录
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 }