fix: billing query - use Tabular instead of DataViewer, fix form submit target

- Changed DataViewer to Tabular with row_options.fields for proper table rendering
- Form submit target changed from 'self' to 'billing_page' (root VBox ID)
  with mode:replace, preventing nested page loading inside Form
- Fixed page_size to page_rows (correct parameter name)
- Added column definitions: date, time, subject, direction, summary, amount, balance
This commit is contained in:
yumoqing 2026-05-31 13:24:32 +08:00
parent 1fddb96291
commit 7361614f89

View File

@ -2,10 +2,11 @@
{% set end_date = params_kw.get('end_date', '') %}
{
"widgettype":"VBox",
"id":"billing_page",
"options":{
"width":"100%",
"height":"100%",
"css":"card",
"cwidth":30,
"gap":"8px"
},
"subwidgets":[
@ -45,24 +46,105 @@
"wid":"self",
"event":"submit",
"actiontype":"urlwidget",
"target":"self",
"target":"billing_page",
"options":{
"url":"{{entire_url('/accounting/billing.ui')}}"
}
},
"mode":"replace"
}
]
}
{% if start_date and end_date %}
,{
"widgettype":"DataViewer",
"widgettype":"Tabular",
"options":{
"width":"100%",
"height":"100%",
"data_url":"{{entire_url('/accounting/billing.dspy')}}",
"data_params":{
"start_date":"{{start_date}}",
"end_date":"{{end_date}}"
},
"editable":false,
"page_size":30
"page_rows":80,
"cache_limit":3,
"row_options":{
"browserfields":{
"exclouded":["row_num_"]
},
"fields":[
{
"name":"acc_date",
"title":"日期",
"type":"date",
"uitype":"date",
"datatype":"date",
"label":"日期",
"cwidth":12
},
{
"name":"acc_timestamp",
"title":"时间",
"type":"timestamp",
"uitype":"timestamp",
"datatype":"timestamp",
"label":"时间",
"cwidth":16
},
{
"name":"subject_name",
"title":"科目",
"type":"str",
"length":50,
"uitype":"str",
"datatype":"str",
"label":"科目",
"cwidth":14
},
{
"name":"acc_dir",
"title":"方向",
"type":"str",
"length":4,
"uitype":"str",
"datatype":"str",
"label":"方向",
"cwidth":8
},
{
"name":"summary",
"title":"摘要",
"type":"str",
"length":100,
"uitype":"str",
"datatype":"str",
"label":"摘要",
"cwidth":30
},
{
"name":"amount",
"title":"金额",
"type":"float",
"length":18,
"dec":4,
"uitype":"float",
"datatype":"float",
"label":"金额",
"cwidth":12
},
{
"name":"balance",
"title":"余额",
"type":"float",
"length":18,
"dec":4,
"uitype":"float",
"datatype":"float",
"label":"余额",
"cwidth":12
}
]
}
}
}
{% endif %}