fix: 修复供应链模块全部CRUD配置问题
- suppliers_list: 添加orgid的code配置(dataurl+valueField/textField),加入editexclouded - supplier_resource_price_list: 修正data_filter格式(fields→AND),补充alters全部code字段 - product_supplier_mapping_list: 添加editexclouded,补充product_id的code配置 - platform_supply_products_list: 添加editexclouded,补充relation_id/source_product_id的code配置 - platform_supply_relations_list: 添加editexclouded,补充supplier_org_id/buyer_org_id的code配置 - sales_ledger_list: 添加editexclouded,补充6个FK字段的code配置 - sub_resellers_list: 添加editexclouded - supplychain_accounting_list: 添加data_filter+filter_labels,补充7个code字段的alters配置 - 新增get_search_sub_distributor_id.dspy和get_search_supply_relation_id.dspy - load_path.py注册新路径
This commit is contained in:
parent
45e9090b69
commit
c4039d2b30
@ -17,6 +17,18 @@
|
||||
"browserfields": {
|
||||
"exclouded": ["id", "supplier_org_id", "buyer_org_id"],
|
||||
"alters": {
|
||||
"relation_id": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_supply_relation_id.dspy')}}",
|
||||
"valueField": "relation_id",
|
||||
"textField": "relation_id_text"
|
||||
},
|
||||
"source_product_id": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_productid.dspy')}}",
|
||||
"valueField": "productid",
|
||||
"textField": "productid_text"
|
||||
},
|
||||
"status": {
|
||||
"uitype": "code",
|
||||
"data": [
|
||||
@ -26,6 +38,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"editexclouded": ["id", "supplier_org_id", "buyer_org_id", "created_at", "updated_at"],
|
||||
"editable": {
|
||||
"new_data_url": "{{entire_url('../api/platform_supply_products_create.dspy')}}",
|
||||
"update_data_url": "{{entire_url('../api/platform_supply_products_update.dspy')}}",
|
||||
|
||||
@ -21,6 +21,18 @@
|
||||
"browserfields": {
|
||||
"exclouded": ["id"],
|
||||
"alters": {
|
||||
"supplier_org_id": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_orgid.dspy')}}",
|
||||
"valueField": "orgid",
|
||||
"textField": "orgid_text"
|
||||
},
|
||||
"buyer_org_id": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_orgid.dspy')}}",
|
||||
"valueField": "orgid",
|
||||
"textField": "orgid_text"
|
||||
},
|
||||
"status": {
|
||||
"uitype": "code",
|
||||
"data": [
|
||||
@ -47,6 +59,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"editexclouded": ["id", "relation_code", "created_by", "created_at", "updated_at"],
|
||||
"subtables": [
|
||||
{
|
||||
"field": "relation_id",
|
||||
|
||||
@ -16,8 +16,9 @@
|
||||
"buyer_org_id": "采购方",
|
||||
"status": "状态"
|
||||
},
|
||||
"editexclouded": ["id", "created_at", "updated_at"],
|
||||
"browserfields": {
|
||||
"exclouded": ["id"],
|
||||
"exclouded": ["id", "supplier_org_id", "buyer_org_id"],
|
||||
"alters": {
|
||||
"supplier_type": {
|
||||
"uitype": "code",
|
||||
@ -26,6 +27,12 @@
|
||||
{"value": "external", "text": "外部供应商"}
|
||||
]
|
||||
},
|
||||
"product_id": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_productid.dspy')}}",
|
||||
"valueField": "productid",
|
||||
"textField": "productid_text"
|
||||
},
|
||||
"is_preferred": {
|
||||
"uitype": "code",
|
||||
"data": [
|
||||
|
||||
@ -22,6 +22,42 @@
|
||||
"browserfields": {
|
||||
"exclouded": ["id"],
|
||||
"alters": {
|
||||
"sub_reseller_id": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_sub_reseller_id.dspy')}}",
|
||||
"valueField": "sub_reseller_id",
|
||||
"textField": "sub_reseller_id_text"
|
||||
},
|
||||
"supplier_id": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_supplier_id.dspy')}}",
|
||||
"valueField": "supplier_id",
|
||||
"textField": "supplier_id_text"
|
||||
},
|
||||
"agreement_id": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_agreement_id.dspy')}}",
|
||||
"valueField": "agreement_id",
|
||||
"textField": "agreement_id_text"
|
||||
},
|
||||
"contract_id": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_contract_id.dspy')}}",
|
||||
"valueField": "contract_id",
|
||||
"textField": "contract_id_text"
|
||||
},
|
||||
"prodtypeid": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_prodtypeid.dspy')}}",
|
||||
"valueField": "prodtypeid",
|
||||
"textField": "prodtypeid_text"
|
||||
},
|
||||
"productid": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_productid.dspy')}}",
|
||||
"valueField": "productid",
|
||||
"textField": "productid_text"
|
||||
},
|
||||
"settlement_status": {
|
||||
"uitype": "code",
|
||||
"data": [
|
||||
@ -31,6 +67,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"editexclouded": ["id", "resellerid", "settlement_status", "created_by", "created_at", "updated_at"],
|
||||
"editable": {
|
||||
"new_data_url": "{{entire_url('../api/sales_ledger_create.dspy')}}",
|
||||
"update_data_url": "{{entire_url('../api/sales_ledger_update.dspy')}}",
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
"sub_reseller_name": "二级分销商名称",
|
||||
"status": "状态"
|
||||
},
|
||||
"editexclouded": ["id", "resellerid", "sub_reseller_code", "created_by", "created_at", "updated_at"],
|
||||
"browserfields": {
|
||||
"exclouded": ["id"],
|
||||
"alters": {
|
||||
|
||||
@ -5,15 +5,43 @@
|
||||
"params": {
|
||||
"sortby": ["effective_date desc", "created_at desc"],
|
||||
"data_filter": {
|
||||
"fields": [
|
||||
{"field": "supplier_org_id", "title": "供应商", "uitype": "code"},
|
||||
{"field": "resource_type", "title": "资源类型", "uitype": "code"},
|
||||
{"field": "status", "title": "状态", "uitype": "code"}
|
||||
"AND": [
|
||||
{"field": "supplier_org_id", "op": "=", "var": "supplier_org_id"},
|
||||
{"field": "resource_type", "op": "=", "var": "resource_type"},
|
||||
{"field": "status", "op": "=", "var": "status"}
|
||||
]
|
||||
},
|
||||
"filter_labels": {
|
||||
"supplier_org_id": "供应商",
|
||||
"resource_type": "资源类型",
|
||||
"status": "状态"
|
||||
},
|
||||
"browserfields": {
|
||||
"exclouded": [],
|
||||
"alters": {}
|
||||
"exclouded": ["id"],
|
||||
"alters": {
|
||||
"supplier_org_id": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_orgid.dspy')}}",
|
||||
"valueField": "orgid",
|
||||
"textField": "orgid_text"
|
||||
},
|
||||
"resource_type": {
|
||||
"uitype": "code",
|
||||
"data": [
|
||||
{"value": "llm", "text": "大语言模型"},
|
||||
{"value": "tts", "text": "语音合成"},
|
||||
{"value": "image", "text": "图像生成"},
|
||||
{"value": "video", "text": "视频生成"}
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"uitype": "code",
|
||||
"data": [
|
||||
{"value": "1", "text": "生效中"},
|
||||
{"value": "0", "text": "已失效"}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"editexclouded": ["id", "created_at", "updated_at"],
|
||||
"editable": {
|
||||
|
||||
@ -17,10 +17,16 @@
|
||||
"is_external": "供应商类型",
|
||||
"status": "状态"
|
||||
},
|
||||
"editexclouded": ["id", "resellerid", "status", "created_by", "created_at", "updated_at"],
|
||||
"editexclouded": ["id", "resellerid", "orgid", "status", "created_by", "created_at", "updated_at"],
|
||||
"browserfields": {
|
||||
"exclouded": ["id", "resellerid", "created_by"],
|
||||
"alters": {
|
||||
"orgid": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_orgid.dspy')}}",
|
||||
"valueField": "orgid",
|
||||
"textField": "orgid_text"
|
||||
},
|
||||
"is_external": {
|
||||
"uitype": "code",
|
||||
"data": [
|
||||
|
||||
@ -8,11 +8,72 @@
|
||||
"created_at desc"
|
||||
],
|
||||
"logined_userorgid": "resellerid",
|
||||
"data_filter": {
|
||||
"AND": [
|
||||
{"field": "sale_date", "op": ">=", "var": "sale_date_start"},
|
||||
{"field": "sale_date", "op": "<=", "var": "sale_date_end"},
|
||||
{"field": "supplier_id", "op": "=", "var": "supplier_id"},
|
||||
{"field": "productid", "op": "=", "var": "productid"}
|
||||
]
|
||||
},
|
||||
"filter_labels": {
|
||||
"sale_date_start": "销售开始日期",
|
||||
"sale_date_end": "销售结束日期",
|
||||
"supplier_id": "供应商",
|
||||
"productid": "产品"
|
||||
},
|
||||
"browserfields": {
|
||||
"exclouded": [
|
||||
"id",
|
||||
"resellerid",
|
||||
"created_by",
|
||||
"created_at"
|
||||
]
|
||||
],
|
||||
"alters": {
|
||||
"supply_contract_id": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_contract_id.dspy')}}",
|
||||
"valueField": "contract_id",
|
||||
"textField": "contract_id_text"
|
||||
},
|
||||
"distribution_agreement_id": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_agreement_id.dspy')}}",
|
||||
"valueField": "agreement_id",
|
||||
"textField": "agreement_id_text"
|
||||
},
|
||||
"sub_distributor_id": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_sub_distributor_id.dspy')}}",
|
||||
"valueField": "sub_distributor_id",
|
||||
"textField": "sub_distributor_id_text"
|
||||
},
|
||||
"supplier_id": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_supplier_id.dspy')}}",
|
||||
"valueField": "supplier_id",
|
||||
"textField": "supplier_id_text"
|
||||
},
|
||||
"prodtypeid": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_prodtypeid.dspy')}}",
|
||||
"valueField": "prodtypeid",
|
||||
"textField": "prodtypeid_text"
|
||||
},
|
||||
"productid": {
|
||||
"uitype": "code",
|
||||
"dataurl": "{{entire_url('../api/get_search_productid.dspy')}}",
|
||||
"valueField": "productid",
|
||||
"textField": "productid_text"
|
||||
},
|
||||
"source_type": {
|
||||
"uitype": "code",
|
||||
"data": [
|
||||
{"value": "1", "text": "手动录入"},
|
||||
{"value": "2", "text": "销售记账"}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"editexclouded": [
|
||||
"id",
|
||||
|
||||
@ -103,6 +103,8 @@ PATHS_LOGINED = [
|
||||
"/supplychain/api/get_search_sub_reseller_id.dspy",
|
||||
"/supplychain/api/get_search_agreement_id.dspy",
|
||||
"/supplychain/api/get_search_orgid.dspy",
|
||||
"/supplychain/api/get_search_sub_distributor_id.dspy",
|
||||
"/supplychain/api/get_search_supply_relation_id.dspy",
|
||||
# CRUD API — sub_distributors
|
||||
"/supplychain/api/sub_distributors_create.dspy",
|
||||
"/supplychain/api/sub_distributors_update.dspy",
|
||||
|
||||
16
wwwroot/api/get_search_sub_distributor_id.dspy
Normal file
16
wwwroot/api/get_search_sub_distributor_id.dspy
Normal file
@ -0,0 +1,16 @@
|
||||
result = [{'sub_distributor_id': '', 'sub_distributor_id_text': '全部'}]
|
||||
try:
|
||||
userorgid = await get_userorgid()
|
||||
if not userorgid:
|
||||
return json.dumps(result, ensure_ascii=False)
|
||||
db = DBPools()
|
||||
dbname = get_module_dbname('supplychain')
|
||||
async with db.sqlorContext(dbname) as sor:
|
||||
rows = await sor.sqlExe(
|
||||
"select id as sub_distributor_id, sub_dist_name as sub_distributor_id_text from sub_distributors where resellerid = ${userorgid}$ and status = '1' order by sub_dist_name",
|
||||
{"userorgid": userorgid}
|
||||
)
|
||||
return json.dumps(result + list(rows), ensure_ascii=False)
|
||||
except Exception as e:
|
||||
debug(f'get_search_sub_distributor_id error: {e}')
|
||||
return json.dumps(result, ensure_ascii=False)
|
||||
13
wwwroot/api/get_search_supply_relation_id.dspy
Normal file
13
wwwroot/api/get_search_supply_relation_id.dspy
Normal file
@ -0,0 +1,13 @@
|
||||
result = [{'relation_id': '', 'relation_id_text': '全部'}]
|
||||
try:
|
||||
db = DBPools()
|
||||
dbname = get_module_dbname('supplychain')
|
||||
async with db.sqlorContext(dbname) as sor:
|
||||
rows = await sor.sqlExe(
|
||||
"select id as relation_id, relation_name as relation_id_text from platform_supply_relations where status = '1' order by relation_name",
|
||||
{}
|
||||
)
|
||||
return json.dumps(result + list(rows), ensure_ascii=False)
|
||||
except Exception as e:
|
||||
debug(f'get_search_supply_relation_id error: {e}')
|
||||
return json.dumps(result, ensure_ascii=False)
|
||||
Loading…
x
Reference in New Issue
Block a user