Skip to content

出库单

字段可选

M:must 必填
O:optional 选填
C: conditional 某些条件下必选

搜索出库单

接口名
    /business/stock_out
Method
    GET
请求
    start_date  M   datetime    开始查询日期
    end_date    M   datetime    结束查询日期
    date_type   M   string  查询日期类型('operate_date'或'create_time')
    offset  O   int 分页缩进,默认0
    limit   O   int 分页每页数量,默认10
    status  O   int 出库单状态(1:待提交;2:待审核;3:审核通过;4:审核未通过;5:已冲销)
    query_data  O   string  查询内容,支持客户ID(K001或者1)和出库单号(CK001)
响应
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   string  返回json数据

    [
        {
            "status"    M   出库单状态码(1:待提交;2:待审核;3:审核通过;4:审核未通过;5:已冲销)
            "customer_cellphone"    M   客户手机号
            "customer_name" M   客户名
            "create_time"   M   'YYYY-MM-DD'    出库单创建时间
            "id"    M   出库单ID
            "operate_date"  M   'YYYY-MM-DD'    出库时间
            "customer_id"   M   客户ID
            "out_count" M   出库件数
        }
    ]
示例
    request
        http://localhost:8888/business/stock_out?start_date=2016-08-04&end_date=2016-09-21&date_type=create_time&offset=0&limit=10&query_data=K001
    response
        {
            "code": 0,
            "pagination": {
                "count": 1,
                "limit": 10,
                "offset": 0
            },
            "data": [
                {
                    "status": 3,
                    "customer_cellphone": "1111111111",
                    "customer_name": "test1111",
                    "create_time": "2016-08-21",
                    "id": "CK00001",
                    "operate_date": "2016-08-10",
                    "customer_id": 1,
                    "out_count": 100
                }
            ],
            "msg": "ok"
        }

出库单明细

接口名
    /business/stock_out/detail
Method
    GET
请求
    id  M   string  出库单ID
响应
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   string  返回json数据

    "operate_date"  M   YYYY-MM-DD  出库日期
    "customer_cellphone"    string M    客户电话
    "id"    M   出库单ID
    "details": [    M   list    出库商品详情
      {
        "name"  M   string  商品名
        "batch_id"  M   string  批次号
        "pallet_count"  M   int 板数
        "out_count" M   int 出库数
        "origin_count"  M   int 原库存件数
        "after_count"   M   int 剩余库存件数
        "ware_category_4_name"  M   string  通道名
        "tail_pallet_count" M   int 尾板数
        "count_per_pallet"  M   int 每板件数
        "ware_category_3_name"  M   string  库位名
        "ware_category_2_name"  M   string  库区名
        "ware_category_1_name"  M   string  仓库名
        "unit_weight"   M   int 件重(kg)
      }
    ]
    "task_should_pay"   M   float   作业单应付金额
    "type"  M   int 出库类型(1:自取;2:送货上门;3:送货上车)
    "status"    M   int 出库单状态
    "customer_id"   M   客户ID
    "additional_task_details": [    O   list    作业单详情
      {
        "follower_name" M   string  跟进人名
        "follower_id"   M   int 跟进人ID
        "remark"    M   string  备注
        "real_count"    M   float   实际数量
        "name"  M   string  作业费用名
        "fee_id"    M   int 作业费用ID
        "charge_count"  M   float   计费数量
        "unit_name" M   string  单位名
        "department_name"   M   string  跟进人部门名
        "department_id"     M   int 跟进人部门ID
        "unit_price"    M   float   单价
      }
    ],
    "customer_name" M   string  客户名
    "can_create_task"   M   bool    是否可以发送出库任务
    "delivery_address"  M   string  送货地址
    "license_plate" M   string  车牌号
    "remark"    M   string  备注
示例
    request
        http://teststation.guanmai.cn:8888/business/stock_out/detail?id=CK00123
    response
        {
            "code": 0,
            "data": {
                "customer_name": "北京客户001",
                "id": "CK00125",
                "details": [{
                    "out_count": 1,
                    "origin_count": 100,
                    "after_count": 99,
                    "ware_category_1_name": "23321",
                    "ware_category_2_name": "123",
                    "pile_up_num": 1,
                    "count_per_pallet": 1,
                    "goods_category_2_name": "冻牛肉",
                    "ware_category_4_name": "111",
                    "unit_weight": 10.0,
                    "ware_category_3_name": "123",
                    "batch_id": "2314134-1",
                    "name": "1",
                }],
                "customer_cellphone": "12312312312",
                "can_create_task": true,
                "type": 1,
                "delivery_address": "",
                "license_plate": "",
                "remark": ""
                "task_should_pay": 100.0,
                "additional_task_details": [{
                    "fee_id": 1,
                    "real_count": 1.0,
                    "department_id": 23,
                    "unit_name": "呀",
                    "unit_price": 100.0,
                    "charge_count": 1.0,
                    "follower_name": "www",
                    "follower_id": 51,
                    "name": "高温作业费",
                    "remark": "13",
                    "department_name": "北京部门1"
                }],
                "status": 2,
                "operate_date": "2016-09-28",
                "customer_id": "K00084"
            },
            "msg": "ok"
        }

创建出库单

接口名
    /business/stock_out/create
Method
    POST
请求
    customer_id M   string  客户ID(K001)
响应
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   string  返回出库单ID
示例
    request
        http://teststation.guanmai.cn:8888/business/stock_out/create
    form-data
        customer_id:K001
    response
        {
          "data": "CK0001",
          "code": 0,
          "msg": "ok"
        }

提交出库单

接口名
    /business/stock_out/submit
Method
    POST
请求
    id  M   string  出库单号
    operate_date    M   datetime    出库日期
    type    M   int 出库类型
    delivery_address    O   string  送货地址
    license_plate   O   string  送货车牌
    remark  O   string  备注
    details M   list    批次信息
        out_count   M   int 出库数
        batch_id    M   string  批次号
    additional_task_details O   list    作业单信息
        fee_id  M   int 费用ID
        real_count  M   int 实际数量
        follower_id M   int 跟进人ID
        remark  M   string  备注
响应
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   string  空
示例
    request
        127.0.0.1:8888/business/stock_out/submit
    form-data
        id: CK00001
        operate_date: 2016-08-05
        type: 2
        delivery_address: "宝安区"
        license_plate: ""
        remark: "备注"
        details:[{"batch_id":"1-1","out_count":100}]
        additional_task_details:[{"fee_id":"1","real_count":100,"follower_id":20,"remark":"WD205"}]
    response
        {
          "msg": "ok",
          "code": 0,
          "data": ""
        }

拒绝出库单

接口名
    /business/stock_out/reject
Method
    POST
请求
    id  M   string  出库单号
响应
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   string  空
示例
    request
        127.0.0.1:8888/business/stock_out/reject
    form-data
        id: CK000001
    response
        {
          "msg": "ok",
          "code": 0,
          "data": null
        }

通过出库单

接口名
    /business/stock_out/adopt
Method
    POST
请求
    id  M   string  出库单号
响应
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   string  空
示例
    request
        127.0.0.1:8888/business/stock_out/adopt
    form-data
        id: CK000001
    response
        {
          "msg": "ok",
          "code": 0,
          "data": null
        }

冲销出库单

接口名
    /business/stock_out/delete
Method
    POST
请求
    id  M   string  出库单号
响应
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   string  空
示例
    request
        127.0.0.1:8888/business/stock_out/delete
    form-data
        id: CK000001
    response
        {
          "msg": "ok",
          "code": 0,
          "data": null
        }

出库单基础信息

接口名
    /business/stock_out/base_info
Method
    GET
请求
    无
响应
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   string  基础信息
示例
    request
        127.0.0.1:8888/business/stock_out/base_info
    response
        {
          "data": {
            "calculate_method": {
              "ONE_PLUS": 2,
              "REAL": 3,
              "HALF_PLUS": 1
            },
            "type": {
              "BOARD": 3,
              "TRANSFER": 4,
              "SELFCOLLECTION": 1,
              "HOMEDELIVERY": 2
            },
            "status": {
              "FAIL": 4,
              "PASSED": 3,
              "DELETED": 5,
              "VERIFYING": 2,
              "WAIT_FOR_SUBMIT": 1
            }
          },
          "code": 0,
          "msg": "ok"
        }

出库默认送货地址

接口名
    /business/stock_out/delivery_address
Method
    GET
请求
    customer_id M   string  客户ID
响应
    code    M   int     返回码,0表示成功,其他表示错误
    msg     M   string  错误信息
    data    M   string  默认送货地址
示例
    request
        127.0.0.1:8888/business/stock_out/delivery_address?customer_id=K002
    response
        {
          "data": "送货地址",
          "code": 0,
          "msg": "ok"
        }