fix: add status codes to models — prevents empty code field in search_form

This commit is contained in:
yumoqing 2026-07-09 14:07:17 +08:00
parent 5705e674b5
commit 6c926cf3d5
3 changed files with 376 additions and 344 deletions

View File

@ -1,143 +1,159 @@
{ {
"summary": [ "summary": [
{ {
"name": "sub_distributors", "name": "sub_distributors",
"title": "二级分销商表", "title": "二级分销商表",
"primary": ["id"], "primary": [
"catelog": "entity" "id"
} ],
], "catelog": "entity"
"fields": [ }
{ ],
"name": "id", "fields": [
"title": "主键ID", {
"type": "str", "name": "id",
"length": 32, "title": "主键ID",
"nullable": "no" "type": "str",
}, "length": 32,
{ "nullable": "no"
"name": "resellerid", },
"title": "所属主分销商机构ID", {
"type": "str", "name": "resellerid",
"length": 32, "title": "所属主分销商机构ID",
"nullable": "no" "type": "str",
}, "length": 32,
{ "nullable": "no"
"name": "sub_dist_code", },
"title": "二级分销商编号", {
"type": "str", "name": "sub_dist_code",
"length": 64, "title": "二级分销商编号",
"nullable": "no" "type": "str",
}, "length": 64,
{ "nullable": "no"
"name": "sub_dist_name", },
"title": "二级分销商名称", {
"type": "str", "name": "sub_dist_name",
"length": 255, "title": "二级分销商名称",
"nullable": "no" "type": "str",
}, "length": 255,
{ "nullable": "no"
"name": "contact_person", },
"title": "联系人", {
"type": "str", "name": "contact_person",
"length": 100 "title": "联系人",
}, "type": "str",
{ "length": 100
"name": "contact_phone", },
"title": "联系电话", {
"type": "str", "name": "contact_phone",
"length": 50 "title": "联系电话",
}, "type": "str",
{ "length": 50
"name": "contact_email", },
"title": "联系邮箱", {
"type": "str", "name": "contact_email",
"length": 255 "title": "联系邮箱",
}, "type": "str",
{ "length": 255
"name": "address", },
"title": "地址", {
"type": "str", "name": "address",
"length": 500 "title": "地址",
}, "type": "str",
{ "length": 500
"name": "tax_number", },
"title": "税号", {
"type": "str", "name": "tax_number",
"length": 64 "title": "税号",
}, "type": "str",
{ "length": 64
"name": "bank_name", },
"title": "开户银行", {
"type": "str", "name": "bank_name",
"length": 255 "title": "开户银行",
}, "type": "str",
{ "length": 255
"name": "bank_account", },
"title": "银行账号", {
"type": "str", "name": "bank_account",
"length": 64 "title": "银行账号",
}, "type": "str",
{ "length": 64
"name": "managed_by", },
"title": "负责销售ID", {
"type": "str", "name": "managed_by",
"length": 32 "title": "负责销售ID",
}, "type": "str",
{ "length": 32
"name": "status", },
"title": "状态", {
"type": "char", "name": "status",
"length": 1, "title": "状态",
"nullable": "no", "type": "char",
"default": "1" "length": 1,
}, "nullable": "no",
{ "default": "1"
"name": "remark", },
"title": "备注", {
"type": "text" "name": "remark",
}, "title": "备注",
{ "type": "text"
"name": "created_by", },
"title": "创建人", {
"type": "str", "name": "created_by",
"length": 32 "title": "创建人",
}, "type": "str",
{ "length": 32
"name": "created_at", },
"title": "创建时间", {
"type": "datetime", "name": "created_at",
"nullable": "no" "title": "创建时间",
}, "type": "datetime",
{ "nullable": "no"
"name": "updated_at", },
"title": "更新时间", {
"type": "datetime" "name": "updated_at",
} "title": "更新时间",
], "type": "datetime"
"indexes": [ }
{ ],
"name": "idx_sd_reseller", "indexes": [
"idxtype": "index", {
"idxfields": ["resellerid"] "name": "idx_sd_reseller",
}, "idxtype": "index",
{ "idxfields": [
"name": "idx_sd_code", "resellerid"
"idxtype": "unique", ]
"idxfields": ["resellerid", "sub_dist_code"] },
}, {
{ "name": "idx_sd_code",
"name": "idx_sd_manager", "idxtype": "unique",
"idxtype": "index", "idxfields": [
"idxfields": ["managed_by"] "resellerid",
} "sub_dist_code"
], ]
"codes": [ },
{ {
"field": "resellerid", "name": "idx_sd_manager",
"table": "organization", "idxtype": "index",
"valuefield": "id", "idxfields": [
"textfield": "orgname" "managed_by"
} ]
] }
} ],
"codes": [
{
"field": "resellerid",
"table": "organization",
"valuefield": "id",
"textfield": "orgname"
},
{
"field": "status",
"table": "appcodes_kv",
"valuefield": "k",
"textfield": "v",
"cond": "parentid='sub_distributor_status'"
}
]
}

View File

@ -1,203 +1,219 @@
{ {
"summary": [ "summary": [
{ {
"name": "suppliers", "name": "suppliers",
"title": "供应商表", "title": "供应商表",
"primary": ["id"], "primary": [
"catelog": "entity" "id"
} ],
], "catelog": "entity"
"fields": [ }
{ ],
"name": "id", "fields": [
"title": "主键ID", {
"type": "str", "name": "id",
"length": 32, "title": "主键ID",
"nullable": "no" "type": "str",
}, "length": 32,
{ "nullable": "no"
"name": "resellerid", },
"title": "所属分销商机构ID", {
"type": "str", "name": "resellerid",
"length": 32, "title": "所属分销商机构ID",
"nullable": "no" "type": "str",
}, "length": 32,
{ "nullable": "no"
"name": "supplier_code", },
"title": "供应商编号", {
"type": "str", "name": "supplier_code",
"length": 64, "title": "供应商编号",
"nullable": "no" "type": "str",
}, "length": 64,
{ "nullable": "no"
"name": "supplier_name", },
"title": "供应商名称", {
"type": "str", "name": "supplier_name",
"length": 255, "title": "供应商名称",
"nullable": "no" "type": "str",
}, "length": 255,
{ "nullable": "no"
"name": "contact_person", },
"title": "联系人", {
"type": "str", "name": "contact_person",
"length": 100 "title": "联系人",
}, "type": "str",
{ "length": 100
"name": "contact_phone", },
"title": "联系电话", {
"type": "str", "name": "contact_phone",
"length": 50 "title": "联系电话",
}, "type": "str",
{ "length": 50
"name": "contact_email", },
"title": "联系邮箱", {
"type": "str", "name": "contact_email",
"length": 255 "title": "联系邮箱",
}, "type": "str",
{ "length": 255
"name": "address", },
"title": "地址", {
"type": "str", "name": "address",
"length": 500 "title": "地址",
}, "type": "str",
{ "length": 500
"name": "tax_number", },
"title": "税号", {
"type": "str", "name": "tax_number",
"length": 64 "title": "税号",
}, "type": "str",
{ "length": 64
"name": "bank_name", },
"title": "开户银行", {
"type": "str", "name": "bank_name",
"length": 255 "title": "开户银行",
}, "type": "str",
{ "length": 255
"name": "bank_account", },
"title": "银行账号", {
"type": "str", "name": "bank_account",
"length": 64 "title": "银行账号",
}, "type": "str",
{ "length": 64
"name": "orgid", },
"title": "机构ID", {
"type": "str", "name": "orgid",
"length": 32, "title": "机构ID",
"nullable": "no" "type": "str",
}, "length": 32,
{ "nullable": "no"
"name": "is_external", },
"title": "是否外部供应商", {
"type": "char", "name": "is_external",
"length": 1, "title": "是否外部供应商",
"nullable": "no", "type": "char",
"default": "1" "length": 1,
}, "nullable": "no",
{ "default": "1"
"name": "settlement_cycle", },
"title": "结算周期", {
"type": "str", "name": "settlement_cycle",
"length": 20 "title": "结算周期",
}, "type": "str",
{ "length": 20
"name": "settlement_day", },
"title": "结算日", {
"type": "int" "name": "settlement_day",
}, "title": "结算日",
{ "type": "int"
"name": "payment_type", },
"title": "付款方式", {
"type": "str", "name": "payment_type",
"length": 20 "title": "付款方式",
}, "type": "str",
{ "length": 20
"name": "status", },
"title": "状态", {
"type": "char", "name": "status",
"length": 1, "title": "状态",
"nullable": "no", "type": "char",
"default": "1" "length": 1,
}, "nullable": "no",
{ "default": "1"
"name": "remark", },
"title": "备注", {
"type": "text" "name": "remark",
}, "title": "备注",
{ "type": "text"
"name": "created_by", },
"title": "创建人", {
"type": "str", "name": "created_by",
"length": 32 "title": "创建人",
}, "type": "str",
{ "length": 32
"name": "created_at", },
"title": "创建时间", {
"type": "datetime", "name": "created_at",
"nullable": "no" "title": "创建时间",
}, "type": "datetime",
{ "nullable": "no"
"name": "updated_at", },
"title": "更新时间", {
"type": "datetime" "name": "updated_at",
} "title": "更新时间",
], "type": "datetime"
"indexes": [ }
{ ],
"name": "idx_suppliers_reseller", "indexes": [
"idxtype": "index", {
"idxfields": ["resellerid"] "name": "idx_suppliers_reseller",
}, "idxtype": "index",
{ "idxfields": [
"name": "idx_suppliers_orgid", "resellerid"
"idxtype": "index", ]
"idxfields": ["orgid"] },
}, {
{ "name": "idx_suppliers_orgid",
"name": "idx_suppliers_code", "idxtype": "index",
"idxtype": "unique", "idxfields": [
"idxfields": ["resellerid", "supplier_code"] "orgid"
} ]
], },
"codes": [ {
{ "name": "idx_suppliers_code",
"field": "resellerid", "idxtype": "unique",
"table": "organization", "idxfields": [
"valuefield": "id", "resellerid",
"textfield": "orgname" "supplier_code"
}, ]
{ }
"field": "orgid", ],
"table": "organization", "codes": [
"valuefield": "id", {
"textfield": "orgname" "field": "resellerid",
}, "table": "organization",
{ "valuefield": "id",
"field": "is_external", "textfield": "orgname"
"table": "appcodes_kv", },
"valuefield": "k", {
"textfield": "v", "field": "orgid",
"cond": "parentid='supplier_is_external'" "table": "organization",
}, "valuefield": "id",
{ "textfield": "orgname"
"field": "payment_type", },
"table": "appcodes_kv", {
"valuefield": "k", "field": "is_external",
"textfield": "v", "table": "appcodes_kv",
"cond": "parentid='supplier_payment_type'" "valuefield": "k",
}, "textfield": "v",
{ "cond": "parentid='supplier_is_external'"
"field": "settlement_cycle", },
"table": "appcodes_kv", {
"valuefield": "k", "field": "payment_type",
"textfield": "v", "table": "appcodes_kv",
"cond": "parentid='supplier_settle_cycle'" "valuefield": "k",
}, "textfield": "v",
{ "cond": "parentid='supplier_payment_type'"
"field": "status", },
"table": "appcodes_kv", {
"valuefield": "k", "field": "settlement_cycle",
"textfield": "v", "table": "appcodes_kv",
"cond": "parentid='supplier_status'" "valuefield": "k",
} "textfield": "v",
] "cond": "parentid='supplier_settle_cycle'"
} },
{
"field": "status",
"table": "appcodes_kv",
"valuefield": "k",
"textfield": "v",
"cond": "parentid='supplier_status'"
},
{
"field": "status",
"table": "appcodes_kv",
"valuefield": "k",
"textfield": "v",
"cond": "parentid='supplier_status'"
}
]
}