uploadCustomCdrInfo.zml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <#-- 主题变量和函数定义 -->
  2. <#include "/ztmpl/zhiqim_manager/"+themeMain+"/define.htm"/>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>${context.getContextName()}</title>
  7. <meta charset="UTF-8">
  8. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  9. ${Styles.src(zhiqim.css)}
  10. ${Scripts.src(zhiqim.js)}
  11. ${Styles.src(zmr_theme.css)}
  12. ${Styles.src(context.getRootPath("/zinc/layui/css/layui.css"))}
  13. ${Scripts.src(context.getRootPath("/zinc/layui/layui.js"))}
  14. </head>
  15. <body>
  16. <script>
  17. var hostUrl = Z.l.protocol+'//'+Z.l.host;
  18. layui.use(['upload', 'element', 'layer'], function(){
  19. var $ = layui.jquery
  20. ,upload = layui.upload
  21. ,element = layui.element
  22. ,layer = layui.layer;
  23. //拖拽上传
  24. upload.render({
  25. elem: '#test10'
  26. ,url: hostUrl+'/uploadCustomFilesInfo.htm?oid='+${oid}
  27. ,accept: 'file'
  28. ,size:51200
  29. ,multiple:true
  30. ,number:0
  31. ,allDone: function(obj){ //当文件全部被提交后,才触发
  32. $("#uploadTotal").empty();
  33. $("#uploadSuccessful").empty();
  34. $("#uploadAborted").empty();
  35. $("#uploadTotal").append(obj.total);
  36. $("#uploadSuccessful").append(obj.successful);
  37. $("#uploadAborted").append(obj.aborted);
  38. }
  39. ,before: function(obj){
  40. window.ajaxLoading = Z.loading({text:"正在上传中,请稍后...", shadow:true , width:300});
  41. }
  42. ,done: function(res){
  43. ajaxLoading.close();
  44. if(res.code == 0)
  45. {
  46. layer.msg('上传成功');
  47. }
  48. else
  49. {
  50. layer.msg(res.msg);
  51. }
  52. }
  53. , error: function (res) {
  54. //请求异常回调
  55. layer.closeAll('loading');
  56. console.error(res);
  57. }
  58. });
  59. });
  60. </script>
  61. <input type="hidden" id="oid" name="oid" value="${order.getOid()}">
  62. <table class="z-table z-bordered z-pd6 z-bg-white zi-bd-b-none">
  63. <tr style="height:35px" bgcolor="${zmr_thead_bgcolor}">
  64. <td class="z-text-left z-w50p">客户素材</td>
  65. </tr>
  66. <tr valign="top" >
  67. <td>
  68. <div class="layui-upload-drag" id="test10" style="width: 100%;height: 240px;">
  69. <i class="layui-icon"></i>
  70. <p>点击上传或拖拽资料素材到此处</p>
  71. </div><br/><br/>
  72. 共上传:<strong id="uploadTotal" style="color: #009688;">0</strong>个&nbsp;&nbsp;
  73. 成功:<strong id="uploadSuccessful" style="color: #5FB878;">0</strong>个&nbsp;&nbsp;
  74. 失败:<strong id="uploadAborted" style="color: #FF5722;">0</strong>个
  75. </td>
  76. </tr>
  77. </table>
  78. <div class="z-absolute z-w100p z-h60 z-text-center z-bg-gray z-pd10" style="bottom:0;left:0">
  79. <button type="button" class="z-button z-large z-mg-l20" onclick="parent.Z.Dialog.close(location.hash);">关闭</button>
  80. </div>
  81. </body>
  82. </html>