supplychain/wwwroot/api/contract_attach.ui
yumoqing 1f06a23fa3 fix: 附件上传改用 Form submit_url (multipart) + UiFile multiple
Form submit_url 直接POST到 filemgr, 支持multipart文件上传
UiFile multiple: true 浏览器原生支持拖拽
去掉无用的按钮+toolbar
2026-07-03 16:37:26 +08:00

65 lines
2.3 KiB
XML

{% 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) %}
{
"widgettype": "VBox",
"options": {
"width": "100%",
"padding": "8px"
},
"subwidgets": [
{
"widgettype": "Title4",
"options": {
"fontWeight": "600",
"otext": "合同附件",
"i18n": true,
"marginBottom": "8px"
}
},
{
"widgettype": "Form",
"id": "upload_form",
"options": {
"submit_url": "{{entire_url('/filemgr/upload_file.dspy')}}",
"fields": [
{"name": "folderid", "uitype": "hide", "value": "{{folder}}"},
{"name": "fiid", "uitype": "hide", "value": "{{fiid}}"},
{"name": "upfile", "uitype": "file", "multiple": true, "label": "选择文件"}
],
"buttons": [
{"name": "submit", "label": "上传", "css": "primary"}
]
}
},
{
"widgettype": "Tabular",
"id": "attach_tbl",
"options": {
"css": "card",
"width": "100%",
"height": "auto",
"data_url": "{{entire_url('contract_attach_list.dspy')}}?folderid={{folder}}&fiid={{fiid}}",
"data_method": "GET",
"page_rows": 50,
"row_options": {
"browserfields": {
"exclouded": [],
"cwidth": {}
},
"fields": [
{"name": "filename", "title": "文件名", "type": "str", "uitype": "str", "label": "文件名", "cwidth": 28},
{"name": "filesize", "title": "大小(KB)", "type": "str", "uitype": "str", "label": "大小", "cwidth": 10},
{"name": "filetype", "title": "类型", "type": "str", "uitype": "str", "label": "类型", "cwidth": 8}
]
}
}
}
]
}