index.ejs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <% include ../tender/tender_sub_menu.ejs %>
  2. <div class="panel-content">
  3. <div class="panel-title">
  4. <div class="title-main d-flex">
  5. <% include ../tender/tender_sub_mini_menu.ejs %>
  6. <h2>
  7. <% if (planMonth) { %>计划至 <%- planMonth.split('-')[0] %>年<%- parseInt(planMonth.split('-')[1]) %>月 <% } %>
  8. </h2>
  9. <div class="ml-auto">
  10. <a href="/tender/<%- ctx.tender.id %>/schedule/ledger" class="btn btn-sm btn-outline-primary">进度台帐</a>
  11. </div>
  12. </div>
  13. </div>
  14. <div class="content-wrap">
  15. <div class="c-body">
  16. <div class="sjs-height-0">
  17. <div class="m-3">
  18. <!--模式切换-->
  19. <div class="col-12 mb-4">
  20. <ul class="nav nav-tabs justify-content-center">
  21. <li class="nav-item">
  22. <a class="nav-link px-5 py-2" href="#tp" id="tp-tab" data-toggle="tab" role="tab" aria-controls="tp" aria-selected="false">金额模式</a>
  23. </li>
  24. <li class="nav-item">
  25. <a class="nav-link px-5 py-2 active" href="#gcl" id="gcl-tab" data-toggle="tab" role="tab" aria-controls="gcl" aria-selected="true">工程量模式</a>
  26. </li>
  27. </ul>
  28. </div>
  29. <!--金额概况-->
  30. <div class="row mx-0 mb-3 justify-content-center">
  31. <div class="col-auto p-0">
  32. <div class="card text-center">
  33. <div class="card-body">
  34. <h5 class="card-title"><%- scheduleInfo ? ctx.helper.formatNum(scheduleInfo.plan_tp, '#,##0.######') : '' %> <small class="text-danger" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="占设计比例"><%- scheduleInfo && scheduleInfo.total_tp !== 0 && scheduleInfo.plan_tp ? ctx.helper.div(scheduleInfo.plan_tp, scheduleInfo.total_tp)*100 !== 0 ? ctx.helper.round(ctx.helper.div(scheduleInfo.plan_tp, scheduleInfo.total_tp)*100, 0) + '%': '0%' : '0%' %></small></h5>
  35. <p class="card-text text-muted">计划完成金额</p>
  36. </div>
  37. </div>
  38. </div>
  39. <!--<div class="col-auto pr-0">-->
  40. <!--<div class="card text-center">-->
  41. <!--<div class="card-body">-->
  42. <!--<h5 class="card-title">50,000.00 <small class="text-danger" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="占计划比例">5%</small></h5>-->
  43. <!--<p class="card-text text-muted">已完成计划金额</p>-->
  44. <!--</div>-->
  45. <!--</div>-->
  46. <!--</div>-->
  47. <div class="col-auto pr-0">
  48. <div class="card text-center">
  49. <div class="card-body">
  50. <h5 class="card-title"><%- scheduleInfo ? ctx.helper.formatNum(scheduleInfo.sj_tp, '#,##0.######') : '' %> <small class="text-danger" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="占设计比例"><%- scheduleInfo && scheduleInfo.total_tp !== 0 && scheduleInfo.sj_tp ? ctx.helper.round(ctx.helper.div(scheduleInfo.sj_tp, scheduleInfo.total_tp)*100, 0) + '%' : '0%' %></small></h5>
  51. <p class="card-text text-muted">实际完成金额</p>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="tab-content">
  57. <div id="gcl" class="tab-pane fade show active" role="tabpanel" aria-labelledby="gcl-tab">
  58. <!--进度条-->
  59. <div class="mb-3">
  60. <% if (scheduleInfo && scheduleInfo.total_tp !== 0) { %>
  61. 计划金额进度(元)
  62. <div class="progress">
  63. <div class="progress-bar bg-success" style="width:<%- ctx.helper.round(ctx.helper.div(scheduleInfo.plan_tp, scheduleInfo.total_tp)*100, 0) %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="计划完成金额:¥<%- ctx.helper.formatNum(scheduleInfo.plan_tp, '#,##0.######') %>"><%- ctx.helper.round(ctx.helper.div(scheduleInfo.plan_tp, scheduleInfo.total_tp)*100, 0) %>%</div>
  64. <div class="progress-bar bg-gray" style="width:<%- 100 - ctx.helper.round(ctx.helper.div(scheduleInfo.plan_tp, scheduleInfo.total_tp)*100, 0) %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="合同未计划:¥<%- ctx.helper.formatNum(ctx.helper.sub(scheduleInfo.total_tp, scheduleInfo.plan_tp), '#,##0.######') %>"><%- 100 - ctx.helper.round(ctx.helper.div(scheduleInfo.plan_tp, scheduleInfo.total_tp)*100, 0) %>%</div>
  65. </div>
  66. <p class="mt-2 mb-0">实际金额进度哦(元)</p>
  67. <div class="progress">
  68. <div class="progress-bar bg-success" style="width:<%- ctx.helper.round(ctx.helper.div(scheduleInfo.sj_tp, scheduleInfo.total_tp)*100, 0) %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="实际完成金额:¥<%- ctx.helper.formatNum(scheduleInfo.sj_tp, '#,##0.######') %>"><%- ctx.helper.round(ctx.helper.div(scheduleInfo.sj_tp, scheduleInfo.total_tp)*100, 0) %>%</div>
  69. <div class="progress-bar bg-gray" style="width:<%- 100 - ctx.helper.round(ctx.helper.div(scheduleInfo.sj_tp, scheduleInfo.total_tp)*100, 0) %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="合同未完成:¥<%- ctx.helper.formatNum(ctx.helper.sub(scheduleInfo.total_tp, scheduleInfo.sj_tp), '#,##0.######') %>"><%- 100 - ctx.helper.round(ctx.helper.div(scheduleInfo.sj_tp, scheduleInfo.total_tp)*100, 0) %>%</div>
  70. </div>
  71. <% } %>
  72. </div>
  73. <div class="card mb-3">
  74. <div class="card-body">
  75. <h5 class="card-title">完成金额进度表</h5>
  76. <div id="chartContainer4" style="height: 300px; width: 100%;">
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <script src="/public/js/echarts/echarts.min.js"></script>
  88. <% if (scheduleInfo && scheduleInfo.total_tp !== 0) { %>
  89. <script type="text/javascript">
  90. var charts = new Array();
  91. //4 完成金额进度进度//
  92. var myChart = echarts.init(document.getElementById('chartContainer4'));
  93. var option = {
  94. color: ['#e9af68','#57b7b6','#e4575a','#959eac','#6699FF',
  95. '#d38b70','#8fb7cf','#cd5c5c','#ffa500','#40e0d0',
  96. '#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',
  97. '#5c616b','#ff6666','#3cb371','#b8860b','#30e0e0'],
  98. title : {
  99. text: ''
  100. },
  101. tooltip : {
  102. trigger: 'axis'
  103. },
  104. calculable : true,
  105. legend: {
  106. data:['计划完成金额','实际完成金额','实际占设计比例']
  107. },
  108. dataZoom: [
  109. {show: true,start: 0, end: 100}
  110. ],
  111. xAxis : [
  112. {
  113. type : 'category',
  114. splitLine : {show : true},
  115. data : [<% if (scheduleMonth.length > 0) { %>
  116. <% for (const sm of scheduleMonth) { %>
  117. '<%- sm.yearmonth.split('-')[0] %>年<%- parseInt(sm.yearmonth.split('-')[1]) %>月',
  118. <% } %>
  119. <% } %>]
  120. }
  121. ],
  122. yAxis : [
  123. {
  124. type : 'value',
  125. name : '金额',
  126. position:'left',
  127. axisLabel : {
  128. formatter: '{value} 元'
  129. },
  130. splitArea : {show : true}
  131. },
  132. {
  133. type : 'value',
  134. name:'完成度',
  135. axisLabel : {
  136. formatter: '{value} %'
  137. },
  138. position: 'right',
  139. splitArea : {show : true}
  140. }
  141. ],
  142. series : [
  143. {
  144. name:'计划完成金额',
  145. type:'bar',
  146. tooltip : {trigger: 'item',formatter: "{b}<br/>{a}:{c}元"},
  147. stack: '计划',
  148. data:[<% if (scheduleMonth.length > 0) { %>
  149. <% for (const sm of scheduleMonth) { %>
  150. '<%- sm.plan_tp %>',
  151. <% } %>
  152. <% } %>]
  153. },
  154. {
  155. name:'实际完成金额',
  156. type:'bar',
  157. tooltip : {trigger: 'item',formatter: "{b}<br/>{a}:{c}元"},
  158. stack: '实际',
  159. data:[<% if (scheduleMonth.length > 0) { %>
  160. <% for (const sm of scheduleMonth) { %>
  161. '<%- sm.sj_tp %>',
  162. <% } %>
  163. <% } %>]
  164. },
  165. {
  166. name:'实际占合同比例',
  167. type:'line',
  168. tooltip : {trigger: 'axis',formatter: "{b}占合同比例<br/>{a}:{c} %"},
  169. yAxisIndex: 1,
  170. data:[<% if (scheduleMonth.length > 0) { %>
  171. <% for (const sm of scheduleMonth) { %>
  172. '<%- ctx.helper.round(ctx.helper.div(sm.sj_tp, scheduleInfo.total_tp)*100, 2) %>',
  173. <% } %>
  174. <% } %>]
  175. },
  176. ]
  177. };
  178. // 为echarts对象加载数据
  179. myChart.setOption(option);
  180. charts.push(myChart);
  181. </script>
  182. <!--sjs-->
  183. <script>
  184. $(document).ready(function () {
  185. $('a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
  186. for(var i = 0; i < charts.length; i++) {
  187. charts[i].resize();
  188. }
  189. });
  190. })
  191. </script>
  192. <% } %>
  193. <script src="/public/js/sub_menu.js"></script>
  194. <script>
  195. $.subMenu({
  196. menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
  197. toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
  198. key: 'menu.1.0.0',
  199. miniHint: '#sub-mini-hint', hintKey: 'menu.hint.1.0.1',
  200. callback: function (info) {
  201. if (info.mini) {
  202. $('.panel-title').addClass('fluid');
  203. $('#sub-menu').removeClass('panel-sidebar');
  204. } else {
  205. $('.panel-title').removeClass('fluid');
  206. $('#sub-menu').addClass('panel-sidebar');
  207. }
  208. autoFlashHeight();
  209. }
  210. });
  211. </script>