84 lines
4.3 KiB
XML

{% set customers = get_free_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": {"padding": "4px 12px", "alignItems": "center"},
"subwidgets": [
{
"widgettype": "Button",
"options": {"label": "初始化自由客户", "css": "primary", "fontSize": "12px", "padding": "4px 12px", "borderRadius": "4px"},
"binds": [{
"wid": "self", "event": "click",
"actiontype": "urlwidget", "target": "app.sage_main_content",
"mode": "replace",
"options": {"url": "{{entire_url('/discount/api/init_free_customers.dspy')}}", "method": "POST"}
}]
}
]
},
{
"widgettype": "HBox",
"options": {"bgcolor": "#0F172A", "padding": "8px 0", "borderRadius": "6px 6px 0 0", "alignItems": "center", "width": "100%"},
"subwidgets": [
{"widgettype": "Text", "options": {"text": "客户名称", "width": "45%", "padding": "0 8px", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8"}},
{"widgettype": "Text", "options": {"text": "分配销售", "width": "45%", "padding": "0 8px", "fontSize": "12px", "fontWeight": "600", "color": "#F59E0B"}},
{"widgettype": "Text", "options": {"text": "状态", "width": "10%", "padding": "0 8px", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8"}}
]
},
{
"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": "45%", "padding": "0 8px", "fontSize": "12px", "color": "#E2E8F0"}},
{
"widgettype": "UiCode",
"options": {
"width": "45%", "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", "fontSize": "11px", "color": "#475569"}}
]
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}
]
}
]
}