{% set contract_id = params_kw.get('contract_id', '') %} {% set contract_type = params_kw.get('contract_type', 'supply') %} {% if contract_type == 'supply' %} {% set fiid = 'supply_contract_attach' %} {% else %} {% set fiid = 'dist_agreement_attach' %} {% endif %} {% set folder = ensure_contract_folder(request, contract_id, fiid) %} {% set delete_url = entire_url('contract_attach_delete.dspy') %} { "widgettype": "VBox", "options": { "width": "100%", "padding": "8px" }, "subwidgets": [ { "widgettype": "HBox", "options": { "alignItems": "center", "marginBottom": "12px" }, "subwidgets": [ { "widgettype": "Title4", "options": { "fontWeight": "600", "otext": "合同附件", "i18n": true } }, { "widgettype": "Filler" } ] }, { "widgettype": "UiFile", "id": "file_input", "options": { "name": "upfile", "multiple": true, "label": "拖拽文件到此处,或点击选择文件" }, "binds": [{ "wid": "self", "event": "changed", "actiontype": "script", "script": "var files=this.value;if(!files||!files.length)return;var fd=new FormData();fd.append('folderid','{{folder}}');fd.append('fiid','{{fiid}}');for(var i=0;i