detail.ejs 90 KB

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