64 Commits

Author SHA1 Message Date
916b501c67 feat: add admin + reset admin password toolbar for sub_distributors
- api/add_sub_distributor_admin.dspy: create org+user+reseller.admin role, show password
- api/reset_sub_distributor_admin_pwd.dspy: reset admin password, show new password
- sub_distributors_list: add toolbar buttons with popup binds
2026-07-10 12:15:31 +08:00
efe45215f0 fix: add /supplychain/ prefix to entire_url in index.ui and menu.ui
entire_url() without module prefix resolves to wrong path,
causing 403 on RBAC check. Now uses absolute /supplychain/ paths.
2026-07-10 11:59:08 +08:00
749047814f fix: use DataViewer instead of UrlWidget (UrlWidget ignores w/h; DataViewer works) 2026-07-10 11:30:05 +08:00
e0dc9963b7 feat: sub_distributors_create now creates organization + supply relation 2026-07-10 11:16:30 +08:00
0c718cf461 fix: fix column name + ensure dspy now returns CRUD page after create
- sub_resellers column is sub_reseller_name (not sub_dist_name)
- After ensure, return UrlWidget loading CRUD list filtered by id
- Popup size increased for CRUD page viewing
2026-07-10 11:11:21 +08:00
7fa70b9a24 fix: use urlwidget+PopupWindow instead of script/dspy for toolbar binds
bricks.js only supports 5 actiontypes; dspy and script with fetch
are not available. Use urlwidget with PopupWindow target instead.
2026-07-10 11:03:56 +08:00
8d9f31d7ad fix: change toolbar binds from dspy to script actiontype 2026-07-10 10:58:22 +08:00
0129866c00 fix: use existing SVG icons for toolbar buttons 2026-07-10 10:38:43 +08:00
3a36dc2400 feat: one-click ensure contract/agreement from supplier/distributor list
- api/ensure_distribution_agreement.dspy: check/create distribution_agreement for sub_reseller
- api/ensure_supply_contract.dspy: check/create supply_contract for supplier
- sub_distributors_list: toolbar '分销协议' now calls ensure endpoint (was PopupWindow)
- suppliers_list: add toolbar '供销协议' calling ensure endpoint
2026-07-10 10:37:17 +08:00
ccd1a6f0e8 fix: remove cheight from all CRUD index.ui — let bricks Tabular auto-height
Removed cheight:40 from outer VBox and inner Tabular options in:
- suppliers_list
- sub_resellers_list
- sub_distributors_list
- supply_contracts_list
- distribution_agreements_list

CRUD Tabular handles its own height; hardcoding cheight causes
title row to fill entire viewport.
2026-07-10 09:29:40 +08:00
6314b98c76 fix: add missing code fields to editexclouded in CRUD index.ui
- supply_contracts_list: add supplier_id to editexclouded
- distribution_agreements_list: add sub_reseller_id to editexclouded
- distribution_agreements_list: fix editable URLs to use custom API dspy paths
- distribution_agreements_list JSON: remove sub_reseller_id query param from new_data_url

Root cause: xls2ui strips code-type fields (those in browserfields.alters with
uitype=code and dataurl) from the generated editexclouded list, even though
they're in the source CRUD JSON config. This causes bricks.js to render UiCode
widgets in add/edit forms that try to call .length on undefined options data,
producing: TypeError: Cannot read properties of undefined (reading 'length')

Force-added generated files (normally gitignored) as temporary fix until
xls2ui is corrected.
2026-07-10 09:15:13 +08:00
da5fd85984 fix: add_sub_distributors calls create_sub_reseller for org+account creation 2026-07-09 16:29:11 +08:00
7c0acb5245 fix: UiFile-based upload with drag-drop support, download/delete toolbar 2026-07-03 17:57:48 +08:00
07d5173d75 feat: add download and delete actions to contract attachment list 2026-07-03 17:45:57 +08:00
3017ac295b fix: bricks.app.getWidgetById → bricks.getWidgetById (app is not the root for widget lookup) 2026-07-03 17:42:03 +08:00
b375ba5155 chore: remove vim swap file 2026-07-03 17:05:35 +08:00
a914380a9b feat: ContractAttachMgr — supplychain 自有附件管理器
ContractAttachMgr 继承 FileMgr, fiid 从 params_kw 透传
contract_upload.dspy: 自有上传端点
contract_attach.ui: 改用 supplychain 自己的上传 dspy
2026-07-03 17:05:24 +08:00
64e240872f fix: show_error → console.error (bricks 无此方法) 2026-07-03 16:54:26 +08:00
b4d66933a6 fix: get_files() -> this.value (UiFile 正确取值方式) 2026-07-03 16:51:51 +08:00
3497d946ce fix: Jinja2 转义 — upload_url 用 {% set %} 预计算
entire_url("/filemgr/...") 中的 " 导致 Jinja2 解析报错
改用 {% set upload_url = entire_url('/filemgr/upload_file.dspy') %}
2026-07-03 16:48:24 +08:00
a63b6ce427 fix: 附件上传改用 UiFile changed + fetch FormData
UiFile changed 事件 → script fetch POST multipart → 成功后 render Tabular
无需点击上传按钮,选择文件即自动上传
2026-07-03 16:46:14 +08:00
1f06a23fa3 fix: 附件上传改用 Form submit_url (multipart) + UiFile multiple
Form submit_url 直接POST到 filemgr, 支持multipart文件上传
UiFile multiple: true 浏览器原生支持拖拽
去掉无用的按钮+toolbar
2026-07-03 16:37:26 +08:00
3df4e237fc feat: 合同附件支持拖拽上传
drop_zone: 虚线边框拖放区域, 点击选择文件
Form: 隐藏字段 folderid+fiid + file input
Script: dragover/drop 事件处理, 拖入文件自动上传
2026-07-03 16:23:21 +08:00
e44c84d14c fix: created_by should be user_id not userorgid 2026-07-03 16:10:02 +08:00
724a912bc9 fix: remove duplicate supplier_id in new_data_url; JSON config is the correct fix, not dspy workaround 2026-07-03 16:09:30 +08:00
698f0f6e29 fix: unwrap list values from bricks code lookups (supplier_id was ['x','x']) before sor.C 2026-07-03 16:00:39 +08:00
fa81da2bbf fix: return plain dict (ahserver handles serialization), match CRUD pattern exactly 2026-07-03 15:54:19 +08:00
4a0b9db82a fix: follow CRUD add_llm pattern exactly — ns.copy(), sor.C, no param cleaning 2026-07-03 15:41:58 +08:00
6b6489af02 fix: back to sor.C with simple param cleaning 2026-07-03 15:40:11 +08:00
37c39a053f fix: sor.I takes 1 arg (data), not 2 2026-07-03 15:33:42 +08:00
fa5a1a3a8e feat: 供应合同和分销协议支持附件上传下载
contract_attach.ui: 附件管理页面(Tabular文件列表 + 上传按钮)
contract_attach_list.dspy: 查询合同附件列表
init.py: ensure_contract_folder() 自动创建附件目录
supply_contracts_list + distribution_agreements_list: 新增'合同附件'toolbar

实现: filemgr folder(contract_id=id, fiid=type)自动管理
2026-07-03 15:32:41 +08:00
1d99375578 fix: use whitelist approach - only pass known table columns to sor.I 2026-07-03 15:29:08 +08:00
959d021537 fix: clean _text suffix fields, use sor.I instead of sor.C, json.dumps return 2026-07-03 15:11:26 +08:00
da64e09090 fix: supply_contracts_create remove json.dumps 2026-07-03 15:10:01 +08:00
32070a53b1 fix: supplychain_accounting update/delete return widgettype format 2026-07-03 15:08:21 +08:00
63a1bedeba fix: clean non-table params before sor.C; return json.dumps instead of dict 2026-07-03 15:04:34 +08:00
f325ad0c93 fix: CRUD endpoint return format - remove json.dumps 2026-07-03 15:01:08 +08:00
813882ff71 fix: supply_contracts_create generates contract_code automatically 2026-07-03 14:30:35 +08:00
e766111aa1 fix: batch fix dspy violations — remove imports/print/ServerEnv, use return json.dumps, proper widgettype format 2026-07-03 13:57:26 +08:00
e79627c55f fix: sor.U()参数错误 - id放data字典内而非单独传第3参数 2026-07-02 18:53:04 +08:00
0bdb019e29 fix: 供应商创建同步org+开账,去json.dumps 2026-07-01 16:01:24 +08:00
2cf0504fa0 fix: .gitignore补supplier_resource_price_list,去除CRUD生成文件追踪 2026-07-01 15:46:54 +08:00
c4039d2b30 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注册新路径
2026-06-25 16:07:23 +08:00
Hermes Agent
45e9090b69 feat: 菜单增加供应商资源定价入口
在外部供应商分组下增加供应商资源定价管理菜单项
2026-06-21 11:45:05 +08:00
Hermes Agent
ba4c123c09 fix: supplier_resource_price CRUD JSON合规格式 + CRUD dspy + load_path
- supplier_resource_price_list.json重写为规范格式(tblname+params)
- 3个新CRUD dspy(create/update/delete)
- load_path.py LOGINED+OPERATOR注册完整路径
2026-06-21 11:40:44 +08:00
Hermes Agent
c06d54d86a feat: 供应商资源定价模块 + CRUD配置 + load_path更新
新增模型: supplier_resource_price (供应商资源定价表)
新增UI: supplier_resource_price_list/index.ui (定价管理界面)
新增DDL: supplier_resource_price建表语句
更新load_path: 添加定价CRUD路径权限
2026-06-20 12:10:48 +08:00
Hermes Agent
a005962abb Revert "fix: root VBox height:100% instead of cheight:40"
This reverts commit 27fbb27e6344e21ebfe9f136945ba8af93684006.
2026-06-19 14:26:31 +08:00
Hermes Agent
27fbb27e63 fix: root VBox height:100% instead of cheight:40 2026-06-19 14:25:10 +08:00
Hermes Agent
ae8e323f16 feat: 结算处理+供应商充值后端dspy - get_reseller/provider_settlement: 查询未结算的supplychain_accounting记录 - add/update_settlement: 调用SettleAccounting发起结算 - get/add/update_provider_recharge: 供应商充值记录CRUD 2026-06-18 13:51:45 +08:00
Hermes Agent
a175d79cc2 feat: 对账与明细对账页面重构 - 对账: 按产品汇总的单边明细发生统计(supplychain_accounting + accounting_log) - 明细对账: 逐笔核对(supplychain_accounting每笔记录) - 分销商维度看dist_amount, 供应商维度看supply_amount - 核对状态: 待核对/我方单边/对方单边/一致 2026-06-18 13:47:35 +08:00