单据
单据数据列表查询
curl -i http://example.com/api/documents.json
{
"status": {
"code": "200",
"message": "OK"
},
"documents": [
{
"id": 26,
"number": "CGD0007",
"type": "purchase",
"type_name": "采购入库单",
"amount": "600.00",
"status": "审批通过",
"operator": "张三",
"created_at": "2016年07月12日"
}
]
}
HTTP请求
GET /api/documents.json
请求参数
参数名 | 是否必填 | 默认值 | 字段说明 |
---|---|---|---|
keyword | 否 | 无 | 关键字 |
- 返回字段说明
返回值字段 | 字段类型 | 字段说明 |
---|---|---|
id | string | ID |
number | string | 编号 |
type | string | 类型 |
type_name | string | 类型名称 |
amount | string | 优惠后金额 |
status | string | 当前状态 |
operator | string | 操作人 |
created_at | string | 创建时间 |
单据详情
curl -i http://example.com/api/documents/:id.json
{
"status": {
"code": "200",
"message": "OK"
},
"document": {
"id": 26,
"number": "CGD0007",
"type": "purchase",
"type_name": "采购入库单",
"amount": "600.00",
"status": "审批通过",
"operator": "陈雨佳",
"created_at": "2016年07月12日",
"org_name": "这是测试公司",
"warehouse_name": "测试仓库",
"discount": "0.0",
"deduction": "0.0",
"note": "",
"total_quantity": "60.0",
"total_deduction": "0.0",
"total_amount": "600.0",
"entry_or_io_at": "2016年07月12日",
"product_items": [
{
"name": "DG001 测试商品1",
"spec": "XS",
"unit": "个",
"quantity": "60.0000",
"price": "10.00",
"discount": "0.00",
"deduction": "0.00",
"amount": "600.00"
}
]
}
}
HTTP请求
GET /api/documents/:id.json
请求参数
参数名 | 是否必填 | 默认值 | 字段说明 |
---|---|---|---|
id | 是 | 无 | ID |
- 返回字段说明
返回值字段 | 字段类型 | 字段说明 |
---|---|---|
id | string | ID |
number | string | 编号 |
type | string | 类型 |
type_name | string | 类型名称 |
amount | string | 优惠后金额 |
status | string | 当前状态 |
operator | string | 操作人 |
created_at | string | 创建时间 |
org_name | string | 公司名称 |
warehouse_name | string | 仓库名称 |
discount | string | 优惠率 |
deduction | string | 优惠金额 |
note | string | 备注 |
total_quantity | string | 总数量 |
total_deduction | string | 总折扣额 |
total_amount | string | 总金额 |
entry_or_io_at | string | 出/入库时间 |
product_items/name | string | 产品项名称 |
product_items/spec | string | 产品项规格 |
product_items/unit | string | 产品项单位 |
product_items/quantity | string | 产品项数量 |
product_items/price | string | 产品项价格 |
product_items/discount | string | 产品项折扣率 |
product_items/deduction | string | 产品项折扣额 |
product_items/amount | string | 产品项金额 |
单据审批
curl -i http://example.com/api/documents/:id.json
{
"status": {
"code": "200",
"message": "OK"
},
"document": {
"id": 26,
"number": "CGD0007",
"type": "purchase",
"type_name": "采购入库单",
"amount": "600.00",
"status": "审批通过",
"operator": "陈雨佳",
"created_at": "2016年07月12日",
"org_name": "这是测试公司",
"warehouse_name": "测试仓库",
"discount": "0.0",
"deduction": "0.0",
"note": "",
"total_quantity": "60.0",
"total_deduction": "0.0",
"total_amount": "600.0",
"entry_or_io_at": "2016年07月12日",
"product_items": [
{
"name": "DG001 测试商品1",
"spec": "XS",
"unit": "个",
"quantity": "60.0000",
"price": "10.00",
"discount": "0.00",
"deduction": "0.00",
"amount": "600.00"
}
]
}
}
HTTP请求
PUT /api/documents/:id.json
请求参数
参数名 | 是否必填 | 默认值 | 字段说明 |
---|---|---|---|
id | 是 | 无 | ID |
type | 是 | 无 | 单据类型 |
status | 是 | 无 | 单据状态 |
reason | 是(仅驳回时必填) | 无 | 驳回原因 |
- 返回字段说明
返回值字段 | 字段类型 | 字段说明 |
---|---|---|
id | string | ID |
number | string | 编号 |
type | string | 类型 |
type_name | string | 类型名称 |
amount | string | 优惠后金额 |
status | string | 当前状态 |
operator | string | 操作人 |
created_at | string | 创建时间 |
org_name | string | 公司名称 |
warehouse_name | string | 仓库名称 |
discount | string | 优惠率 |
deduction | string | 优惠金额 |
note | string | 备注 |
total_quantity | string | 总数量 |
total_deduction | string | 总折扣额 |
total_amount | string | 总金额 |
entry_or_io_at | string | 出/入库时间 |
product_items/name | string | 产品项名称 |
product_items/spec | string | 产品项规格 |
product_items/unit | string | 产品项单位 |
product_items/quantity | string | 产品项数量 |
product_items/price | string | 产品项价格 |
product_items/discount | string | 产品项折扣率 |
product_items/deduction | string | 产品项折扣额 |
product_items/amount | string | 产品项金额 |
文档更新时间: 2025-03-17 14:52 作者:姜河