file.ejs 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <% include ./material_sub_menu.ejs %>
  2. <div class="panel-content">
  3. <div class="panel-title">
  4. <div class="title-main d-flex justify-content-between">
  5. <div class="d-flex justify-content-start align-items-center">
  6. <a href="#addfujian" data-toggle="modal" class="btn btn-sm btn-light text-primary" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="添加清单"><i class="fa fa-cloud-upload" aria-hidden="true"></i> 上传附件</a>
  7. <span class="d-flex align-items-center" style="margin-left: 5px;">
  8. <input type="checkbox" id="file-checkbox">
  9. <span class="text-primary" style="margin-left: 5px;">所有期</span>
  10. </span>
  11. </div>
  12. </div>
  13. </div>
  14. <div class="content-wrap">
  15. <div class="c-body">
  16. <div class="sjs-height-0">
  17. <table class="table table-bordered">
  18. <thead>
  19. <tr><th width="50">序号</th><th>名称</th><th width="90">大小</th><th width="90">调差期</th><th width="150">上传时间</th><th width="100">操作</th></tr>
  20. </thead>
  21. <tbody id="file-list">
  22. <% fileList.forEach(function(file, idx){ %>
  23. <tr>
  24. <td><%=idx + 1%></td>
  25. <td><a href="/<%- file.filepath %>" target="_blank"><%=file.file_name%></a></td>
  26. <td><%=file.file_size%></td>
  27. <td>第<%= file.s_order %>期</td>
  28. <td><%=file.upload_time%></td>
  29. <td>
  30. <% if(file.user_id === ctx.session.sessionUser.accountId) { %>
  31. <% if (!ctx.material.curAuditor) { %>
  32. <% if (ctx.material.status === auditConst.status.uncheck && ctx.session.sessionUser.accountId === ctx.material.user_id) { %>
  33. <a href="javascript: void;" class="btn btn-light btn-sm delete-file" title="删除附件" data-attid="<%- file.id %>">
  34. <span class="fa fa-trash text-danger"></span>
  35. </a>
  36. <% } %>
  37. <% if (ctx.material.status === auditConst.status.checkNo && ctx.session.sessionUser.accountId === ctx.material.user_id) { %>
  38. <a href="javascript: void;" class="btn btn-light btn-sm delete-file" title="删除附件" data-attid="<%- file.id %>">
  39. <span class="fa fa-trash text-danger"></span>
  40. </a>
  41. <% } %>
  42. <% } else {%>
  43. <% if(ctx.material.curAuditor.aid === ctx.session.sessionUser.accountId) { %>
  44. <a href="javascript: void;" class="btn btn-light btn-sm delete-file" title="删除附件" data-attid="<%- file.id %>">
  45. <span class="fa fa-trash text-danger"></span>
  46. </a>
  47. <% } %>
  48. <% } %>
  49. <% } %>
  50. </td>
  51. </tr>
  52. <% }) %>
  53. </tbody>
  54. </table>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. <script>
  60. const auditors = JSON.parse('<%- JSON.stringify(auditors) %>');
  61. const curAuditor = JSON.parse('<%- JSON.stringify(ctx.material.curAuditor) %>');
  62. const material = JSON.parse('<%- JSON.stringify(ctx.material) %>');
  63. const auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
  64. const cur_uid = '<%- ctx.session.sessionUser.accountId %>';
  65. const tid = '<%- ctx.tender.id %>';
  66. const mid = '<%- ctx.material.id %>';
  67. const fileList = JSON.parse('<%- JSON.stringify(fileList) %>');
  68. </script>