1
0
forked from erp-dev/erp

fix: added permission for plate_order and printing_order api

This commit is contained in:
2026-01-14 18:14:22 +08:00
parent fae667c965
commit cae0f8434e
17 changed files with 867 additions and 15 deletions

View File

@@ -4,10 +4,101 @@
## 目录
- [创建出货单](#创建出货单)
- [通过生产订单查询销售品](#通过生产订单查询销售品)
---
## 创建出货单
创建出货单并关联销售品。
### 接口信息
- **URL**: `/api/v1/shipment/shipments/`
- **Method**: `POST`
- **认证**: 需要登录JWT Token
### 请求参数
| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| customer | int | 是 | 客户ID |
| shipment_date | string | 是 | 出货日期YYYY-MM-DD |
| remark | string | 否 | 备注 |
| sales_items | array[int] | 否 | 要关联的销售品ID列表 |
### 请求示例
```json
{
"customer": 1,
"shipment_date": "2026-01-14",
"remark": "备注信息",
"sales_items": [1, 2, 3]
}
```
### 响应格式
```json
{
"id": 1,
"customer": 1,
"customer_name": "客户A",
"shipment_date": "2026-01-14",
"remark": "备注信息",
"items_count": 3,
"created_by_id": 1,
"created_by_name": "张三",
"created_at": "2026-01-14T10:00:00Z",
"updated_at": "2026-01-14T10:00:00Z"
}
```
### 响应字段说明
| 字段 | 类型 | 说明 |
|------|------|------|
| id | int | 出货单ID |
| customer | int | 客户ID |
| customer_name | string | 客户名称 |
| shipment_date | string | 出货日期 |
| remark | string | 备注 |
| items_count | int | 关联的销售品数量 |
| created_by_id | int | 创建人ID |
| created_by_name | string | 创建人名称 |
| created_at | string | 创建时间 |
| updated_at | string | 更新时间 |
### 错误响应
#### 400 Bad Request - 客户不存在
```json
{
"detail": "客户 999 不存在"
}
```
#### 400 Bad Request - 销售品不存在
```json
{
"detail": "以下销售品不存在: [999]"
}
```
#### 400 Bad Request - 销售品已关联其他出货单
```json
{
"detail": "以下销售品已关联到其他出货单: [1, 2]"
}
```
---
## 通过生产订单查询销售品
查询与指定生产订单PrintingOrder关联的所有销售品SalesItem