index.ejs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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 active" href="#tp" id="tp-tab" data-toggle="tab" role="tab" aria-controls="tp" aria-selected="true">金额模式</a>
  23. </li>
  24. <li class="nav-item">
  25. <a class="nav-link px-5 py-2" href="#gcl" id="gcl-tab" data-toggle="tab" role="tab" aria-controls="gcl" aria-selected="false">工程量模式</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 ? ctx.helper.round(ctx.helper.div(scheduleInfo.plan_tp, scheduleInfo.total_tp)*100, 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 ? ctx.helper.round(ctx.helper.div(scheduleInfo.sj_tp, scheduleInfo.total_tp)*100, 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="tp" class="tab-pane fade show active" role="tabpanel" aria-labelledby="tp-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 id="gcl" class="tab-pane fade" role="tabpanel" aria-labelledby="gcl-tab">
  82. <div class="mb-3">
  83. <% if (scheduleInfo && scheduleInfo.total_gcl !== 0) { %>
  84. 计划工程量进度
  85. <div class="progress">
  86. <div class="progress-bar bg-info" style="width:<%- ctx.helper.round(ctx.helper.div(scheduleInfo.plan_gcl, scheduleInfo.total_gcl)*100, 0) %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="计划完成工程量:¥<%- ctx.helper.formatNum(scheduleInfo.plan_gcl, '#,##0.######') %>"><%- ctx.helper.round(ctx.helper.div(scheduleInfo.plan_gcl, scheduleInfo.total_gcl)*100, 0) %>%</div>
  87. <div class="progress-bar bg-gray" style="width:<%- 100 - ctx.helper.round(ctx.helper.div(scheduleInfo.plan_gcl, scheduleInfo.total_gcl)*100, 0) %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="合同未计划:¥<%- ctx.helper.formatNum(ctx.helper.sub(scheduleInfo.total_gcl, scheduleInfo.plan_gcl), '#,##0.######') %>"><%- 100 - ctx.helper.round(ctx.helper.div(scheduleInfo.plan_gcl, scheduleInfo.total_gcl)*100, 0) %>%</div>
  88. </div>
  89. <p class="mt-2 mb-0">实际工程量进度</p>
  90. <div class="progress">
  91. <div class="progress-bar bg-info" style="width:<%- ctx.helper.round(ctx.helper.div(scheduleInfo.sj_gcl, scheduleInfo.total_gcl)*100, 0) %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="实际完成工程量:¥<%- ctx.helper.formatNum(scheduleInfo.sj_gcl, '#,##0.######') %>"><%- ctx.helper.round(ctx.helper.div(scheduleInfo.sj_gcl, scheduleInfo.total_gcl)*100, 0) %>%</div>
  92. <div class="progress-bar bg-gray" style="width:<%- 100 - ctx.helper.round(ctx.helper.div(scheduleInfo.sj_gcl, scheduleInfo.total_gcl)*100, 0) %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="合同未完成:¥<%- ctx.helper.formatNum(ctx.helper.sub(scheduleInfo.total_gcl, scheduleInfo.sj_gcl), '#,##0.######') %>"><%- 100 - ctx.helper.round(ctx.helper.div(scheduleInfo.sj_gcl, scheduleInfo.total_gcl)*100, 0) %>%</div>
  93. </div>
  94. <% } %>
  95. </div>
  96. <!--图表-->
  97. <div class="card mb-3">
  98. <div class="card-body">
  99. <h5 class="card-title">工程量进度表</h5>
  100. <div id="chartContainer3" style="height: 300px; width: 100%;">
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. <script src="/public/js/echarts/echarts.min.js"></script>
  112. <% if (scheduleInfo && scheduleInfo.total_tp !== 0 && scheduleInfo.total_gcl !== 0) { %>
  113. <script type="text/javascript">
  114. var charts = new Array();
  115. //计划进度//
  116. // 基于准备好的dom,初始化echarts图表
  117. var myChart2 = echarts.init(document.getElementById('chartContainer3'));
  118. var option2 = {
  119. color: ['#d38b70','#8fb7cf','#cd5c5c','#ffa500','#40e0d0',
  120. '#17a2b8','#28a745','#e4575a','#959eac','#6699FF',
  121. '#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',
  122. '#5c616b','#ff6666','#3cb371','#b8860b','#30e0e0'],
  123. title : {
  124. text: ''
  125. },
  126. tooltip : {
  127. trigger: 'axis'
  128. },
  129. calculable : true,
  130. legend: {
  131. data:['计划完成工程量','实际完成工程量','实际占设计比例']
  132. },
  133. dataZoom: [
  134. {show: true,start: 0, end: 100}
  135. ],
  136. xAxis : [
  137. {
  138. type : 'category',
  139. splitLine : {show : true},
  140. data : [<% if (scheduleMonth.length > 0) { %>
  141. <% for (const sm of scheduleMonth) { %>
  142. '<%- sm.yearmonth.split('-')[0] %>年<%- parseInt(sm.yearmonth.split('-')[1]) %>月',
  143. <% } %>
  144. <% } %>],
  145. }
  146. ],
  147. yAxis : [
  148. {
  149. type : 'value',
  150. name : '工程量',
  151. position:'left',
  152. axisLabel : {
  153. formatter: '{value}'
  154. },
  155. splitArea : {show : true}
  156. },
  157. {
  158. type : 'value',
  159. name:'完成度',
  160. axisLabel : {
  161. formatter: '{value} %'
  162. },
  163. position: 'right',
  164. splitArea : {show : true}
  165. }
  166. ],
  167. series : [
  168. {
  169. name:'计划完成工程量',
  170. type:'bar',
  171. tooltip : {trigger: 'item',formatter: "{b}<br/>{a}:{c}"},
  172. stack: '计划',
  173. data:[<% if (scheduleMonth.length > 0) { %>
  174. <% for (const sm of scheduleMonth) { %>
  175. '<%- sm.plan_gcl %>',
  176. <% } %>
  177. <% } %>]
  178. },
  179. {
  180. name:'实际完成工程量',
  181. type:'bar',
  182. tooltip : {trigger: 'item',formatter: "{b}<br/>{a}:{c}"},
  183. stack: '实际',
  184. data:[<% if (scheduleMonth.length > 0) { %>
  185. <% for (const sm of scheduleMonth) { %>
  186. '<%- sm.sj_gcl %>',
  187. <% } %>
  188. <% } %>]
  189. },
  190. {
  191. name:'实际占设计比例',
  192. type:'line',
  193. tooltip : {trigger: 'axis',formatter: "{b}占合同比例<br/>{a}:{c} %"},
  194. yAxisIndex: 1,
  195. data:[<% if (scheduleMonth.length > 0) { %>
  196. <% for (const sm of scheduleMonth) { %>
  197. '<%- ctx.helper.round(ctx.helper.div(sm.sj_gcl, scheduleInfo.total_gcl)*100, 2) %>',
  198. <% } %>
  199. <% } %>]
  200. },
  201. ]
  202. };
  203. // 为echarts对象加载数据
  204. myChart2.setOption(option2);
  205. charts.push(myChart2);
  206. //4 完成金额进度进度//
  207. var myChart = echarts.init(document.getElementById('chartContainer4'));
  208. var option = {
  209. color: ['#e9af68','#57b7b6','#e4575a','#959eac','#6699FF',
  210. '#d38b70','#8fb7cf','#cd5c5c','#ffa500','#40e0d0',
  211. '#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',
  212. '#5c616b','#ff6666','#3cb371','#b8860b','#30e0e0'],
  213. title : {
  214. text: ''
  215. },
  216. tooltip : {
  217. trigger: 'axis'
  218. },
  219. calculable : true,
  220. legend: {
  221. data:['计划完成金额','实际完成金额','实际占设计比例']
  222. },
  223. dataZoom: [
  224. {show: true,start: 0, end: 100}
  225. ],
  226. xAxis : [
  227. {
  228. type : 'category',
  229. splitLine : {show : true},
  230. data : [<% if (scheduleMonth.length > 0) { %>
  231. <% for (const sm of scheduleMonth) { %>
  232. '<%- sm.yearmonth.split('-')[0] %>年<%- parseInt(sm.yearmonth.split('-')[1]) %>月',
  233. <% } %>
  234. <% } %>]
  235. }
  236. ],
  237. yAxis : [
  238. {
  239. type : 'value',
  240. name : '金额',
  241. position:'left',
  242. axisLabel : {
  243. formatter: '{value} 元'
  244. },
  245. splitArea : {show : true}
  246. },
  247. {
  248. type : 'value',
  249. name:'完成度',
  250. axisLabel : {
  251. formatter: '{value} %'
  252. },
  253. position: 'right',
  254. splitArea : {show : true}
  255. }
  256. ],
  257. series : [
  258. {
  259. name:'计划完成金额',
  260. type:'bar',
  261. tooltip : {trigger: 'item',formatter: "{b}<br/>{a}:{c}元"},
  262. stack: '计划',
  263. data:[<% if (scheduleMonth.length > 0) { %>
  264. <% for (const sm of scheduleMonth) { %>
  265. '<%- sm.plan_tp %>',
  266. <% } %>
  267. <% } %>]
  268. },
  269. {
  270. name:'实际完成金额',
  271. type:'bar',
  272. tooltip : {trigger: 'item',formatter: "{b}<br/>{a}:{c}元"},
  273. stack: '实际',
  274. data:[<% if (scheduleMonth.length > 0) { %>
  275. <% for (const sm of scheduleMonth) { %>
  276. '<%- sm.sj_tp %>',
  277. <% } %>
  278. <% } %>]
  279. },
  280. {
  281. name:'实际占合同比例',
  282. type:'line',
  283. tooltip : {trigger: 'axis',formatter: "{b}占合同比例<br/>{a}:{c} %"},
  284. yAxisIndex: 1,
  285. data:[<% if (scheduleMonth.length > 0) { %>
  286. <% for (const sm of scheduleMonth) { %>
  287. '<%- ctx.helper.round(ctx.helper.div(sm.sj_tp, scheduleInfo.total_tp)*100, 2) %>',
  288. <% } %>
  289. <% } %>]
  290. },
  291. ]
  292. };
  293. // 为echarts对象加载数据
  294. myChart.setOption(option);
  295. charts.push(myChart);
  296. </script>
  297. <!--sjs-->
  298. <script>
  299. $(document).ready(function () {
  300. $('a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
  301. for(var i = 0; i < charts.length; i++) {
  302. charts[i].resize();
  303. }
  304. });
  305. })
  306. </script>
  307. <% } %>
  308. <script src="/public/js/sub_menu.js"></script>
  309. <script>
  310. $.subMenu({
  311. menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
  312. toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
  313. key: 'menu.1.0.0',
  314. miniHint: '#sub-mini-hint', hintKey: 'menu.hint.1.0.1',
  315. callback: function (info) {
  316. if (info.mini) {
  317. $('.panel-title').addClass('fluid');
  318. $('#sub-menu').removeClass('panel-sidebar');
  319. } else {
  320. $('.panel-title').removeClass('fluid');
  321. $('#sub-menu').addClass('panel-sidebar');
  322. }
  323. autoFlashHeight();
  324. }
  325. });
  326. </script>