70 lines
3.8 KiB
XML

{% set customers = get_bound_customers(request) %}
{% set sales = get_reseller_sales(request) %}
{
"widgettype": "VBox",
"options": {"width": "100%", "height": "100%", "css": "filler"},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "客户再分配 - 更换销售",
"fontSize": "16px", "fontWeight": "600", "color": "#F1F5F9", "padding": "8px 12px"
}
},
{
"widgettype": "HBox",
"options": {"bgcolor": "#0F172A", "padding": "8px 0", "borderRadius": "6px 6px 0 0", "alignItems": "center", "width": "100%"},
"subwidgets": [
{"widgettype": "Text", "options": {"text": "客户名称", "width": "30%", "padding": "0 8px", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8"}},
{"widgettype": "Text", "options": {"text": "当前销售", "width": "25%", "padding": "0 8px", "fontSize": "12px", "fontWeight": "600", "color": "#22C55E"}},
{"widgettype": "Text", "options": {"text": "更换为", "width": "35%", "padding": "0 8px", "fontSize": "12px", "fontWeight": "600", "color": "#F59E0B"}},
{"widgettype": "Text", "options": {"text": "", "width": "10%", "padding": "0 8px"}}
]
},
{
"widgettype": "VScrollPanel",
"options": {"width": "100%", "flex": "1"},
"subwidgets": [
{
"widgettype": "VBox",
"options": {"width": "100%"},
"subwidgets": [
{% for c in customers %}
{
"widgettype": "HBox",
"options": {"padding": "6px 0", "border": "0 0 1px 0", "borderColor": "#334155", "alignItems": "center", "width": "100%"},
"subwidgets": [
{"widgettype": "Text", "options": {"text": {{json.dumps(c.customer_name or '')}}, "width": "30%", "padding": "0 8px", "fontSize": "12px", "color": "#E2E8F0"}},
{"widgettype": "Text", "options": {"text": {{json.dumps(c.sale_name or '-')}}, "width": "25%", "padding": "0 8px", "fontSize": "12px", "color": "#22C55E"}},
{
"widgettype": "UiCode",
"options": {
"width": "35%", "padding": "0 8px",
"name": "sale_id",
"value": "",
"placeholder": "选择新销售...",
"data": {{json.dumps(sales or [], ensure_ascii=False)}}
},
"binds": [{
"wid": "self", "event": "blur",
"actiontype": "urlwidget", "datawidget": "self", "target": "self",
"options": {
"url": "{{entire_url('/discount/api/save_customer_sale.dspy')}}",
"params": {
"bind_id": {{json.dumps(c.bind_id or '')}},
"customerid": {{json.dumps(c.customerid)}}
}
}
}]
},
{"widgettype": "Text", "options": {"text": "", "width": "10%", "padding": "0 8px"}}
]
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}
]
}
]
}