- 7个数据库表: suppliers, supply_contracts, supply_contract_items, sub_distributors, distribution_agreements, distribution_agreement_items, supplychain_accounting - CRUD JSON配置 (7个列表 + editable段) - API端点: create/update/delete (21个) + calculate_accounting + query_discount (2个) - 前端页面: index.ui + 5个功能页 + menu.ui - 记账计算: 自动查找有效合同/协议折扣,计算进货金额、分销金额、利润 - 折扣查找优先级: 精确产品 > 产品分类 > 默认折扣 - productid/prodtypeid引用product模块(即将开发)
234 lines
5.8 KiB
JSON
234 lines
5.8 KiB
JSON
{
|
|
"summary": [
|
|
{
|
|
"name": "supplychain_accounting",
|
|
"title": "供销记账表",
|
|
"primary": ["id"],
|
|
"catelog": "relation"
|
|
}
|
|
],
|
|
"fields": [
|
|
{
|
|
"name": "id",
|
|
"title": "主键ID",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "resellerid",
|
|
"title": "所属主分销商机构ID",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "supply_contract_id",
|
|
"title": "供销合同ID",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "supply_contract_item_id",
|
|
"title": "供销合同产品明细ID",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "distribution_agreement_id",
|
|
"title": "分销协议ID",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "distribution_agreement_item_id",
|
|
"title": "分销协议产品明细ID",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "sub_distributor_id",
|
|
"title": "二级分销商ID",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "supplier_id",
|
|
"title": "供应商ID",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "prodtypeid",
|
|
"title": "产品分类ID",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "productid",
|
|
"title": "产品ID",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "quantity",
|
|
"title": "数量",
|
|
"type": "double",
|
|
"length": 15,
|
|
"dec": 4,
|
|
"nullable": "no",
|
|
"default": "0"
|
|
},
|
|
{
|
|
"name": "unit_price",
|
|
"title": "销售单价",
|
|
"type": "double",
|
|
"length": 15,
|
|
"dec": 4,
|
|
"nullable": "no",
|
|
"default": "0"
|
|
},
|
|
{
|
|
"name": "supply_discount",
|
|
"title": "进货折扣",
|
|
"type": "double",
|
|
"length": 5,
|
|
"dec": 4
|
|
},
|
|
{
|
|
"name": "supply_amount",
|
|
"title": "进货金额(应付供应商)",
|
|
"type": "double",
|
|
"length": 15,
|
|
"dec": 2,
|
|
"nullable": "no",
|
|
"default": "0"
|
|
},
|
|
{
|
|
"name": "dist_discount",
|
|
"title": "分销折扣",
|
|
"type": "double",
|
|
"length": 5,
|
|
"dec": 4
|
|
},
|
|
{
|
|
"name": "dist_amount",
|
|
"title": "分销金额(二级分销商应付)",
|
|
"type": "double",
|
|
"length": 15,
|
|
"dec": 2,
|
|
"nullable": "no",
|
|
"default": "0"
|
|
},
|
|
{
|
|
"name": "profit_amount",
|
|
"title": "利润金额",
|
|
"type": "double",
|
|
"length": 15,
|
|
"dec": 2,
|
|
"nullable": "no",
|
|
"default": "0"
|
|
},
|
|
{
|
|
"name": "sale_date",
|
|
"title": "销售日期",
|
|
"type": "date",
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "source_type",
|
|
"title": "来源类型",
|
|
"type": "char",
|
|
"length": 1,
|
|
"default": "1"
|
|
},
|
|
{
|
|
"name": "source_id",
|
|
"title": "来源记录ID",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "remark",
|
|
"title": "备注",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"name": "created_by",
|
|
"title": "创建人",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"title": "创建时间",
|
|
"type": "datetime",
|
|
"nullable": "no"
|
|
}
|
|
],
|
|
"indexes": [
|
|
{
|
|
"name": "idx_sa_reseller",
|
|
"idxtype": "index",
|
|
"idxfields": ["resellerid"]
|
|
},
|
|
{
|
|
"name": "idx_sa_sale_date",
|
|
"idxtype": "index",
|
|
"idxfields": ["sale_date"]
|
|
},
|
|
{
|
|
"name": "idx_sa_product",
|
|
"idxtype": "index",
|
|
"idxfields": ["productid"]
|
|
},
|
|
{
|
|
"name": "idx_sa_subdist",
|
|
"idxtype": "index",
|
|
"idxfields": ["sub_distributor_id"]
|
|
},
|
|
{
|
|
"name": "idx_sa_supplier",
|
|
"idxtype": "index",
|
|
"idxfields": ["supplier_id"]
|
|
},
|
|
{
|
|
"name": "idx_sa_source",
|
|
"idxtype": "index",
|
|
"idxfields": ["source_type", "source_id"]
|
|
}
|
|
],
|
|
"codes": [
|
|
{
|
|
"field": "supply_contract_id",
|
|
"table": "supply_contracts",
|
|
"valuefield": "id",
|
|
"textfield": "contract_name"
|
|
},
|
|
{
|
|
"field": "distribution_agreement_id",
|
|
"table": "distribution_agreements",
|
|
"valuefield": "id",
|
|
"textfield": "agreement_name"
|
|
},
|
|
{
|
|
"field": "sub_distributor_id",
|
|
"table": "sub_distributors",
|
|
"valuefield": "id",
|
|
"textfield": "sub_dist_name"
|
|
},
|
|
{
|
|
"field": "supplier_id",
|
|
"table": "suppliers",
|
|
"valuefield": "id",
|
|
"textfield": "supplier_name"
|
|
},
|
|
{
|
|
"field": "resellerid",
|
|
"table": "organization",
|
|
"valuefield": "id",
|
|
"textfield": "orgname"
|
|
}
|
|
]
|
|
}
|