detail.ejs 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366
  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="float-right 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>含税(信息价/指数法)</th><td width="70"><%= materialData.m_tp !== null ? ctx.helper.round(ctx.helper.mul(materialData.m_tp, 1+materialData.rate/100), 2) : '0' %></td><td width="70"><%= 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 width="70"><%= materialData.m_tp !== null ? ctx.helper.round(materialData.m_tp, 2) : '0' %></td><td width="70"><%= materialData.ex_tp !== null ? ctx.helper.round(materialData.ex_tp, 2) : '0' %></td></tr>
  312. <% } else { %>
  313. <tr><th>含税(信息价/指数法)</th><td width="70">0</td><td width="70">0</td></tr>
  314. <tr><th>不含税(信息价/指数法)</th><td width="70">0</td><td width="70">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. right: '0%',
  396. orient:'vertical'
  397. },
  398. series: [
  399. {
  400. name: '金额',
  401. type: 'pie',
  402. top:'0%',
  403. right:'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: '3%',
  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. rotate: 30,
  458. formatter: function (value, index) {
  459. if (value < 0) {
  460. let newValue = Math.abs(value);
  461. if (newValue >= 10000 && newValue < 10000000) {
  462. newValue = newValue / 10000 + "万";
  463. } else if (newValue >= 10000000) {
  464. newValue = newValue / 10000000 + "千万";
  465. }
  466. value = '-' + newValue;
  467. }
  468. if (value >= 10000 && value < 10000000) {
  469. value = value / 10000 + "万";
  470. } else if (value >= 10000000) {
  471. value = value / 10000000 + "千万";
  472. }
  473. return value;
  474. }
  475. },
  476. splitArea : {show : true}
  477. },
  478. series: [{
  479. 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 %>,],
  480. type: 'bar',
  481. itemStyle:{
  482. normal:{
  483. color:function(params){
  484. 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)'];
  485. return colorlist[params.dataIndex];
  486. }
  487. }
  488. }
  489. }]
  490. };
  491. // 为echarts对象加载数据
  492. myChart1.setOption(option1);
  493. //计量支付概况 结束//
  494. //章节计量情况图//
  495. var myChart2 = echarts.init(document.getElementById('jlchart3'), 'dark');
  496. var option2 = {
  497. 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)'],
  498. backgroundColor: '#343a40 ',
  499. tooltip: {
  500. trigger: 'axis',
  501. axisPointer: {
  502. type: 'shadow'
  503. }
  504. },
  505. legend: {
  506. data: ['台账金额','截止本期计量']
  507. },
  508. grid: {
  509. left: '3%',
  510. right: '4%',
  511. bottom: '3%',
  512. containLabel: true
  513. },
  514. yAxis: {
  515. type : 'value',
  516. name : '金额',
  517. position:'left',
  518. axisLabel : {
  519. // if (ctx.tender.info.display.thousandth) {
  520. // formatter: function (value, index) {
  521. // return value.format2Str('#,##0.######') + ' 元'
  522. // }
  523. formatter: function (value, index) {
  524. if (value < 0) {
  525. let newValue = Math.abs(value);
  526. if (newValue >= 10000 && newValue < 10000000) {
  527. newValue = newValue / 10000 + "万";
  528. } else if (newValue >= 10000000) {
  529. newValue = newValue / 10000000 + "千万";
  530. }
  531. value = '-' + newValue;
  532. }
  533. if (value >= 10000 && value < 10000000) {
  534. value = value / 10000 + "万";
  535. } else if (value >= 10000000) {
  536. value = value / 10000000 + "千万";
  537. }
  538. return value;
  539. }
  540. },
  541. splitArea : {show : true}
  542. },
  543. xAxis: {
  544. type: 'category',
  545. data: [
  546. <% for (const gcl of gclChapter) { %>
  547. '<%- gcl.code %>章',
  548. <% } %>
  549. ]
  550. },
  551. series: [
  552. {
  553. name: '台账金额',
  554. type: 'bar',
  555. data: [
  556. <% for (const gcl of gclChapter) { %>
  557. <%- gcl.total_price %>,
  558. <% } %>
  559. ]
  560. },
  561. {
  562. name: '截止本期计量',
  563. type: 'bar',
  564. data: [
  565. <% for (const gcl of gclChapter) { %>
  566. <%- gcl.end_gather_tp %>,
  567. <% } %>
  568. ]
  569. }
  570. ]
  571. };
  572. // 为echarts对象加载数据
  573. myChart2.setOption(option2);
  574. //4 标段期数计量进度//
  575. var myChart3 = echarts.init(document.getElementById('chartContainer4'), 'dark');
  576. var option3 = {
  577. 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)'],
  578. backgroundColor: '#343a40 ',
  579. title : {
  580. text: ''
  581. },
  582. tooltip : {
  583. trigger: 'axis',
  584. },
  585. calculable : true,
  586. legend: {
  587. itemWidth:15,
  588. data:['本期合同计量','本期数量变更计量','截至上期累计完成','本期完成计量','完成度']
  589. },
  590. dataZoom: [
  591. {show: true, start: 0, end: 100,height:10,bottom:30}
  592. ],
  593. xAxis : [
  594. {
  595. type : 'category',
  596. splitLine : {show : true},
  597. data : [
  598. <% for (const s of stages) {%>
  599. '第<%- s.order %>期',
  600. <% } %>
  601. ]
  602. }
  603. ],
  604. yAxis : [
  605. {
  606. type : 'value',
  607. name : '金额',
  608. position:'left',
  609. axisLabel : {
  610. formatter: function (value, index) {
  611. if (value < 0) {
  612. let newValue = Math.abs(value);
  613. if (newValue >= 10000 && newValue < 10000000) {
  614. newValue = newValue / 10000 + "万";
  615. } else if (newValue >= 10000000) {
  616. newValue = newValue / 10000000 + "千万";
  617. }
  618. value = '-' + newValue;
  619. }
  620. if (value >= 10000 && value < 10000000) {
  621. value = value / 10000 + "万";
  622. } else if (value >= 10000000) {
  623. value = value / 10000000 + "千万";
  624. }
  625. return value;
  626. }
  627. },
  628. splitArea : {show : true},
  629. splitLine : {show : true},
  630. },
  631. {
  632. type : 'value',
  633. name:'完成度',
  634. axisLabel : {
  635. formatter: '{value} %'
  636. },
  637. position: 'right',
  638. splitArea : {show : false},
  639. splitLine : {show : false},
  640. }
  641. ],
  642. series : [
  643. {
  644. name:'本期合同计量',
  645. type:'bar',
  646. tooltip : {
  647. trigger: 'item',
  648. <% if (ctx.tender.info.display.thousandth) { %>
  649. formatter: function (params, ticket, callback) {
  650. return params.name + '<br/>' + params.seriesName + ': ' + params.value.format2Str('#,##0.######') + ' 元';
  651. }
  652. <% } else { %>
  653. tooltip : {trigger: 'item',formatter: "{b} <br/>{a}:{c}元"},
  654. <% } %>
  655. },
  656. stack: '合同',
  657. data:[
  658. <% for (const s of stages) {%>
  659. <%- s.contract_tp %>,
  660. <% } %>
  661. ]
  662. },
  663. {
  664. name:'本期数量变更计量',
  665. type:'bar',
  666. tooltip : {
  667. trigger: 'item',
  668. <% if (ctx.tender.info.display.thousandth) { %>
  669. formatter: function (params, ticket, callback) {
  670. return params.name + '<br/>' + params.seriesName + ': ' + params.value.format2Str('#,##0.######') + ' 元';
  671. }
  672. <% } else { %>
  673. tooltip : {trigger: 'item',formatter: "{b} <br/>{a}:{c}元"},
  674. <% } %>
  675. },
  676. stack: '变更',
  677. data:[
  678. <% for (const s of stages) {%>
  679. <%- s.qc_tp %>,
  680. <% } %>
  681. ]
  682. },
  683. {
  684. name:'截至上期累计完成',
  685. type:'bar',
  686. tooltip : {
  687. trigger: 'item',
  688. <% if (ctx.tender.info.display.thousandth) { %>
  689. formatter: function (params, ticket, callback) {
  690. return params.name + '<br/>' + params.seriesName + ': ' + params.value.format2Str('#,##0.######') + ' 元';
  691. }
  692. <% } else { %>
  693. tooltip : {trigger: 'item',formatter: "{b} <br/>{a}:{c}元"},
  694. <% } %>
  695. },
  696. stack: '完成',
  697. data:[
  698. <% for (const s of stages) {%>
  699. <%- ctx.helper.add(s.pre_contract_tp, s.pre_qc_tp) %>,
  700. <% } %>
  701. ]
  702. },
  703. {
  704. name:'本期完成计量',
  705. type:'bar',
  706. tooltip : {
  707. trigger: 'item',
  708. <% if (ctx.tender.info.display.thousandth) { %>
  709. formatter: function (params, ticket, callback) {
  710. return params.name + '<br/>' + params.seriesName + ': ' + params.value.format2Str('#,##0.######') + ' 元';
  711. }
  712. <% } else { %>
  713. tooltip : {trigger: 'item',formatter: "{b} <br/>{a}:{c}元"},
  714. <% } %>
  715. },
  716. stack: '完成',
  717. data:[
  718. <% for (const s of stages) {%>
  719. <%- ctx.helper.add(s.contract_tp, s.qc_tp) %>,
  720. <% } %>
  721. ]
  722. },
  723. {
  724. name:'完成度',
  725. type:'line',
  726. tooltip : {trigger: 'axis',formatter: "{b}占总标段<br/>{a}:{c} %"},
  727. yAxisIndex: 1,
  728. data:[
  729. <% for (const s of stages) {%>
  730. <%- ctx.helper.mul(ctx.helper.div(ctx.helper.add(s.contract_tp, s.qc_tp), tender.sum, 2), 100) %>,
  731. <% } %>
  732. ]
  733. },
  734. ]
  735. };
  736. // 为echarts对象加载数据
  737. myChart3.setOption(option3);
  738. //4 标段期数计量进度//
  739. //3 标段月进度//
  740. // 基于准备好的dom,初始化echarts图表
  741. var myChart4 = echarts.init(document.getElementById('chartContainer3'), 'dark');
  742. var option4 = {
  743. color:["#17a2b8","#28a745"],
  744. backgroundColor: '#343a40 ',
  745. title : {
  746. text: ''
  747. },
  748. tooltip : {
  749. trigger: 'axis',
  750. formatter: function (params, ticket, callback) {
  751. let sHint = '';
  752. for (const param of params) {
  753. if (sHint !== '') {
  754. sHint += '<br>';
  755. }
  756. if (sHint === '' && param.name !== '') {
  757. sHint = param.name + '<br>';
  758. }
  759. sHint += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + param.color +'"></span>';
  760. if (param.data) {
  761. sHint += param.seriesName + ': ' + param.data + ' %';
  762. } else {
  763. sHint += param.seriesName + ': -';
  764. }
  765. }
  766. return sHint;
  767. },
  768. },
  769. legend: {
  770. data:['截止本月完成','本月完成']
  771. },
  772. toolbox: {
  773. show : true,
  774. right:'3%',
  775. feature : {
  776. magicType : {
  777. show: true,
  778. type: ['line', 'bar'],
  779. title:{
  780. line:'切换为折线图',
  781. bar:'切换为柱状图'
  782. }
  783. }
  784. }
  785. },
  786. dataZoom : {
  787. show : true,
  788. start : 50,
  789. end : 100,
  790. height:10,
  791. bottom:30
  792. },
  793. xAxis : [
  794. {
  795. type : 'category',
  796. boundaryGap : true,
  797. data : [
  798. <% for (const mp of monthProgress) { %>
  799. '<%- mp.month %>',
  800. <% } %>
  801. ]
  802. }
  803. ],
  804. yAxis : [
  805. {
  806. type : 'value',
  807. axisLabel : {
  808. formatter: '{value} %'
  809. },
  810. splitArea : {show : true}
  811. }
  812. ],
  813. series : [
  814. {
  815. name:'截止本月完成',
  816. type:'line',
  817. itemStyle: {
  818. normal: {
  819. lineStyle: {
  820. shadowColor : 'rgba(0,0,0,0.4)',
  821. shadowBlur: 5,
  822. shadowOffsetX: 3,
  823. shadowOffsetY: 3
  824. }
  825. }
  826. },
  827. areaStyle: { // 区域填充样式
  828. color: { // 填充的颜色 // 线性渐变,前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置
  829. type: 'linear',
  830. x: 0,
  831. y: 0,
  832. x2: 0,
  833. y2: 1,
  834. colorStops: [
  835. {
  836. offset: 0,
  837. color: 'rgba(37,234,255,0.7)', // 0% 处的颜色
  838. },
  839. {
  840. offset: 1,
  841. color: 'rgba(37,234,255,0.7)' // 100% 处的颜色
  842. }
  843. ],
  844. global: false, // 缺省为 false
  845. }
  846. },
  847. data:[
  848. <% for (const mp of monthProgress) { %>
  849. <%- mp.end_ratio %>,
  850. <% } %>
  851. ]
  852. },
  853. {
  854. name:'本月完成',
  855. type:'line',
  856. itemStyle: {
  857. normal: {
  858. lineStyle: {
  859. shadowColor : 'rgba(0,0,0,0.4)',
  860. shadowBlur: 5,
  861. shadowOffsetX: 3,
  862. shadowOffsetY: 3
  863. }
  864. }
  865. },
  866. areaStyle: { // 区域填充样式
  867. color: { // 填充的颜色 // 线性渐变,前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置
  868. type: 'linear',
  869. x: 0,
  870. y: 0,
  871. x2: 0,
  872. y2: 1,
  873. colorStops: [
  874. {
  875. offset: 0,
  876. color: 'rgba(40,167,69,0.7)', // 0% 处的颜色
  877. },
  878. {
  879. offset: 1,
  880. color: 'rgba(40,167,69,0.7)' // 100% 处的颜色
  881. }
  882. ],
  883. global: false, // 缺省为 false
  884. }
  885. },
  886. data:[
  887. <% for (const mp of monthProgress) { %>
  888. <%- mp.ratio %>,
  889. <% } %>
  890. ]
  891. }
  892. ]
  893. };
  894. // 为echarts对象加载数据
  895. myChart4.setOption(option4);
  896. //3 标段月进度//
  897. //变更审批进度//
  898. var myChart5 = echarts.init(document.getElementById('bgchart'), 'dark');
  899. var option5 = {
  900. 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)'],
  901. backgroundColor: '#343a40 ',
  902. tooltip: {
  903. trigger: 'item'
  904. },
  905. legend: {
  906. top: '0%',
  907. right: '0%',
  908. orient:'vertical',
  909. itemWidth:15,
  910. data: ['一般变更', '较大变更', '重大变更', '待上报', '审批中', '已完成']
  911. },
  912. series: [
  913. {
  914. name: '数量',
  915. type: 'pie',
  916. top:'0%',
  917. right:'60%',
  918. selectedMode: 'single',
  919. radius: '50%',
  920. avoidLabelOverlap: false,
  921. label: {
  922. show:false,
  923. //position: 'inner',
  924. //fontSize: 14,
  925. },
  926. labelLine: {
  927. show: false
  928. },
  929. data: [
  930. <% for (const cs of change_status_total) { %>
  931. {value: <%- cs.num %>, name: '<%- cs.name %>'},
  932. <% } %>
  933. ]
  934. },
  935. {
  936. name: '数量',
  937. type: 'pie',
  938. top:'0%',
  939. right:'60%',
  940. radius: ['70%', '100%'],
  941. avoidLabelOverlap: false,
  942. label: {
  943. show: false,
  944. position: 'center'
  945. },
  946. emphasis: {
  947. label: {
  948. show: false,
  949. //fontSize: '14',
  950. //fontWeight: 'bold'
  951. }
  952. },
  953. labelLine: {
  954. //show: false,
  955. length: 20,
  956. },
  957. data: [
  958. <% for (const cq of change_quality_total) { %>
  959. {value: <%- cq.num %>, name: '<%- cq.name %>'},
  960. <% } %>
  961. ]
  962. }
  963. ]
  964. };
  965. // 为echarts对象加载数据
  966. myChart5.setOption(option5);
  967. function echartsReset() {
  968. myChart.resize();
  969. myChart1.resize();
  970. myChart2.resize();
  971. myChart3.resize();
  972. myChart4.resize();
  973. myChart5.resize();
  974. }
  975. $(function () {
  976. $('#change-echarts a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
  977. console.log('hello');
  978. myChart3.resize();
  979. myChart4.resize();
  980. });
  981. $('#showFull').click(function () {
  982. const full=document.getElementById("big-data");
  983. launchIntoFullscreen(full);
  984. // $('#exitFull').show();
  985. // $('#showFull').hide();
  986. });
  987. $('#exitFull').click(function () {
  988. exitFullscreen();
  989. // $('#exitFull').hide();
  990. // $('#showFull').show();
  991. })
  992. })
  993. $(window).resize(echartsReset);
  994. // 数据全屏
  995. function launchIntoFullscreen(element) {
  996. if(element.requestFullscreen){
  997. element.requestFullscreen();
  998. }
  999. else if(element.mozRequestFullScreen) {
  1000. element.mozRequestFullScreen();
  1001. }
  1002. else if(element.webkitRequestFullscreen) {
  1003. element.webkitRequestFullscreen();
  1004. }
  1005. else if(element.msRequestFullscreen) {
  1006. element.msRequestFullscreen();
  1007. }
  1008. }
  1009. function exitFullscreen() {
  1010. if(document.exitFullscreen) {
  1011. document.exitFullscreen();
  1012. } else if(document.mozCancelFullScreen) {
  1013. document.mozCancelFullScreen();
  1014. } else if(document.webkitExitFullscreen) {
  1015. document.webkitExitFullscreen();
  1016. }
  1017. }
  1018. document.addEventListener("fullscreenchange", function (event) {
  1019. if (document.fullscreenElement) {
  1020. $('#exitfull-div').show();
  1021. $('#showFull').hide();
  1022. } else {
  1023. $('#exitfull-div').hide();
  1024. $('#showFull').show();
  1025. }
  1026. });
  1027. </script>
  1028. <script src="/public/js/sub_menu.js"></script>
  1029. <script>
  1030. $.subMenu({
  1031. menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
  1032. toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
  1033. key: 'menu.1.0.0',
  1034. miniHint: '#sub-mini-hint', hintKey: 'menu.hint.1.0.1',
  1035. callback: function (info) {
  1036. if (info.mini) {
  1037. $('.panel-title').addClass('fluid');
  1038. $('#sub-menu').removeClass('panel-sidebar');
  1039. } else {
  1040. $('.panel-title').removeClass('fluid');
  1041. $('#sub-menu').addClass('panel-sidebar');
  1042. }
  1043. autoFlashHeight();
  1044. echartsReset();
  1045. }
  1046. });
  1047. </script>
  1048. <script>
  1049. const tenderId = parseInt('<%- tender.id %>');
  1050. $(document).ready(function () {
  1051. // 获取审批流程
  1052. $('a[data-target="#sp-list" ]').on('click', function () {
  1053. const type = $(this).attr('data-type');
  1054. const data = {
  1055. order: $(this).attr('data-order'),
  1056. };
  1057. let url = '';
  1058. let auditConst = '';
  1059. if (type === 'stage') {
  1060. url = '/tender/' + tenderId + '/measure/stage/auditors';
  1061. auditConst = JSON.parse('<%- JSON.stringify(audit.stage) %>');
  1062. } else if (type === 'ledger') {
  1063. url = '/tender/' + tenderId + '/measure/ledger/auditors';
  1064. auditConst = JSON.parse('<%- JSON.stringify(audit.ledger) %>');
  1065. } else if (type === 'material') {
  1066. url = '/tender/' + tenderId + '/measure/material/auditors';
  1067. auditConst = JSON.parse('<%- JSON.stringify(audit.material) %>');
  1068. }
  1069. postData(url, data, function (result) {
  1070. const { auditHistory, auditors, user } = result
  1071. let historyHTML = ''
  1072. const leftAuditors = auditors;
  1073. auditHistory.forEach((auditors, idx) => {
  1074. if(idx === auditHistory.length - 1 && auditHistory.length !== 1) {
  1075. historyHTML += `<div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
  1076. >展开历史审批流程</a></div>`
  1077. }
  1078. historyHTML += `<div class="${idx < auditHistory.length - 1 ? 'fold-card' : ''}">
  1079. <div class="text-center text-muted">${idx + 1}#</div>
  1080. <ul class="timeline-list list-unstyled mt-2">`
  1081. auditors.forEach((auditor, index) => {
  1082. if (index === 0) {
  1083. historyHTML += `<li class="timeline-list-item pb-2">
  1084. <div class="timeline-item-date">
  1085. ${formatDate(auditor.begin_time)}
  1086. </div>
  1087. <div class="timeline-item-tail"></div>
  1088. <div class="timeline-item-icon bg-success text-light">
  1089. <i class="fa fa-caret-down"></i>
  1090. </div>
  1091. <div class="timeline-item-content">
  1092. <div class="card bg-dark border-secondary text-white">
  1093. <div class="card-body p-3">
  1094. <div class="card-text">
  1095. <p class="mb-1"><span
  1096. class="h5">${user.name}</span><span
  1097. class="pull-right text-success">${idx !== 0 ? '重新' : ''}上报审批</span>
  1098. </p>
  1099. <p class="text-muted mb-0">${user.role}</p>
  1100. </div>
  1101. </div>
  1102. </div>
  1103. </div>
  1104. </li>
  1105. <li class="timeline-list-item pb-2">
  1106. <div class="timeline-item-date">
  1107. ${formatDate(auditor.end_time)}
  1108. </div>`
  1109. if(index < auditors.length - 1) {
  1110. historyHTML += `<div class="timeline-item-tail"></div>`
  1111. }
  1112. if(auditor.status === auditConst.status.checked) {
  1113. historyHTML += `<div class="timeline-item-icon bg-success text-light">
  1114. <i class="fa fa-check"></i>
  1115. </div>`
  1116. } else if(auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre) {
  1117. historyHTML += `<div class="timeline-item-icon bg-warning text-light">
  1118. <i class="fa fa-level-up"></i>
  1119. </div>`
  1120. } else if(auditor.status === auditConst.status.checking) {
  1121. historyHTML += `<div class="timeline-item-icon bg-warning text-light">
  1122. <i class="fa fa-ellipsis-h"></i>
  1123. </div>`
  1124. } else {
  1125. historyHTML += `<div class="timeline-item-icon bg-secondary text-light"></div>`
  1126. }
  1127. historyHTML += `<div class="timeline-item-content">
  1128. <div class="card bg-dark border-secondary text-white">
  1129. <div class="card-body p-3">
  1130. <div class="card-text">
  1131. <p class="mb-1"><span class="h5">${auditor.name}</span><span
  1132. class="pull-right ${auditConst.statusClass[auditor.status]}">${auditConst.statusString[auditor.status]}</span>
  1133. </p>
  1134. <p class="text-muted mb-0">${auditor.role}</p>
  1135. </div>
  1136. </div>`
  1137. if (auditor.opinion) {
  1138. historyHTML += `<div class="card-body p-3 border-top">
  1139. <p style="margin: 0;">${auditor.opinion}</p>
  1140. </div>`
  1141. }
  1142. historyHTML += `</div></div></li>`
  1143. } else {
  1144. historyHTML += `<li class="timeline-list-item pb-2">
  1145. <div class="timeline-item-date">
  1146. ${formatDate(auditor.end_time)}
  1147. </div>`
  1148. if(index < auditors.length - 1) {
  1149. historyHTML += `<div class="timeline-item-tail"></div>`
  1150. }
  1151. if(auditor.status === auditConst.status.checked) {
  1152. historyHTML += `<div class="timeline-item-icon bg-success text-light">
  1153. <i class="fa fa-check"></i>
  1154. </div>`
  1155. } else if(auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre) {
  1156. historyHTML += `<div class="timeline-item-icon bg-warning text-light">
  1157. <i class="fa fa-level-up"></i>
  1158. </div>`
  1159. } else if(auditor.status === auditConst.status.checking) {
  1160. historyHTML += `<div class="timeline-item-icon bg-warning text-light">
  1161. <i class="fa fa-ellipsis-h"></i>
  1162. </div>`
  1163. } else {
  1164. historyHTML += `<div class="timeline-item-icon bg-secondary text-light"></div>`
  1165. }
  1166. historyHTML += `<div class="timeline-item-content">
  1167. <div class="card bg-dark border-secondary text-white">
  1168. <div class="card-body p-3">
  1169. <div class="card-text">
  1170. <p class="mb-1"><span class="h5">${auditor.name}</span>
  1171. <span
  1172. class="pull-right
  1173. ${auditConst.statusClass[auditor.status]}">${auditor.status !== auditConst.status.uncheck ? auditConst.statusString[auditor.status] : ''}
  1174. ${auditor.status === auditConst.status.checkNo ? user.name : ''}
  1175. ${auditor.status === auditConst.status.checkNoPre ? (leftAuditors.find(item => item.order === auditor.sort-1) ? leftAuditors.find(item => item.order === auditor.sort-1).name : '') : ''}
  1176. </span>
  1177. </p>
  1178. <p class="text-muted mb-0">${auditor.role}</p>
  1179. </div>
  1180. </div>`
  1181. if (auditor.opinion) {
  1182. historyHTML += `<div class="card-body p-3 border-top">
  1183. <p style="margin: 0;">${auditor.opinion} </p>
  1184. </div>`
  1185. }
  1186. historyHTML += `</div></div></li>`
  1187. }
  1188. })
  1189. historyHTML += '</ul></div>'
  1190. })
  1191. $('#audit-list').empty()
  1192. $('#audit-list').append(historyHTML)
  1193. });
  1194. });
  1195. // 展开/收起历史审核记录
  1196. $('#audit-list').on('click', 'a', function() {
  1197. const type = $(this).data('target')
  1198. const auditCard = $(this).parent().parent()
  1199. console.log('auditCard', auditCard)
  1200. if (type === 'show') {
  1201. $(this).data('target', 'hide')
  1202. auditCard.find('.fold-card').slideDown('swing', () => {
  1203. auditCard.find('#end-target').text($(this).data('idx') + '#')
  1204. auditCard.find('#fold-btn').text('收起历史审核记录')
  1205. })
  1206. } else {
  1207. $(this).data('target', 'show')
  1208. auditCard.find('.fold-card').slideUp('swing', () => {
  1209. auditCard.find('#end-target').text('1#')
  1210. auditCard.find('#fold-btn').text('展开历史审核记录')
  1211. })
  1212. }
  1213. });
  1214. function formatDate(date) {
  1215. if (!date) return '';
  1216. date = new Date(date)
  1217. const year = date.getFullYear();
  1218. let mon = date.getMonth() + 1;
  1219. let day = date.getDate();
  1220. let hour = date.getHours();
  1221. let minute = date.getMinutes();
  1222. let scond = date.getSeconds();
  1223. if (mon < 10) {
  1224. mon = '0' + mon.toString();
  1225. }
  1226. if (day < 10) {
  1227. day = '0' + day.toString();
  1228. }
  1229. if (hour < 10) {
  1230. hour = '0' + hour.toString();
  1231. }
  1232. if (minute < 10) {
  1233. minute = '0' + minute.toString();
  1234. }
  1235. if (scond < 10) {
  1236. scond = '0' + scond.toString();
  1237. }
  1238. return `${year}<span class="text-light">${mon}-${day}</span><span class="text-light">${hour}:${minute}:${scond}</span>`;
  1239. };
  1240. })
  1241. </script>
  1242. <% if (hadMap || ctx.session.sessionUser.is_admin) { %>
  1243. <script src="/public/js/map/turf.min.js"></script>
  1244. <script src="/public/js/map/gcoord.js"></script>
  1245. <script>
  1246. const tenderMapList = JSON.parse(unescape('<%- escape(JSON.stringify(tenderMapList)) %>'));
  1247. </script>
  1248. <% } %>
  1249. <% if (hadMap) { %>
  1250. <!--<script src="//bj.bcebos.com/v1/mapopen/api-demos/js/mapStyle.js"></script>-->
  1251. <script type="text/javascript" src="https://api.map.baidu.com/api?v=1.0&type=webgl&ak=C3hLZAjuWTaCdwnwoYY83APrwlPEj4v7"></script>
  1252. <script type="text/javascript">
  1253. // 画线
  1254. $(function () {
  1255. const map = new BMapGL.Map("map");
  1256. // 创建地图实例
  1257. const polyLineList = [];
  1258. const centerPoint = { lng: 116.404, lat: 39.915 };
  1259. let level = 15;
  1260. const pointList = [];
  1261. const centerList = [];
  1262. for (const tm of tenderMapList) {
  1263. if (tm.map_json) {
  1264. const map_json = JSON.parse(unescape(escape(tm.map_json)));
  1265. const lngLatList = [];
  1266. for (const mj of map_json) {
  1267. const result = gcoord.transform([mj.lng, mj.lat], gcoord.WGS84, gcoord.BD09);
  1268. lngLatList.push(new BMapGL.Point(result[0], result[1]));
  1269. }
  1270. polyLineList.push({
  1271. map: lngLatList,
  1272. color: tm.color,
  1273. });
  1274. const center = JSON.parse(tm.center);
  1275. pointList.push(turf.point([center.lng, center.lat]));
  1276. if (tm.tips) {
  1277. 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);
  1278. centerList.push({ map: new BMapGL.Point(centerResult[0], centerResult[1]), color: tm.color, tips: tm.tips });
  1279. }
  1280. }
  1281. }
  1282. if (pointList.length > 0) {
  1283. let maxDistance = 0;
  1284. // 中心点计算
  1285. const features = turf.featureCollection(pointList);
  1286. const center = turf.center(features);
  1287. if (center && center.geometry && center.geometry.coordinates && center.geometry.coordinates.length === 2) {
  1288. centerPoint.lng = _.round(center.geometry.coordinates[0], 4);
  1289. centerPoint.lat = _.round(center.geometry.coordinates[1], 4);
  1290. }
  1291. // 地图级别计算
  1292. for (const c of pointList) {
  1293. const distance = turf.distance(c, turf.point([centerPoint.lng, centerPoint.lat]));
  1294. if (distance > maxDistance) {
  1295. maxDistance = distance;
  1296. }
  1297. }
  1298. const result = gcoord.transform([centerPoint.lng, centerPoint.lat], gcoord.WGS84, gcoord.BD09);
  1299. centerPoint.lng = result[0];
  1300. centerPoint.lat = result[1];
  1301. // 级别区间
  1302. // 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];
  1303. 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];
  1304. level = _.findIndex(range, function (item) {
  1305. return item <= maxDistance;
  1306. })
  1307. level = level + 1;
  1308. }
  1309. // 初始化地图,设置中心点坐标和地图级别
  1310. const point = new BMapGL.Point(centerPoint.lng, centerPoint.lat);
  1311. map.centerAndZoom(point, level);
  1312. // const LocationControl = new BMapGL.LocationControl(); // 添加比例尺控件
  1313. // map.addControl(LocationControl);
  1314. map.enableScrollWheelZoom(true);
  1315. map.setMapStyleV2({styleId: '20d4aea41cf71387395f2dc835f1c4b6'});
  1316. if (polyLineList.length > 0) {
  1317. for (const pl of polyLineList) {
  1318. const polyline = new BMapGL.Polyline(pl.map, {strokeColor: pl.color, strokeWeight:10, strokeOpacity:1});
  1319. map.addOverlay(polyline);
  1320. }
  1321. }
  1322. if (centerList.length > 0) {
  1323. for (const cl of centerList) {
  1324. const opts = {
  1325. position : cl.map, // 指定文本标注所在的地理位置
  1326. offset : new BMapGL.Size(5, 5) //设置文本偏移量
  1327. }
  1328. const label = new BMapGL.Label(cl.tips, opts); // 创建文本标注对象
  1329. label.setStyle({
  1330. color : cl.color,
  1331. fontSize : '10px',
  1332. height : '18px',
  1333. lineHeight : '18px',
  1334. fontFamily: '微软雅黑',
  1335. border: '1px solid ' + cl.color,
  1336. });
  1337. map.addOverlay(label);
  1338. }
  1339. }
  1340. })
  1341. </script>
  1342. <% } %>