66 lines
2.3 KiB
XML
66 lines
2.3 KiB
XML
{
|
|
"widgettype": "Form",
|
|
"id": "voucher_issue_form",
|
|
"options": {
|
|
"cols": 1,
|
|
"title": "发放代金券",
|
|
"padding": "16px",
|
|
"submit_url": "{{entire_url('/voucher/api/instance/voucher_issue.dspy')}}",
|
|
"method": "POST",
|
|
"fields": [
|
|
{
|
|
"name": "template_id",
|
|
"label": "模板ID",
|
|
"uitype": "hide",
|
|
"value": "{{params_kw.get('template_id') or params_kw.get('id') or ''}}"
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"label": "客户机构",
|
|
"uitype": "code",
|
|
"required": true,
|
|
"dataurl": "{{entire_url('/appbase/get_code.dspy')}}",
|
|
"params": {
|
|
"dbname": "{{get_module_dbname('voucher')}}",
|
|
"table": "organization",
|
|
"tblvalue": "id",
|
|
"tbltext": "orgname",
|
|
"valueField": "customer_id",
|
|
"textField": "customer_id_text"
|
|
}
|
|
},
|
|
{
|
|
"name": "source",
|
|
"label": "发放来源",
|
|
"uitype": "code",
|
|
"value": "manual",
|
|
"data": [
|
|
{
|
|
"value": "manual",
|
|
"text": "手动发放"
|
|
},
|
|
{
|
|
"value": "promo",
|
|
"text": "促销活动"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "remark",
|
|
"label": "备注",
|
|
"uitype": "str",
|
|
"placeholder": "可选"
|
|
}
|
|
]
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "submited",
|
|
"actiontype": "script",
|
|
"target": "self",
|
|
"script": "var resp=event.params; var d=null; try{d=await resp.json();}catch(e){d=null;} if(d&&d.widgettype){await bricks.widgetBuild(d,bricks.Body);} if(d&&d.widgettype==='Message'){ var t1=bricks.getWidgetById('voucher_instance_tbl',bricks.app); if(t1){await t1.render({});} var t2=bricks.getWidgetById('voucher_template_tbl',bricks.app); if(t2){await t2.render({});} }"
|
|
}
|
|
]
|
|
}
|