63 lines
3.2 KiB
XML
63 lines
3.2 KiB
XML
{
|
|
"widgettype": "VBox",
|
|
"options": {"width": "100%", "height": "100%", "padding": "8px", "gap": "8px"},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "InlineForm",
|
|
"id": "my_voucher_filter",
|
|
"options": {
|
|
"css": "card", "padding": "8px", "submit_label": "查询",
|
|
"fields": [
|
|
{"name": "status", "label": "状态", "uitype": "code", "cwidth": 10,
|
|
"data": [
|
|
{"value": "", "text": "全部"},
|
|
{"value": "unused", "text": "未使用"},
|
|
{"value": "used", "text": "已使用"},
|
|
{"value": "expired", "text": "已过期"},
|
|
{"value": "void", "text": "已作废"}
|
|
]}
|
|
]
|
|
},
|
|
"binds": [{
|
|
"wid": "self", "event": "submit",
|
|
"actiontype": "script", "target": "my_voucher_table",
|
|
"script": "var tbl = bricks.getWidgetById('my_voucher_table', bricks.app.root); if(tbl) await tbl.render(params);"
|
|
}]
|
|
},
|
|
{
|
|
"widgettype": "Tabular",
|
|
"id": "my_voucher_table",
|
|
"options": {
|
|
"title": "我的代金券",
|
|
"width": "100%", "css": "card",
|
|
"data_url": "{{entire_url('/voucher/api/my_vouchers.dspy')}}",
|
|
"data_method": "GET", "page_rows": 20,
|
|
"row_options": {
|
|
"browserfields": {
|
|
"exclouded": ["id"],
|
|
"alters": {
|
|
"status": {"uitype": "code", "textField": "status_text", "data": [
|
|
{"value": "unused", "text": "未使用"}, {"value": "used", "text": "已使用"},
|
|
{"value": "expired", "text": "已过期"}, {"value": "void", "text": "已作废"}]},
|
|
"source": {"uitype": "code", "textField": "source_text", "data": [
|
|
{"value": "manual", "text": "手动发放"}, {"value": "register", "text": "注册赠券"},
|
|
{"value": "promo", "text": "促销活动"}]}
|
|
}
|
|
},
|
|
"fields": [
|
|
{"name": "code", "label": "券码", "type": "str", "cwidth": 16},
|
|
{"name": "template_name", "label": "模板", "type": "str", "cwidth": 14},
|
|
{"name": "face_value", "label": "面值(元)", "type": "double", "cwidth": 8},
|
|
{"name": "status", "label": "状态", "type": "str", "cwidth": 8},
|
|
{"name": "actual_deducted", "label": "已抵扣(元)", "type": "double", "cwidth": 9},
|
|
{"name": "valid_from", "label": "生效时间", "type": "datetime", "cwidth": 13},
|
|
{"name": "valid_to", "label": "过期时间", "type": "datetime", "cwidth": 13},
|
|
{"name": "source", "label": "来源", "type": "str", "cwidth": 8},
|
|
{"name": "remark", "label": "备注", "type": "str", "cwidth": 16}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|