inspection_overview.ejs 6.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <% include ./sub_menu.ejs %>
  2. <% const inspectionUrl = '/sp/' + ctx.subProject.id + '/quality/tender/' + ctx.tender.id + '/inspection'; %>
  3. <div class="panel-content quality-inspection-overview" data-inspection-url="<%= inspectionUrl %>">
  4. <div class="panel-title">
  5. <div class="title-main d-flex">
  6. <% include ./sub_mini_menu.ejs %>
  7. <div>巡检概况</div>
  8. </div>
  9. </div>
  10. <div class="content-wrap">
  11. <div class="c-body p-3">
  12. <div class="row mb-3">
  13. <div class="col-md-5 mb-3 mb-md-0">
  14. <div class="card h-100">
  15. <div class="card-header d-flex align-items-center">
  16. <strong>整改中(<%= overview.counts.rectification %>)</strong>
  17. <a class="ml-auto" href="<%= inspectionUrl %>/rectification">查看全部</a>
  18. </div>
  19. <div class="overview-rectifications">
  20. <table class="table table-sm table-hover mb-0">
  21. <thead>
  22. <tr>
  23. <th class="overview-inspection-column">巡检</th>
  24. <th>待完成整改人</th>
  25. <th class="text-center overview-progress-column">进度</th>
  26. <th class="text-center overview-days-column">已持续</th>
  27. </tr>
  28. </thead>
  29. <tbody>
  30. <% overview.rectifications.forEach(item => { %>
  31. <tr>
  32. <td>
  33. <a href="<%= inspectionUrl %>/<%= item.id %>/information"><%= item.code || '查看巡检' %></a>
  34. <div class="text-muted text-truncate" title="<%= item.check_item %>"><%= item.check_item || '-' %></div>
  35. </td>
  36. <td><%= item.pendingUsers.length ? item.pendingUsers.join('、') : '-' %></td>
  37. <td class="text-center"><%= item.total ? '已完成 ' + item.done + '/' + item.total : '-' %></td>
  38. <td class="text-center"><span class="badge badge-light"><%= item.elapsedDays === null ? '-' : item.elapsedDays === 0 ? '今天' : item.elapsedDays + '天' %></span></td>
  39. </tr>
  40. <% }); %>
  41. <% if (!overview.rectifications.length) { %>
  42. <tr><td colspan="4" class="text-center text-muted py-5">暂无正在整改的巡检</td></tr>
  43. <% } %>
  44. </tbody>
  45. </table>
  46. </div>
  47. <div class="card-footer text-muted small">
  48. 按本轮整改持续时间排序<%= overview.counts.rectification > 10 ? ',展示前10条' : '' %>。
  49. </div>
  50. </div>
  51. </div>
  52. <div class="col-md-7">
  53. <div class="card h-100">
  54. <div class="card-header"><strong>巡检状态分布</strong></div>
  55. <div class="card-body">
  56. <% if (overview.total) { %>
  57. <div id="quality-overview-pie" class="overview-pie" role="img" aria-label="巡检状态分布:整改中<%= overview.counts.rectification %>,审批中<%= overview.counts.report + overview.counts.reply %>,已完成<%= overview.counts.completed %>"></div>
  58. <% } else { %>
  59. <div class="overview-pie d-flex align-items-center justify-content-center text-muted">暂无巡检状态数据</div>
  60. <% } %>
  61. <div class="overview-status-links d-flex justify-content-around text-center">
  62. <a href="<%= inspectionUrl %>/rectification">整改中 <strong><%= overview.counts.rectification %></strong></a>
  63. <div class="dropdown">
  64. <button id="quality-overview-approval" type="button" class="btn btn-link btn-sm dropdown-toggle p-0" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">审批中 <strong><%= overview.counts.report + overview.counts.reply %></strong></button>
  65. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="quality-overview-approval">
  66. <a class="dropdown-item" href="<%= inspectionUrl %>?status=2">上报审批(<%= overview.counts.report %>)</a>
  67. <a class="dropdown-item" href="<%= inspectionUrl %>/approval">批复审批(<%= overview.counts.reply %>)</a>
  68. </div>
  69. </div>
  70. <a href="<%= inspectionUrl %>?status=3">已完成 <strong><%= overview.counts.completed %></strong></a>
  71. </div>
  72. </div>
  73. <div class="card-footer text-muted small">审批中包含上报审批和批复审批,占比以这三类巡检合计为基数。</div>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="card mb-3">
  78. <div class="card-header d-flex align-items-center">
  79. <strong>巡检完成趋势</strong>
  80. </div>
  81. <div class="card-body">
  82. <% if (!overview.trend.hasData) { %><p class="text-center text-muted mb-0"><%= overview.trend.year %>年暂无提交或完成巡检记录</p><% } %>
  83. <div id="quality-overview-trend" class="overview-trend" role="img" aria-label="<%= overview.trend.year %>年提交巡检、完成巡检及完成占比趋势"></div>
  84. </div>
  85. <div class="card-footer text-muted small">
  86. <div>提交巡检按实际首次提交月份统计,退回重报不重复计数;完成巡检按整张巡检单最终完成月份统计。</div>
  87. <div>完成占比=完成巡检 ÷ 提交巡检 × 100%;按当月统计,当月无提交巡检时显示0%。</div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <script>
  94. const qualityInspectionOverview = JSON.parse(unescape('<%- escape(JSON.stringify({ statuses: overview.statuses, total: overview.total, trend: overview.trend })) %>'));
  95. </script>