其他出入库单

其他出入库单查询接口

根据关键字(支持出入库时间、状态、编号的查询),得到与之匹配的其他出入库单。

curl -H "Authorization: Token token=<token>, uid=<uid>" http://example.com/api/storageios.json
{
    "status": {
        "code": 200,
        "message": "OK"
    },
    "storageios": [
        {
            "id": 59,
            "number": "QTRKD201709270001",
            "check_number": "",
            "category": "in",
            "category_i18n": "其他入库",
            "storaged_at": "2017-09-27",
            "status": "submitted",
            "status_i18n": "已提交",
            "warehouse_name": "zxcvsadfzx21",
            "creator": "陈小朋q",
            "created_at": "2017-09-27",
            "total_amount": "10.0000",
            "next_status": null,
            "category": "in",
            "document_type": "storageio"
        },
        {
            "id": 51,
            "number": "QTRKD201705170001",
            "check_number": "",
            "category": "in",
            "category_i18n": "其他入库",
            "storaged_at": "2017-05-17",
            "status": "approving",
            "status_i18n": "待1级审批",
            "warehouse_name": "测试仓库9",
            "creator": "陈小朋q",
            "created_at": "2017-05-17",
            "total_amount": "10.0000",
            "next_status": null,
            "category": "in",
            "document_type": "storageio"
        }
    ]
}
  • HTTP 请求

    GET http://example.com/api/storageios.json

  • 请求参数

参数名 是否必须 说明
date 出入库日期,支持 全部、今天、昨天、本周、上周、1周之前、本月、上月、今年、去年;还可以用日期区间,比如 2017-10-01/2017-10-10
status 单据状态, draft(草稿)、approving(待审批)、submitted(已提交)、rejected(已驳回)、passed(审批通过)、deprecated(废弃)
warehouse_id 仓库ID
product_category_id 产品分类ID
creator_id 创建者ID
keyword 关键词模糊查询,支持产品名称、单据编号、产品属性、产品规格
page 第几页
per 每页返回数
  • 返回字段说明
返回值字段 字段类型 字段说明
id integer 单据ID
number string 单据编号
check_number string 盘点单编号
category string 类型,in 表示其他入库,out 表示其他出库,profit 表示盘盈单,loss 表示盘亏单
category_i18n string 类型名
storaged_at string 出入库时间
status string 状态值,draft(草稿)、approving(待审批)、submitted(已提交)、rejected(已驳回)、passed(审批通过)、deprecated(废弃)
status_i18n string 状态
warehouse_name string 仓库名称
creator integer 创建人名字
created_at string 创建日期
total_amount string 总金额
next_status string 下一个状态
category string 出入库单类型,in 表示其他入库,out 表示其他出库,profit 表示盘盈单,loss 表示盘亏单
document_type string 单据类型名

新增其他出入库单

根据提供的数据,新增其他出入库单。

curl -i -X POST -h "Authorization: Token token=<token>, uid=<uid>" http://example.com/api/storageios.json
{
    "status": {
        "code": 200,
        "message": "OK"
    },
    "storageio": {
        "id": 190
    }
}
  • HTTP请求

    POST api/storageios.json

  • 请求参数说明

参数名 是否必填 默认值 字段说明
warehouse_id 关联仓库ID
number 编号,开启自动编号后可不填,关闭自动编号后必填
total_quantity 总数量
total_amount 总金额
storageio_category_id 自定义单据类型id
storaged_at 出入库时间
note 备注
check_id 关联盘点单
status 状态,如果关闭审批,支持draft(草稿)、submitted(提交);如果开启审批,支持draft(草稿)、approving(提交审批)
product_items_attributes[0][product_attr_group_id] 产品属性组ID
product_items_attributes[0][product_number] 产品编号
product_items_attributes[0][product_unit_id] 产品单位ID
product_items_attributes[0][batch_number] 批次号
product_items_attributes[0][produced_at] 生产日期
product_items_attributes[0][expired_at] 有效日期
product_items_attributes[0][attr_names] 属性名称
product_items_attributes[0][product_id] 产品ID
product_items_attributes[0][name] 产品名称
product_items_attributes[0][spec] 规格
product_items_attributes[0][unit] 单位
product_items_attributes[0][quantity] 数量
product_items_attributes[0][price] 价格
product_items_attributes[0][amount] 优惠后金额
product_items_attributes[0][note] 备注
product_items_attributes[0][modified] 最后一次修改的字段,包括quantity、price、price_with_tax、discount、deduction、amount、tax_rate、tax_amount、amount_with_tax
product_items_attributes[0][serial_codes_attributes][0][identifier] 序列号
product_items_attributes[0][serial_codes_attributes][0][product_attr_group_id] 产品属性组ID
product_items_attributes[0][serial_codes_attributes][0][warehouse_id] 仓库ID
product_items_attributes[0][serial_codes_attributes][0][category] 类别
attachments_attributes[0][dn_key] 七牛存储的key
attachments_attributes[0][key] 同上
attachments_attributes[0][filename] 文件名
attachments_attributes[0][url] 文件URL
attachments_attributes[0][size] 文件大小
  • 返回字段说明
返回值字段 字段类型 字段说明
id string ID

获取其他出入库单详情

根据其他出入单ID,得到对应的其他出入库单。

curl "http://example.com/api/storageios/:id.json"
{
    "status": {
        "code": 200,
        "message": "OK"
    },
    "storageio": {
        "id": 59,
        "number": "QTRKD201709270001",
        "check_number": "",
        "category": "in",
        "category_i18n": "其他入库",
        "storageio_category_id": 1,
        "storageio_category_name": "其他入库",
        "storaged_at": "2017-09-27",
        "status": "submitted",
        "status_i18n": "已提交",
        "warehouse_name": "zxcvsadfzx21",
        "creator": "陈小朋q",
        "created_at": "2017-09-27",
        "total_amount": "10.0000",
        "next_status": "passed",
        "document_type": "storageio",
        "has_serial_code": false,
        "check_id": "",
        "total_quantity": "1.00",
        "warehouse_id": 23,
        "creator_id": 1,
        "note": "",
        "attachments_count": 0,
        "approved_level": 0,
        "creator_name": "陈小朋q",
        "product_items": [
            {
                "id": 1084,
                "name": "测试商品1",
                "spec": "XS",
                "unit": "个",
                "product_id": 1,
                "product_attr_group_id": 1,
                "product_unit_id": 131,
                "order_item_id": null,
                "parent_id": null,
                "batch_number": null,
                "batch_id": null,
                "attr_names": "",
                "modified": "quantity",
                "note": "aa",
                "product_number": "DG001",
                "number": "DG001",
                "quantity": "1.00",
                "price": "10.0000",
                "price_with_tax": "10.0000",
                "amount_with_tax": "10.0000",
                "tax_amount": "0.0000",
                "tax_rate": "0.00",
                "discount": "0.00",
                "deduction": "0.0000",
                "amount": "10.0000",
                "serial_code_status": "serial_closed",
                "order_number": null,
                "expired_at": null,
                "produced_at": null,
                "product_attr_group_name": "",
                "product_image": "",
                "product_images": [],
                "serial_codes_attributes": []
            }
        ],
        "attachments": []
    }
}
  • HTTP 请求

    GET http://example.com/api/storageios/:id.json

  • 请求参数

参数名 是否必须 说明
id 必须 其他出入库单ID
  • 返回字段说明
返回值字段 字段类型 字段说明
id integer ID
number string 编号
check_number string 关联盘点单编号
category string 类型,in 表示其他入库,out 表示其他出库,profit 表示盘盈单,loss 表示盘亏单
category_i18n string 类型名
storageio_category_id integer 用户自定义单据类型id
storageio_category_name string 用户自定义单据类型名称
storaged_at string 出入库时间
status string 状态值,draft(草稿)、approving(待审批)、submitted(已提交)、rejected(已驳回)、passed(审批通过)、deprecated(废弃)
status_i18n string 状态
warehouse_name string 仓库名称
creator integer 创建人名字
created_at string 创建日期
total_amount string 总金额
next_status string 下一个状态
category string 出入库单类型,in 表示其他入库,out 表示其他出库,profit 表示盘盈单,loss 表示盘亏单
document_type string 单据类型名
has_serial_code boolean 是否含有序列号产品
check_id integer 关联盘点单ID
total_quantity string 总数量
warehouse_id integer 仓库ID
creator_id integer 创建人
note string 备注
attachments_count integer 附件个数
approved_level integer 审批级别
creator_name string 创建者名称
product_items[0][id] integer 产品项ID
product_items[0][name] string 产品名称
product_items[0][spec] string 产品规格
product_items[0][unit] string 产品单位
product_items[0][product_id] integer 产品ID
product_items[0][product_attr_group_id] integer 产品属性组ID
product_items[0][product_number] string 产品编号
product_items[0][product_unit_id] integer 产品单位ID
product_items[0][batch_number] string 批次号
product_items[0][produced_at] string 生产日期
product_items[0][expired_at] string 有效日期
product_items[0][attr_names] string 属性名称
product_items[0][product_id] integer 产品ID
product_items[0][name] string 产品名称
product_items[0][spec] string 规格
product_items[0][unit] string 单位
product_items[0][quantity] string 数量
product_items[0][price] string 价格
product_items[0][amount] string 优惠后金额
product_items[0][note] string 备注
product_items[0][serial_codes_attributes][0][identifier] string 序列号
product_items[0][serial_codes_attributes][0][product_attr_group_id] integer 产品属性组ID
product_items[0][serial_codes_attributes][0][warehouse_id] integer 仓库ID
product_items[0][serial_codes_attributes][0][category] string 类别
attachments[0][id] integer 附件ID
attachments[0][filename] string 附件文件名
attachments[0][url] string 附件URL

编辑其他出入库单

根据提供的数据,更新其他出入库单。

curl -i -X PUT -H "Authorization: Token token=<token>, uid=<uid>" http://example.com/api/storageios.json
  • 参数格式
参数名 是否必填 默认值 字段说明
warehouse_id 关联仓库ID
number 编号,开启自动编号后可不填,关闭自动编号后必填
total_quantity 总数量
total_amount 总金额
storageio_category_id 自定义单据类型id
storaged_at 出入库时间
note 备注
check_id 关联盘点单
status 状态,如果关闭审批,支持draft(草稿)、submitted(提交);如果开启审批,支持draft(草稿)、approving(提交审批)
product_items_attributes[0][id] 产品项ID
product_items_attributes[0][product_attr_group_id] 产品属性组ID
product_items_attributes[0][product_number] 产品编号
product_items_attributes[0][product_unit_id] 产品单位ID
product_items_attributes[0][batch_number] 批次号
product_items_attributes[0][produced_at] 生产日期
product_items_attributes[0][expired_at] 有效日期
product_items_attributes[0][attr_names] 属性名称
product_items_attributes[0][product_id] 产品ID
product_items_attributes[0][name] 产品名称
product_items_attributes[0][spec] 规格
product_items_attributes[0][unit] 单位
product_items_attributes[0][quantity] 数量
product_items_attributes[0][price] 价格
product_items_attributes[0][amount] 优惠后金额
product_items_attributes[0][note] 备注
product_items_attributes[0][modified] 最后一次修改的字段,包括quantity、price、price_with_tax、discount、deduction、amount、tax_rate、tax_amount、amount_with_tax
product_items_attributes[0][_destroy] 是否删除
product_items_attributes[0][serial_codes_attributes][0][id] 序列号ID
product_items_attributes[0][serial_codes_attributes][0][identifier] 序列号
product_items_attributes[0][serial_codes_attributes][0][product_attr_group_id] 产品属性组ID
product_items_attributes[0][serial_codes_attributes][0][warehouse_id] 仓库ID
product_items_attributes[0][serial_codes_attributes][0][category] 类别
product_items_attributes[0][serial_codes_attributes][0][_destroy] 是否删除
attachments_attributes[0][dn_key] 七牛存储的key
attachments_attributes[0][key] 同上
attachments_attributes[0][filename] 文件名
attachments_attributes[0][url] 文件URL
attachments_attributes[0][size] 文件大小
  • HTTP请求

    PUT api/storageios/:id.json

  • 返回字段说明

返回值字段 字段类型 字段说明
id string ID

其他出/入库货单获取自动编号

获取自动编号

curl -H "Authorization: Token token=<token>, uid=<uid>" /api/storageios/get_auto_number.json
{
    "status": {
        "code": 200,
        "message": "OK"
    },
    "number": "QTCKD20180528001"
}
  • HTTP请求

    GET http://example.com/api/storageios/get_auto_number.json

  • 请求参数

参数名 是否必须 说明
category 类别 in/out/profit/loss(注意:该参数没有默认值且必传)
  • 返回字段说明
字段 类型 说明
number string 编号
文档更新时间: 2025-03-17 14:52   作者:姜河