简要描述:
创建采购单
请求URL:
http://lbl-open.thinkerx.com/api/lbl/methods/storePurchase
请求方式:
POST
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| login_token | 是 | string | 通行证 |
| factory_id | 否 | string | 单库工厂必填id |
| handler | 是 | string | 操作人 |
| group_code | 否 | string | 关联合同编号 |
| data | 是 | array | 板材信息, 详见json |
请求示例
{
"handler":"admin", // 操作人
"group_code":"YX20260115-1", // 关联合同号
"data": {
"purchase": {
"supplier_id": "14", // 经销商id
"note": "12", // 备注
"order_time": "2026-01-15 14:01:16", // 下单时间
"due_time": "2026-01-22", // 预计到场时间
"currency_name": "undefined",
"currency_id": "0", //币种 默认0
"ws_gst": "", // 税
"money_without_gst": "524.047", // 扣税金额
"money_sum": "524.047", // 未扣税金额
"money_sum_zh": "伍佰贰拾肆元零伍分", // 大写金额
"purchase_type": "0"
},
"one": {
"bar":[], // 型材 结构都相同
"glass":[], // 玻璃纱网
"addon":[], // 配件
"panel": [ //板材
{
"id": "0",
"bom_id": "49", // 材料id
"wh_which": "panel", // 类型 同上面的key
"wpc_id": "", // 接口带入,下面除了备注的都带入
"carQuantity": "0", // 接口带入
"wapd_id": "",
"oids": "",
"price": "167.97",
"money_sum": "500.047",
"wh_type": "face", // 采购方式 face:面积 count:数量
"quantity": "1", // 数量
"aluminum_price": "0",
"process_charge": "0",
"total_weight": "0", // 重量
"supplier_code": "",
"note": "", // 备注
"priority": "0",
"gross": "2.977",
"calculate_type": "0",
"back_date": "2026-01-22",
"conversion_quantity": "",
"theory_gross": "2.977",
"edge_length": "0"
}
],
"other": [ // 其他物料
{
"id": "0",
"bom_id": "13",
"wh_which": "other",
"wpc_id": "",
"carQuantity": "0",
"wapd_id": "",
"oids": "",
"price": "12",
"money_sum": "24",
"quantity": "2",
"aluminum_price": "0",
"process_charge": "0",
"total_weight": "0",
"supplier_code": "",
"note": "",
"priority": "1",
"gross": "2",
"calculate_type": "0",
"back_date": "2026-01-22",
"conversion_quantity": "",
"theory_gross": "2",
"edge_length": "0"
}
]
}
},
"purchase_code": "" // 自定义订单号
}返回示例
{
"return": 0,
"error": "",
"data": [
]
}返回参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| status | int | 状态码 0成功 1失败 |
| message | str | 返回信息 |
| data | array | 账号数据 |
