detail.ejs 90 KB

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