1
0
forked from erp-dev/erp

feat: added print_count api, added merchant setting model, added manual mode setting for purchase order

This commit is contained in:
2025-11-28 15:01:11 +08:00
parent 53f2a24b20
commit 0c62398120
36 changed files with 1634 additions and 478 deletions

View File

@@ -38,8 +38,8 @@ GET /api/v1/plate-orders/
| style_name | string | 否 | 款式名称(模糊查询) |
| plate_date_from | date | 否 | 开版日期起始YYYY-MM-DD |
| plate_date_to | date | 否 | 开版日期结束YYYY-MM-DD |
| required_completion_date_from | date | 否 | 要求完成日期起始 |
| required_completion_date_to | date | 否 | 要求完成日期结束 |
| required_completion_date_from | datetime | 否 | 要求完成时间起始ISO86012025-11-20T08:00:00Z |
| required_completion_date_to | datetime | 否 | 要求完成时间结束ISO8601 |
| created_date_from | date | 否 | 创建日期起始 |
| created_date_to | date | 否 | 创建日期结束 |
| search | string | 否 | 全文搜索(搜索设计编号、款式名称、客户名称、面料) |
@@ -75,7 +75,7 @@ GET /api/v1/plate-orders/
"style_name": "花朵印染",
"fabric": "棉布",
"width": "150cm",
"required_completion_date": "2025-11-20",
"required_completion_date": "2025-11-20T18:00:00Z",
"completion_date": null,
"is_ordered": false,
"process": 1,
@@ -112,8 +112,24 @@ GET /api/v1/plate-orders/{id}/
"plate_type": "圆网",
"plate_date": "2025-11-10T10:00:00Z",
"plate_method": "手工",
"plate_image": "/media/plate_images/design001.jpg",
"plate_image_url": "http://example.com/media/plate_images/design001.jpg",
"plate_image": [
{
"file_id": 12,
"name": "主图",
"url": "https://example.com/media/uploads/2025/11/plate-a.jpg",
"path": "uploads/2025/11/plate-a.jpg"
},
{
"file_id": 13,
"name": "细节图",
"url": "https://example.com/media/uploads/2025/11/plate-b.jpg",
"path": "uploads/2025/11/plate-b.jpg"
}
],
"plate_image_url": [
"https://example.com/media/uploads/2025/11/plate-a.jpg",
"https://example.com/media/uploads/2025/11/plate-b.jpg"
],
"plate_notes": "注意色彩还原",
"reprint_reason": null,
"urgency_level": "加急",
@@ -140,7 +156,7 @@ GET /api/v1/plate-orders/{id}/
"difficulty_rating": "中等",
"sample_meter": "5米",
"required_sample_meters": 10.00,
"required_completion_date": "2025-11-20",
"required_completion_date": "2025-11-20T18:00:00Z",
"completion_date": null,
"approval_result": "通过",
"is_ordered": false,
@@ -181,7 +197,11 @@ Content-Type: application/json
"salesperson": 3,
"merchandiser": 4,
"designer": 8,
"required_completion_date": "2025-11-25",
"plate_image": [
{"file_id": 21, "name": "主图"},
{"file_id": 22, "name": "细节图"}
],
"required_completion_date": "2025-11-25T06:30:00Z",
"is_mark_frame": false,
"plate_method": "机器",
"production_method": "小批量",
@@ -197,7 +217,7 @@ Content-Type: application/json
- `plate_type`: 版型
- `plate_date`: 开版日期
- `plate_method`: 开版方式
- `plate_image`: 开版图片(文件上传
- `plate_image`: 开版图片引用列表(数组,元素包含 `file_id` 与可选 `name`,需要先通过 `/api/v1/upload/` 上传文件
- `plate_notes`: 打版注意事项
- `reprint_reason`: 复版原因
- `urgency_level`: 紧急程度
@@ -218,7 +238,7 @@ Content-Type: application/json
- `difficulty_rating`: 难度评级
- `sample_meter`: 米样
- `required_sample_meters`: 所需样品米数
- `required_completion_date`: 要求完成时间
- `required_completion_date`: 要求完成时间(日期+具体时间UTC 推荐)
- `completion_date`: 完成时间
- `approval_result`: 审批结果
- `is_ordered`: 是否已下单
@@ -576,7 +596,7 @@ GET /api/v1/plate-orders/{id}/timeline/
| plate_type | string | 版型(首版/复版等) |
| plate_date | datetime | 开版时间 |
| plate_method | string | 开版方式 |
| plate_image | file | 开版图片 |
| plate_image | array<object> | 开版图片引用列表(通过 `UploadedFile` ID 关联) |
| plate_notes | text | 打版注意事项 |
| reprint_reason | text | 复版原因 |
| urgency_level | string | 紧急程度 |
@@ -599,7 +619,7 @@ GET /api/v1/plate-orders/{id}/timeline/
| difficulty_rating | string | 难度评级 |
| sample_meter | string | 米样 |
| required_sample_meters | decimal | 所需样品米数 |
| required_completion_date | date | 要求完成时间 |
| required_completion_date | datetime | 要求完成时间ISO8601 字符串) |
| completion_date | datetime | 完成时间 |
| approval_result | string | 审批结果 |
| is_ordered | boolean | 是否已下单 |
@@ -647,7 +667,7 @@ curl -X POST "http://api.example.com/api/v1/plate-orders/" \
"style_name": "新款印染",
"fabric": "纯棉",
"urgency_level": "加急",
"required_completion_date": "2025-11-20",
"required_completion_date": "2025-11-20T18:00:00Z",
"process": 1
}'
```
@@ -709,7 +729,7 @@ curl -X GET "http://api.example.com/api/v1/plate-orders/1/timeline/" \
2. **权限控制**: 作废和恢复操作需要特定权限
3. **日期格式**: 所有日期字段使用 ISO 8601 格式YYYY-MM-DD 或 YYYY-MM-DDTHH:MM:SSZ
4. **分页**: 列表接口默认支持分页,使用 `limit``offset` 参数控制
5. **文件上传**: `plate_image` 字段需要使用 multipart/form-data 格式上传
5. **文件引用**: 需先调用 `/api/v1/upload/` 上传文件并获取 `file_id`,再通过 `plate_image` 数组提交引用(无需 multipart
6. **自动创建流程实例**: 创建开版订单时,如果提供了 `process` 字段,系统会自动创建对应的 BusinessObject 流程实例。如果不提供则使用默认流程
7. **流程验证**: 提供的 `process` ID 必须在系统中存在,否则会返回验证错误
8. **流程操作**: