tender.ejs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
  6. <meta http-equiv="x-ua-compatible" content="ie=edge">
  7. <title>标段概况-计量支付</title>
  8. <link rel="stylesheet" href="/public/css/bootstrap/bootstrap.min.css">
  9. <link rel="stylesheet" href="/public/css/wap/main.css">
  10. <link rel="stylesheet" href="/public/css/toast.css">
  11. <link rel="stylesheet" href="/public/css/font-awesome/font-awesome.min.css">
  12. <script src=/public/js/echarts/echarts.min.js></script>
  13. <link rel="shortcut icon" href="/public/images/favicon.ico">
  14. <style>
  15. body {
  16. padding: 0;
  17. }
  18. .tab-content > .tab-pane,.pill-content > .pill-pane {
  19. display: block;
  20. height: 0;
  21. overflow-y: hidden;
  22. }
  23. .tab-content > .active,.pill-content > .active {
  24. height: auto;
  25. }
  26. </style>
  27. </head>
  28. <body>
  29. <div class="container">
  30. <!--顶部-->
  31. <nav class="fixed-top bg-dark">
  32. <div class="my-2 d-flex justify-content-between">
  33. <span class="text-white ml-3"><a href="/wap/list" class="mr-2 text-white show-loading"><i class="fa fa-chevron-left"></i>标段概况</a></span>
  34. <a tabindex="0" href="javascript:void(0)" class="text-white text-truncate text-center"
  35. style="width:150px" data-toggle="popover" data-placement="top"
  36. data-content="<%- tender.name %>" data-trigger="focus"><%- tender.name %></a>
  37. <div class="mr-3">
  38. <div class="dropdown">
  39. <button class="btn btn-sm btn-light dropdown-toggle" type="button" data-toggle="dropdown">
  40. <%- ctx.session.sessionUser.name.substr(ctx.session.sessionUser.name.length > 2 ? ctx.session.sessionUser.name.length - 2 : 0) %>
  41. </button>
  42. <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
  43. <a class="dropdown-item" href="/wap/logout">退出登录</a>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </nav>
  49. <!--标段概况-->
  50. <div class="py-6">
  51. <!--标签-->
  52. <ul class="nav nav-tabs nav-fill">
  53. <li class="nav-item">
  54. <a class="px-1 nav-link active" data-toggle="tab" href="#gaikuang" role="tab">概况</a>
  55. </li>
  56. <li class="nav-item">
  57. <a class="px-1 nav-link" data-toggle="tab" href="#yufukuan" role="tab">预付款</a>
  58. </li>
  59. <li class="nav-item">
  60. <a class="px-1 nav-link" data-toggle="tab" href="#tzxiuding" role="tab">台帐修订</a>
  61. </li>
  62. <li class="nav-item">
  63. <a class="px-1 nav-link" data-toggle="tab" href="#jlqi" role="tab">计量期</a>
  64. </li>
  65. <li class="nav-item">
  66. <a class="px-1 nav-link" data-toggle="tab" href="#biangeng" role="tab">工程变更</a>
  67. </li>
  68. </ul>
  69. <div class="tab-content">
  70. <div class="tab-pane active" id="gaikuang">
  71. <!--图表-->
  72. <div class="card mb-3 mr-1 mt-3">
  73. <div class="card-body">
  74. <h5 class="card-title">期进度表</h5>
  75. <div style="overflow-x:scroll;padding-bottom: 10px">
  76. <div id="chartContainer4" style="height: 300px; width: 250%;">
  77. </div>
  78. </div>
  79. <p class="text-center text-muted m-0">左右滑动</p>
  80. </div>
  81. </div>
  82. <div class="card mb-3 mr-1">
  83. <div class="card-body">
  84. <h5 class="card-title">月进度表</h5>
  85. <div style="overflow-x:scroll;padding-bottom: 10px">
  86. <div id="chartContainer3" style="height: 300px; width: 320%;">
  87. </div>
  88. </div>
  89. <p class="text-center text-muted m-0">左右滑动</p>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="tab-pane" id="yufukuan">
  94. <% for (const t of advanceConst.typeCol) { %>
  95. <div class="card my-3">
  96. <div class="card-body">
  97. <a href="/wap/tender/<%- tender.id %>/advance#<%- t.key %>"><h5 class="card-title d-flex justify-content-between"><%- t.name %><span><% if (advanceList[t.type]) { %>第<%- advanceList[t.type].order %>期<% } %></span></h5></a>
  98. </div>
  99. </div>
  100. <% } %>
  101. </div>
  102. <div class="tab-pane" id="tzxiuding">
  103. <dl class="mb-2 mt-3">
  104. <% for (const lr of revises) { %>
  105. <dt class="bg-light p-2 d-flex justify-content-between"><span>第<%- lr.corder %>次修订</span>
  106. <% if (!lr.valid) {%>
  107. <span class="text-danger">
  108. 作废
  109. </span>
  110. <% } else { %>
  111. <span class="<%- auditReviseConst.auditStringClass[lr.status] %>">
  112. <% if (lr.curAuditor && lr.status !== auditReviseConst.status.checked) { %>
  113. <%- lr.curAuditor.name %><%if (lr.curAuditor.role !== '' && lr.curAuditor.role !== null) { %>-<%- lr.curAuditor.role %><% } %>
  114. <% } %>
  115. <%- lr.status === auditReviseConst.status.checked ? '审批完成' : auditReviseConst.auditProgress[lr.status] %>
  116. </span>
  117. <% } %>
  118. </dt>
  119. <dd>
  120. <table class="table table-hover">
  121. <tr><td width="90">修订时间</td><td><%- ctx.moment(lr.in_time).format('YYYY-MM-DD') %></td></tr>
  122. <tr><td>修订人</td><td><%- lr.user_name %></td></tr>
  123. <tr><td>修订详情</td><td><% if (lr.content) { %><% if (lr.content.length <= 22) { %><%- lr.content %><% } else { %><%- lr.content.substring(0,22) %><a class="show-content" data-content="<%- lr.content %>" href="javascript:void(0);">展开更多</a><% } %><% } %></td></tr>
  124. <% if (lr.curAuditor && lr.status == auditReviseConst.status.checking && lr.curAuditor.audit_id === ctx.session.sessionUser.accountId) { %>
  125. <tr>
  126. <td colspan="2">
  127. <a class="btn btn-block btn-success" href="/wap/tender/<%- tender.id %>/revise/<%- lr.id %>/info">审批</a>
  128. </td>
  129. </tr>
  130. <% } %>
  131. </table>
  132. </dd>
  133. <% } %>
  134. </dl>
  135. </div>
  136. <div class="tab-pane" id="jlqi">
  137. <!--期列表-->
  138. <dl class="mb-2 mt-3">
  139. <% for (const s of stages) { %>
  140. <dt class="bg-light p-2 d-flex justify-content-between"><span>第<%- s.order %>期</span>
  141. <span class="<%- auditConst.auditStringClass[s.status] %>">
  142. <% if (s.curAuditor && s.status !== auditConst.status.checked) { %>
  143. <%- s.curAuditor.name %><%if (s.curAuditor.role !== '' && s.curAuditor.role !== null) { %>-<%- s.curAuditor.role %><% } %>
  144. <% } %>
  145. <%- s.status === auditConst.status.checked ? '审批完成' : auditConst.auditProgress[s.status] %>
  146. </span>
  147. </dt>
  148. <dd>
  149. <table class="table table-hover">
  150. <tbody><tr>
  151. <td>
  152. <p class="mb-0">本期合同计量</p>
  153. <b>¥<%- s.contract_tp ? s.contract_tp : 0 %></b>
  154. </td>
  155. <td>
  156. <p class="mb-0">本期数量变更计量</p>
  157. <b>¥<%- s.qc_tp ? s.qc_tp : 0 %></b>
  158. </td>
  159. </tr>
  160. <tr>
  161. <td>
  162. <p class="mb-0">本期完成计量</p>
  163. <b>¥<%- s.tp ? s.tp : 0 %></b>
  164. </td>
  165. <td>
  166. <p class="mb-0">截止上期完成计量</p>
  167. <b>¥<%- s.pre_tp ? s.pre_tp : 0 %></b>
  168. </td>
  169. </tr>
  170. <tr>
  171. <td>
  172. <p class="mb-0">截止本期完成计量</p>
  173. <b>¥<%- s.end_tp ? s.end_tp : 0 %></b>
  174. </td>
  175. <td>
  176. <p class="mb-0">本期应付</p>
  177. <b>¥<%- s.yf_tp ? s.yf_tp : 0 %></b>
  178. </td>
  179. </tr>
  180. <% if (s.curAuditor && s.status == auditConst.status.checking && s.curAuditor.aid === ctx.session.sessionUser.accountId) { %>
  181. <tr>
  182. <td colspan="2">
  183. <a class="btn btn-block btn-success" href="/wap/tender/<%- s.tid %>/stage/<%- s.order %>">审批本期</a>
  184. </td>
  185. </tr>
  186. <% } %>
  187. </tbody></table>
  188. </dd>
  189. <% } %>
  190. </dl>
  191. </div>
  192. <div class="tab-pane" id="biangeng">
  193. <!--工程变更-->
  194. <dl class="mb-2 mt-3">
  195. <% for (const c of changes) { %>
  196. <dt class="bg-light p-2 d-flex justify-content-between"><span><a href="/wap/tender/<%- tender.id %>/change/<%- c.cid %>/info"><% if (c.status !== auditChangeConst.status.checked) { %><%- c.code %><% } else { %><%- c.p_code %><% } %></a></span></dt>
  197. <dd>
  198. <table class="table table-hover">
  199. <tbody>
  200. <tr>
  201. <td colspan="2">
  202. <p class="mb-0">工程名称</p>
  203. <%- c.name %>
  204. </td>
  205. </tr>
  206. <tr>
  207. <td>
  208. <p class="mb-0">变更性质</p>
  209. <b><% for (const q in changeConst.quality) { %>
  210. <% const cQuality = changeConst.quality[q] %><% if (cQuality.value === c.quality) { %><%- cQuality.name %><% } %><% } %></b>
  211. </td>
  212. <td>
  213. <p class="mb-0">变更金额</p>
  214. <b><%- ctx.helper.roundNum(c.total_price, tpUnit) %></b>
  215. </td>
  216. </tr>
  217. <tr>
  218. <td colspan="2">
  219. <% if ((c.status === auditChangeConst.status.checking || c.status === auditChangeConst.status.backnew) && c.curAuditor.uid === ctx.session.sessionUser.accountId) { %>
  220. <a href="/wap/tender/<%- tender.id %>/change/<%- c.cid %>/info#shenpi" class="btn btn-block btn-success">审批变更</a>
  221. <% } else if (c.status === auditChangeConst.status.uncheck) { %>
  222. <span>待上报</span>
  223. <% } else { %>
  224. <span class="<%- auditChangeConst.auditStatusClass[c.curAuditor.status] %>"><%- c.curAuditor.name %>-<%- c.curAuditor.jobs %> <%- auditChangeConst.auditStatusString[c.curAuditor.status] %></span>
  225. <% } %>
  226. </td>
  227. </tr>
  228. </tbody>
  229. </table>
  230. </dd>
  231. <% } %>
  232. </dl>
  233. </div>
  234. </div>
  235. </div>
  236. <!--底栏菜单-->
  237. <nav class="fixed-bottom navbar-dark bg-light border-top">
  238. <ul class="nav nav-fill my-2">
  239. <li class="nav-item">
  240. <a class="nav-link text-muted show-loading" href="/wap/dashboard"><i class="fa fa-check-square-o"></i> 待审批</a>
  241. </li>
  242. <li class="nav-item">
  243. <a class="nav-link active show-loading" href="/wap/list"><i class="fa fa-list-ul"></i> 项目</a>
  244. </li>
  245. </ul>
  246. </nav>
  247. </div>
  248. <!-- JS. -->
  249. <script src="/public/js/jquery/jquery-3.2.1.min.js"></script>
  250. <script src="/public/js/popper/popper.min.js"></script>
  251. <script src="/public/js/bootstrap/bootstrap.min.js"></script>
  252. <script src="/public/js/cookies.js"></script>
  253. <script src="/public/js/wap/global.js"></script>
  254. <script type="text/javascript">
  255. //4 标段期数计量进度//
  256. var myChart = echarts.init(document.getElementById('chartContainer4'));
  257. var option = {
  258. color: ['#e9af68','#57b7b6','#e4575a','#959eac','#6699FF',
  259. '#d38b70','#8fb7cf','#cd5c5c','#ffa500','#40e0d0',
  260. '#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',
  261. '#5c616b','#ff6666','#3cb371','#b8860b','#30e0e0'],
  262. title : {
  263. text: ''
  264. },
  265. tooltip : {
  266. trigger: 'axis'
  267. },
  268. calculable : true,
  269. legend: {
  270. data:['本期合同计量','本期数量变更计量','截止上期累计完成','本期完成计量','完成度']
  271. },
  272. dataZoom: [
  273. {show: true,start: 0, end: 100}
  274. ],
  275. xAxis : [
  276. {
  277. type : 'category',
  278. splitLine : {show : true},
  279. data : [
  280. <% for (const s of stagesEcharts) {%>
  281. '第<%- s.order %>期',
  282. <% } %>
  283. ]
  284. }
  285. ],
  286. yAxis : [
  287. {
  288. type : 'value',
  289. name : '金额',
  290. position:'left',
  291. axisLabel : {
  292. formatter: '{value} 元'
  293. },
  294. splitArea : {show : true},
  295. splitLine : {show : true},
  296. },
  297. {
  298. type : 'value',
  299. name:'完成度',
  300. axisLabel : {
  301. formatter: '{value} %'
  302. },
  303. position: 'right',
  304. splitArea : {show : false},
  305. splitLine : {show : false},
  306. }
  307. ],
  308. series : [
  309. {
  310. name:'本期合同计量',
  311. type:'bar',
  312. tooltip : {trigger: 'item',formatter: "{b} <br/>{a}:{c}元"},
  313. stack: '合同',
  314. data:[
  315. <% for (const s of stagesEcharts) {%>
  316. <%- s.contract_tp %>,
  317. <% } %>
  318. ]
  319. },
  320. {
  321. name:'本期数量变更计量',
  322. type:'bar',
  323. tooltip : {trigger: 'item',formatter: "{b} <br/>{a}:{c}元"},
  324. stack: '变更',
  325. data:[
  326. <% for (const s of stagesEcharts) {%>
  327. <%- s.qc_tp %>,
  328. <% } %>
  329. ]
  330. },
  331. {
  332. name:'截止上期累计完成',
  333. type:'bar',
  334. tooltip : {trigger: 'item',formatter: "{b} <br/>{a}:{c}元"},
  335. stack: '完成',
  336. data:[
  337. <% for (const s of stagesEcharts) {%>
  338. <%- ctx.helper.add(s.pre_contract_tp, s.pre_qc_tp) %>,
  339. <% } %>
  340. ]
  341. },
  342. {
  343. name:'本期完成计量',
  344. type:'bar',
  345. tooltip : {trigger: 'item',formatter: "{b} <br/>{a}:{c}元"},
  346. stack: '完成',
  347. data:[
  348. <% for (const s of stagesEcharts) {%>
  349. <%- ctx.helper.add(s.contract_tp, s.qc_tp) %>,
  350. <% } %>
  351. ]
  352. },
  353. {
  354. name:'完成度',
  355. type:'line',
  356. tooltip : {trigger: 'axis',formatter: "{b}占总标段<br/>{a}:{c} %"},
  357. yAxisIndex: 1,
  358. data:[
  359. <% for (const s of stagesEcharts) {%>
  360. <%- ctx.helper.mul(ctx.helper.div(ctx.helper.add(s.contract_tp, s.qc_tp), tender.sum, 2), 100) %>,
  361. <% } %>
  362. ]
  363. },
  364. ]
  365. };
  366. // 为echarts对象加载数据
  367. myChart.setOption(option);
  368. //4 标段期数计量进度//
  369. //3 标段月进度//
  370. // 基于准备好的dom,初始化echarts图表
  371. var myChart = echarts.init(document.getElementById('chartContainer3'));
  372. var option = {
  373. color:["#e9af68","#57b7b6"],
  374. title : {
  375. text: ''
  376. },
  377. tooltip : {
  378. trigger: 'axis',
  379. formatter: function (params, ticket, callback) {
  380. let sHint = '';
  381. for (const param of params) {
  382. if (sHint !== '') {
  383. sHint += '<br>';
  384. }
  385. if (sHint === '' && param.name !== '') {
  386. sHint = param.name + '<br>';
  387. }
  388. sHint += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + param.color +'"></span>';
  389. if (param.data) {
  390. sHint += param.seriesName + ': ' + param.data + ' %';
  391. } else {
  392. sHint += param.seriesName + ': -';
  393. }
  394. }
  395. return sHint;
  396. },
  397. },
  398. legend: {
  399. data:['截止本月完成','本月完成']
  400. },
  401. toolbox: {
  402. show : true,
  403. feature : {
  404. magicType : {show: true, type: ['line', 'bar']}
  405. }
  406. },
  407. dataZoom : {
  408. show : true,
  409. start : 50,
  410. end : 100
  411. },
  412. xAxis : [
  413. {
  414. type : 'category',
  415. boundaryGap : true,
  416. data : [
  417. <% for (const mp of monthProgress) { %>
  418. '<%- mp.month %>',
  419. <% } %>
  420. ]
  421. }
  422. ],
  423. yAxis : [
  424. {
  425. type : 'value',
  426. axisLabel : {
  427. formatter: '{value} %'
  428. },
  429. splitArea : {show : true}
  430. }
  431. ],
  432. series : [
  433. {
  434. name:'截止本月完成',
  435. type:'line',
  436. itemStyle: {
  437. normal: {
  438. lineStyle: {
  439. shadowColor : 'rgba(0,0,0,0.4)',
  440. shadowBlur: 5,
  441. shadowOffsetX: 3,
  442. shadowOffsetY: 3
  443. }
  444. }
  445. },
  446. data:[
  447. <% for (const mp of monthProgress) { %>
  448. <%- mp.end_ratio %>,
  449. <% } %>
  450. ]
  451. },
  452. {
  453. name:'本月完成',
  454. type:'line',
  455. itemStyle: {
  456. normal: {
  457. lineStyle: {
  458. shadowColor : 'rgba(0,0,0,0.4)',
  459. shadowBlur: 5,
  460. shadowOffsetX: 3,
  461. shadowOffsetY: 3
  462. }
  463. }
  464. },
  465. data:[
  466. <% for (const mp of monthProgress) { %>
  467. <%- mp.ratio %>,
  468. <% } %>
  469. ]
  470. }
  471. ]
  472. };
  473. // 为echarts对象加载数据
  474. myChart.setOption(option);
  475. //3 标段月进度//
  476. </script>
  477. <script>
  478. $(document).ready(function () {
  479. if (window.location.hash && window.location.hash === '#yufukuan') {
  480. $('#gaikuang').removeClass('active');
  481. $('.nav-item a[href="#gaikuang"]').removeClass('active');
  482. $('#yufukuan').addClass('active');
  483. $('.nav-item a[href="#yufukuan"]').addClass('active');
  484. } else if (window.location.hash && window.location.hash === '#tzxiuding') {
  485. $('#gaikuang').removeClass('active');
  486. $('.nav-item a[href="#gaikuang"]').removeClass('active');
  487. $('#tzxiuding').addClass('active');
  488. $('.nav-item a[href="#tzxiuding"]').addClass('active');
  489. } else if (window.location.hash && window.location.hash === '#jlqi') {
  490. $('#gaikuang').removeClass('active');
  491. $('.nav-item a[href="#gaikuang"]').removeClass('active');
  492. $('#jlqi').addClass('active');
  493. $('.nav-item a[href="#jlqi"]').addClass('active');
  494. } else if (window.location.hash && window.location.hash === '#biangeng') {
  495. $('#gaikuang').removeClass('active');
  496. $('.nav-item a[href="#gaikuang"]').removeClass('active');
  497. $('#biangeng').addClass('active');
  498. $('.nav-item a[href="#biangeng"]').addClass('active');
  499. }
  500. $('.show-content').on('click', function () {
  501. $(this).parents('td').html($(this).data('content'));
  502. });
  503. });
  504. </script>
  505. </body>
  506. </html>