refactor: billing - use Form title, Tabular always present, form submit loadData via script

This commit is contained in:
yumoqing 2026-05-31 13:56:56 +08:00
parent 6d3dcf2db9
commit 8d447b90ea

View File

@ -1,5 +1,3 @@
{% set start_date = params_kw.get('start_date', '') %}
{% set end_date = params_kw.get('end_date', '') %}
{ {
"widgettype":"VBox", "widgettype":"VBox",
"id":"billing_page", "id":"billing_page",
@ -9,35 +7,21 @@
"css":"card", "css":"card",
"gap":"8px" "gap":"8px"
}, },
"subwidgets":[
{
"widgettype":"Title6",
"options":{
"text":"账单查询"
}
},
{
"widgettype":"VBox",
"options":{
"width":"100%",
"height":"60px"
},
"subwidgets":[ "subwidgets":[
{ {
"widgettype":"Form", "widgettype":"Form",
"options":{ "options":{
"title":"账单查询",
"fields":[ "fields":[
{ {
"name":"start_date", "name":"start_date",
"label":"开始日期", "label":"开始日期",
"uitype":"date", "uitype":"date"
"value":"{{start_date}}"
}, },
{ {
"name":"end_date", "name":"end_date",
"label":"结束日期", "label":"结束日期",
"uitype":"date", "uitype":"date"
"value":"{{end_date}}"
} }
], ],
"buttons":[ "buttons":[
@ -52,29 +36,22 @@
{ {
"wid":"self", "wid":"self",
"event":"submit", "event":"submit",
"actiontype":"urlwidget", "actiontype":"script",
"target":"billing_page", "target":"billing_tabular",
"options":{ "options":{
"url":"{{entire_url('/accounting/billing.ui')}}" "script":"this.loadData(params)"
}
}
]
}, },
"mode":"replace" {
}
]
}
]
}
{% if start_date and end_date %}
,{
"widgettype":"Tabular", "widgettype":"Tabular",
"id":"billing_tabular",
"options":{ "options":{
"width":"100%", "width":"100%",
"height":"100%", "height":"100%",
"css":"filler", "css":"filler",
"data_url":"{{entire_url('/accounting/billing.dspy')}}", "data_url":"{{entire_url('/accounting/billing.dspy')}}",
"data_params":{
"start_date":"{{start_date}}",
"end_date":"{{end_date}}"
},
"editable":false, "editable":false,
"page_rows":80, "page_rows":80,
"cache_limit":3, "cache_limit":3,
@ -157,6 +134,5 @@
} }
} }
} }
{% endif %}
] ]
} }