list.ejs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <div class="panel-content">
  2. <div class="panel-title fluid">
  3. <div class="title-main d-flex justify-content-between">
  4. <div class="col-4 pl-0">
  5. <div class="d-inline-block"><a href="/construction" class="mr-2"><i class="fa fa-chevron-left mr-2"></i><span>返回</span></a><%- (ctx.constructionTender.name.length > 20 ? ctx.constructionTender.name.substring(0,20) + '...' : ctx.constructionTender.name) %></div>
  6. </div>
  7. <div class="col-3">
  8. <div class="d-inline-block mr-2">
  9. <span>日志状态:</span>
  10. <div class="btn-group pl-0">
  11. <button type="button" class="btn btn-sm btn-light text-primary dropdown-toggle pl-0" data-toggle="dropdown"
  12. id="curReportStatus" data-status="<%- curStatus ? curStatus.status : 0 %>"><% if (curStatus) { %><%- curStatus.statusName %> (<%- curStatus.num %>)<% } else { %>全部<% } %></button>
  13. <div class="dropdown-menu" aria-labelledby="zhankai">
  14. <% if (curStatus) { %>
  15. <a class="dropdown-item to-log-link" href="javascript:void(0);" data-status="0">全部</a>
  16. <% } %>
  17. <% for (const s of statusList) { %>
  18. <% if (!curStatus || (curStatus && curStatus.status !== s.status)) { %>
  19. <a class="dropdown-item to-log-link" href="javascript:void(0);" data-status="<%- s.status %>"><%- s.statusName %> (<%- s.num %>)</a>
  20. <% } %>
  21. <% } %>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="d-inline-block mr-2">
  26. <span>填报人:</span>
  27. <div class="btn-group">
  28. <button type="button" class="btn btn-sm btn-light text-primary dropdown-toggle pl-0" data-toggle="dropdown"
  29. id="curReportUid" data-uid="<%- curReportUser ? curReportUser.uid : 0 %>"><% if (curReportUser) { %><%- curReportUser.user_name %><% } else { %>全部<% } %></button>
  30. <div class="dropdown-menu" aria-labelledby="zhankai">
  31. <% if (curReportUser) { %>
  32. <a class="dropdown-item to-log-link2" href="javascript:void(0);" data-uid="0">全部</a>
  33. <% } %>
  34. <% for (const ru of reportUserList) { %>
  35. <% if (!curReportUser || (curReportUser && curReportUser.uid !== ru.uid)) { %>
  36. <a class="dropdown-item to-log-link2" href="javascript:void(0);" data-uid="<%- ru.uid %>"><%- ru.user_name %></a>
  37. <% } %>
  38. <% } %>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. <div class="ml-auto">
  44. <% if (reportFlag) { %>
  45. <a href="#add-log" data-toggle="modal" data-target="#add-log" class="btn btn-sm btn-primary pull-right">新建日志</a>
  46. <a href="#batch-commit" data-toggle="modal" data-target="#batch-commit" class="btn btn-sm btn-primary pull-right mr-2">批量提交</a>
  47. <% } %>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="content-wrap">
  52. <div class="c-body">
  53. <div class="sjs-height-0">
  54. <table class="table table-bordered">
  55. <thead class="text-center">
  56. <tr>
  57. <th width="10%">日志编号</th>
  58. <th width="20%">创建时间</th>
  59. <th width="20%">时间/周期</th>
  60. <th width="10%">日志类型</th>
  61. <th width="10%">填报人</th>
  62. <th width="10%">审签人</th>
  63. <th width="10%">日志状态</th>
  64. <th width="10%">操作</th>
  65. </tr>
  66. </thead>
  67. <tbody class="text-center">
  68. <% for (const log of logList) { %>
  69. <tr>
  70. <td><a href="/construction/<%- ctx.constructionTender.id %>/log/<%- log.id %>"><%- log.code %></a></td>
  71. <td><%- moment(log.create_time).format('YYYY-MM-DD') %></td>
  72. <td><%- log.period %></td>
  73. <td><%- constructionConst.type[log.type] %></td>
  74. <td><%- log.report_username %></td>
  75. <td><%- log.shenpi_username %></td>
  76. <td><span class="<%- constructionConst.statusClass[log.status] %>"><%- constructionConst.statusString[log.status] %></span></td>
  77. <td>
  78. <% if (ctx.session.sessionUser.accountId === log.shenpi_uid && log.status === constructionConst.status.checking) { %>
  79. <a href="/construction/<%- ctx.constructionTender.id %>/log/<%- log.id %>" class="btn btn-success btn-sm">审签</a>
  80. <% } %>
  81. <% if (ctx.session.sessionUser.accountId === log.report_uid && log.status === constructionConst.status.uncheck) { %>
  82. <a href="/construction/<%- ctx.constructionTender.id %>/log/<%- log.id %>" class="btn btn-primary btn-sm">提交</a>
  83. <a href="#del-bg" data-toggle="modal" data-target="#del-bg" data-id="<%- log.id %>" class="btn btn-outline-danger btn-sm delete-log-a">删除</a>
  84. <% } %>
  85. </td>
  86. </tr>
  87. <% } %>
  88. </tbody>
  89. </table>
  90. <% include ../layout/page.ejs %>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <script>
  96. const tender_id = <%- ctx.constructionTender.id %>;
  97. const reportFlag = <%- reportFlag %>;
  98. <% if (reportFlag) { %>
  99. const dateCodeList = JSON.parse(unescape('<%- escape(JSON.stringify(dateCodeList)) %>'));
  100. <% } %>
  101. </script>