detail.ejs 74 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411
  1. <link href="/public/css/bootstrap/bootstrap-colorpicker.min.css" rel="stylesheet">
  2. <% include ./tender_sub_menu.ejs %>
  3. <div class="panel-content">
  4. <div class="panel-title">
  5. <div class="title-main d-flex">
  6. <% include ./tender_sub_mini_menu.ejs %>
  7. <% if (tender.ledger_status !== audit.ledger.status.uncheck) { %>
  8. <h2>进行至
  9. <% if (lastStage) { %>
  10. 第<%- lastStage.order %>期<small class="<%- audit.stage.statusClass[lastStage.status] %>">(<%- audit.stage.statusString[lastStage.status] %>)</small>
  11. <% } else { %>
  12. 台账<small class="<%- audit.ledger.auditStringClass[tender.ledger_status] %>">(<%- audit.ledger.auditString[tender.ledger_status] %>)</small>
  13. <% } %>
  14. </h2>
  15. <% } %>
  16. <% if (cooperation) { %>
  17. <div>
  18. <a href="/tender/<%= tender.id %>/cooperation" class="btn btn-sm btn-light" ><i class="fa fa-users"></i> 协作办公</a>
  19. </div>
  20. <% } %>
  21. <div class="ml-auto">
  22. <a href="javascript:void(0)" title="全屏显示" id="showFull" style="font-size: 16px" class="float-left text-dark mr-3"><i class="fa fa-arrows-alt"></i></a>
  23. <div class="dropdown d-flex float-left mt-1 mr-2">
  24. <!--<button id="showFull" class="btn btn-sm btn-outline-dark mr-2">全屏</button>-->
  25. <a class="btn btn-sm btn-outline-dark dropdown-toggle dropdown-wd" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  26. 标段
  27. </a>
  28. <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
  29. <a href="#bd-set-1" data-toggle="modal" data-target="#bd-set-1" class="dropdown-item" >标段属性</a>
  30. <a href="#bd-set-2" data-toggle="modal" data-target="#bd-set-2" class="dropdown-item" >小数位数</a>
  31. <a href="#bd-set-3" data-toggle="modal" data-target="#bd-set-3" class="dropdown-item" >数量精度</a>
  32. <a href="#bd-set-4" data-toggle="modal" data-target="#bd-set-4" class="dropdown-item" >合同参数</a>
  33. <a href="#bd-set-5" data-toggle="modal" data-target="#bd-set-5" class="dropdown-item" >显示设置</a>
  34. <a href="#bd-set-6" data-toggle="modal" data-target="#bd-set-6" class="dropdown-item" >章节设置</a>
  35. <a href="#bd-set-7" data-toggle="modal" data-target="#bd-set-7" class="dropdown-item" >付款账号</a>
  36. <a class="dropdown-item" href="javascript: void(0);" id="copyBtn">拷贝设置</a>
  37. </div>
  38. </div>
  39. <% if (ctx.session.sessionUser.is_admin) { %>
  40. <div class="dropdown d-flex mt-1">
  41. <a class="btn btn-sm btn-outline-dark dropdown-toggle dropdown-wd" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  42. 管理员
  43. </a>
  44. <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
  45. <% if (ctx.session.sessionProject.page_show !== null && parseInt(ctx.session.sessionProject.page_show.xxjd) === 1) { %>
  46. <a href="#xxjd-set" data-toggle="modal" data-target="#xxjd-set" class="dropdown-item">投资进度</a>
  47. <% } %>
  48. <a href="/tender/<%- tender.id %>/shenpi" class="dropdown-item">审批流程</a>
  49. <a href="#bd-set-9" data-toggle="modal" data-target="#bd-set-9" class="dropdown-item">游客账号 <span id="tourist-num" <% if (tourists.length !== 0) { %>class="badge badge-secondary"<% } %>><% if (tourists.length !== 0) { %><%- tourists.length %><% } %></span></a>
  50. <a href="#bd-set-10" data-toggle="modal" data-target="#bd-set-10" class="dropdown-item">上报限制</a>
  51. <a href="#bd-set-11" data-toggle="modal" data-target="#bd-set-11" class="dropdown-item">概况设置</a>
  52. </div>
  53. </div>
  54. <% } %>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="content-wrap" id="big-data">
  59. <div style="height: 70px;background-color: #2c3237; display: none" id="exitfull-div">
  60. <div class="title-main d-flex">
  61. <div class="ml-auto">
  62. <div class="dropdown d-flex float-left mt-1 mr-2">
  63. <button id="exitFull" class="btn btn-sm btn-secondary ml-auto">退出全屏</button>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="c-body" style="background:#2c3237 !important">
  69. <div class="sjs-height-0">
  70. <!--<div class="auto-main-height">-->
  71. <div class="main-height-one">
  72. <div class="m-3">
  73. <!--金额概况-->
  74. <div class="row ml-1 mb-3">
  75. <div class="col-12">
  76. <div class="row">
  77. <div class="col-2 pl-0">
  78. <div class="card text-center bg-dark text-white">
  79. <div class="card-body">
  80. <h5 class="card-title card-big-title"><%- ctx.helper.formatMoney(tender.total_price) %></h5>
  81. <p class="card-text text-muted">0号台账合同</p>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="col-2 pl-0">
  86. <div class="card text-center bg-dark text-white">
  87. <div class="card-body">
  88. <h5 class="card-title card-big-title"><%- ctx.helper.formatMoney(tender.end_qc_tp) %> <small class="text-danger" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="占合同比例"><%- tender.qc_ratio %>%</small></h5>
  89. <p class="card-text text-muted">截止本期变更</p>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="col-2 pl-0">
  94. <div class="card text-center bg-dark text-white">
  95. <div class="card-body">
  96. <h5 class="card-title card-big-title"><%- ctx.helper.formatMoney(tender.gather_tp) %></h5>
  97. <p class="card-text text-muted">本期完成</p>
  98. </div>
  99. </div>
  100. </div>
  101. <div class="col-2 pl-0">
  102. <div class="card text-center bg-dark text-white">
  103. <div class="card-body">
  104. <h5 class="card-title card-big-title"><%- ctx.helper.formatMoney(tender.end_gather_tp) %></h5>
  105. <p class="card-text text-muted">截止本期完成</p>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="col-2 pl-0">
  110. <div class="card text-center bg-dark text-white">
  111. <div class="card-body">
  112. <h5 class="card-title card-big-title"><%- ctx.helper.formatMoney(tender.pre_gather_tp) %></h5>
  113. <p class="card-text text-muted">截止上期完成</p>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="col-2 pl-0">
  118. <div class="card text-center bg-dark text-white">
  119. <div class="card-body">
  120. <h5 class="card-title card-big-title"><%- ctx.helper.formatMoney(tender.yf_tp) %></h5>
  121. <p class="card-text text-muted">本期应付</p>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. <!--进度条-->
  129. <div class="">
  130. <div class="progress">
  131. <% if (tender.pre_ratio > 0) { %>
  132. <div class="progress-bar bg-success bg-green" style="width: <%- tender.pre_ratio %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="截止上期累计完成:¥<%- ctx.helper.formatMoney(tender.pre_gather_tp) %>"><%- tender.pre_ratio %>%</div>
  133. <% } %>
  134. <% if (tender.cur_ratio > 0) { %>
  135. <div class="progress-bar bg-info bg-blue" style="width: <%- tender.cur_ratio %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="本期完成:¥<%- ctx.helper.formatMoney(tender.gather_tp) %>"><%- tender.cur_ratio %>%</div>
  136. <% } %>
  137. <% if (tender.other_ratio > 0) { %>
  138. <div class="progress-bar bg-danger bg-red" style="width: <%- tender.other_ratio %>%;" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥<%- ctx.helper.formatMoney(tender.other_tp) %>"><%- tender.other_ratio %>%</div>
  139. <% } %>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. <!--图表1-->
  145. <div class="main-height-two">
  146. <div class="m-3">
  147. <div class="row">
  148. <div class="col-3">
  149. <!--计量完成概况-->
  150. <div class="card mb-3 bg-dark text-white">
  151. <div class="card-header"><h6 class="mb-0">计量完成概况</h6></div>
  152. <div class="card-body">
  153. <div id="jlchart1" style="height: 100%; width: 100%;">
  154. </div>
  155. </div>
  156. </div>
  157. <!--支付情况-->
  158. <div class="card mb-3 bg-dark text-white">
  159. <div class="card-header"><h6 class="mb-0">支付情况</h6></div>
  160. <div class="card-body">
  161. <div id="jlchart2" style="height: 100%; width: 100%;">
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. <!--章节计量情况图-->
  167. <div class="col-6 pl-0">
  168. <div class="card mb-3 bg-dark text-white">
  169. <% if (hadMap) { %>
  170. <div class="card-body" id="map" style="height: 388px; width: 100%;">
  171. </div>
  172. <% } else { %>
  173. <div class="card-header"><h6 class="mb-0">章节计量情况图</h6></div>
  174. <div class="card-body">
  175. <div id="jlchart3" style="height: 304px; width: 100%;">
  176. </div>
  177. </div>
  178. <% } %>
  179. </div>
  180. </div>
  181. <div class="col-3 pl-0">
  182. <!--台账审批进度-->
  183. <div class="card mb-3 bg-dark text-white">
  184. <div class="card-header"><h6 class="mb-0"><% if (lastStage) { %>计量审批进度<% } else { %>台账审批进度<% } %></h6></div>
  185. <div class="card-body">
  186. <div style="">
  187. <div class="btn-group btn-group-sm btn-block my-1">
  188. <% if (lastStage) { %>
  189. <% if (lastStage.auditors && lastStage.auditors.length > 0) { %>
  190. <% for (const [i,sa] of lastStage.auditors.entries()) { %>
  191. <button class="btn <% if (sa.status === audit.stage.status.checked) { %>btn-green<% } else if (sa.status === audit.stage.status.checking) { %>btn-yellow<% } else if (sa.status === audit.stage.status.checkNo) { %>btn-red<% } else { %>btn-blueOne<% } %><% if (i+1 !== lastStage.auditors.length) { %> btn-relative<% } %>" data-toggle="tooltip"
  192. data-placement="top" data-original-title="<%- sa.name %> <% if (sa.status === audit.stage.status.checked) { %>审批完成<% } else if (sa.status === audit.stage.status.checking) { %>审批中<% } else if (sa.status === audit.stage.status.checkNo || sa.status === audit.stage.status.checkNoPre) { %>审批退回<% } else if (sa.status === audit.stage.status.checkAgain) { %>重新审批<% } %> <% if (sa.end_time) { %><%- ctx.helper.dateTran(sa.end_time, 'YYYY-MM-DD') %><% } %>">
  193. <% if (lastStage.auditors.length > 1 && i !== 0) { %><i class="fa <% if (lastStage.auditors[i-1].status === audit.stage.status.checked) { %>text-green<% } else if (lastStage.auditors[i-1].status === audit.stage.status.checking) { %>text-yellow<% } else if (lastStage.auditors[i-1].status === audit.stage.status.checkNo) { %>text-red<% } else { %>text-blueOne<% } %> fa-caret-right icon-absolute icon-size"></i><% } %><%- (i+1) %></button>
  194. <% } %>
  195. <% } else { %>
  196. <button class="btn btn-secondary" data-toggle="tooltip" data-placement="top" data-original-title="">&nbsp;</button>
  197. <% } %>
  198. <% } else { %>
  199. <%if (tender.auditors && tender.auditors.length > 0) { %>
  200. <% for (const [i, la] of tender.auditors.entries()) { %>
  201. <button class="btn <% if (la.status === audit.ledger.status.checked) { %>btn-green<% } else if (la.status === audit.ledger.status.checking) { %>btn-yellow<% } else if (la.status === audit.ledger.status.checkNo) { %>btn-red<% } else { %>btn-blueOne<% } %><% if (i+1 !== tender.auditors.length) { %> btn-relative<% } %>" data-toggle="tooltip"
  202. data-placement="top" data-original-title="<%- la.name %> <% if (la.status === audit.ledger.status.checked) { %>审批完成<% } else if (la.status === audit.ledger.status.checking) { %>审批中<% } else if (la.status === audit.ledger.status.checkNo || la.status === audit.ledger.status.checkNoPre) { %>审批退回<% } %> <% if (la.end_time) { %><%- ctx.helper.dateTran(la.end_time, 'YYYY-MM-DD') %><% } %>">
  203. <% if (tender.auditors.length > 1 && i !== 0) { %><i class="fa <% if (tender.auditors[i-1].status === audit.ledger.status.checked) { %>text-green<% } else if (tender.auditors[i-1].status === audit.ledger.status.checking) { %>text-yellow<% } else if (tender.auditors[i-1].status === audit.ledger.status.checkNo) { %>text-red<% } else { %>text-blueOne<% } %> fa-caret-right icon-absolute icon-size"></i><% } %><%- (i+1) %></button>
  204. <% } %>
  205. <% } else { %>
  206. <button class="btn btn-secondary" data-toggle="tooltip" data-placement="top" data-original-title="">&nbsp;</button>
  207. <% } %>
  208. <% } %>
  209. </div>
  210. <div class="row">
  211. <div class="col-2">
  212. </div>
  213. <div class="col-8 text-center">
  214. <% if (lastStage) { %>
  215. 第<%- lastStage.order %>期
  216. <% if (lastStage.status === audit.stage.status.uncheck) { %>
  217. <span class="text-info"><%- lastStage.status_users %></span>
  218. <% } else { %>
  219. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" data-type="stage" data-order="<%- lastStage.order %>"><%- lastStage.status_users %></a>
  220. <% } %>
  221. <span class="<%- audit.stage.statusClass[lastStage.status] %>"><%- audit.stage.statusString[lastStage.status] %></span>
  222. <% } else { %>
  223. <% if (tender.ledger_status === audit.ledger.status.uncheck) { %>
  224. <span class="text-info"><%- tender.status_users %></span> <span>待上报</span>
  225. <% } else { %>
  226. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" data-type="ledger" data-order="<%- tender.order %>"><%- tender.status_users %></a> <span class="<%- audit.ledger.auditStringClass[tender.ledger_status] %> %>"><%- audit.ledger.auditString[tender.ledger_status] %></span>
  227. <% } %>
  228. <% } %>
  229. </div>
  230. </div>
  231. <div class="row mt-1 border-top border-secondary pt-1 mt-2">
  232. <% if (lastStage) { %>
  233. <div class="col-7 mb-1">
  234. 本期合同计量金额:
  235. </div>
  236. <div class="col-5 text-right mb-1">
  237. <%- lastStage.contract_tp %>
  238. </div>
  239. <div class="col-7">
  240. 本期变更计量金额:
  241. </div>
  242. <div class="col-5 text-right">
  243. <%- lastStage.qc_tp %>
  244. </div>
  245. <% } else { %>
  246. <div class="col-7 mb-1">
  247. &nbsp;
  248. </div>
  249. <div class="col-5 text-right mb-1">
  250. &nbsp;
  251. </div>
  252. <div class="col-7">
  253. &nbsp;
  254. </div>
  255. <div class="col-5 text-right">
  256. &nbsp;
  257. </div>
  258. <% } %>
  259. </div>
  260. </div>
  261. </div>
  262. </div>
  263. <div class="card mb-3 bg-dark text-white">
  264. <div class="card-header">
  265. <ul class="nav nav-tabs card-header-tabs panel-card-tabs">
  266. <li class="nav-item">
  267. <a class="nav-link active" data-toggle="tab" href="#taizhangshenpi" role="tab" aria-selected="true">工程变更进度</a>
  268. </li>
  269. <li class="nav-item">
  270. <a class="nav-link" data-toggle="tab" href="#taizhangxiuding" role="tab" aria-selected="true">材料调差进度</a>
  271. </li>
  272. </ul>
  273. </div>
  274. <div class="card-body">
  275. <div class="tab-content">
  276. <div class="tab-pane active" id="taizhangshenpi">
  277. <div id="bgchart" style="height: 100%; width: 100%;"></div>
  278. </div>
  279. <div class="tab-pane" id="taizhangxiuding" >
  280. <div class="card-body p-0">
  281. <div>
  282. <div class="btn-group btn-group-sm btn-block">
  283. <% if (materialData && materialData.auditors.length > 0) { %>
  284. <% for (const [i, ma] of materialData.auditors.entries()) { %>
  285. <button class="btn <% if (ma.status === audit.material.status.checked) { %>btn-green<% } else if (ma.status === audit.material.status.checking) { %>btn-yellow<% } else if(ma.status === audit.material.status.checkNo) { %>btn-red<% } else { %>btn-blueOne<% } %><% if (i+1 !== materialData.auditors.length) { %> btn-relative<% } %>" data-toggle="tooltip"
  286. data-placement="top" data-original-title="<%- ma.name %> <% if (ma.status === audit.material.status.checked) { %>审批完成<% } else if (ma.status === audit.material.status.checking) { %>审批中<% } else if (ma.status === audit.material.status.checkNo || ma.status === audit.material.status.checkNoPre) { %>审批退回<% } %> <% if (ma.end_time) { %><%- ctx.helper.dateTran(ma.end_time, 'YYYY-MM-DD') %><% } %>">
  287. <% if (materialData.auditors.length > 1 && i !== 0) { %><i class="fa <% if (materialData.auditors[i-1].status === audit.material.status.checked) { %>text-green<% } else if (materialData.auditors[i-1].status === audit.material.status.checking) { %>text-yellow<% } else if (materialData.auditors[i-1].status === audit.material.status.checkNo) { %>text-red<% } else { %>text-blueOne<% } %> fa-caret-right icon-absolute icon-size"></i><% } %><%- (i+1) %></button>
  288. <% } %>
  289. <% } else { %>
  290. <button class="btn btn-secondary" data-toggle="tooltip" data-placement="top" data-original-title="">&nbsp;</button>
  291. <% } %>
  292. <!--<button class="btn btn-warning" data-toggle="tooltip" data-placement="top" data-original-title="温仁书 审批中">2</button>-->
  293. <!--<button class="btn btn-info" data-toggle="tooltip" data-placement="top" data-original-title="玉安然">3</button>-->
  294. </div>
  295. <div class="row">
  296. <div class="col-2">
  297. </div>
  298. <div class="col-8 text-center">
  299. 第 <%- (materialData ? materialData.order : '0') %> 期
  300. <% if (materialData) { %>
  301. <% if (materialData.curAuditor) { %>
  302. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" data-type="material" data-order="<%- materialData.order %>"><%- materialData.curAuditor.name %></a>
  303. <% } %>
  304. <span class="<%- audit.material.auditProgressClass[materialData.status] %>"><%- audit.material.auditProgress[materialData.status] %></span>
  305. <% } %>
  306. </div>
  307. </div>
  308. <table class="table table-bordered table-2sm mb-0 mt-1 table-dark">
  309. <% if (materialData) { %>
  310. <tr><th width="60%">含税(信息价/指数法)</th><td width="20%"><%= materialData.m_tp !== null ? ctx.helper.round(ctx.helper.mul(materialData.m_tp, 1+materialData.rate/100), 2) : '0' %></td><td width="20%"><%= materialData.ex_tp !== null ? ctx.helper.round(ctx.helper.mul(materialData.ex_tp, 1+materialData.rate/100), 2) : '0' %></td></tr>
  311. <tr><th>不含税(信息价/指数法)</th><td><%= materialData.m_tp !== null ? ctx.helper.round(materialData.m_tp, 2) : '0' %></td><td><%= materialData.ex_tp !== null ? ctx.helper.round(materialData.ex_tp, 2) : '0' %></td></tr>
  312. <% } else { %>
  313. <tr><th width="60%">含税(信息价/指数法)</th><td width="20%">0</td><td width="20%">0</td></tr>
  314. <tr><th>不含税(信息价/指数法)</th><td>0</td><td>0</td></tr>
  315. <% } %>
  316. </table>
  317. </div>
  318. </div>
  319. </div>
  320. </div>
  321. </div>
  322. </div>
  323. </div>
  324. <!--期进度表-->
  325. <div class="col-6">
  326. <div class="card mb-3 bg-dark text-white bottom-height">
  327. <% if (hadMap) { %>
  328. <div class="card-header"><h6 class="mb-0">章节计量情况表</h6></div>
  329. <div class="card-body">
  330. <div id="jlchart3" style="height: 300px; width: 100%;"></div>
  331. </div>
  332. <% } else { %>
  333. <div class="card-header"><h6 class="mb-0">期进度表</h6></div>
  334. <div class="card-body">
  335. <div id="chartContainer4" style="height: 300px; width: 100%;"></div>
  336. </div>
  337. <% } %>
  338. </div>
  339. </div>
  340. <!--月进度表-->
  341. <div class="col-6 pl-0">
  342. <div class="card mb-3 bg-dark text-white bottom-height">
  343. <% if (hadMap) { %>
  344. <div class="card-header">
  345. <ul class="nav nav-tabs card-header-tabs panel-card-tabs" id="change-echarts">
  346. <li class="nav-item">
  347. <a class="nav-link active" data-toggle="tab" href="#qijindubiao" role="tab" aria-selected="true">期进度表</a>
  348. </li>
  349. <li class="nav-item">
  350. <a class="nav-link" data-toggle="tab" href="#yuejindbiao" role="tab" aria-selected="true">月进度表</a>
  351. </li>
  352. </ul>
  353. </div>
  354. <div class="card-body">
  355. <div class="tab-content">
  356. <div class="tab-pane active" id="qijindubiao">
  357. <div id="chartContainer4" class="bottom-height-two" style="width: 100%;"></div>
  358. </div>
  359. <div class="tab-pane" id="yuejindbiao" >
  360. <div id="chartContainer3" class="bottom-height-two" style="width: 100%;"></div>
  361. </div>
  362. </div>
  363. </div>
  364. <% } else { %>
  365. <div class="card-header"><h6 class="mb-0">月进度表</h6></div>
  366. <div class="card-body">
  367. <div id="chartContainer3" style="height: 300px; width: 100%;"></div>
  368. </div>
  369. <% } %>
  370. </div>
  371. </div>
  372. </div>
  373. </div>
  374. </div>
  375. </div>
  376. </div>
  377. </div>
  378. </div>
  379. </div>
  380. <script type="text/javascript">
  381. const tenders = JSON.parse(unescape('<%- escape(JSON.stringify(tenders)) %>'));
  382. const category = JSON.parse(unescape('<%- escape(JSON.stringify(categoryData)) %>'));
  383. const tender = JSON.parse('<%- JSON.stringify(tender) %>');
  384. const cur_uid = parseInt('<%- ctx.session.sessionUser.accountId %>');
  385. //计量完成概况//
  386. var myChart = echarts.init(document.getElementById('jlchart1'), 'dark');
  387. var option = {
  388. color: ['rgba(24,144,255,0.7)','rgba(69,183,149,0.7)','rgba(250,204,20,0.7)','rgba(145,82,225,0.7)','rgba(58,207,221,0.7)','rgba(204,73,80,0.7)','rgba(255,255,225,0.7)'],
  389. backgroundColor: '#343a40 ',
  390. tooltip: {
  391. trigger: 'item'
  392. },
  393. legend: {
  394. top: '0%',
  395. left: '0%',
  396. orient:'vertical'
  397. },
  398. series: [
  399. {
  400. name: '金额',
  401. type: 'pie',
  402. top:'0%',
  403. left:'50%',
  404. radius: ['100%'],
  405. avoidLabelOverlap: false,
  406. label: {
  407. show: false,
  408. position: 'right'
  409. },
  410. emphasis: {
  411. label: {
  412. show: true,
  413. fontSize: '20',
  414. fontWeight: 'bold'
  415. }
  416. },
  417. labelLine: {
  418. show: false
  419. },
  420. data: [
  421. <% for (const s of stage_total) { %>
  422. {value: <%- s.num %>, name: '<%- s.name %>'},
  423. <% } %>
  424. ]
  425. }
  426. ]
  427. };
  428. // 为echarts对象加载数据
  429. myChart.setOption(option);
  430. //计量完成概况 结束//
  431. //计量支付概况//
  432. var myChart1 = echarts.init(document.getElementById('jlchart2'), 'dark');
  433. var option1 = {
  434. backgroundColor: '#343a40 ',
  435. tooltip: {
  436. trigger: 'axis',
  437. axisPointer: {
  438. type: 'shadow'
  439. }
  440. },
  441. grid: {
  442. left: '3%',
  443. right: '18%',
  444. top:'5%',
  445. bottom: '0%',
  446. containLabel: true
  447. },
  448. yAxis: {
  449. type: 'category',
  450. data: ['总价', '截止应付', '截止实付']
  451. },
  452. xAxis: {
  453. type: 'value',
  454. name : '金额',
  455. position:'left',
  456. axisLabel : {
  457. interval: 0,//横轴信息全部显示
  458. rotate: 35,// 倾斜角度
  459. formatter: function (value, index) {
  460. if (value < 0) {
  461. let newValue = Math.abs(value);
  462. if (newValue >= 10000 && newValue < 10000000) {
  463. newValue = newValue / 10000 + "万";
  464. } else if (newValue >= 10000000) {
  465. newValue = newValue / 10000000 + "千万";
  466. }
  467. value = '-' + newValue;
  468. }
  469. if (value >= 10000 && value < 10000000) {
  470. value = value / 10000 + "万";
  471. } else if (value >= 10000000) {
  472. value = value / 10000000 + "千万";
  473. }
  474. return value;
  475. }
  476. },
  477. splitArea : {show : true}
  478. },
  479. series: [{
  480. data: [<%- tender.total_price ? tender.total_price : 0 %>, <%- tender.end_yf_tp ? tender.end_yf_tp : 0 %>, <%- tender.end_sf_tp ? tender.end_sf_tp : 0 %>,],
  481. type: 'bar',
  482. itemStyle:{
  483. normal:{
  484. color:function(params){
  485. var colorlist = ['rgba(24,144,255,0.7)','rgba(69,183,149,0.7)','rgba(250,204,20,0.7)','rgba(145,82,225,0.7)','rgba(58,207,221,0.7)','rgba(204,73,80,0.7)','rgba(255,255,225,0.7)'];
  486. return colorlist[params.dataIndex];
  487. }
  488. }
  489. }
  490. }]
  491. };
  492. // 为echarts对象加载数据
  493. myChart1.setOption(option1);
  494. //计量支付概况 结束//
  495. //章节计量情况图//
  496. var myChart2 = echarts.init(document.getElementById('jlchart3'), 'dark');
  497. var option2 = {
  498. color: ['rgba(24,144,255,0.7)','rgba(69,183,149,0.7)','rgba(250,204,20,0.7)','rgba(145,82,225,0.7)','rgba(58,207,221,0.7)','rgba(204,73,80,0.7)','rgba(255,255,225,0.7)'],
  499. backgroundColor: '#343a40 ',
  500. tooltip: {
  501. trigger: 'axis',
  502. axisPointer: {
  503. type: 'shadow'
  504. }
  505. },
  506. legend: {
  507. data: ['台账金额','截止本期计量']
  508. },
  509. grid: {
  510. left: '3%',
  511. right: '4%',
  512. bottom: '3%',
  513. containLabel: true
  514. },
  515. yAxis: {
  516. type : 'value',
  517. name : '金额',
  518. position:'left',
  519. axisLabel : {
  520. // if (ctx.tender.info.display.thousandth) {
  521. // formatter: function (value, index) {
  522. // return value.format2Str('#,##0.######') + ' 元'
  523. // }
  524. formatter: function (value, index) {
  525. if (value < 0) {
  526. let newValue = Math.abs(value);
  527. if (newValue >= 10000 && newValue < 10000000) {
  528. newValue = newValue / 10000 + "万";
  529. } else if (newValue >= 10000000) {
  530. newValue = newValue / 10000000 + "千万";
  531. }
  532. value = '-' + newValue;
  533. }
  534. if (value >= 10000 && value < 10000000) {
  535. value = value / 10000 + "万";
  536. } else if (value >= 10000000) {
  537. value = value / 10000000 + "千万";
  538. }
  539. return value;
  540. }
  541. },
  542. splitArea : {show : true}
  543. },
  544. xAxis: {
  545. type: 'category',
  546. data: [
  547. <% for (const gcl of gclChapter) { %>
  548. <% if (parseInt(gcl.code) <= 900 || (parseInt(gcl.code) > 900 && (gcl.total_price !== 0 || gcl.end_gather_tp !== 0))) { %>
  549. '<%- gcl.code %>章',
  550. <% } %>
  551. <% } %>
  552. ]
  553. },
  554. series: [
  555. {
  556. name: '台账金额',
  557. type: 'bar',
  558. data: [
  559. <% for (const gcl of gclChapter) { %>
  560. <% if (parseInt(gcl.code) <= 900 || (parseInt(gcl.code) > 900 && (gcl.total_price !== 0 || gcl.end_gather_tp !== 0))) { %>
  561. <%- gcl.total_price %>,
  562. <% } %>
  563. <% } %>
  564. ]
  565. },
  566. {
  567. name: '截止本期计量',
  568. type: 'bar',
  569. data: [
  570. <% for (const gcl of gclChapter) { %>
  571. <% if (parseInt(gcl.code) <= 900 || (parseInt(gcl.code) > 900 && (gcl.total_price !== 0 || gcl.end_gather_tp !== 0))) { %>
  572. <%- gcl.end_gather_tp %>,
  573. <% } %>
  574. <% } %>
  575. ]
  576. }
  577. ]
  578. };
  579. // 为echarts对象加载数据
  580. myChart2.setOption(option2);
  581. //4 标段期数计量进度//
  582. var myChart3 = echarts.init(document.getElementById('chartContainer4'), 'dark');
  583. var option3 = {
  584. color: ['rgba(24,144,255,0.7)','rgba(69,183,149,0.7)','rgba(250,204,20,0.7)','rgba(145,82,225,0.7)','rgba(204,73,80,0.7)','rgba(58,207,221,0.7)','rgba(255,255,225,0.7)'],
  585. backgroundColor: '#343a40 ',
  586. title : {
  587. text: ''
  588. },
  589. tooltip : {
  590. trigger: 'axis',
  591. },
  592. calculable : true,
  593. legend: {
  594. itemWidth:15,
  595. data:['本期合同计量','本期数量变更计量','截至上期累计完成','本期完成计量','完成度']
  596. },
  597. dataZoom: [
  598. {show: true, start: 0, end: 100,height:10,bottom:30}
  599. ],
  600. xAxis : [
  601. {
  602. type : 'category',
  603. splitLine : {show : true},
  604. data : [
  605. <% for (const s of stages) {%>
  606. '第<%- s.order %>期',
  607. <% } %>
  608. ]
  609. }
  610. ],
  611. yAxis : [
  612. {
  613. type : 'value',
  614. name : '金额',
  615. position:'left',
  616. axisLabel : {
  617. formatter: function (value, index) {
  618. if (value < 0) {
  619. let newValue = Math.abs(value);
  620. if (newValue >= 10000 && newValue < 10000000) {
  621. newValue = newValue / 10000 + "万";
  622. } else if (newValue >= 10000000) {
  623. newValue = newValue / 10000000 + "千万";
  624. }
  625. value = '-' + newValue;
  626. }
  627. if (value >= 10000 && value < 10000000) {
  628. value = value / 10000 + "万";
  629. } else if (value >= 10000000) {
  630. value = value / 10000000 + "千万";
  631. }
  632. return value;
  633. }
  634. },
  635. splitArea : {show : true},
  636. splitLine : {show : true},
  637. },
  638. {
  639. type : 'value',
  640. name:'完成度',
  641. axisLabel : {
  642. formatter: '{value} %'
  643. },
  644. position: 'right',
  645. splitArea : {show : false},
  646. splitLine : {show : false},
  647. }
  648. ],
  649. series : [
  650. {
  651. name:'本期合同计量',
  652. type:'bar',
  653. tooltip : {
  654. trigger: 'item',
  655. <% if (ctx.tender.info.display.thousandth) { %>
  656. formatter: function (params, ticket, callback) {
  657. return params.name + '<br/>' + params.seriesName + ': ' + params.value.format2Str('#,##0.######') + ' 元';
  658. }
  659. <% } else { %>
  660. tooltip : {trigger: 'item',formatter: "{b} <br/>{a}:{c}元"},
  661. <% } %>
  662. },
  663. stack: '合同',
  664. data:[
  665. <% for (const s of stages) {%>
  666. <%- s.contract_tp %>,
  667. <% } %>
  668. ]
  669. },
  670. {
  671. name:'本期数量变更计量',
  672. type:'bar',
  673. tooltip : {
  674. trigger: 'item',
  675. <% if (ctx.tender.info.display.thousandth) { %>
  676. formatter: function (params, ticket, callback) {
  677. return params.name + '<br/>' + params.seriesName + ': ' + params.value.format2Str('#,##0.######') + ' 元';
  678. }
  679. <% } else { %>
  680. tooltip : {trigger: 'item',formatter: "{b} <br/>{a}:{c}元"},
  681. <% } %>
  682. },
  683. stack: '变更',
  684. data:[
  685. <% for (const s of stages) {%>
  686. <%- s.qc_tp %>,
  687. <% } %>
  688. ]
  689. },
  690. {
  691. name:'截至上期累计完成',
  692. type:'bar',
  693. tooltip : {
  694. trigger: 'item',
  695. <% if (ctx.tender.info.display.thousandth) { %>
  696. formatter: function (params, ticket, callback) {
  697. return params.name + '<br/>' + params.seriesName + ': ' + params.value.format2Str('#,##0.######') + ' 元';
  698. }
  699. <% } else { %>
  700. tooltip : {trigger: 'item',formatter: "{b} <br/>{a}:{c}元"},
  701. <% } %>
  702. },
  703. stack: '完成',
  704. data:[
  705. <% for (const s of stages) {%>
  706. <%- ctx.helper.add(s.pre_contract_tp, s.pre_qc_tp) %>,
  707. <% } %>
  708. ]
  709. },
  710. {
  711. name:'本期完成计量',
  712. type:'bar',
  713. tooltip : {
  714. trigger: 'item',
  715. <% if (ctx.tender.info.display.thousandth) { %>
  716. formatter: function (params, ticket, callback) {
  717. return params.name + '<br/>' + params.seriesName + ': ' + params.value.format2Str('#,##0.######') + ' 元';
  718. }
  719. <% } else { %>
  720. tooltip : {trigger: 'item',formatter: "{b} <br/>{a}:{c}元"},
  721. <% } %>
  722. },
  723. stack: '完成',
  724. data:[
  725. <% for (const s of stages) {%>
  726. <%- ctx.helper.add(s.contract_tp, s.qc_tp) %>,
  727. <% } %>
  728. ]
  729. },
  730. {
  731. name:'完成度',
  732. type:'line',
  733. tooltip : {trigger: 'axis',formatter: "{b}占总标段<br/>{a}:{c} %"},
  734. yAxisIndex: 1,
  735. data:[
  736. <% for (const s of stages) {%>
  737. <%- ctx.helper.mul(ctx.helper.div(ctx.helper.add(s.contract_tp, s.qc_tp), tender.sum, 2), 100) %>,
  738. <% } %>
  739. ]
  740. },
  741. ]
  742. };
  743. // 为echarts对象加载数据
  744. myChart3.setOption(option3);
  745. //4 标段期数计量进度//
  746. //3 标段月进度//
  747. // 基于准备好的dom,初始化echarts图表
  748. var myChart4 = echarts.init(document.getElementById('chartContainer3'), 'dark');
  749. var option4 = {
  750. color:["#17a2b8","#28a745"],
  751. backgroundColor: '#343a40 ',
  752. title : {
  753. text: ''
  754. },
  755. tooltip : {
  756. trigger: 'axis',
  757. formatter: function (params, ticket, callback) {
  758. let sHint = '';
  759. for (const param of params) {
  760. if (sHint !== '') {
  761. sHint += '<br>';
  762. }
  763. if (sHint === '' && param.name !== '') {
  764. sHint = param.name + '<br>';
  765. }
  766. sHint += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + param.color +'"></span>';
  767. if (param.data) {
  768. sHint += param.seriesName + ': ' + param.data + ' %';
  769. } else {
  770. sHint += param.seriesName + ': -';
  771. }
  772. }
  773. return sHint;
  774. },
  775. },
  776. legend: {
  777. data:['截止本月完成','本月完成']
  778. },
  779. toolbox: {
  780. show : true,
  781. right:'3%',
  782. feature : {
  783. magicType : {
  784. show: true,
  785. type: ['line', 'bar'],
  786. title:{
  787. line:'切换为折线图',
  788. bar:'切换为柱状图'
  789. }
  790. }
  791. }
  792. },
  793. dataZoom : {
  794. show : true,
  795. start : 50,
  796. end : 100,
  797. height:10,
  798. bottom:30
  799. },
  800. xAxis : [
  801. {
  802. type : 'category',
  803. boundaryGap : true,
  804. data : [
  805. <% for (const mp of monthProgress) { %>
  806. '<%- mp.month %>',
  807. <% } %>
  808. ]
  809. }
  810. ],
  811. yAxis : [
  812. {
  813. type : 'value',
  814. axisLabel : {
  815. formatter: '{value} %'
  816. },
  817. splitArea : {show : true}
  818. }
  819. ],
  820. series : [
  821. {
  822. name:'截止本月完成',
  823. type:'line',
  824. itemStyle: {
  825. normal: {
  826. lineStyle: {
  827. shadowColor : 'rgba(0,0,0,0.4)',
  828. shadowBlur: 5,
  829. shadowOffsetX: 3,
  830. shadowOffsetY: 3
  831. }
  832. }
  833. },
  834. areaStyle: { // 区域填充样式
  835. color: { // 填充的颜色 // 线性渐变,前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置
  836. type: 'linear',
  837. x: 0,
  838. y: 0,
  839. x2: 0,
  840. y2: 1,
  841. colorStops: [
  842. {
  843. offset: 0,
  844. color: 'rgba(37,234,255,0.7)', // 0% 处的颜色
  845. },
  846. {
  847. offset: 1,
  848. color: 'rgba(37,234,255,0.7)' // 100% 处的颜色
  849. }
  850. ],
  851. global: false, // 缺省为 false
  852. }
  853. },
  854. data:[
  855. <% for (const mp of monthProgress) { %>
  856. <%- mp.end_ratio %>,
  857. <% } %>
  858. ]
  859. },
  860. {
  861. name:'本月完成',
  862. type:'line',
  863. itemStyle: {
  864. normal: {
  865. lineStyle: {
  866. shadowColor : 'rgba(0,0,0,0.4)',
  867. shadowBlur: 5,
  868. shadowOffsetX: 3,
  869. shadowOffsetY: 3
  870. }
  871. }
  872. },
  873. areaStyle: { // 区域填充样式
  874. color: { // 填充的颜色 // 线性渐变,前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置
  875. type: 'linear',
  876. x: 0,
  877. y: 0,
  878. x2: 0,
  879. y2: 1,
  880. colorStops: [
  881. {
  882. offset: 0,
  883. color: 'rgba(40,167,69,0.7)', // 0% 处的颜色
  884. },
  885. {
  886. offset: 1,
  887. color: 'rgba(40,167,69,0.7)' // 100% 处的颜色
  888. }
  889. ],
  890. global: false, // 缺省为 false
  891. }
  892. },
  893. data:[
  894. <% for (const mp of monthProgress) { %>
  895. <%- mp.ratio %>,
  896. <% } %>
  897. ]
  898. }
  899. ]
  900. };
  901. // 为echarts对象加载数据
  902. myChart4.setOption(option4);
  903. //3 标段月进度//
  904. //变更审批进度//
  905. var myChart5 = echarts.init(document.getElementById('bgchart'), 'dark');
  906. var option5 = {
  907. color: ['rgba(145,82,225,0.7)','rgba(58,207,221,0.7)','rgba(204,73,80,0.7)','rgba(24,144,255,0.7)','rgba(69,183,149,0.7)','rgba(250,204,20,0.7)','rgba(255,255,225,0.7)'],
  908. backgroundColor: '#343a40 ',
  909. tooltip: {
  910. trigger: 'item'
  911. },
  912. // legend: {
  913. // top: '0%',
  914. // right: '0%',
  915. // orient:'vertical',
  916. // itemWidth:15,
  917. // data: ['一般变更', '较大变更', '重大变更', '待上报', '审批中', '已完成']
  918. // },
  919. legend:[{
  920. top: '0%',
  921. right: '0%',
  922. orient:'vertical',
  923. itemWidth:15,
  924. data:['一般变更','较大变更','重大变更']
  925. },{
  926. top: '0%',
  927. right: '35%',
  928. orient:'vertical',
  929. itemWidth:15,
  930. data:['待上报','审批中','已完成']
  931. }],
  932. series: [
  933. {
  934. name: '数量',
  935. type: 'pie',
  936. top:'0%',
  937. right:'65%',
  938. selectedMode: 'single',
  939. radius: '50%',
  940. avoidLabelOverlap: false,
  941. label: {
  942. show:false,
  943. //position: 'inner',
  944. //fontSize: 14,
  945. },
  946. labelLine: {
  947. show: false
  948. },
  949. data: [
  950. <% for (const cs of change_status_total) { %>
  951. {value: <%- cs.num %>, name: '<%- cs.name %>'},
  952. <% } %>
  953. ]
  954. },
  955. {
  956. name: '数量',
  957. type: 'pie',
  958. top:'0%',
  959. right:'65%',
  960. radius: ['70%', '100%'],
  961. avoidLabelOverlap: false,
  962. label: {
  963. show: false,
  964. position: 'center'
  965. },
  966. emphasis: {
  967. label: {
  968. show: false,
  969. //fontSize: '14',
  970. //fontWeight: 'bold'
  971. }
  972. },
  973. labelLine: {
  974. //show: false,
  975. length: 20,
  976. },
  977. data: [
  978. <% for (const cq of change_quality_total) { %>
  979. {value: <%- cq.num %>, name: '<%- cq.name %>'},
  980. <% } %>
  981. ]
  982. }
  983. ]
  984. };
  985. // 为echarts对象加载数据
  986. myChart5.setOption(option5);
  987. function echartsReset() {
  988. myChart.resize();
  989. myChart1.resize();
  990. myChart2.resize();
  991. myChart3.resize();
  992. myChart4.resize();
  993. myChart5.resize();
  994. }
  995. $(function () {
  996. $('#change-echarts a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
  997. myChart3.resize();
  998. myChart4.resize();
  999. });
  1000. $('#showFull').click(function () {
  1001. const full=document.getElementById("big-data");
  1002. launchIntoFullscreen(full);
  1003. // $('#exitFull').show();
  1004. // $('#showFull').hide();
  1005. });
  1006. $('#exitFull').click(function () {
  1007. exitFullscreen();
  1008. // $('#exitFull').hide();
  1009. // $('#showFull').show();
  1010. })
  1011. })
  1012. $(window).resize(echartsReset);
  1013. // 数据全屏
  1014. function launchIntoFullscreen(element) {
  1015. if(element.requestFullscreen){
  1016. element.requestFullscreen();
  1017. }
  1018. else if(element.mozRequestFullScreen) {
  1019. element.mozRequestFullScreen();
  1020. }
  1021. else if(element.webkitRequestFullscreen) {
  1022. element.webkitRequestFullscreen();
  1023. }
  1024. else if(element.msRequestFullscreen) {
  1025. element.msRequestFullscreen();
  1026. }
  1027. }
  1028. function exitFullscreen() {
  1029. if(document.exitFullscreen) {
  1030. document.exitFullscreen();
  1031. } else if(document.mozCancelFullScreen) {
  1032. document.mozCancelFullScreen();
  1033. } else if(document.webkitExitFullscreen) {
  1034. document.webkitExitFullscreen();
  1035. }
  1036. }
  1037. document.addEventListener("fullscreenchange", function (event) {
  1038. if (document.fullscreenElement) {
  1039. $('#exitfull-div').show();
  1040. $('#showFull').hide();
  1041. } else {
  1042. $('#exitfull-div').hide();
  1043. $('#showFull').show();
  1044. }
  1045. });
  1046. </script>
  1047. <script src="/public/js/sub_menu.js"></script>
  1048. <script>
  1049. $.subMenu({
  1050. menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
  1051. toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
  1052. key: 'menu.1.0.0',
  1053. miniHint: '#sub-mini-hint', hintKey: 'menu.hint.1.0.1',
  1054. callback: function (info) {
  1055. if (info.mini) {
  1056. $('.panel-title').addClass('fluid');
  1057. $('#sub-menu').removeClass('panel-sidebar');
  1058. } else {
  1059. $('.panel-title').removeClass('fluid');
  1060. $('#sub-menu').addClass('panel-sidebar');
  1061. }
  1062. autoFlashHeight();
  1063. echartsReset();
  1064. }
  1065. });
  1066. </script>
  1067. <script>
  1068. const tenderId = parseInt('<%- tender.id %>');
  1069. $(document).ready(function () {
  1070. // 获取审批流程
  1071. $('a[data-target="#sp-list" ]').on('click', function () {
  1072. const type = $(this).attr('data-type');
  1073. const data = {
  1074. order: $(this).attr('data-order'),
  1075. };
  1076. let url = '';
  1077. let auditConst = '';
  1078. if (type === 'stage') {
  1079. url = '/tender/' + tenderId + '/measure/stage/auditors';
  1080. auditConst = JSON.parse('<%- JSON.stringify(audit.stage) %>');
  1081. } else if (type === 'ledger') {
  1082. url = '/tender/' + tenderId + '/measure/ledger/auditors';
  1083. auditConst = JSON.parse('<%- JSON.stringify(audit.ledger) %>');
  1084. } else if (type === 'material') {
  1085. url = '/tender/' + tenderId + '/measure/material/auditors';
  1086. auditConst = JSON.parse('<%- JSON.stringify(audit.material) %>');
  1087. }
  1088. postData(url, data, function (result) {
  1089. const { auditHistory, auditors, user } = result
  1090. let historyHTML = ''
  1091. const leftAuditors = auditors;
  1092. auditHistory.forEach((auditors, idx) => {
  1093. if(idx === auditHistory.length - 1 && auditHistory.length !== 1) {
  1094. historyHTML += `<div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
  1095. >展开历史审批流程</a></div>`
  1096. }
  1097. historyHTML += `<div class="${idx < auditHistory.length - 1 ? 'fold-card' : ''}">
  1098. <div class="text-center text-muted">${idx + 1}#</div>
  1099. <ul class="timeline-list list-unstyled mt-2">`
  1100. auditors.forEach((auditor, index) => {
  1101. if (index === 0) {
  1102. historyHTML += `<li class="timeline-list-item pb-2">
  1103. <div class="timeline-item-date">
  1104. ${formatDate(auditor.begin_time)}
  1105. </div>
  1106. <div class="timeline-item-tail"></div>
  1107. <div class="timeline-item-icon bg-success text-light">
  1108. <i class="fa fa-caret-down"></i>
  1109. </div>
  1110. <div class="timeline-item-content">
  1111. <div class="card bg-dark border-secondary text-white">
  1112. <div class="card-body p-3">
  1113. <div class="card-text">
  1114. <p class="mb-1"><span
  1115. class="h5">${user.name}</span><span
  1116. class="pull-right text-success">${idx !== 0 ? '重新' : ''}上报审批</span>
  1117. </p>
  1118. <p class="text-muted mb-0">${user.role}</p>
  1119. </div>
  1120. </div>
  1121. </div>
  1122. </div>
  1123. </li>
  1124. <li class="timeline-list-item pb-2">
  1125. <div class="timeline-item-date">
  1126. ${formatDate(auditor.end_time)}
  1127. </div>`
  1128. if(index < auditors.length - 1) {
  1129. historyHTML += `<div class="timeline-item-tail"></div>`
  1130. }
  1131. if(auditor.status === auditConst.status.checked) {
  1132. historyHTML += `<div class="timeline-item-icon bg-success text-light">
  1133. <i class="fa fa-check"></i>
  1134. </div>`
  1135. } else if(auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre) {
  1136. historyHTML += `<div class="timeline-item-icon bg-warning text-light">
  1137. <i class="fa fa-level-up"></i>
  1138. </div>`
  1139. } else if(auditor.status === auditConst.status.checking) {
  1140. historyHTML += `<div class="timeline-item-icon bg-warning text-light">
  1141. <i class="fa fa-ellipsis-h"></i>
  1142. </div>`
  1143. } else {
  1144. historyHTML += `<div class="timeline-item-icon bg-secondary text-light"></div>`
  1145. }
  1146. historyHTML += `<div class="timeline-item-content">
  1147. <div class="card bg-dark border-secondary text-white">
  1148. <div class="card-body p-3">
  1149. <div class="card-text">
  1150. <p class="mb-1"><span class="h5">${auditor.name}</span><span
  1151. class="pull-right ${auditConst.statusClass[auditor.status]}">${auditConst.statusString[auditor.status]}</span>
  1152. </p>
  1153. <p class="text-muted mb-0">${auditor.role}</p>
  1154. </div>
  1155. </div>`
  1156. if (auditor.opinion) {
  1157. historyHTML += `<div class="card-body p-3 border-top">
  1158. <p style="margin: 0;">${auditor.opinion}</p>
  1159. </div>`
  1160. }
  1161. historyHTML += `</div></div></li>`
  1162. } else {
  1163. historyHTML += `<li class="timeline-list-item pb-2">
  1164. <div class="timeline-item-date">
  1165. ${formatDate(auditor.end_time)}
  1166. </div>`
  1167. if(index < auditors.length - 1) {
  1168. historyHTML += `<div class="timeline-item-tail"></div>`
  1169. }
  1170. if(auditor.status === auditConst.status.checked) {
  1171. historyHTML += `<div class="timeline-item-icon bg-success text-light">
  1172. <i class="fa fa-check"></i>
  1173. </div>`
  1174. } else if(auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre) {
  1175. historyHTML += `<div class="timeline-item-icon bg-warning text-light">
  1176. <i class="fa fa-level-up"></i>
  1177. </div>`
  1178. } else if(auditor.status === auditConst.status.checking) {
  1179. historyHTML += `<div class="timeline-item-icon bg-warning text-light">
  1180. <i class="fa fa-ellipsis-h"></i>
  1181. </div>`
  1182. } else {
  1183. historyHTML += `<div class="timeline-item-icon bg-secondary text-light"></div>`
  1184. }
  1185. historyHTML += `<div class="timeline-item-content">
  1186. <div class="card bg-dark border-secondary text-white">
  1187. <div class="card-body p-3">
  1188. <div class="card-text">
  1189. <p class="mb-1"><span class="h5">${auditor.name}</span>
  1190. <span
  1191. class="pull-right
  1192. ${auditConst.statusClass[auditor.status]}">${auditor.status !== auditConst.status.uncheck ? auditConst.statusString[auditor.status] : ''}
  1193. ${auditor.status === auditConst.status.checkNo ? user.name : ''}
  1194. ${auditor.status === auditConst.status.checkNoPre ? (leftAuditors.find(item => item.order === auditor.sort-1) ? leftAuditors.find(item => item.order === auditor.sort-1).name : '') : ''}
  1195. </span>
  1196. </p>
  1197. <p class="text-muted mb-0">${auditor.role}</p>
  1198. </div>
  1199. </div>`
  1200. if (auditor.opinion) {
  1201. historyHTML += `<div class="card-body p-3 border-top">
  1202. <p style="margin: 0;">${auditor.opinion} </p>
  1203. </div>`
  1204. }
  1205. historyHTML += `</div></div></li>`
  1206. }
  1207. })
  1208. historyHTML += '</ul></div>'
  1209. })
  1210. $('#audit-list').empty()
  1211. $('#audit-list').append(historyHTML)
  1212. });
  1213. });
  1214. // 展开/收起历史审核记录
  1215. $('#audit-list').on('click', 'a', function() {
  1216. const type = $(this).data('target')
  1217. const auditCard = $(this).parent().parent()
  1218. console.log('auditCard', auditCard)
  1219. if (type === 'show') {
  1220. $(this).data('target', 'hide')
  1221. auditCard.find('.fold-card').slideDown('swing', () => {
  1222. auditCard.find('#end-target').text($(this).data('idx') + '#')
  1223. auditCard.find('#fold-btn').text('收起历史审核记录')
  1224. })
  1225. } else {
  1226. $(this).data('target', 'show')
  1227. auditCard.find('.fold-card').slideUp('swing', () => {
  1228. auditCard.find('#end-target').text('1#')
  1229. auditCard.find('#fold-btn').text('展开历史审核记录')
  1230. })
  1231. }
  1232. });
  1233. function formatDate(date) {
  1234. if (!date) return '';
  1235. date = new Date(date)
  1236. const year = date.getFullYear();
  1237. let mon = date.getMonth() + 1;
  1238. let day = date.getDate();
  1239. let hour = date.getHours();
  1240. let minute = date.getMinutes();
  1241. let scond = date.getSeconds();
  1242. if (mon < 10) {
  1243. mon = '0' + mon.toString();
  1244. }
  1245. if (day < 10) {
  1246. day = '0' + day.toString();
  1247. }
  1248. if (hour < 10) {
  1249. hour = '0' + hour.toString();
  1250. }
  1251. if (minute < 10) {
  1252. minute = '0' + minute.toString();
  1253. }
  1254. if (scond < 10) {
  1255. scond = '0' + scond.toString();
  1256. }
  1257. return `${year}<span class="text-light">${mon}-${day}</span><span class="text-light">${hour}:${minute}:${scond}</span>`;
  1258. };
  1259. })
  1260. </script>
  1261. <% if (hadMap || ctx.session.sessionUser.is_admin) { %>
  1262. <script src="/public/js/map/turf.min.js"></script>
  1263. <script src="/public/js/map/gcoord.js"></script>
  1264. <script>
  1265. const tenderMapList = JSON.parse(unescape('<%- escape(JSON.stringify(tenderMapList)) %>'));
  1266. </script>
  1267. <% } %>
  1268. <% if (hadMap) { %>
  1269. <!--<script src="//bj.bcebos.com/v1/mapopen/api-demos/js/mapStyle.js"></script>-->
  1270. <script type="text/javascript" src="https://api.map.baidu.com/api?v=1.0&type=webgl&ak=C3hLZAjuWTaCdwnwoYY83APrwlPEj4v7"></script>
  1271. <script type="text/javascript">
  1272. // 画线
  1273. $(function () {
  1274. const map = new BMapGL.Map("map");
  1275. // 创建地图实例
  1276. const polyLineList = [];
  1277. const centerPoint = { lng: 116.404, lat: 39.915 };
  1278. let level = 15;
  1279. const pointList = [];
  1280. const centerList = [];
  1281. for (const tm of tenderMapList) {
  1282. if (tm.map_json) {
  1283. const map_json = JSON.parse(unescape(escape(tm.map_json)));
  1284. const lngLatList = [];
  1285. for (const mj of map_json) {
  1286. const result = gcoord.transform([mj.lng, mj.lat], gcoord.WGS84, gcoord.BD09);
  1287. lngLatList.push(new BMapGL.Point(result[0], result[1]));
  1288. }
  1289. polyLineList.push({
  1290. map: lngLatList,
  1291. color: tm.color,
  1292. });
  1293. const center = JSON.parse(tm.center);
  1294. pointList.push(turf.point([center.lng, center.lat]));
  1295. if (tm.tips) {
  1296. const centerResult = gcoord.transform([map_json[Math.ceil(map_json.length/2)].lng, map_json[Math.ceil(map_json.length/2)].lat], gcoord.WGS84, gcoord.BD09);
  1297. centerList.push({ map: new BMapGL.Point(centerResult[0], centerResult[1]), color: tm.color, tips: tm.tips });
  1298. }
  1299. }
  1300. }
  1301. if (pointList.length > 0) {
  1302. let maxDistance = 0;
  1303. // 中心点计算
  1304. const features = turf.featureCollection(pointList);
  1305. const center = turf.center(features);
  1306. if (center && center.geometry && center.geometry.coordinates && center.geometry.coordinates.length === 2) {
  1307. centerPoint.lng = _.round(center.geometry.coordinates[0], 4);
  1308. centerPoint.lat = _.round(center.geometry.coordinates[1], 4);
  1309. }
  1310. // 地图级别计算
  1311. if (pointList.length === 1) {
  1312. // 只有一条路线
  1313. const map_json = JSON.parse(unescape(escape(tenderMapList[0].map_json)));
  1314. for (const mj of map_json) {
  1315. const distance = turf.distance(turf.point([mj.lng, mj.lat]), turf.point([centerPoint.lng, centerPoint.lat]));
  1316. if (distance > maxDistance) {
  1317. maxDistance = distance;
  1318. }
  1319. }
  1320. } else {
  1321. for (const c of pointList) {
  1322. const distance = turf.distance(c, turf.point([centerPoint.lng, centerPoint.lat]));
  1323. if (distance > maxDistance) {
  1324. maxDistance = distance;
  1325. }
  1326. }
  1327. }
  1328. if (maxDistance === 0) {
  1329. level = 15;
  1330. } else {
  1331. // 级别区间
  1332. // const range = [0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 25, 50, 100, 200, 500, 1000, 2000, 5000, 10000];
  1333. const range = [10000, 5000, 2000, 1000, 500, 200, 100, 50, 25, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, 0.02];
  1334. level = _.findIndex(range, function (item) {
  1335. return item <= maxDistance;
  1336. })
  1337. level = level + 1;
  1338. }
  1339. const result = gcoord.transform([centerPoint.lng, centerPoint.lat], gcoord.WGS84, gcoord.BD09);
  1340. centerPoint.lng = result[0];
  1341. centerPoint.lat = result[1];
  1342. }
  1343. // 初始化地图,设置中心点坐标和地图级别
  1344. const point = new BMapGL.Point(centerPoint.lng, centerPoint.lat);
  1345. map.centerAndZoom(point, level);
  1346. // const LocationControl = new BMapGL.LocationControl(); // 添加比例尺控件
  1347. // map.addControl(LocationControl);
  1348. map.enableScrollWheelZoom(true);
  1349. map.setMapStyleV2({styleId: '20d4aea41cf71387395f2dc835f1c4b6'});
  1350. if (polyLineList.length > 0) {
  1351. for (const pl of polyLineList) {
  1352. const polyline = new BMapGL.Polyline(pl.map, {strokeColor: pl.color, strokeWeight:10, strokeOpacity:1});
  1353. map.addOverlay(polyline);
  1354. }
  1355. }
  1356. if (centerList.length > 0) {
  1357. for (const cl of centerList) {
  1358. const opts = {
  1359. position : cl.map, // 指定文本标注所在的地理位置
  1360. offset : new BMapGL.Size(5, 0) //设置文本偏移量
  1361. }
  1362. const label = new BMapGL.Label(cl.tips, opts); // 创建文本标注对象
  1363. label.setStyle({
  1364. height: '18px',
  1365. lineHeight : '18px',
  1366. color : cl.color,
  1367. borderRadius: '5px',
  1368. borderColor: cl.color,
  1369. padding: '0px 5px',
  1370. fontSize : '12px',
  1371. // fontFamily: '微软雅黑',
  1372. });
  1373. map.addOverlay(label);
  1374. // const opts = {
  1375. // width: 0,
  1376. // height: 0,
  1377. // maxwidth: 220,
  1378. // title: '路线标注:',
  1379. // };
  1380. // const infoWindow = new BMapGL.InfoWindow(cl.tips, opts);
  1381. // map.openInfoWindow(infoWindow, cl.map);
  1382. }
  1383. }
  1384. })
  1385. </script>
  1386. <% } %>