index.ejs 98 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715
  1. <link href="/public/css/bootstrap/bootstrap-colorpicker.min.css" rel="stylesheet">
  2. <div class="panel-content" style="background:#2c3237 !important">
  3. <div class="panel-title fluid border-top-0" style="background:#2c3237 !important">
  4. <div class="title-main d-flex justify-content-between">
  5. <div class="d-inline-block mr-2">
  6. <div class="btn-group" id="first-category">
  7. <button type="button" class="btn btn-sm btn-outline-dark text-white dropdown-toggle" data-cid="" data-value="" data-toggle="dropdown">全部</button>
  8. <div class="dropdown-menu" aria-labelledby="zhankai">
  9. <a class="dropdown-item select-cate" data-value="" href="javascript:void(0);">全部</a>
  10. <% if (categoryData.length > 0 && categoryData[0].value.length > 0) { %>
  11. <% for (const c of categoryData[0].value) { %>
  12. <a class="dropdown-item select-cate" data-cid="<%- c.cid %>" data-value="<%- c.id %>" href="javascript:void(0);"><%- c.value %></a>
  13. <% } %>
  14. <% } %>
  15. </div>
  16. </div>
  17. <% if (categoryData[1] && categoryData[1].value.length > 0) { %>
  18. <div class="btn-group" id="second-category" style="display: none">
  19. <button type="button" class="btn btn-sm btn-outline-dark text-white dropdown-toggle" data-cid="" data-value="" data-toggle="dropdown">全部</button>
  20. <div class="dropdown-menu" aria-labelledby="zhankai">
  21. <a class="dropdown-item select-cate" data-value="" href="javascript:void(0);">全部</a>
  22. <% for (const c of categoryData[1].value) { %>
  23. <a class="dropdown-item select-cate" data-cid="<%- c.cid %>" data-value="<%- c.id %>" href="javascript:void(0);"><%- c.value %></a>
  24. <% } %>
  25. </div>
  26. </div>
  27. <% } %>
  28. <% if (categoryData[2] && categoryData[2].value.length > 0) { %>
  29. <div class="btn-group" id="third-category" style="display: none">
  30. <button type="button" class="btn btn-sm btn-outline-dark text-white dropdown-toggle" data-cid="" data-value="" data-toggle="dropdown">全部</button>
  31. <div class="dropdown-menu" aria-labelledby="zhankai">
  32. <a class="dropdown-item select-cate" data-value="" href="javascript:void(0);">全部</a>
  33. <% for (const c of categoryData[2].value) { %>
  34. <a class="dropdown-item select-cate" data-cid="<%- c.cid %>" data-value="<%- c.id %>" href="javascript:void(0);"><%- c.value %></a>
  35. <% } %>
  36. </div>
  37. </div>
  38. <% } %>
  39. </div>
  40. <div>
  41. <a href="javascript:void(0)" title="全屏显示" id="showFull" class="text-white"><i class="fa fa-arrows-alt"></i></a>
  42. <div class="btn-group">
  43. <button type="button" class="btn btn-sm btn-outline-dark text-white dropdown-toggle" data-toggle="dropdown" id="zhankai">决策大屏<span><%- ctx.session.sessionProject.dataCollect %></span></button>
  44. <div class="dropdown-menu" aria-labelledby="zhankai">
  45. <% for (const i of projectData.data_collect_pages) { %>
  46. <a class="dropdown-item change-collect" href="javascript:void(0)" data-collect="<%- i %>">决策大屏<%- i %></a>
  47. <% } %>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="content-wrap" id="big-data">
  54. <div style="height: 30px;background-color: #2c3237; display: none" id="exitfull-div">
  55. <div class="title-main d-flex">
  56. <div class="ml-auto">
  57. <div class="dropdown d-flex float-left mt-1 mr-2">
  58. <button id="exitFull" class="btn btn-sm btn-secondary ml-auto">退出全屏</button>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="c-body" style="background:#2c3237 !important">
  64. <div class="flex-content" data-content="1" <% if (ctx.session.sessionProject.dataCollect !== 1 && ctx.session.sessionProject.dataCollect !== 3) { %>style="display: none"<% } %>>
  65. <div class="row">
  66. <div class="col-3 pr-0">
  67. <div class="left-content">
  68. <div class="left-card-content">
  69. <div class="height-20 mb-2">
  70. <div class="card text-center bg-dark text-white ml-2 mr-2 py-1 height-100">
  71. <div class="card-body card-per-body">
  72. <div class="row">
  73. <div class="col-6">
  74. <h5 class="card-title card-case-title data_tender_num">0</h5>
  75. <p class="card-text card-case-text text-muted">标段个数</p>
  76. </div>
  77. <div class="col-6">
  78. <h5 class="card-title card-case-title data_tender_rate">0%</h5>
  79. <p class="card-text card-case-text text-muted">计量进度</p>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="height-20 mb-2">
  86. <div class="card text-center bg-dark text-white ml-2 mr-2 py-2 height-100">
  87. <div class="card-body card-per-body">
  88. <h5 class="card-title card-case-title data_total_price">0.00</h5>
  89. <p class="card-text card-case-text text-muted">台账金额</p>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="height-20 mb-2">
  94. <div class="card text-center bg-dark text-white ml-2 mr-2 py-2 height-100">
  95. <div class="card-body card-per-body">
  96. <h5 class="card-title card-case-title data_total_change_price">0.00</h5>
  97. <p class="card-text text-muted">累计变更金额</p>
  98. </div>
  99. </div>
  100. </div>
  101. <div class="height-20 mb-2">
  102. <div class="card text-center bg-dark text-white ml-2 mr-2 py-2 height-100">
  103. <div class="card-body card-per-body">
  104. <h5 class="card-title card-case-title data_total_stage_price">0.00</h5>
  105. <p class="card-text text-muted">累计完成金额</p>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="height-20">
  110. <div class="card text-center bg-dark text-white ml-2 mr-2 height-100">
  111. <div class="card-body card-per-body">
  112. <h5 class="card-title card-case-title data_total_material_price">0.00</h5>
  113. <p class="card-text text-muted">材料调差</p>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <!--饼图-->
  119. <div class="left-chart">
  120. <div class="card height-100 bg-dark mt-2 ml-2 mr-2">
  121. <div id="jechart" style="height: 100%; width: 100%;"></div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <div class="col-6 pl-0 pr-0">
  127. <div class="center-content mr-2">
  128. <div class="center-chart-content">
  129. <div class="center-di">
  130. <div class="card bg-dark height-100">
  131. <div class="jlchart" data-chart-num="1" id="jlchart" style="height: 100%; width: 100%; <% if (ctx.session.sessionProject.dataCollect === 3) { %>display:none;<% } %>"></div>
  132. <div class="di-content mb-2" id="map1" style="background: #343A40; width: 100%; <% if (ctx.session.sessionProject.dataCollect === 1) { %>display:none;<% } %>">
  133. </div>
  134. </div>
  135. </div>
  136. <div class="center-chart">
  137. <div class="card height-100 bg-dark mt-2">
  138. <div class="jlchart" data-chart-num="2" id="jlchart" style="height: 100%; width: 100%; <% if (ctx.session.sessionProject.dataCollect === 1) { %>display:none;<% } %>"></div>
  139. <div class="di-content mb-2" <% if (ctx.session.sessionProject.dataCollect === 3) { %>style="display:none;"<% } %>>
  140. <div class="jldbchart" data-chart-num="1" id="jldbchart" style="height: 100%; width: 100%;"></div>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. <div class="center-table">
  146. <div class="card height-100 bg-dark mt-2">
  147. <h6 class="bg-dark text-center text-white m-0 py-3">标段明细数据</h6>
  148. <div class="tablebox">
  149. <table id="tableId">
  150. <thead>
  151. <tr>
  152. <th>标段</th>
  153. <th>期数</th>
  154. <th>0号台账</th>
  155. <th>本期完成</th>
  156. <th>截止本期完成</th>
  157. <th>本期应付</th>
  158. <th>截止本期应付</th>
  159. </tr>
  160. </thead>
  161. <tbody id="stage-data">
  162. </tbody>
  163. </table>
  164. <table id="tableId1"></table>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. <div class="col-3 pl-0">
  171. <div class="right-content">
  172. <div class="right-chart-content">
  173. <div class="right-month">
  174. <h6 class="card bg-dark text-center text-white m-0 pt-2 pb-3">本月审批统计</h6>
  175. <div class="row right-month-height">
  176. <div class="col-6 pr-0 height-50">
  177. <div class="card text-center bg-dark text-white border-right-0 border-botton-0 height-100">
  178. <div class="card-body card-small-body height-100">
  179. <h5 class="card-title card-approve-title height-50"><span class="month_stage_num">0</span><small class="small-text">期</small></h5>
  180. <p class="card-text text-muted height-50">计量期</p>
  181. </div>
  182. </div>
  183. </div>
  184. <div class="col-6 pl-0 height-50">
  185. <div class="card text-center bg-dark text-white border-botton-0 height-100">
  186. <div class="card-body card-small-body height-100">
  187. <h5 class="card-title card-approve-title height-50"><span class="month_change_num">0</span><small class="small-text">条</small></h5>
  188. <p class="card-text text-muted height-50">变更令</p>
  189. </div>
  190. </div>
  191. </div>
  192. <div class="col-6 pr-0 height-50">
  193. <div class="card text-center bg-dark text-white border-right-0 border-top-0 height-100">
  194. <div class="card-body card-small-body height-100">
  195. <h5 class="card-title card-approve-title height-50"><span class="month_revise_num">0</span><small class="small-text">次</small></h5>
  196. <p class="card-text text-muted height-50">台账修订</p>
  197. </div>
  198. </div>
  199. </div>
  200. <div class="col-6 pl-0 height-50">
  201. <div class="card text-center bg-dark text-white border-top-0 height-100">
  202. <div class="card-body card-small-body height-100">
  203. <h5 class="card-title card-approve-title height-50"><span class="month_material_num">0</span><small class="small-text">期</small></h5>
  204. <p class="card-text text-muted height-50">材料调差</p>
  205. </div>
  206. </div>
  207. </div>
  208. </div>
  209. </div>
  210. <div class="right-chart">
  211. <div class="card height-100 bg-dark">
  212. <div class="jlwcdchart" id="jlwcdchart" style="height: 100%; width: 100%;"></div>
  213. </div>
  214. </div>
  215. </div>
  216. <div class="right-biaoduan">
  217. <div class="card height-100 bg-dark mt-2">
  218. <h6 class="bg-dark text-center text-white m-0 py-3">标段审批信息</h6>
  219. <div id="review_box" class="m-0 p-3 mb-2">
  220. <ul class="list-unstyled" id="comment1">
  221. <% for (const notice of noticeList) { %>
  222. <% if(notice.type === pushType.stage) { %>
  223. <li class="media pb-3 mb-3 border-bottom-grey-1">
  224. <div class="media-body">
  225. <div class="row">
  226. <div class="col-2"><span class="badge badge-success">计量审批</span></div>
  227. <div class="col-10 text-white">
  228. <a href="/tender/<%- notice.tid %>" class="text-white"><%- notice.name %></a>
  229. <a href="/tender/<%- notice.tid %>/measure/stage/<%- notice.order %>" class="text-white">第<%- notice.order %>期 </a>
  230. <span class="<%- acStage.statusClass[notice.status] %>"><%- acStage.statusString[notice.status]%></span>
  231. </div>
  232. </div>
  233. <p class="mt-1 mb-0 text-white"><%- notice.su_name %><small class="ml-1 text-muted"><%- (notice.su_role ? '- ' + notice.su_role : '') %></small>
  234. <span class="pull-right text-muted"><%- ctx.helper.formatFullDate(notice.create_time) %></span>
  235. </p>
  236. </div>
  237. </li>
  238. <% } else if(notice.type === pushType.material) { %>
  239. <li class="media pb-3 mb-3 border-bottom-grey-1">
  240. <div class="media-body">
  241. <div class="row">
  242. <div class="col-2"><span class="badge badge-secondary">材料调差</span></div>
  243. <div class="col-10 text-white">
  244. <a href="/tender/<%- notice.tid %>" class="text-white"><%- notice.name %></a>
  245. <a href="/tender/<%- notice.tid %>/measure/material/<%- notice.order %>" class="text-white">第<%- notice.order %>期 </a>
  246. <span class="<%- acMaterial.statusClass[notice.status] %>"><%- acMaterial.statusString[notice.status]%></span>
  247. </div>
  248. </div>
  249. <p class="mt-1 mb-0 text-white"><%- notice.su_name %><small class="ml-1 text-muted"><%- (notice.su_role ? '- ' + notice.su_role : '') %></small>
  250. <span class="pull-right text-muted"><%- ctx.helper.formatFullDate(notice.create_time) %></span>
  251. </p>
  252. </div>
  253. </li>
  254. <% } else if(notice.type === pushType.ledger) { %>
  255. <li class="media pb-3 mb-3 border-bottom-grey-1">
  256. <div class="media-body">
  257. <div class="row">
  258. <div class="col-2"><span class="badge badge-info">台账审批</span></div>
  259. <div class="col-10 text-white">
  260. <a data-id="<%- notice.id %>"href="/tender/<%- notice.tid %>/ledger" class="text-white"><%- notice.name %></a> <span class="<%- acLedger.statusClass[notice.status] %>"><%- acLedger.statusString[notice.status]%></span>
  261. </div>
  262. </div>
  263. <p class="mt-1 mb-0 text-white"><%- notice.su_name %><small class="ml-1 text-muted"><%- (notice.su_role ? '- ' + notice.su_role : '') %></small>
  264. <span class="pull-right text-muted"><%- ctx.helper.formatFullDate(notice.create_time) %></span>
  265. </p>
  266. </div>
  267. </li>
  268. <% } else if(notice.type === pushType.revise) { %>
  269. <li class="media pb-3 mb-3 border-bottom-grey-1">
  270. <div class="media-body">
  271. <div class="row">
  272. <div class="col-2"><span class="badge badge-info">台账修订</span></div>
  273. <div class="col-10 text-white">
  274. <a href="/tender/<%- notice.tid %>" class="text-white"><%- notice.name %></a>
  275. <a href="/tender/<%- notice.tid %>/revise/info" class="text-white">台账修订(第<%- notice.corder %>次)</a>
  276. <span class="<%- acRevise.statusClass[notice.status] %>"><%- acRevise.statusString[notice.status]%></span>
  277. </div>
  278. </div>
  279. <p class="mt-1 mb-0 text-white"><%- notice.su_name %><small class="ml-1 text-muted"><%- (notice.su_role ? '- ' + notice.su_role : '') %></small>
  280. <span class="pull-right text-muted"><%- ctx.helper.formatFullDate(notice.create_time) %></span>
  281. </p>
  282. </div>
  283. </li>
  284. <% } else if(notice.type === pushType.change){ %>
  285. <li class="media pb-3 mb-3 border-bottom-grey-1">
  286. <div class="media-body">
  287. <div class="row">
  288. <div class="col-2"><span class="badge badge-danger">变更审批</span></div>
  289. <div class="col-10 text-white">
  290. <a href="/tender/<%- notice.tid %>" class="text-white"><%- notice.name %></a>
  291. <a href="/tender/<%- notice.tid %>/change/<%- notice.cid %>/information" class="text-white"><%- notice.c_code %> </a>
  292. <span class="<%- acChange.statusClass[notice.status] %>"><%- acChange.statusString[notice.status]%></span>
  293. </div>
  294. </div>
  295. <p class="mt-1 mb-0 text-white"><%- notice.su_name %><small class="ml-1 text-muted"><%- (notice.su_role ? '- ' + notice.su_role : '') %></small>
  296. <span class="pull-right text-muted"><%- ctx.helper.formatFullDate(notice.create_time) %></span>
  297. </p>
  298. </div>
  299. </li>
  300. <% } else if(notice.type === pushType.advance) { %>
  301. <li class="media pb-3 mb-3 border-bottom-grey-1">
  302. <div class="media-body">
  303. <div class="row">
  304. <div class="col-2"><span class="badge badge-warning">预付款</span></div>
  305. <div class="col-10 text-white">
  306. <a href="/tender/<%- notice.tid %>" class="text-white"><%- notice.name %></a>
  307. <a href="/tender/<%- notice.tid %>/advance/<%- notice.vid %>/detail" class="text-white">第<%- notice.order %>期</a>
  308. <span class="<%- acAdvance.statusClass[notice.status] %>"><%- acAdvance.statusString[notice.status]%></span>
  309. </div>
  310. </div>
  311. <p class="mt-1 mb-0 text-white"><%- notice.su_name %><small class="ml-1 text-muted"><%- (notice.su_role ? '- ' + notice.su_role : '') %></small>
  312. <span class="pull-right text-muted"><%- ctx.helper.formatFullDate(notice.create_time) %></span>
  313. </p>
  314. </div>
  315. </li>
  316. <% } %>
  317. <% } %>
  318. </ul>
  319. <ul id="comment2"></ul>
  320. </div>
  321. </div>
  322. </div>
  323. </div>
  324. </div>
  325. </div>
  326. </div>
  327. <div class="flex-content" data-content="2" <% if (ctx.session.sessionProject.dataCollect !== 2 && ctx.session.sessionProject.dataCollect !== 4) { %>style="display: none"<% } %>>
  328. <div class="mx-3">
  329. <div class="row">
  330. <div class="col-6 pr-1">
  331. <div class="left-content">
  332. <div class="left-small-card-content ml-3">
  333. <div class="row height-100">
  334. <div class="col-4 pl-0">
  335. <div class="card text-center bg-dark text-white ml-0 mr-0 height-100">
  336. <div class="card-body card-per-body">
  337. <div class="row height-100">
  338. <div class="col-6">
  339. <h5 class="card-title card-case-title data_tender_num">0</h5>
  340. <p class="card-text card-case-text text-muted">标段个数</p>
  341. </div>
  342. <div class="col-6">
  343. <h5 class="card-title card-case-title data_tender_rate">0%</h5>
  344. <p class="card-text card-case-text text-muted">计量进度</p>
  345. </div>
  346. </div>
  347. </div>
  348. </div>
  349. </div>
  350. <div class="col-4 pl-0">
  351. <div class="card text-center bg-dark text-white height-100">
  352. <div class="card-body card-per-body">
  353. <h5 class="card-title card-case-title data_total_price">0.00</h5>
  354. <p class="card-text card-case-text text-muted">台账金额</p>
  355. </div>
  356. </div>
  357. </div>
  358. <div class="col-4 pl-0">
  359. <div class="card text-center bg-dark text-white height-100">
  360. <div class="card-body card-per-body">
  361. <h5 class="card-title card-case-title data_total_change_price">0.00</h5>
  362. <p class="card-text text-muted">累计变更金额</p>
  363. </div>
  364. </div>
  365. </div>
  366. </div>
  367. </div>
  368. <div class="left-big-chart-content">
  369. <div class="card height-60 bg-dark mt-2 mb-2">
  370. <div class="jlchart" id="jlchart" style="height: 100%; width: 100%;"></div>
  371. </div>
  372. <div class="height-36">
  373. <div class="row height-100">
  374. <div class="col-6 pr-2">
  375. <div class="left-bottom-chart height-100">
  376. <div class="card height-100 bg-dark">
  377. <div class="jlwcdchart" id="jlwcdchart" style="height: 100%; width: 100%;"></div>
  378. </div>
  379. </div>
  380. </div>
  381. <div class="col-6 pl-0">
  382. <div class="left-bottom-chart height-100">
  383. <div class="card height-100 bg-dark">
  384. <div id="tztjchart" style="height: 100%; width: 100%;"></div>
  385. </div>
  386. </div>
  387. </div>
  388. </div>
  389. </div>
  390. </div>
  391. </div>
  392. </div>
  393. <div class="col-6 pl-1 pr-0">
  394. <div class="right-content">
  395. <div class="right-small-card-content mx-3">
  396. <div class="row height-100">
  397. <div class="col-4 pl-0">
  398. <div class="card text-center bg-dark text-white mb-2 height-100">
  399. <div class="card-body card-per-body">
  400. <h5 class="card-title card-case-title data_total_stage_price">0.00</h5>
  401. <p class="card-text card-case-text text-muted">累计完成金额</p>
  402. </div>
  403. </div>
  404. </div>
  405. <div class="col-4 pl-0">
  406. <div class="card text-center bg-dark text-white height-100">
  407. <div class="card-body card-per-body">
  408. <h5 class="card-title card-case-title data_total_advance_price">0.00</h5>
  409. <p class="card-text card-case-text text-muted">预付款</p>
  410. </div>
  411. </div>
  412. </div>
  413. <div class="col-4 pl-0">
  414. <div class="card text-center bg-dark text-white height-100">
  415. <div class="card-body card-per-body">
  416. <h5 class="card-title card-case-title data_total_material_price">0.00</h5>
  417. <p class="card-text card-case-text text-muted">材料调差</p>
  418. </div>
  419. </div>
  420. </div>
  421. </div>
  422. </div>
  423. <div class="right-big-chart-content mr-3">
  424. <div class="height-60 mt-2">
  425. <div class="card height-100 bg-dark">
  426. <div class="jldbchart" data-chart-num="2" id="jldbchart" style="height: 100%; width: 100%; <% if (ctx.session.sessionProject.dataCollect === 4) { %>display:none;<% } %>"></div>
  427. <div class="di-content mb-2" id="map2" style="height: 100%; width: 100%; <% if (ctx.session.sessionProject.dataCollect === 2) { %>display:none;<% } %>"></div>
  428. </div>
  429. </div>
  430. <div class="height-36 mt-2">
  431. <div class="height-100 right-bottom-50-fl">
  432. <div class="left-bd-scroll height-100 mr-1">
  433. <div class="card bg-dark height-100">
  434. <h6 class="bg-dark text-center text-white m-0 py-3">标段审批信息</h6>
  435. <div id="review_box2" class="m-0 p-3 mb-2 height-100">
  436. <ul class="list-unstyled" id="comment3">
  437. <% for (const notice of noticeList) { %>
  438. <% if(notice.type === pushType.stage) { %>
  439. <li class="media pb-3 mb-3 border-bottom-grey-1">
  440. <div class="media-body">
  441. <div class="row">
  442. <div class="col-2"><span class="badge badge-success">计量审批</span></div>
  443. <div class="col-10 text-white">
  444. <a href="/tender/<%- notice.tid %>" class="text-white"><%- notice.name %></a>
  445. <a href="/tender/<%- notice.tid %>/measure/stage/<%- notice.order %>" class="text-white">第<%- notice.order %>期 </a>
  446. <span class="<%- acStage.statusClass[notice.status] %>"><%- acStage.statusString[notice.status]%></span>
  447. </div>
  448. </div>
  449. <p class="mt-1 mb-0 text-white"><%- notice.su_name %><small class="ml-1 text-muted"><%- (notice.su_role ? '- ' + notice.su_role : '') %></small>
  450. <span class="pull-right text-muted"><%- ctx.helper.formatFullDate(notice.create_time) %></span>
  451. </p>
  452. </div>
  453. </li>
  454. <% } else if(notice.type === pushType.material) { %>
  455. <li class="media pb-3 mb-3 border-bottom-grey-1">
  456. <div class="media-body">
  457. <div class="row">
  458. <div class="col-2"><span class="badge badge-secondary">材料调差</span></div>
  459. <div class="col-10 text-white">
  460. <a href="/tender/<%- notice.tid %>" class="text-white"><%- notice.name %></a>
  461. <a href="/tender/<%- notice.tid %>/measure/material/<%- notice.order %>" class="text-white">第<%- notice.order %>期 </a>
  462. <span class="<%- acMaterial.statusClass[notice.status] %>"><%- acMaterial.statusString[notice.status]%></span>
  463. </div>
  464. </div>
  465. <p class="mt-1 mb-0 text-white"><%- notice.su_name %><small class="ml-1 text-muted"><%- (notice.su_role ? '- ' + notice.su_role : '') %></small>
  466. <span class="pull-right text-muted"><%- ctx.helper.formatFullDate(notice.create_time) %></span>
  467. </p>
  468. </div>
  469. </li>
  470. <% } else if(notice.type === pushType.ledger) { %>
  471. <li class="media pb-3 mb-3 border-bottom-grey-1">
  472. <div class="media-body">
  473. <div class="row">
  474. <div class="col-2"><span class="badge badge-info">台账审批</span></div>
  475. <div class="col-10 text-white">
  476. <a data-id="<%- notice.id %>"href="/tender/<%- notice.tid %>/ledger" class="text-white"><%- notice.name %></a> <span class="<%- acLedger.statusClass[notice.status] %>"><%- acLedger.statusString[notice.status]%></span>
  477. </div>
  478. </div>
  479. <p class="mt-1 mb-0 text-white"><%- notice.su_name %><small class="ml-1 text-muted"><%- (notice.su_role ? '- ' + notice.su_role : '') %></small>
  480. <span class="pull-right text-muted"><%- ctx.helper.formatFullDate(notice.create_time) %></span>
  481. </p>
  482. </div>
  483. </li>
  484. <% } else if(notice.type === pushType.revise) { %>
  485. <li class="media pb-3 mb-3 border-bottom-grey-1">
  486. <div class="media-body">
  487. <div class="row">
  488. <div class="col-2"><span class="badge badge-info">台账修订</span></div>
  489. <div class="col-10 text-white">
  490. <a href="/tender/<%- notice.tid %>" class="text-white"><%- notice.name %></a>
  491. <a href="/tender/<%- notice.tid %>/revise/info" class="text-white">台账修订(第<%- notice.corder %>次)</a>
  492. <span class="<%- acRevise.statusClass[notice.status] %>"><%- acRevise.statusString[notice.status]%></span>
  493. </div>
  494. </div>
  495. <p class="mt-1 mb-0 text-white"><%- notice.su_name %><small class="ml-1 text-muted"><%- (notice.su_role ? '- ' + notice.su_role : '') %></small>
  496. <span class="pull-right text-muted"><%- ctx.helper.formatFullDate(notice.create_time) %></span>
  497. </p>
  498. </div>
  499. </li>
  500. <% } else if(notice.type === pushType.change){ %>
  501. <li class="media pb-3 mb-3 border-bottom-grey-1">
  502. <div class="media-body">
  503. <div class="row">
  504. <div class="col-2"><span class="badge badge-danger">变更审批</span></div>
  505. <div class="col-10 text-white">
  506. <a href="/tender/<%- notice.tid %>" class="text-white"><%- notice.name %></a>
  507. <a href="/tender/<%- notice.tid %>/change/<%- notice.cid %>/information" class="text-white"><%- notice.c_code %> </a>
  508. <span class="<%- acChange.statusClass[notice.status] %>"><%- acChange.statusString[notice.status]%></span>
  509. </div>
  510. </div>
  511. <p class="mt-1 mb-0 text-white"><%- notice.su_name %><small class="ml-1 text-muted"><%- (notice.su_role ? '- ' + notice.su_role : '') %></small>
  512. <span class="pull-right text-muted"><%- ctx.helper.formatFullDate(notice.create_time) %></span>
  513. </p>
  514. </div>
  515. </li>
  516. <% } else if(notice.type === pushType.advance) { %>
  517. <li class="media pb-3 mb-3 border-bottom-grey-1">
  518. <div class="media-body">
  519. <div class="row">
  520. <div class="col-2"><span class="badge badge-warning">预付款</span></div>
  521. <div class="col-10 text-white">
  522. <a href="/tender/<%- notice.tid %>" class="text-white"><%- notice.name %></a>
  523. <a href="/tender/<%- notice.tid %>/advance/<%- notice.vid %>/detail" class="text-white">第<%- notice.order %>期</a>
  524. <span class="<%- acAdvance.statusClass[notice.status] %>"><%- acAdvance.statusString[notice.status]%></span>
  525. </div>
  526. </div>
  527. <p class="mt-1 mb-0 text-white"><%- notice.su_name %><small class="ml-1 text-muted"><%- (notice.su_role ? '- ' + notice.su_role : '') %></small>
  528. <span class="pull-right text-muted"><%- ctx.helper.formatFullDate(notice.create_time) %></span>
  529. </p>
  530. </div>
  531. </li>
  532. <% } %>
  533. <% } %>
  534. </ul>
  535. <ul id="comment4"></ul>
  536. </div>
  537. </div>
  538. </div>
  539. </div>
  540. <div class="height-100 right-bottom-50-fl">
  541. <div class="right-month height-100 ml-1">
  542. <h6 class="card bg-dark text-center text-white m-0 py-3">本月审批统计</h6>
  543. <div class="row right-month-height">
  544. <div class="col-6 pr-0">
  545. <div class="card text-center bg-dark text-white border-right-0 border-botton-0 height-100">
  546. <div class="card-body card-small-body">
  547. <h5 class="card-title card-approve-title height-50"><span class="month_stage_num">0</span><small class="small-text">期</small></h5>
  548. <p class="card-text text-muted height-50">计量期</p>
  549. </div>
  550. </div>
  551. </div>
  552. <div class="col-6 pl-0">
  553. <div class="card text-center bg-dark text-white border-botton-0 height-100">
  554. <div class="card-body card-small-body">
  555. <h5 class="card-title card-approve-title height-50"><span class="month_change_num">0</span><small class="small-text">条</small></h5>
  556. <p class="card-text text-muted height-50">变更令</p>
  557. </div>
  558. </div>
  559. </div>
  560. <div class="col-6 pr-0">
  561. <div class="card text-center bg-dark text-white border-right-0 border-top-0 height-100">
  562. <div class="card-body card-small-body">
  563. <h5 class="card-title card-approve-title height-50"><span class="month_revise_num">0</span><small class="small-text">次</small></h5>
  564. <p class="card-text text-muted height-50">台账修订</p>
  565. </div>
  566. </div>
  567. </div>
  568. <div class="col-6 pl-0">
  569. <div class="card text-center bg-dark text-white border-top-0 height-100">
  570. <div class="card-body card-small-body">
  571. <h5 class="card-title card-approve-title height-50"><span class="month_material_num">0</span><small class="small-text">期</small></h5>
  572. <p class="card-text text-muted height-50">材料调差</p>
  573. </div>
  574. </div>
  575. </div>
  576. </div>
  577. </div>
  578. </div>
  579. </div>
  580. </div>
  581. </div>
  582. </div>
  583. </div>
  584. </div>
  585. </div>
  586. </div>
  587. </div>
  588. </div>
  589. <script src="/public/js/datacollect_scroll.js"></script>
  590. <script type="text/javascript"> autoFlashHeight();</script>
  591. <script type="text/javascript">
  592. // 分类金额饼图表
  593. var myChart1 = echarts.init(document.getElementById('jechart'), 'dark');
  594. option1 = {
  595. tooltip : {
  596. trigger: 'item',
  597. formatter: "{a} <br/>{b} : {c} ({d}%)",
  598. // 当前鼠标位置
  599. position: 'right',
  600. },
  601. title: {
  602. text: '金额统计图',
  603. left: 'center',
  604. top:'7%'
  605. },
  606. color: ['rgba(38, 217, 217,0.7)','rgba(78, 139, 229,0.7)',
  607. 'rgba(78, 229, 139,0.7)','rgba(108, 78, 229,0.7)',
  608. 'rgba(58,207,221,0.7)','rgba(164, 229, 78,0.7)',
  609. 'rgba(199, 78, 229,0.7)', 'rgba(229, 92, 174, 0.7)',
  610. 'rgba(229, 214, 78, 0.7)', 'rgba(241, 87, 96, 0.7)',
  611. 'rgba(242, 179, 82, 0.7)'],
  612. backgroundColor: '#343a40 ',
  613. // tooltip: {
  614. // trigger: 'item'
  615. // },
  616. // legend: {
  617. // orient: 'vertical',
  618. // left: 'center',
  619. // },
  620. series: [
  621. {
  622. name: '台账金额',
  623. type: 'pie',
  624. radius: '60%',
  625. top:'15%',
  626. formatter: function(name){
  627. return name.length>10?name.substr(0,10)+"...":name;
  628. },
  629. data: [],
  630. emphasis: {
  631. itemStyle: {
  632. shadowBlur: 10,
  633. shadowOffsetX: 0,
  634. shadowColor: 'rgba(0, 0, 0, 0.5)'
  635. }
  636. }
  637. }
  638. ]
  639. };
  640. myChart1.setOption(option1);
  641. // 计量情况柱状图表
  642. // var myChart2 = echarts.init(document.getElementsByClassName('jlchart')[0], 'dark');
  643. option2 = {
  644. title: {
  645. text: '计量情况',
  646. left: 'center',
  647. top:'5%'
  648. },
  649. color: ['rgba(38, 217, 217,0.7)','rgba(78, 139, 229,0.7)',
  650. 'rgba(78, 229, 139,0.7)','rgba(108, 78, 229,0.7)',
  651. 'rgba(58,207,221,0.7)','rgba(164, 229, 78,0.7)',
  652. 'rgba(199, 78, 229,0.7)', 'rgba(229, 92, 174, 0.7)',
  653. 'rgba(229, 214, 78, 0.7)', 'rgba(241, 87, 96, 0.7)',
  654. 'rgba(242, 179, 82, 0.7)'],
  655. backgroundColor: '#343a40 ',
  656. tooltip: {
  657. trigger: 'axis',
  658. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  659. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  660. },
  661. },
  662. dataZoom: [
  663. {
  664. brushSelect:false,
  665. // zoomLock: false,
  666. type: 'slider',
  667. show: true,
  668. realtime: true,
  669. showdetail: false,
  670. showDataShadow: false,
  671. // dataZoomIndex: 10,
  672. start: 0,
  673. end: 8,
  674. handleSize: 0,
  675. height: 10,
  676. bottom: '10%',
  677. },
  678. // {
  679. // // realtime: true,
  680. // type: 'slider',
  681. // show: true,
  682. // realtime: true,
  683. // showdetail: false,
  684. // showDataShadow: false,
  685. // // dataZoomIndex: 10,
  686. // start: 0,
  687. // end: 8,
  688. // handleSize: 0,
  689. // bottom:30,
  690. // height:10,
  691. // }
  692. ],
  693. legend: {
  694. data: ['台账', '合同计量', '变更计量'],
  695. top:'17%'
  696. },
  697. grid: {
  698. top:'25%',
  699. left: '3%',
  700. right: '4%',
  701. bottom: '15%',
  702. containLabel: true
  703. },
  704. xAxis: [
  705. {
  706. type: 'category',
  707. data: [],
  708. axisLabel: {
  709. show: true,
  710. interval: 0,
  711. textStyle: {
  712. color: "#fff",
  713. fontSize: 14
  714. },
  715. formatter: function(value) {
  716. var res = value;
  717. if(res.length > 6) {
  718. res = res.substring(0, 5) + "..";
  719. }
  720. return res;
  721. }
  722. }
  723. }
  724. ],
  725. yAxis: [
  726. {
  727. type: 'value',
  728. name:'金额',
  729. position: 'left',
  730. axisLabel : {
  731. formatter: function (value, index) {
  732. if (value < 0) {
  733. let newValue = Math.abs(value);
  734. if (newValue >= 10000 && newValue < 10000000) {
  735. newValue = newValue / 10000 + "万";
  736. } else if (newValue >= 10000000) {
  737. newValue = newValue / 10000000 + "千万";
  738. }
  739. value = '-' + newValue;
  740. }
  741. if (value >= 10000 && value < 10000000) {
  742. value = value / 10000 + "万";
  743. } else if (value >= 10000000) {
  744. value = value / 10000000 + "千万";
  745. }
  746. return value;
  747. }
  748. },
  749. splitArea : {show : true}
  750. },
  751. // {
  752. // type: 'value',
  753. // name:'完成度',
  754. // position: 'right',
  755. // min:0,
  756. // max:100,
  757. // axisLabel : {
  758. // formatter: '{value} %'
  759. // },
  760. // splitArea : {show : true}
  761. // }
  762. ],
  763. series: [
  764. {
  765. name: '台账',
  766. type: 'bar',
  767. emphasis: {
  768. focus: 'series'
  769. },
  770. data: []
  771. },
  772. {
  773. name: '合同计量',
  774. type: 'bar',
  775. stack: '计量',
  776. emphasis: {
  777. focus: 'series'
  778. },
  779. data: []
  780. },
  781. {
  782. name: '变更计量',
  783. type: 'bar',
  784. stack: '计量',
  785. emphasis: {
  786. focus: 'series'
  787. },
  788. data: []
  789. }
  790. ]
  791. };
  792. var chart2 = document.getElementsByClassName('jlchart');
  793. var myChart2_1 = echarts.init(chart2[0], 'dark');
  794. var myChart2_2 = echarts.init(chart2[1], 'dark');
  795. var myChart2_3 = echarts.init(chart2[2], 'dark');
  796. myChart2_1.setOption(option2);
  797. myChart2_2.setOption(option2);
  798. myChart2_3.setOption(option2);
  799. // myChart2.setOption(option);
  800. // 计量完成度统计柱状图表
  801. // var myChart3 = echarts.init(document.getElementsByClassName('jlwcdchart')[0], 'dark');
  802. option3 = {
  803. title: {
  804. text: '计量完成度统计',
  805. left: 'center',
  806. top:'5%'
  807. },
  808. color: ['rgba(38, 217, 217,0.7)','rgba(78, 139, 229,0.7)',
  809. 'rgba(78, 229, 139,0.7)','rgba(108, 78, 229,0.7)',
  810. 'rgba(58,207,221,0.7)','rgba(164, 229, 78,0.7)',
  811. 'rgba(199, 78, 229,0.7)', 'rgba(229, 92, 174, 0.7)',
  812. 'rgba(229, 214, 78, 0.7)', 'rgba(241, 87, 96, 0.7)',
  813. 'rgba(242, 179, 82, 0.7)'],
  814. backgroundColor: '#343a40 ',
  815. tooltip: {
  816. trigger: 'axis',
  817. axisPointer: { // Use axis to trigger tooltip
  818. type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
  819. }
  820. },
  821. grid: {
  822. left: '10%',
  823. right: '10%',
  824. bottom: '3%',
  825. containLabel: true
  826. },
  827. xAxis: {
  828. type: 'value'
  829. },
  830. yAxis: {
  831. type: 'category',
  832. data: [],
  833. axisLabel: {
  834. show: true,
  835. interval: 0,
  836. // textStyle: {
  837. // color: "#fff",
  838. // fontSize: 14
  839. // },
  840. formatter: function(value) {
  841. var res = value;
  842. if(res.length > 6) {
  843. res = res.substring(0, 5) + "..";
  844. }
  845. return res;
  846. }
  847. }
  848. },
  849. dataZoom: [
  850. {
  851. brushSelect:false,
  852. start: 0,
  853. end: 10,
  854. type: 'slider',
  855. show: true,
  856. handleSize: 0,
  857. realtime: true,
  858. showDetail: false,
  859. // filterMode: 'empty',
  860. yAxisIndex: [0,1],
  861. width: 10,
  862. height: '80%',
  863. right: '5%',
  864. bottom:'2%'
  865. },
  866. ],
  867. series: [
  868. {
  869. name: '完成度',
  870. type: 'bar',
  871. stack: 'total',
  872. label: {
  873. show: true
  874. },
  875. emphasis: {
  876. focus: 'series'
  877. },
  878. data: []
  879. }
  880. ]
  881. };
  882. var chart3 = document.getElementsByClassName('jlwcdchart');
  883. var myChart3_1 = echarts.init(chart3[0], 'dark');
  884. var myChart3_2 = echarts.init(chart3[1], 'dark');
  885. myChart3_1.setOption(option3);
  886. myChart3_2.setOption(option3);
  887. // 计量对比线形图表
  888. option4 = {
  889. title: {
  890. text: '计量对比',
  891. left: 'center',
  892. top:'5%'
  893. },
  894. color: ['rgba(38, 217, 217,0.7)','rgba(78, 139, 229,0.7)',
  895. 'rgba(78, 229, 139,0.7)','rgba(108, 78, 229,0.7)',
  896. 'rgba(58,207,221,0.7)','rgba(164, 229, 78,0.7)',
  897. 'rgba(199, 78, 229,0.7)', 'rgba(229, 92, 174, 0.7)',
  898. 'rgba(229, 214, 78, 0.7)', 'rgba(241, 87, 96, 0.7)',
  899. 'rgba(242, 179, 82, 0.7)'],
  900. backgroundColor: '#343a40 ',
  901. tooltip: {
  902. trigger: 'axis',
  903. axisPointer: {
  904. type: 'cross',
  905. label: {
  906. backgroundColor: '#6a7985'
  907. }
  908. }
  909. },
  910. legend: {
  911. data: ['本月计量', '累计计量'],
  912. top:'15%'
  913. },
  914. grid: {
  915. top:'25%',
  916. left: '3%',
  917. right: '4%',
  918. bottom: '15%',
  919. containLabel: true
  920. },
  921. xAxis: [
  922. {
  923. type: 'category',
  924. boundaryGap: false,
  925. data: []
  926. }
  927. ],
  928. yAxis: [
  929. {
  930. type: 'value',
  931. axisLabel : {
  932. formatter: function (value, index) {
  933. if (value < 0) {
  934. let newValue = Math.abs(value);
  935. if (newValue >= 10000 && newValue < 10000000) {
  936. newValue = newValue / 10000 + "万";
  937. } else if (newValue >= 10000000) {
  938. newValue = newValue / 10000000 + "千万";
  939. }
  940. value = '-' + newValue;
  941. }
  942. if (value >= 10000 && value < 10000000) {
  943. value = value / 10000 + "万";
  944. } else if (value >= 10000000) {
  945. value = value / 10000000 + "千万";
  946. }
  947. return value;
  948. }
  949. },
  950. }
  951. ],
  952. dataZoom: [
  953. {
  954. brushSelect: false,
  955. showdetail: false,
  956. show: true,
  957. realtime: true,
  958. dataZoomIndex: 10,
  959. start: 0,
  960. end: 5,
  961. handleSize: 0,
  962. height: 10,
  963. bottom: '10%'
  964. },
  965. ],
  966. series: [
  967. {
  968. name: '本月计量',
  969. type: 'line',
  970. stack: '总量',
  971. areaStyle: {},
  972. emphasis: {
  973. focus: 'series'
  974. },
  975. data: []
  976. },
  977. {
  978. name: '累计计量',
  979. type: 'line',
  980. stack: '总量',
  981. areaStyle: {},
  982. emphasis: {
  983. focus: 'series'
  984. },
  985. data: []
  986. }
  987. ]
  988. };
  989. var chart4 = document.getElementsByClassName('jldbchart');
  990. var myChart4_1 = echarts.init(chart4[0], 'dark');
  991. var myChart4_2 = echarts.init(chart4[1], 'dark');
  992. myChart4_1.setOption(option4);
  993. myChart4_2.setOption(option4);
  994. // for (var i = 0; i < chart4.length; i++) {
  995. // var myChart4 = echarts.init(chart4[i], 'dark');
  996. // myChart4.setOption(option);
  997. // }
  998. // 投资统计分析圆饼图表
  999. var myChart5 = echarts.init(document.getElementById('tztjchart'), 'dark');
  1000. option5 = {
  1001. title: {
  1002. text: '投资统计分析',
  1003. left: 'center',
  1004. top:'7%'
  1005. },
  1006. color: ['rgba(38, 217, 217,0.7)','rgba(78, 139, 229,0.7)',
  1007. 'rgba(78, 229, 139,0.7)','rgba(108, 78, 229,0.7)',
  1008. 'rgba(58,207,221,0.7)','rgba(164, 229, 78,0.7)',
  1009. 'rgba(199, 78, 229,0.7)', 'rgba(229, 92, 174, 0.7)',
  1010. 'rgba(229, 214, 78, 0.7)', 'rgba(241, 87, 96, 0.7)',
  1011. 'rgba(242, 179, 82, 0.7)'],
  1012. backgroundColor: '#343a40 ',
  1013. tooltip: {
  1014. trigger: 'item',
  1015. },
  1016. series: [
  1017. {
  1018. name: '访问来源',
  1019. type: 'pie',
  1020. top:'15%',
  1021. bottom:'10%',
  1022. radius: <% if (categoryData && categoryData[2] && categoryData[2].value.length > 0) { %>['0%', '30%']<% } else if (categoryData && categoryData[1] && categoryData[1].value.length > 0) { %>['0%', '50%']<% } else { %>['0%', '85%']<% } %>,
  1023. // label: {
  1024. // position: 'inner',
  1025. // fontSize: 14
  1026. // },
  1027. label:{
  1028. show:false
  1029. },
  1030. labelLine: {
  1031. show: true
  1032. },
  1033. formatter: function(name){
  1034. return name.length>10?name.substr(0,10)+"...":name;
  1035. },
  1036. data: [
  1037. ]
  1038. },
  1039. {
  1040. name: '访问来源',
  1041. type: 'pie',
  1042. top:'15%',
  1043. bottom:'10%',
  1044. radius: <% if (categoryData && categoryData[2] && categoryData[2].value.length > 0) { %>['30%', '60%']<% } else { %>['50%', '85%']<% } %>,
  1045. // label: {
  1046. // position: 'inner',
  1047. // fontSize: 14
  1048. // },
  1049. label:{
  1050. show:false
  1051. },
  1052. labelLine: {
  1053. show: true,
  1054. },
  1055. formatter: function(name){
  1056. return name.length>10?name.substr(0,10)+"...":name;
  1057. },
  1058. data: [
  1059. ]
  1060. },
  1061. {
  1062. name: '访问来源',
  1063. type: 'pie',
  1064. top:'15%',
  1065. bottom:'10%',
  1066. radius: ['60%', '85%'],
  1067. // label: {
  1068. // position: 'inner',
  1069. // fontSize: 14
  1070. // },
  1071. label:{
  1072. show:false
  1073. },
  1074. labelLine: {
  1075. show: true
  1076. },
  1077. formatter: function(name){
  1078. return name.length>10?name.substr(0,10)+"...":name;
  1079. },
  1080. data: [
  1081. ]
  1082. }
  1083. ]
  1084. };
  1085. myChart5.setOption(option5);
  1086. function echartsReset() {
  1087. myChart1.resize();
  1088. myChart2_1.resize();
  1089. myChart2_2.resize();
  1090. myChart2_3.resize();
  1091. myChart3_1.resize();
  1092. myChart3_2.resize();
  1093. myChart4_1.resize();
  1094. myChart4_2.resize();
  1095. myChart5.resize();
  1096. }
  1097. $(function () {
  1098. $('#showFull').click(function () {
  1099. const full=document.getElementById("big-data");
  1100. launchIntoFullscreen(full);
  1101. });
  1102. $('#exitFull').click(function () {
  1103. exitFullscreen();
  1104. })
  1105. })
  1106. let resizeTimer = null;
  1107. $(window).bind('resize', function () {
  1108. if (resizeTimer) clearTimeout(resizeTimer);
  1109. resizeTimer = setTimeout(function () {
  1110. echartsReset();
  1111. $(".tableid_").find('th').each(function(i) {
  1112. $(this).css('width', $('#tableId').find('th:eq(' + i + ')').innerWidth());
  1113. });
  1114. }, 500);
  1115. })
  1116. // 数据全屏
  1117. function launchIntoFullscreen(element) {
  1118. if(element.requestFullscreen){
  1119. element.requestFullscreen();
  1120. }
  1121. else if(element.mozRequestFullScreen) {
  1122. element.mozRequestFullScreen();
  1123. }
  1124. else if(element.webkitRequestFullscreen) {
  1125. element.webkitRequestFullscreen();
  1126. }
  1127. else if(element.msRequestFullscreen) {
  1128. element.msRequestFullscreen();
  1129. }
  1130. }
  1131. function exitFullscreen() {
  1132. if(document.exitFullscreen) {
  1133. document.exitFullscreen();
  1134. } else if(document.mozCancelFullScreen) {
  1135. document.mozCancelFullScreen();
  1136. } else if(document.webkitExitFullscreen) {
  1137. document.webkitExitFullscreen();
  1138. }
  1139. }
  1140. document.addEventListener("fullscreenchange", function (event) {
  1141. if (document.fullscreenElement) {
  1142. $('#exitfull-div').show();
  1143. $('#showFull').hide();
  1144. } else {
  1145. $('#exitfull-div').hide();
  1146. $('#showFull').show();
  1147. }
  1148. });
  1149. </script>
  1150. <!--<script src="/public/js/map/turf.min.js"></script>-->
  1151. <!--<script src="/public/js/map/gcoord.js"></script>-->
  1152. <!--<script type="text/javascript" src="https://api.map.baidu.com/api?v=1.0&type=webgl&ak=C3hLZAjuWTaCdwnwoYY83APrwlPEj4v7"></script>-->
  1153. <script>
  1154. // let map1, map2;
  1155. // function loadScript() {
  1156. // var script = document.createElement("script");
  1157. // script.src = "https://api.map.baidu.com/api?v=1.0&type=webgl&ak=C3hLZAjuWTaCdwnwoYY83APrwlPEj4v7&callback=initialize";
  1158. // document.body.appendChild(script);
  1159. // }
  1160. // window.onload = loadScript;
  1161. // const map1 = new BMapGL.Map("map1");
  1162. // const map2 = new BMapGL.Map("map2");
  1163. // map1.enableScrollWheelZoom(true);
  1164. // map1.setMapStyleV2({styleId: '20d4aea41cf71387395f2dc835f1c4b6'});
  1165. // map2.enableScrollWheelZoom(true);
  1166. // map2.setMapStyleV2({styleId: '20d4aea41cf71387395f2dc835f1c4b6'});
  1167. const originDataCollect = parseInt('<%- ctx.session.sessionProject.dataCollect %>');
  1168. const category = JSON.parse(unescape('<%- escape(JSON.stringify(categoryData)) %>'));
  1169. <!--const mapJson = JSON.parse(unescape('<%- escape(JSON.stringify(map_json)) %>'));-->
  1170. let tenders = '';
  1171. // let noticeList = '';
  1172. $(function () {
  1173. postData('/datacollect/load', {}, function (result) {
  1174. tenders = result.tenderList;
  1175. const chart_option5_data = {
  1176. data1: [],
  1177. data2: [],
  1178. data3: [],
  1179. }
  1180. const chart_category_data = {
  1181. data1: [],
  1182. data2: [],
  1183. data3: [],
  1184. }
  1185. let option5_is_tender = false;
  1186. // 设置圆环图5数据,还要设置圆环图大小
  1187. if (category && category.length > 0) {
  1188. if (category[0] && category[0].value.length > 0) {
  1189. for (const c of category[0].value) {
  1190. chart_category_data.data1.push([{
  1191. cid: category[0].id,
  1192. value: c.id,
  1193. }]);
  1194. chart_option5_data.data1.push({
  1195. value: 0,
  1196. name: c.value,
  1197. });
  1198. }
  1199. }
  1200. if (category[1] && category[1].value.length > 0) {
  1201. for (const cc1 of chart_category_data.data1) {
  1202. for (const c of category[1].value) {
  1203. chart_category_data.data2.push([...cc1, {
  1204. cid: category[1].id,
  1205. value: c.id,
  1206. }]);
  1207. }
  1208. }
  1209. for (const cd1 of chart_option5_data.data1) {
  1210. for (const c of category[1].value) {
  1211. chart_option5_data.data2.push({
  1212. value: 0,
  1213. name: cd1.name + ' ' + c.value,
  1214. });
  1215. }
  1216. }
  1217. }
  1218. if (category[2] && category[2].value.length > 0) {
  1219. for (const cc2 of chart_category_data.data2) {
  1220. for (const c of category[2].value) {
  1221. chart_category_data.data3.push([...cc2, {
  1222. cid: category[2].id,
  1223. value: c.id,
  1224. }]);
  1225. }
  1226. }
  1227. for (const cd2 of chart_option5_data.data2) {
  1228. for (const c of category[2].value) {
  1229. chart_option5_data.data3.push({
  1230. value: 0,
  1231. name: cd2.name + ' ' + c.value,
  1232. });
  1233. }
  1234. }
  1235. }
  1236. } else {
  1237. option5_is_tender = true;
  1238. }
  1239. for (const t of tenders) {
  1240. calculateTender(t);
  1241. if (option5_is_tender) {
  1242. if (t.total_price) chart_option5_data.data1.push({ value: t.total_price, name: t.name});
  1243. } else {
  1244. for (const cc1 of chart_category_data.data1) {
  1245. const sameObject = _.intersectionWith(t.category, cc1, _.isEqual);
  1246. if(sameObject.length === 1) {
  1247. const index = _.findIndex(chart_category_data.data1, function (item) {
  1248. return _.isEqual(item, sameObject);
  1249. });
  1250. if (index !== -1) {
  1251. chart_option5_data.data1[index].value = ZhCalc.add(chart_option5_data.data1[index].value, (t.total_price ? t.total_price : 0));
  1252. }
  1253. }
  1254. // const index = sameObject[0] ? _.findIndex(cc1, { cid: sameObject[0].cid, value: sameObject[0].value }) : -1;
  1255. // console.log(cc1, chart_category_data.data1, index);
  1256. // if (index !== -1) {
  1257. // chart_option5_data.data1[index].value = ZhCalc.add(chart_option5_data.data1[index].value, (t.total_price ? t.total_price : 0));
  1258. // }
  1259. }
  1260. for (const cc2 of chart_category_data.data2) {
  1261. const sameObject = _.intersectionWith(t.category, cc2, _.isEqual);
  1262. if(sameObject.length === 2) {
  1263. const index = _.findIndex(chart_category_data.data2, function (item) {
  1264. return _.isEqual(item, sameObject);
  1265. })
  1266. if (index !== -1) {
  1267. chart_option5_data.data2[index].value = ZhCalc.add(chart_option5_data.data2[index].value, (t.total_price ? t.total_price : 0));
  1268. }
  1269. }
  1270. }
  1271. for (const cc3 of chart_category_data.data3) {
  1272. const sameObject = _.intersectionWith(t.category, cc3, _.isEqual);
  1273. if(sameObject.length === 3) {
  1274. const index = _.findIndex(chart_category_data.data3, function (item) {
  1275. return _.isEqual(item, sameObject);
  1276. })
  1277. if (index !== -1) {
  1278. chart_option5_data.data3[index].value = ZhCalc.add(chart_option5_data.data3[index].value, (t.total_price ? t.total_price : 0));
  1279. }
  1280. }
  1281. }
  1282. }
  1283. }
  1284. const option5 = myChart5.getOption();
  1285. option5.series[0].data = _.filter(chart_option5_data.data1, function (item) {
  1286. return item.value !== 0;
  1287. });
  1288. option5.series[1].data = _.filter(chart_option5_data.data2, function (item) {
  1289. return item.value !== 0;
  1290. });
  1291. option5.series[2].data = _.filter(chart_option5_data.data3, function (item) {
  1292. return item.value !== 0;
  1293. });
  1294. myChart5.setOption(option5);
  1295. // const selectCategory = {
  1296. // cid: category && category[0].value ? category[0].id : ,
  1297. // }
  1298. // const categoryName =
  1299. if (category && category.length > 0) {
  1300. if (category[0] && category[0].value.length > 0) {
  1301. for (const [i, fc] of category[0].value.entries()) {
  1302. const fcCategory = {cid: fc.cid, value: fc.id};
  1303. if (_.findIndex(tenders, function (item) {
  1304. return _.findIndex(item.category, fcCategory) !== -1;
  1305. }) === -1) {
  1306. $('#first-category .select-cate').eq(i + 1).hide();
  1307. } else {
  1308. $('#first-category .select-cate').eq(i + 1).show();
  1309. }
  1310. }
  1311. }
  1312. }
  1313. setData(tenders, 0);
  1314. })
  1315. function calculateTender(tender) {
  1316. if (tender.lastStage) {
  1317. tender.gather_tp = ZhCalc.add(tender.lastStage.contract_tp, tender.lastStage.qc_tp);
  1318. tender.end_contract_tp = ZhCalc.add(tender.lastStage.pre_contract_tp, tender.lastStage.contract_tp);
  1319. tender.end_qc_tp = ZhCalc.add(tender.lastStage.pre_qc_tp, tender.lastStage.qc_tp);
  1320. tender.end_gather_tp = ZhCalc.add(tender.end_contract_tp, tender.end_qc_tp);
  1321. tender.pre_gather_tp = ZhCalc.add(tender.lastStage.pre_contract_tp, tender.lastStage.pre_qc_tp);
  1322. tender.yf_tp = ZhCalc.add(tender.lastStage.yf_tp);
  1323. tender.end_yf_tp = ZhCalc.add(tender.lastStage.pre_yf_tp, tender.yf_tp);
  1324. }
  1325. }
  1326. function setData(tenderList, categoryIndex = 0) {
  1327. let total_price = 0;
  1328. let total_change_price = 0;
  1329. let total_stage_price = 0;
  1330. let total_advance_price = 0;
  1331. let total_material_price = 0;
  1332. let month_stage_num = 0;
  1333. let month_change_num = 0;
  1334. let month_revise_num = 0;
  1335. let month_material_num = 0;
  1336. let html = '';
  1337. const chart_option_name = [];
  1338. const chart_option2_data = {
  1339. total_price: [],
  1340. contract_tp:[],
  1341. qc_tp:[],
  1342. };
  1343. const chart_option3_data = [];
  1344. const chart_option1_data = [];
  1345. let option1_is_tender = false;
  1346. const chart_category_data = [];
  1347. if (category && category.length > 0 && category[categoryIndex] && category[categoryIndex].value.length > 0) {
  1348. for (const c of category[categoryIndex].value) {
  1349. chart_category_data.push({
  1350. cid: category[categoryIndex].id,
  1351. value: c.id,
  1352. });
  1353. chart_option1_data.push({
  1354. value: 0,
  1355. name: c.value,
  1356. });
  1357. }
  1358. } else {
  1359. option1_is_tender = true;
  1360. }
  1361. const chart_option4_data = [];
  1362. for(const t of tenderList) {
  1363. total_price = ZhCalc.add(total_price, t.total_price);
  1364. total_change_price = ZhCalc.add(total_change_price, t.end_qc_tp);
  1365. total_stage_price = ZhCalc.add(total_stage_price, t.end_gather_tp);
  1366. total_material_price = ZhCalc.add(total_material_price, t.material_tp);
  1367. total_advance_price = ZhCalc.add(total_advance_price, t.advance_tp);
  1368. month_stage_num = ZhCalc.add(month_stage_num, t.month_stage_num);
  1369. month_change_num = ZhCalc.add(month_change_num, t.month_change_num);
  1370. month_revise_num = ZhCalc.add(month_revise_num, t.month_revise_num);
  1371. month_material_num = ZhCalc.add(month_material_num, t.month_material_num);
  1372. html += '<tr>\n' +
  1373. ' <td><span data-toggle="tooltip" data-placement="right" data-original-title="'+ t.name +'">'+ (t.name.length > 15 ? t.name.substring(0, 15) + '...' : t.name) +'</span></td>\n' +
  1374. ' <td>'+ (t.lastStage ? '第' + (t.lastStage ? t.lastStage.order : 0) + '期': '台账' ) + '</td>\n' +
  1375. ' <td>'+ (t.total_price ? t.total_price : 0) +'</td>\n' +
  1376. ' <td>'+ (t.gather_tp ? t.gather_tp : 0) +'</td>\n' +
  1377. ' <td>'+ (t.end_gather_tp ? t.end_gather_tp : 0) +'</td>\n' +
  1378. ' <td>'+ (t.yf_tp ? t.yf_tp : 0) +'</td>\n' +
  1379. ' <td>'+ (t.end_yf_tp ? t.end_yf_tp : 0) +'</td>\n' +
  1380. ' </tr>\n';
  1381. chart_option_name.push(t.name);
  1382. chart_option2_data.total_price.push(t.total_price ? t.total_price : 0);
  1383. chart_option2_data.contract_tp.push(t.end_contract_tp ? t.end_contract_tp : 0);
  1384. chart_option2_data.qc_tp.push(t.end_qc_tp ? t.end_qc_tp : 0);
  1385. const rate = ZhCalc.mul(ZhCalc.div(ZhCalc.add(t.pre_gather_tp, t.gather_tp), t.total_price, 2), 100, 0);
  1386. chart_option3_data.push(rate ? rate : '');
  1387. if (option1_is_tender) {
  1388. if(t.total_price) chart_option1_data.push({ value: t.total_price, name: t.name});
  1389. } else {
  1390. const sameObject = _.intersectionWith(t.category, chart_category_data, _.isEqual);
  1391. const index = sameObject[0] ? _.findIndex(chart_category_data, { cid: sameObject[0].cid, value: sameObject[0].value }) : -1;
  1392. if (index !== -1) {
  1393. chart_option1_data[index].value = ZhCalc.add(chart_option1_data[index].value, (t.total_price ? t.total_price : 0));
  1394. }
  1395. }
  1396. for (const s of t.month_stage) {
  1397. const index = _.findIndex(chart_option4_data, { yearmonth: s.yearmonth });
  1398. if (index === -1) {
  1399. chart_option4_data.push({
  1400. yearmonth: s.yearmonth,
  1401. tp: s.tp,
  1402. end_tp: s.end_tp,
  1403. })
  1404. // chart_option4_data.yearmonth.push(s.yearmonth);
  1405. // chart_option4_data.tp.push(s.tp);
  1406. // chart_option4_data.end_tp.push(s.end_tp);
  1407. } else {
  1408. // chart_option4_data.tp[index].tp = ZhCalc.add(chart_option4_data.tp[index].tp, s.tp);
  1409. // chart_option4_data.tp[index].end_tp = ZhCalc.add(chart_option4_data.tp[index].end_tp, s.end_tp);
  1410. chart_option4_data[index].tp = ZhCalc.add(chart_option4_data[index].tp, s.tp);
  1411. chart_option4_data[index].end_tp = ZhCalc.add(chart_option4_data[index].end_tp, s.end_tp);
  1412. }
  1413. }
  1414. }
  1415. // console.log(tenderList);
  1416. $('.data_tender_num').text(tenderList.length);
  1417. const rate = total_price ? ZhCalc.round(ZhCalc.div(total_stage_price, total_price) * 100, 2) : 0;
  1418. $('.data_tender_rate').text(rate ? rate + '%' : '0%');
  1419. $('.data_total_price').text(formatMoney(total_price));
  1420. $('.data_total_change_price').text(formatMoney(total_change_price));
  1421. $('.data_total_stage_price').text(formatMoney(total_stage_price));
  1422. $('.data_total_advance_price').text(formatMoney(total_advance_price));
  1423. $('.data_total_material_price').text(formatMoney(total_material_price));
  1424. $('.month_stage_num').text(month_stage_num);
  1425. $('.month_change_num').text(month_change_num);
  1426. $('.month_revise_num').text(month_revise_num);
  1427. $('.month_material_num').text(month_material_num);
  1428. // 滚动数据
  1429. $('#stage-data').html(html);
  1430. // if (originDataCollect === 1 || originDataCollect === 2) {
  1431. tableScroll('tableId', '100%', 30, 7);
  1432. // }
  1433. $('[data-toggle="tooltip"]').tooltip();
  1434. // 图表数据赋值
  1435. const option2 = myChart2_1.getOption();
  1436. option2.dataZoom[0].start = 0;
  1437. option2.dataZoom[0].end = computedPosition(tenderList.length);
  1438. option2.xAxis[0].data = chart_option_name;
  1439. option2.series[0].data = chart_option2_data.total_price;
  1440. option2.series[1].data = chart_option2_data.contract_tp;
  1441. option2.series[2].data = chart_option2_data.qc_tp;
  1442. option2.series[2].data = chart_option2_data.qc_tp;
  1443. if (tenderList.length >= 8) {
  1444. option2.dataZoom[0].show = true;
  1445. } else {
  1446. option2.dataZoom[0].show = false;
  1447. }
  1448. myChart2_1.setOption(option2);
  1449. myChart2_2.setOption(option2);
  1450. myChart2_3.setOption(option2);
  1451. const option3 = myChart3_1.getOption();
  1452. option3.dataZoom[0].start = 0;
  1453. option3.dataZoom[0].end = computedPosition(tenderList.length);
  1454. option3.yAxis[0].data = chart_option_name;
  1455. option3.series[0].data = chart_option3_data;
  1456. if (tenderList.length >= 8) {
  1457. option3.dataZoom[0].show = true;
  1458. // option3.dataZoom[0].bottom = '10%';
  1459. // option3.grid.bottom = '15%';
  1460. } else {
  1461. option3.dataZoom[0].show = false;
  1462. // option3.dataZoom[0].bottom = '0%';
  1463. // option3.grid.bottom = '3%';
  1464. }
  1465. myChart3_1.setOption(option3);
  1466. myChart3_2.setOption(option3);
  1467. const option1 = myChart1.getOption();
  1468. option1.series[0].data = _.filter(chart_option1_data, function (item) {
  1469. return item.value !== 0;
  1470. });
  1471. myChart1.setOption(option1);
  1472. const option4_data = {
  1473. yearmonth: [],
  1474. tp: [],
  1475. end_tp: [],
  1476. }
  1477. if (chart_option4_data.length > 0) {
  1478. // chart_option4_data 排序
  1479. const new_chart_option4_data = _.sortBy(chart_option4_data, 'yearmonth');
  1480. for (const [i,c4] of new_chart_option4_data.entries()) {
  1481. option4_data.yearmonth.push(c4.yearmonth);
  1482. option4_data.tp.push(c4.tp);
  1483. if(i !== 0) {
  1484. option4_data.end_tp.push(ZhCalc.add(c4.tp, option4_data.end_tp[i-1]));
  1485. } else {
  1486. option4_data.end_tp.push(c4.tp);
  1487. }
  1488. }
  1489. }
  1490. const option4 = myChart4_1.getOption();
  1491. option4.dataZoom[0].start = 0;
  1492. option4.dataZoom[0].end = computedPosition(option4_data.yearmonth.length);
  1493. option4.xAxis[0].data = option4_data.yearmonth;
  1494. option4.series[0].data = option4_data.tp;
  1495. option4.series[1].data = option4_data.end_tp;
  1496. if (option4_data.yearmonth.length >= 8) {
  1497. option4.dataZoom[0].show = true;
  1498. // option4.dataZoom[0].bottom = '10%';
  1499. // option4.grid.bottom = '15%';
  1500. } else {
  1501. option4.dataZoom[0].show = false;
  1502. // option4.dataZoom[0].bottom = '0%';
  1503. // option4.grid.bottom = '3%';
  1504. }
  1505. myChart4_1.setOption(option4);
  1506. myChart4_2.setOption(option4);
  1507. $('#tableId').css({'margin-top': 0});
  1508. // 地图设置
  1509. // const polyLineList = [];
  1510. // const centerPoint = { lng: mapJson.lng, lat: mapJson.lat };
  1511. // let level = mapJson.level;
  1512. // // 初始化地图,设置中心点坐标和地图级别
  1513. // const point = new BMapGL.Point(centerPoint.lng, centerPoint.lat);
  1514. // // 创建地图实例
  1515. // map1.centerAndZoom(point, level);
  1516. // // 创建地图实例
  1517. // map2.centerAndZoom(point, level);
  1518. // map1.reset();
  1519. // map2.reset();
  1520. }
  1521. $('.change-collect').on('click', function () {
  1522. const num = parseInt($(this).data('collect'));
  1523. $('#zhankai span').text(num);
  1524. if (num === 1 || num === 3) {
  1525. $('.flex-content[data-content="1"]').show();
  1526. $('.flex-content[data-content="2"]').hide();
  1527. if (originDataCollect !== 1 && originDataCollect !== 3) {
  1528. tableScroll('tableId', '100%', 30, 7);
  1529. }
  1530. if (num === 3) {
  1531. $('.jlchart[data-chart-num="1"]').hide();
  1532. $('.jlchart[data-chart-num="1"]').siblings().show();
  1533. $('.jlchart[data-chart-num="2"]').show();
  1534. $('.jlchart[data-chart-num="2"]').siblings().hide();
  1535. } else {
  1536. $('.jlchart[data-chart-num="1"]').show();
  1537. $('.jlchart[data-chart-num="1"]').siblings().hide();
  1538. $('.jlchart[data-chart-num="2"]').hide();
  1539. $('.jlchart[data-chart-num="2"]').siblings().show();
  1540. }
  1541. // roll(50);
  1542. } else {
  1543. $('.flex-content[data-content="2"]').show();
  1544. $('.flex-content[data-content="1"]').hide();
  1545. // roll2(50);
  1546. if (num === 4) {
  1547. $('.jldbchart[data-chart-num="2"]').hide();
  1548. $('.jldbchart[data-chart-num="2"]').siblings().show();
  1549. } else {
  1550. $('.jldbchart[data-chart-num="2"]').show();
  1551. $('.jldbchart[data-chart-num="2"]').siblings().hide();
  1552. }
  1553. }
  1554. echartsReset();
  1555. });
  1556. // 第一层分类选择
  1557. $("body").on('click', '#first-category .select-cate', function () {
  1558. const id = $(this).data('value');
  1559. $(this).parents('.dropdown-menu').siblings('button').text($(this).text());
  1560. let newTenderList = tenders;
  1561. let categoryIndex = 0;
  1562. if (!id) {
  1563. $('#second-category').hide();
  1564. $('#third-category').hide();
  1565. $('#first-category').children('button').attr('data-cid', '').attr('data-value', '');
  1566. } else {
  1567. // 获取第一层已选类别
  1568. const firstCategory = { cid: parseInt($(this).data('cid')), value: parseInt(id) };
  1569. $('#first-category').children('button').attr('data-cid', $(this).data('cid')).attr('data-value', id);
  1570. newTenderList = _.filter(tenders, function (item) {
  1571. return _.findIndex(item.category, firstCategory) !== -1;
  1572. })
  1573. categoryIndex = 1;
  1574. if (category[1] && category[1].value.length > 0) {
  1575. $('#second-category').show();
  1576. $('#third-category').hide();
  1577. $('#second-category').children('button').text('全部').attr('data-cid', '').attr('data-value', '');
  1578. for (const [i,sc] of category[1].value.entries()) {
  1579. const scCategory = { cid: sc.cid, value: sc.id };
  1580. if (_.findIndex(newTenderList, function (item) {
  1581. return _.findIndex(item.category, scCategory) !== -1;}) === -1) {
  1582. $('#second-category .select-cate').eq(i+1).hide();
  1583. } else {
  1584. $('#second-category .select-cate').eq(i+1).show();
  1585. }
  1586. }
  1587. }
  1588. // categoryList.push(firstCategory);
  1589. }
  1590. setData(newTenderList, categoryIndex);
  1591. // 获取新的tenderList及categoryList
  1592. });
  1593. // 第二层分类选择
  1594. $("body").on('click', '#second-category .select-cate', function () {
  1595. const id = $(this).data('value');
  1596. // 获取第一层已选类别
  1597. const first_cid = $('#first-category').children('button').attr('data-cid');
  1598. const first_value = $('#first-category').children('button').attr('data-value');
  1599. const firstCategory = { cid: parseInt(first_cid), value: parseInt(first_value) };
  1600. let newTenderList = _.filter(tenders, function (item) {
  1601. return _.findIndex(item.category, firstCategory) !== -1;
  1602. });
  1603. // let categoryList = [firstCategory];
  1604. let categoryIndex = 1;
  1605. $(this).parents('.dropdown-menu').siblings('button').text($(this).text());
  1606. if (!id) {
  1607. $('#third-category').hide();
  1608. } else {
  1609. // 获取第二层已选类别
  1610. const secondCategory = { cid: parseInt($(this).data('cid')), value: parseInt(id) };
  1611. $('#second-category').children('button').attr('data-cid', $(this).data('cid')).attr('data-value', id);
  1612. newTenderList = _.filter(newTenderList, function (item) {
  1613. return _.findIndex(item.category, secondCategory) !== -1;
  1614. });
  1615. categoryIndex = 2;
  1616. if (category[2] && category[2].value.length > 0) {
  1617. $('#third-category').show();
  1618. $('#third-category').children('button').text('全部').attr('data-cid', '').attr('data-value', '');
  1619. for (const [i,sc] of category[2].value.entries()) {
  1620. const tcCategory = { cid: sc.cid, value: sc.id };
  1621. if (_.findIndex(newTenderList, function (item) {
  1622. return _.findIndex(item.category, tcCategory) !== -1;}) === -1) {
  1623. $('#third-category .select-cate').eq(i+1).hide();
  1624. } else {
  1625. $('#third-category .select-cate').eq(i+1).show();
  1626. }
  1627. }
  1628. }
  1629. // categoryList.push(secondCategory);
  1630. }
  1631. setData(newTenderList, categoryIndex);
  1632. // 获取新的tenderList及categoryList
  1633. });
  1634. // 第三层分类选择(至多三层)
  1635. $("body").on('click', '#third-category .select-cate', function () {
  1636. const id = $(this).data('value');
  1637. // 获取第一层已选类别
  1638. const first_cid = $('#first-category').children('button').attr('data-cid');
  1639. const first_value = $('#first-category').children('button').attr('data-value');
  1640. const firstCategory = { cid: parseInt(first_cid), value: parseInt(first_value) };
  1641. let newTenderList = _.filter(tenders, function (item) {
  1642. return _.findIndex(item.category, firstCategory) !== -1;
  1643. });
  1644. // 获取第二层已选类别
  1645. const second_cid = $('#second-category').children('button').attr('data-cid');
  1646. const second_value = $('#second-category').children('button').attr('data-value');
  1647. const secondCategory = { cid: parseInt(second_cid), value: parseInt(second_value) };
  1648. newTenderList = _.filter(newTenderList, function (item) {
  1649. return _.findIndex(item.category, secondCategory) !== -1;
  1650. });
  1651. // let categoryList = [firstCategory, secondCategory];
  1652. let categoryIndex = 2;
  1653. $(this).parents('.dropdown-menu').siblings('button').text($(this).text());
  1654. if (!id) {
  1655. $('#third-category').children('button').text('全部').attr('data-cid', '').attr('data-value', '');
  1656. } else {
  1657. $('#third-category').children('button').attr('data-cid', $(this).data('cid')).attr('data-value', id);
  1658. categoryIndex = 3;
  1659. const third_cid = $('#third-category').children('button').attr('data-cid');
  1660. const third_value = $('#third-category').children('button').attr('data-value');
  1661. const thirdCategory = { cid: parseInt(third_cid), value: parseInt(third_value) };
  1662. newTenderList = _.filter(newTenderList, function (item) {
  1663. return _.findIndex(item.category, thirdCategory) !== -1;
  1664. });
  1665. // categoryList.push({ cid: parseInt($(this).data('cid')), value: parseInt($(this).data('value')) });
  1666. }
  1667. setData(newTenderList, categoryIndex);
  1668. // 获取新的tenderList及categoryList
  1669. })
  1670. })
  1671. function formatMoney(s, dot = ',', decimal = 2) {
  1672. if (!s) {
  1673. s = 0;
  1674. return s.toFixed(decimal);
  1675. }
  1676. s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(decimal) + '';
  1677. if (!decimal) {
  1678. s += '.';
  1679. }
  1680. const l = s.split('.')[0].split('').reverse(),
  1681. r = s.split('.')[1];
  1682. let t = '';
  1683. for (let i = 0; i < l.length; i++) {
  1684. t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? dot : '');
  1685. }
  1686. const num = t.split('').reverse().join('') + (decimal === 0 ? '' : '.' + r);
  1687. return num.replace('-,', '-');
  1688. }
  1689. // 计算显示滚动条长度
  1690. function computedPosition(xArrayLength) {
  1691. if (xArrayLength >= 8) {
  1692. return Math.floor(8 / xArrayLength * 100) > 100 ? 100 : Math.floor(8 / xArrayLength * 100);
  1693. // return length <= 10 ? 35 : 100 - Math.floor(35 / length * 100);
  1694. } else {
  1695. return 100;
  1696. }
  1697. }
  1698. </script>