1
0
forked from erp-dev/erp

feat: shipment_delivery

This commit is contained in:
2026-04-03 16:55:22 +08:00
parent 371cd796e7
commit 76b30cf4f4
16 changed files with 2513 additions and 9 deletions

View File

@@ -70,6 +70,12 @@
}
```
说明:
- `sales_items` 现在返回的是带图片字段的销售品详情结构
- 若销售品关联的 `PrintingJob.product` 存在主图,则会返回 `product_image_url`
- 若无关联图片,则 `product_image_url``null`
### 出货单详情
- **URL**: `/api/v1/shipment/shipments/<id>/`
@@ -82,6 +88,10 @@
|------|------|------|
| status | int | 可选状态过滤;取值为 1=草稿(未发布), 2=已发布, 3=已取消, 4=已驳回, 5=已审核。传入后仅当该出货单状态匹配时才返回详情 |
说明:
- 详情中的 `sales_items` 同样返回带 `product_image_url` 的销售品详情结构
---
### 更新出货单
@@ -92,7 +102,7 @@
说明:
- 仅允许修改业务数据字段:`customer``shipment_date``area``remark``external_id`
- 仅允许修改业务数据字段:`customer``shipment_date``address``contact_name``contact_phone``area``remark``external_id`
- 该接口不允许修改 `status`
-`草稿(未发布)` 状态的出货单允许修改
- 非草稿状态会返回 `400 Bad Request`
@@ -101,6 +111,9 @@
```json
{
"address": "宁波市滨海路 9 号",
"contact_name": "王五",
"contact_phone": "13700137000",
"area": "更新地区",
"remark": "更新备注"
}
@@ -139,6 +152,9 @@
|------|------|------|------|
| customer | int | 是 | 客户ID |
| shipment_date | string | 是 | 出货日期YYYY-MM-DD |
| address | string | 否 | 地址(可空字符串,长度<=255 |
| contact_name | string | 否 | 联系人(可空字符串,长度<=100 |
| contact_phone | string | 否 | 联系电话(可空字符串,长度<=50 |
| area | string | 否 | 出货地区(可空字符串,长度<=30 |
| remark | string | 否 | 备注 |
| sales_items | array[int] | 否 | 要关联的销售品ID列表 |
@@ -149,6 +165,9 @@
{
"customer": 1,
"shipment_date": "2026-01-14",
"address": "杭州市测试路 1 号",
"contact_name": "张三",
"contact_phone": "13800138000",
"area": "华东",
"remark": "备注信息",
"sales_items": [1, 2, 3]
@@ -165,6 +184,9 @@
"customer": 1,
"customer_name": "客户A",
"shipment_date": "2026-01-14",
"address": "杭州市测试路 1 号",
"contact_name": "张三",
"contact_phone": "13800138000",
"area": "华东",
"remark": "备注信息",
"status": 1,
@@ -194,6 +216,9 @@
| customer | int | 客户ID |
| customer_name | string | 客户名称 |
| shipment_date | string | 出货日期 |
| address | string | 地址 |
| contact_name | string | 联系人 |
| contact_phone | string | 联系电话 |
| area | string | 出货地区 |
| remark | string | 备注 |
| status | int | 状态枚举1=草稿(未发布), 2=已发布, 3=已取消, 4=已驳回, 5=已审核) |
@@ -287,6 +312,9 @@
|------|------|------|------|
| customer | int | 是 | 客户ID |
| shipment_date | string | 是 | 出货日期YYYY-MM-DD |
| address | string | 否 | 地址(可空字符串,长度<=255 |
| contact_name | string | 否 | 联系人(可空字符串,长度<=100 |
| contact_phone | string | 否 | 联系电话(可空字符串,长度<=50 |
| area | string | 否 | 出货地区(可空字符串,长度<=30 |
| remark | string | 否 | 备注 |
| external_id | string | 是 | 外部订单号(长度<=120 |
@@ -306,6 +334,9 @@
{
"customer": 1,
"shipment_date": "2026-01-14",
"address": "绍兴市仓库 2 号",
"contact_name": "李四",
"contact_phone": "13900139000",
"area": "华南",
"remark": "external 备注(可选)",
"external_id": "EXT-ORDER-001",
@@ -326,6 +357,9 @@
"customer": 1,
"customer_name": "客户A",
"shipment_date": "2026-01-14",
"address": "绍兴市仓库 2 号",
"contact_name": "李四",
"contact_phone": "13900139000",
"area": "华南",
"remark": "external 备注(可选)",
"status": 1,