{% set amount = test_pricing(params_kw.id, params_kw) %} {% set ppt = get_pricing_program_timeing(params_kw.id) %} {% if ppt %} { "widgettype": "Form", "options": { "width": "100%", "height": "100%", "fields": [ {% if amount is not None %} { "name": amoumt, "label": "价格", "value": {{amount}}, "uitype": "float" }, {% endif %} {% for f,spec in ppt.pricing_data.fields.items() %} { {% if params_kw.get(f) %} "value": "{{params_kw.get(f)}}", {% endif %} "name": "{{f}}, "label": "{{spec.label}}", "uitype": "{{spec.type}}" } {% if not loop.last %},{% endif %} {% endfor %} ] }, "binds":[ { "wid": "self", "event": "submit", "actiontype": "urlwidget", "target": "self", "options": { "params": { "id": "{{params_kw.id}}" }, "method": "POST", "url": "{{entire_url('pricing_test.ui')}}" } } ] } {% else %} { "widgettype": "Text", "options": { "i18n": true, "otext": "定价时序数据没找到", "wrap": true, "halign": "left", "width": "100%", "height": "100%" } } {% endif %}