supplychain/models/supplychain_accounting.json
yumoqing 092d74133e fix: 添加product引用, 创建scripts/load_path.py, 修复.dspy代码生成逻辑
- models/*.json: 在supply_contract_items, distribution_agreement_items,
  supplychain_accounting的codes段添加products/product_types引用
- scripts/load_path.py: 模块RBAC权限管理脚本, 包含any/logined/operator/sale四类权限
- supplychain/init.py: 重命名get_module_dbname为_get_dbname避免覆盖全局函数
- wwwroot/api/*_create.dspy: 修复自动编号生成逻辑(移除死代码条件判断)
2026-05-25 15:37:06 +08:00

246 lines
6.1 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": "prodtypeid",
"table": "product_types",
"valuefield": "id",
"textfield": "type_name"
},
{
"field": "productid",
"table": "products",
"valuefield": "id",
"textfield": "product_name"
},
{
"field": "resellerid",
"table": "organization",
"valuefield": "id",
"textfield": "orgname"
}
]
}