supplychain/models/supply_contracts.json
yumoqing da32159ad9 feat: 供应商和分销商管理模块 (supplychain)
- 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模块(即将开发)
2026-05-25 15:37:06 +08:00

133 lines
3.1 KiB
JSON

{
"summary": [
{
"name": "supply_contracts",
"title": "供销合同表",
"primary": ["id"],
"catelog": "entity"
}
],
"fields": [
{
"name": "id",
"title": "主键ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "resellerid",
"title": "所属分销商机构ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "supplier_id",
"title": "供应商ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "contract_code",
"title": "合同编号",
"type": "str",
"length": 64,
"nullable": "no"
},
{
"name": "contract_name",
"title": "合同名称",
"type": "str",
"length": 255,
"nullable": "no"
},
{
"name": "sign_date",
"title": "签署日期",
"type": "date"
},
{
"name": "start_date",
"title": "生效日期",
"type": "date",
"nullable": "no"
},
{
"name": "end_date",
"title": "到期日期",
"type": "date"
},
{
"name": "status",
"title": "状态",
"type": "char",
"length": 1,
"nullable": "no",
"default": "1"
},
{
"name": "default_discount",
"title": "默认折扣",
"type": "double",
"length": 5,
"dec": 4,
"default": "1.0000"
},
{
"name": "remark",
"title": "备注",
"type": "text"
},
{
"name": "created_by",
"title": "创建人",
"type": "str",
"length": 32
},
{
"name": "created_at",
"title": "创建时间",
"type": "datetime",
"nullable": "no"
},
{
"name": "updated_at",
"title": "更新时间",
"type": "datetime"
}
],
"indexes": [
{
"name": "idx_sc_reseller",
"idxtype": "index",
"idxfields": ["resellerid"]
},
{
"name": "idx_sc_supplier",
"idxtype": "index",
"idxfields": ["supplier_id"]
},
{
"name": "idx_sc_code",
"idxtype": "unique",
"idxfields": ["resellerid", "contract_code"]
}
],
"codes": [
{
"field": "supplier_id",
"table": "suppliers",
"valuefield": "id",
"textfield": "supplier_name"
},
{
"field": "resellerid",
"table": "organization",
"valuefield": "id",
"textfield": "orgname"
}
]
}