detail.ejs 90 KB

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