project_information_modal.ejs 121 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640
  1. <!--添加附件-->
  2. <div class="modal fade" id="addfujian">
  3. <div class="modal-dialog" role="document">
  4. <div class="modal-content">
  5. <div class="modal-header">
  6. <h5 class="modal-title" id="myModalLabel">上传附件</h5>
  7. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  8. <span aria-hidden="true">&times;</span>
  9. </button>
  10. </div>
  11. <div class="modal-body">
  12. <p>单个文件大小限制:50MB,支持office等文档格式、图片格式、压缩包格式</p>
  13. <!-- <p><a href="javascript: void(0);" class="btn btn-primary" id="file-modal-target">选择文件</a></p> -->
  14. <input type="file" id="file-modal" multiple="multiple">
  15. </div>
  16. <div class="modal-footer">
  17. <button id="file-cancel" type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">取消</button>
  18. <button id="file-ok" type="button" class="btn btn-primary btn-sm">添加</button>
  19. </div>
  20. </div>
  21. </div>
  22. </div>
  23. <% if ((ctx.change.status === auditConst.status.uncheck || ctx.change.status === auditConst.status.back || ctx.change.status === auditConst.status.revise) && (ctx.session.sessionUser.accountId === ctx.change.uid || ctx.tender.isTourist)) { %>
  24. <!--上报审批-->
  25. <div class="modal fade" id="sub-sp" data-backdrop="static">
  26. <div class="modal-dialog" role="document">
  27. <div class="modal-content">
  28. <div class="modal-header">
  29. <h5 class="modal-title">上报审批</h5>
  30. </div>
  31. <div class="modal-body">
  32. <div class="dropdown text-right">
  33. <% if (ctx.tender.info.shenpi.change !== shenpiConst.sp_status.gdspl) { %>
  34. <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button"
  35. id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
  36. aria-expanded="false">
  37. 添加审批流程
  38. </button>
  39. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton"
  40. style="width:220px">
  41. <div class="mb-2 p-2"><input class="form-control form-control-sm"
  42. placeholder="姓名/手机 检索" id="gr-search" autocomplete="off"></div>
  43. <dl class="list-unstyled book-list search-user-list">
  44. <% accountGroup.forEach((group, idx) => { %>
  45. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>" data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  46. <div class="dd-content" data-toggleid="<%- idx %>">
  47. <% group.groupList.forEach(item => { %>
  48. <% if (item.id !== ctx.session.sessionUser.accountId) { %>
  49. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
  50. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  51. class="ml-auto"><%- item.mobile %></span></p>
  52. <span class="text-muted"><%- item.role %></span>
  53. </dd>
  54. <% } %>
  55. <% });%>
  56. </div>
  57. <% }) %>
  58. </dl>
  59. </div>
  60. <% } else if(spGroupList.length > 0) { %>
  61. <div class="row">
  62. <div class="col-7"></div>
  63. <div class="col-5">
  64. <select class="form-control form-control-sm" id="change-sp-group">
  65. <% for (const g of spGroupList) { %>
  66. <option value="<%= g.id %>" <% if (g.id === change.sp_group) { %>selected<% } %>><%= g.name %></option>
  67. <% } %>
  68. </select>
  69. </div>
  70. </div>
  71. <% } %>
  72. </div>
  73. <div class="card mt-3">
  74. <div class="card-header">
  75. 审批流程
  76. </div>
  77. <div class="modal-height-500" style="overflow: auto">
  78. <ul class="list-group list-group-flush" id="auditors">
  79. <% for (let i = 0, iLen = ctx.change.auditorGroups.length; i < iLen; i++) { %>
  80. <li class="list-group-item d-flex" auditorId="<%- ctx.change.auditorGroups[i][0].aid %>">
  81. <div class="col-auto"><%- i+1 %></div>
  82. <div class="col">
  83. <% for (const auditor of ctx.change.auditorGroups[i]) { %>
  84. <div class="d-inline-block mx-1" auditorId="<%- auditor.aid %>">
  85. <i class="fa fa-user text-muted"></i> <%- auditor.name %> <small class="text-muted"><%- auditor.role %></small>
  86. </div>
  87. <% } %>
  88. </div>
  89. <div class="col-auto">
  90. <% if (ctx.change.auditorGroups[i][0].audit_type !== auditType.key.common) { %>
  91. <span class="badge badge-pill badge-<%- auditType.info[ctx.change.auditorGroups[i][0].audit_type].class %> badge-bg-small"><small><%- auditType.info[ctx.change.auditorGroups[i][0].audit_type].long%></small></span>
  92. <% } %>
  93. <% if ((ctx.tender.info.shenpi.change === shenpiConst.sp_status.sqspr ||
  94. (ctx.tender.info.shenpi.change === shenpiConst.sp_status.gdzs && i+1 !== iLen)) && ctx.session.sessionUser.accountId === ctx.change.uid) { %>
  95. <a href="javascript: void(0)" class="text-danger pull-right">移除</a>
  96. <% } %>
  97. </div>
  98. </li>
  99. <% } %>
  100. </ul>
  101. </div>
  102. </div>
  103. </div>
  104. <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkAuditorFrom()">
  105. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  106. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  107. <% if (ctx.session.sessionUser.accountId === ctx.change.uid) { %>
  108. <button class="btn btn-primary btn-sm" type="submit">确认上报</button>
  109. <% } %>
  110. </form>
  111. </div>
  112. </div>
  113. </div>
  114. <% if (ctx.change.status === auditConst.status.revise && (ctx.session.sessionUser.accountId === ctx.change.uid || ctx.session.sessionUser.is_admin)) { %>
  115. <!--撤销修订-->
  116. <div class="modal fade" id="sub-revoke" role="dialog" aria-labelledby="myModalLabel">
  117. <div class="modal-dialog" role="document">
  118. <form id="reviseForm" class="modal-content" method="post" action="/tender/<%- tender.id %>/change/project/cancel/revise" onsubmit="return false;">
  119. <div class="modal-header">
  120. <h5 class="modal-title" id="myModalLabel">撤销修订</h5>
  121. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  122. <span aria-hidden="true">&times;</span>
  123. </button>
  124. </div>
  125. <div class="modal-body">
  126. <h5>撤销修订,所有修改的数据将全部会被还原。</h5>
  127. <h5>确认撤销修订?</h5>
  128. </div>
  129. <div class="modal-footer">
  130. <input type="hidden" name="cpid" value="<%= ctx.change.id %>">
  131. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  132. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  133. <button type="button" id="cancel-revise-btn" class="btn btn-primary btn-sm">确认</button>
  134. </div>
  135. </form>
  136. </div>
  137. </div>
  138. <% } %>
  139. <% } %>
  140. <% if(ctx.change && (ctx.change.status !== auditConst.status.uncheck)) { %>
  141. <!--审批流程/结果-->
  142. <div class="modal fade" id="sp-list" data-backdrop="static">
  143. <div class="modal-dialog modal-lg" role="document">
  144. <div class="modal-content">
  145. <div class="modal-header">
  146. <h5 class="modal-title"><%- ctx.change.status === auditConst.status.back || ctx.change.status === auditConst.status.revise ? '重新上报' : '审批流程' %></h5>
  147. </div>
  148. <div class="modal-body">
  149. <div class="row">
  150. <div class="col-4">
  151. <% if(ctx.change.status === auditConst.status.back || ctx.change.status === auditConst.status.revise) { %>
  152. <a class="sp-list-item" href="#sub-sp" data-toggle="modal" data-target="#sub-sp" id="hideSp">修改审批流程</a>
  153. <% } else if(ctx.change.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  154. <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
  155. <% } %>
  156. <div class="card modal-height-500 mt-3" style="overflow: auto">
  157. <ul class="list-group list-group-flush auditors-list" id="auditors-list">
  158. <% ctx.change.auditors2.forEach((item, idx) => { %>
  159. <% if (idx === 0) { %>
  160. <li class="list-group-item d-flex justify-content-between align-items-center">
  161. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  162. <span class="text-muted">
  163. <% for (const u of item) { %>
  164. <small class="d-inline-block text-dark mx-1" title="<%- u.company %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  165. <% } %>
  166. </span>
  167. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  168. </li>
  169. <% } else if(idx === ctx.change.auditors2.length -1 && idx !== 0) { %>
  170. <li class="list-group-item d-flex justify-content-between align-items-center" data-auditorid="<%- item[0].aid %>">
  171. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  172. <span class="text-muted">
  173. <% for (const u of item) { %>
  174. <small class="d-inline-block text-dark mx-1" title="<%- u.company %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  175. <% } %>
  176. </span>
  177. <div class="d-flex ml-auto">
  178. <% if (item[0].audit_type !== auditType.key.common) { %>
  179. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  180. <% } %>
  181. <span class="badge badge-light badge-pill"><small>终审</small></span>
  182. </div>
  183. </li>
  184. <% } else {%>
  185. <li class="list-group-item d-flex justify-content-between align-items-center" data-auditorid="<%- item[0].aid %>">
  186. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  187. <span class="text-muted">
  188. <% for (const u of item) { %>
  189. <small class="d-inline-block text-dark mx-1" title="<%- u.company %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  190. <% } %>
  191. </span>
  192. <div class="d-flex ml-auto">
  193. <% if (item[0].audit_type !== auditType.key.common) { %>
  194. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  195. <% } %>
  196. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  197. </div>
  198. </li>
  199. <% } %>
  200. <% }) %>
  201. </ul>
  202. </div>
  203. </div>
  204. <div class="col-8 modal-height-500" style="overflow: auto">
  205. <% ctx.change.auditHistory.forEach((his, idx) => { %>
  206. <!-- 展开/收起历史流程 -->
  207. <% if(idx === ctx.change.auditHistory.length - 1 && ctx.change.auditHistory.length !== 1) { %>
  208. <div class="text-right">
  209. <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
  210. </div>
  211. <% } %>
  212. <div class="<%- idx < ctx.change.auditHistory.length - 1 ? 'fold-card' : '' %>">
  213. <div class="text-center text-muted"><%- idx+1 %>#</div>
  214. <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.change.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  215. <% his.forEach((group, index) => { %>
  216. <% if (index === 0) { %>
  217. <li class="timeline-list-item pb-2">
  218. <div class="timeline-item-date">
  219. <%- group.beginYear %>
  220. <span><%- group.beginDate %></span>
  221. <span><%- group.beginTime %></span>
  222. </div>
  223. <div class="timeline-item-tail"></div>
  224. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  225. <div class="timeline-item-content">
  226. <div class="py-1">
  227. <span class="text-black-50">原报</span>
  228. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  229. </div>
  230. <div class="card">
  231. <div class="card-body px-3 py-0">
  232. <div class="card-text p-2 py-3 row">
  233. <div class="col-10">
  234. <span class="h6"><%- ctx.change.user.name %></span>
  235. <span class="text-muted ml-1">
  236. <%- ctx.change.user.company %>
  237. <% if (ctx.change.user.role) { %>
  238. - <%- ctx.change.user.role %>
  239. <% } %>
  240. </span>
  241. </div>
  242. <div class="col">
  243. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  244. </div>
  245. </div>
  246. </div>
  247. </div>
  248. </div>
  249. </li>
  250. <% } %>
  251. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === ctx.change.auditHistory.length - 1) { %>is_uncheck<% } %>">
  252. <% if (group.endYear) { %>
  253. <div class="timeline-item-date">
  254. <%- group.endYear %>
  255. <span><%- group.endDate %></span>
  256. <span><%- group.endTime %></span>
  257. </div>
  258. <% } %>
  259. <% if (index < his.length - 1) { %>
  260. <div class="timeline-item-tail"></div>
  261. <% } %>
  262. <% if (group.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) { %>
  263. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  264. <% } else if (ctx.helper._.includes([auditConst.status.back, auditConst.status.revise, auditConst.status.checkCancel], group.status)) { %>
  265. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  266. <% } else if (group.status === auditConst.status.checking) { %>
  267. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  268. <% } else if(group.status === auditConst.status.checkAgain) {%>
  269. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-check"></i></div>
  270. <% } else if (group.status === auditConst.status.checkNo) { %>
  271. <div class="timeline-item-icon bg-danger text-light"><i class="fa fa-stop"></i></div>
  272. <% } else { %>
  273. <div class="timeline-item-icon bg-secondary text-light"></div>
  274. <% } %>
  275. <div class="timeline-item-content">
  276. <div class="py-1">
  277. <span class="text-black-50">
  278. <%- (group.audit_order === 0 ? '原报' : !group.is_final ? group.audit_order + '审' : '终审') %>
  279. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  280. </span>
  281. <% if (group.status !== auditConst.status.uncheck) { %>
  282. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  283. <% } %>
  284. </div>
  285. <div class="card">
  286. <div class="card-body px-3 py-0">
  287. <% for (const [i, auditor] of group.auditors.entries()) { %>
  288. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  289. <div class="col-10">
  290. <span class="h6"><%- auditor.name %></span>
  291. <% if (group.audit_order === 0) { %>
  292. <% if (auditor.role && auditor.role.trim()) { %>
  293. <span class="text-muted ml-1"><%- auditor.role %></span>
  294. <% } %>
  295. <% } else { %>
  296. <span class="text-muted ml-1">
  297. <%- auditor.company %>
  298. <% if (auditor.role && auditor.role.trim()) { %>
  299. - <%- auditor.role %>
  300. <% } %>
  301. </span>
  302. <% } %>
  303. </div>
  304. <div class="col">
  305. <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
  306. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  307. <% } else if (ctx.helper._.includes([auditConst.status.back, auditConst.status.revise, auditConst.status.checkCancel], auditor.status)) { %>
  308. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  309. <% } else if(auditor.status === auditConst.status.checkAgain) {%>
  310. <span class="pull-right text-warning"><i class="fa fa-check-circle"></i></span>
  311. <% } else if (auditor.status === auditConst.status.checkNo) {%>
  312. <span class="pull-right text-danger"><i class="fa fa-stop-circle"></i></span>
  313. <% } else if (auditor.status === auditConst.status.checking) { %>
  314. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  315. <% } %>
  316. </div>
  317. <% if (auditor.opinion) { %>
  318. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion %></div>
  319. <% } %>
  320. </div>
  321. <% } %>
  322. </div>
  323. </div>
  324. </div>
  325. </li>
  326. <% }) %>
  327. </ul>
  328. </div>
  329. <% }) %>
  330. </div>
  331. </div>
  332. </div>
  333. <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkAuditorFrom()">
  334. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  335. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  336. <% if((ctx.change.status === auditConst.status.back || ctx.change.status === auditConst.status.revise) && ctx.session.sessionUser.accountId === ctx.change.uid) { %>
  337. <button class="btn btn-primary btn-sm sp-list-item" type="submit">确认上报</button>
  338. <% } %>
  339. </form>
  340. </div>
  341. </div>
  342. </div>
  343. <% } %>
  344. <% if (ctx.change.status === auditConst.status.checking) { %>
  345. <% if (ctx.change.curAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0) { %>
  346. <!--审批通过-->
  347. <div class="modal fade sp-location-list" id="sp-done" data-backdrop="static">
  348. <div class="modal-dialog modal-lg" role="document">
  349. <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck(0);">
  350. <div class="modal-header">
  351. <h5 class="modal-title">审批通过</h5>
  352. </div>
  353. <div class="modal-body">
  354. <div class="row">
  355. <div class="col-4">
  356. <% if(ctx.change.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  357. <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
  358. <% } %>
  359. <div class="card modal-height-500 mt-3" style="overflow: auto">
  360. <ul class="list-group list-group-flush auditors-list">
  361. <% ctx.change.auditors2.forEach((item, idx) => { %>
  362. <% if (idx === 0) { %>
  363. <li class="list-group-item d-flex justify-content-between align-items-center">
  364. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  365. <span class="text-muted">
  366. <% for (const u of item) { %>
  367. <small class="d-inline-block text-dark mx-1" title="<%- u.company %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  368. <% } %>
  369. </span>
  370. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  371. </li>
  372. <% } else if(idx === ctx.change.auditors2.length -1 && idx !== 0) { %>
  373. <li class="list-group-item d-flex justify-content-between align-items-center">
  374. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  375. <span class="text-muted">
  376. <% for (const u of item) { %>
  377. <small class="d-inline-block text-dark mx-1" title="<%- u.company %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  378. <% } %>
  379. </span>
  380. <div class="d-flex ml-auto">
  381. <% if (item[0].audit_type !== auditType.key.common) { %>
  382. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  383. <% } %>
  384. <span class="badge badge-light badge-pill"><small>终审</small></span>
  385. </div>
  386. </li>
  387. <% } else {%>
  388. <li class="list-group-item d-flex justify-content-between align-items-center">
  389. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  390. <span class="text-muted">
  391. <% for (const u of item) { %>
  392. <small class="d-inline-block text-dark mx-1" title="<%- u.company %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  393. <% } %>
  394. </span>
  395. <div class="d-flex ml-auto">
  396. <% if (item[0].audit_type !== auditType.key.common) { %>
  397. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1 ml-auto"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  398. <% } %>
  399. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  400. </div>
  401. </li>
  402. <% } %>
  403. <% }) %>
  404. </ul>
  405. </div>
  406. </div>
  407. <div class="col-8 modal-height-500" style="overflow: auto">
  408. <% ctx.change.auditHistory.forEach((his, idx) => { %>
  409. <!-- 展开/收起历史流程 -->
  410. <% if(idx === ctx.change.auditHistory.length - 1 && ctx.change.auditHistory.length !== 1) { %>
  411. <div class="text-right">
  412. <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
  413. </div>
  414. <% } %>
  415. <div class="<%- idx < ctx.change.auditHistory.length - 1 ? 'fold-card' : '' %>">
  416. <div class="text-center text-muted"><%- idx+1 %>#</div>
  417. <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.change.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  418. <% his.forEach((group, index) => { %>
  419. <% if (index === 0) { %>
  420. <li class="timeline-list-item pb-2">
  421. <div class="timeline-item-date">
  422. <%- group.beginYear %>
  423. <span><%- group.beginDate %></span>
  424. <span><%- group.beginTime %></span>
  425. </div>
  426. <div class="timeline-item-tail"></div>
  427. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  428. <div class="timeline-item-content">
  429. <div class="py-1">
  430. <span class="text-black-50">原报</span>
  431. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  432. </div>
  433. <div class="card">
  434. <div class="card-body px-3 py-0">
  435. <div class="card-text p-2 py-3 row">
  436. <div class="col-10">
  437. <span class="h6"><%- ctx.change.user.name %></span>
  438. <span class="text-muted ml-1">
  439. <%- ctx.change.user.company %>
  440. <% if (ctx.change.user.role) { %>
  441. - <%- ctx.change.user.role %>
  442. <% } %>
  443. </span>
  444. </div>
  445. <div class="col">
  446. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  447. </div>
  448. </div>
  449. </div>
  450. </div>
  451. </div>
  452. </li>
  453. <% } %>
  454. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === ctx.change.auditHistory.length - 1) { %>is_uncheck<% } %>">
  455. <% if (group.endYear) { %>
  456. <div class="timeline-item-date">
  457. <%- group.endYear %>
  458. <span><%- group.endDate %></span>
  459. <span><%- group.endTime %></span>
  460. </div>
  461. <% } %>
  462. <% if (index < his.length - 1) { %>
  463. <div class="timeline-item-tail"></div>
  464. <% } %>
  465. <% if (group.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) { %>
  466. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  467. <% } else if (ctx.helper._.includes([auditConst.status.back, auditConst.status.revise, auditConst.status.checkCancel], group.status)) { %>
  468. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  469. <% } else if (group.status === auditConst.status.checking) { %>
  470. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  471. <% } else if(group.status === auditConst.status.checkAgain) {%>
  472. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-check"></i></div>
  473. <% } else if (group.status === auditConst.status.checkNo) { %>
  474. <div class="timeline-item-icon bg-danger text-light"><i class="fa fa-stop"></i></div>
  475. <% } else { %>
  476. <div class="timeline-item-icon bg-secondary text-light"></div>
  477. <% } %>
  478. <div class="timeline-item-content">
  479. <div class="py-1">
  480. <span class="text-black-50">
  481. <%- (group.audit_order === 0 ? '原报' : !group.is_final ? group.audit_order + '审' : '终审') %>
  482. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  483. </span>
  484. <% if (group.status !== auditConst.status.uncheck) { %>
  485. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  486. <% } %>
  487. </div>
  488. <div class="card">
  489. <div class="card-body px-3 py-0">
  490. <% for (const [i, auditor] of group.auditors.entries()) { %>
  491. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  492. <div class="col-10">
  493. <span class="h6"><%- auditor.name %></span>
  494. <% if (group.audit_order === 0) { %>
  495. <% if (auditor.role && auditor.role.trim()) { %>
  496. <span class="text-muted ml-1"><%- auditor.role %></span>
  497. <% } %>
  498. <% } else { %>
  499. <span class="text-muted ml-1">
  500. <%- auditor.company %>
  501. <% if (auditor.role && auditor.role.trim()) { %>
  502. - <%- auditor.role %>
  503. <% } %>
  504. </span>
  505. <% } %>
  506. </div>
  507. <div class="col">
  508. <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
  509. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  510. <% } else if (ctx.helper._.includes([auditConst.status.back, auditConst.status.revise, auditConst.status.checkCancel], auditor.status)) { %>
  511. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  512. <% } else if(auditor.status === auditConst.status.checkAgain) {%>
  513. <span class="pull-right text-warning"><i class="fa fa-check-circle"></i></span>
  514. <% } else if (auditor.status === auditConst.status.checkNo) {%>
  515. <span class="pull-right text-danger"><i class="fa fa-stop-circle"></i></span>
  516. <% } else if (auditor.status === auditConst.status.checking) { %>
  517. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  518. <% } %>
  519. </div>
  520. <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
  521. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  522. <% } %>
  523. <% if (auditor.status === auditConst.status.checking && auditor.aid === ctx.session.sessionUser.accountId) { %>
  524. <div class="col-12 py-1 bg-light">
  525. <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
  526. </div>
  527. <% } %>
  528. </div>
  529. <% } %>
  530. </div>
  531. </div>
  532. </div>
  533. </li>
  534. <% }) %>
  535. </ul>
  536. </div>
  537. <% }) %>
  538. </div>
  539. </div>
  540. </div>
  541. <div class="modal-footer">
  542. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  543. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  544. <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
  545. <button type="submit" class="btn btn-success btn-sm">确认通过</button>
  546. </div>
  547. </form>
  548. </div>
  549. </div>
  550. <!--审批退回-->
  551. <div class="modal fade sp-location-list" id="sp-back" data-backdrop="static">
  552. <div class="modal-dialog modal-lg" role="document">
  553. <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post"
  554. onsubmit="return auditCheck(1);">
  555. <div class="modal-header">
  556. <h5 class="modal-title">审批退回</h5>
  557. </div>
  558. <div class="modal-body">
  559. <div class="row">
  560. <div class="col-4">
  561. <% if(ctx.change.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  562. <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
  563. <% } %>
  564. <div class="card modal-height-500 mt-3" style="overflow: auto">
  565. <ul class="list-group list-group-flush auditors-list">
  566. <% ctx.change.auditors2.forEach((item, idx) => { %>
  567. <% if (idx === 0) { %>
  568. <li class="list-group-item d-flex justify-content-between align-items-center">
  569. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  570. <span class="text-muted">
  571. <% for (const u of item) { %>
  572. <small class="d-inline-block text-dark mx-1" title="<%- u.company %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  573. <% } %>
  574. </span>
  575. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  576. </li>
  577. <% } else if(idx === ctx.change.auditors2.length -1 && idx !== 0) { %>
  578. <li class="list-group-item d-flex justify-content-between align-items-center">
  579. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  580. <span class="text-muted">
  581. <% for (const u of item) { %>
  582. <small class="d-inline-block text-dark mx-1" title="<%- u.company %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  583. <% } %>
  584. </span>
  585. <div class="d-flex ml-auto">
  586. <% if (item[0].audit_type !== auditType.key.common) { %>
  587. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  588. <% } %>
  589. <span class="badge badge-light badge-pill"><small>终审</small></span>
  590. </div>
  591. </li>
  592. <% } else {%>
  593. <li class="list-group-item d-flex justify-content-between align-items-center">
  594. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  595. <span class="text-muted">
  596. <% for (const u of item) { %>
  597. <small class="d-inline-block text-dark mx-1" title="<%- u.company %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  598. <% } %>
  599. </span>
  600. <div class="d-flex ml-auto">
  601. <% if (item[0].audit_type !== auditType.key.common) { %>
  602. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  603. <% } %>
  604. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  605. </div>
  606. </li>
  607. <% } %>
  608. <% }) %>
  609. </ul>
  610. </div>
  611. </div>
  612. <div class="col-8 modal-height-500" style="overflow: auto">
  613. <% ctx.change.auditHistory.forEach((his, idx) => { %>
  614. <!-- 展开/收起历史流程 -->
  615. <% if(idx === ctx.change.auditHistory.length - 1 && ctx.change.auditHistory.length !== 1) { %>
  616. <div class="text-right">
  617. <a href="javascript: void(0);" id="fold-btn" data-target="show" data-idx="<%- idx + 1 %>">展开历史审批流程</a>
  618. </div>
  619. <% } %>
  620. <div class="<%- idx < ctx.change.auditHistory.length - 1 ? 'fold-card' : '' %>">
  621. <div class="text-center text-muted"><%- idx+1 %>#</div>
  622. <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.change.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  623. <% his.forEach((group, index) => { %>
  624. <% if (index === 0) { %>
  625. <li class="timeline-list-item pb-2">
  626. <div class="timeline-item-date">
  627. <%- group.beginYear %>
  628. <span><%- group.beginDate %></span>
  629. <span><%- group.beginTime %></span>
  630. </div>
  631. <div class="timeline-item-tail"></div>
  632. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  633. <div class="timeline-item-content">
  634. <div class="py-1">
  635. <span class="text-black-50">原报</span>
  636. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  637. </div>
  638. <div class="card">
  639. <div class="card-body px-3 py-0">
  640. <div class="card-text p-2 py-3 row">
  641. <div class="col-10">
  642. <span class="h6"><%- ctx.change.user.name %></span>
  643. <span class="text-muted ml-1">
  644. <%- ctx.change.user.company %>
  645. <% if (ctx.change.user.role) { %>
  646. - <%- ctx.change.user.role %>
  647. <% } %>
  648. </span>
  649. </div>
  650. <div class="col">
  651. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  652. </div>
  653. </div>
  654. </div>
  655. </div>
  656. </div>
  657. </li>
  658. <% } %>
  659. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === ctx.change.auditHistory.length - 1) { %>is_uncheck<% } %>">
  660. <% if (his.endYear) { %>
  661. <div class="timeline-item-date">
  662. <%- group.endYear %>
  663. <span><%- group.endDate %></span>
  664. <span><%- group.endTime %></span>
  665. </div>
  666. <% } %>
  667. <% if (index < his.length - 1) { %>
  668. <div class="timeline-item-tail"></div>
  669. <% } %>
  670. <% if (group.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) { %>
  671. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  672. <% } else if (ctx.helper._.includes([auditConst.status.back, auditConst.status.revise, auditConst.status.checkCancel], group.status)) { %>
  673. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  674. <% } else if (group.status === auditConst.status.checking) { %>
  675. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  676. <% } else if(group.status === auditConst.status.checkAgain) {%>
  677. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-check"></i></div>
  678. <% } else if (group.status === auditConst.status.checkNo) { %>
  679. <div class="timeline-item-icon bg-danger text-light"><i class="fa fa-stop"></i></div>
  680. <% } else { %>
  681. <div class="timeline-item-icon bg-secondary text-light"></div>
  682. <% } %>
  683. <div class="timeline-item-content">
  684. <div class="py-1">
  685. <span class="text-black-50">
  686. <%- (group.audit_order === 0 ? '原报' : !group.is_final ? group.audit_order + '审' : '终审') %>
  687. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  688. </span>
  689. <% if (group.status !== auditConst.status.uncheck) { %>
  690. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  691. <% } %>
  692. </div>
  693. <div class="card">
  694. <div class="card-body px-3 py-0">
  695. <% for (const [i, auditor] of group.auditors.entries()) { %>
  696. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  697. <div class="col-10">
  698. <span class="h6"><%- auditor.name %></span>
  699. <% if (group.audit_order === 0) { %>
  700. <% if (auditor.role && auditor.role.trim()) { %>
  701. <span class="text-muted ml-1"><%- auditor.role %></span>
  702. <% } %>
  703. <% } else { %>
  704. <span class="text-muted ml-1">
  705. <%- auditor.company %>
  706. <% if (auditor.role && auditor.role.trim()) { %>
  707. - <%- auditor.role %>
  708. <% } %>
  709. </span>
  710. <% } %>
  711. </div>
  712. <div class="col">
  713. <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
  714. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  715. <% } else if (ctx.helper._.includes([auditConst.status.back, auditConst.status.revise, auditConst.status.checkCancel], auditor.status)) { %>
  716. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  717. <% } else if(auditor.status === auditConst.status.checkAgain) {%>
  718. <span class="pull-right text-warning"><i class="fa fa-check-circle"></i></span>
  719. <% } else if (auditor.status === auditConst.status.checkNo) {%>
  720. <span class="pull-right text-danger"><i class="fa fa-stop-circle"></i></span>
  721. <% } else if (auditor.status === auditConst.status.checking) { %>
  722. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  723. <% } %>
  724. </div>
  725. <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
  726. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  727. <% } %>
  728. <% if (auditor.status === auditConst.status.checking && auditor.aid === ctx.session.sessionUser.accountId) { %>
  729. <div class="col-12 py-1 bg-light">
  730. <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
  731. <div class="alert alert-warning mt-1 mb-0 p-2">
  732. <div class="form-check form-check-inline">
  733. <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.back %>" checked>
  734. <label class="form-check-label" for="inlineRadio1">退回原报 <%- ctx.change.user.name %></label>
  735. </div>
  736. </div>
  737. </div>
  738. <% } %>
  739. </div>
  740. <% } %>
  741. </div>
  742. </div>
  743. </div>
  744. </li>
  745. <% }) %>
  746. </ul>
  747. </div>
  748. <% }) %>
  749. </div>
  750. </div>
  751. </div>
  752. <div class="modal-footer">
  753. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  754. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  755. <button type="submit" class="btn btn-warning btn-sm">确认退回</button>
  756. </div>
  757. </form>
  758. </div>
  759. </div>
  760. <!-- 终止 -->
  761. <div class="modal fade" id="stop" data-backdrop="static">
  762. <div class="modal-dialog " role="document">
  763. <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck(2);">
  764. <div class="modal-header">
  765. <h5 class="modal-title">终止</h5>
  766. </div>
  767. <div class="modal-body">
  768. <div class="form-group">
  769. <label>审批意见<b class="text-danger">*</b></label>
  770. <textarea class="form-control" name="opinion" placeholder="请填写审批意见"></textarea>
  771. </div>
  772. <label class="form-text alert alert-danger m-0">审批终止,将结束本次审批。</label>
  773. </div>
  774. <div class="modal-footer">
  775. <button type="button" class="btn btn-sm btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  776. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  777. <input type="hidden" name="checkType" value="<%= auditConst.status.checkNo %>" />
  778. <button type="submit" class="btn btn-sm btn-danger btn-sm" >确认</button>
  779. </div>
  780. </form>
  781. </div>
  782. </div>
  783. <% } %>
  784. <% } %>
  785. <!--弹出添加协审-->
  786. <div class="modal fade" id="xieshen" data-backdrop="static">
  787. <div class="modal-dialog" role="document">
  788. <div class="modal-content">
  789. <div class="modal-header">
  790. <h5 class="modal-title">添加协审</h5>
  791. </div>
  792. <div class="modal-body modal-height">
  793. <div class="mb-3">协审账号可以查看本变更,上传附件。</div>
  794. <div>
  795. <div class="dropdown mb-3">
  796. <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button"
  797. id="dropdownMenuButton2" data-toggle="dropdown" aria-haspopup="true"
  798. aria-expanded="false">
  799. 选择协审人
  800. </button>
  801. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton2"
  802. style="width:220px">
  803. <div class="mb-2 p-2"><input class="form-control form-control-sm"
  804. placeholder="姓名/手机 检索" id="gr-search2" autocomplete="off"></div>
  805. <dl class="list-unstyled book-list search-user-list2">
  806. <% accountGroup.forEach((group, idx) => { %>
  807. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>" data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  808. <div class="dd-content" data-toggleid="<%- idx %>">
  809. <% group.groupList.forEach(item => { %>
  810. <% if (item.id !== ctx.change.uid) { %>
  811. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
  812. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  813. class="ml-auto"><%- item.mobile %></span></p>
  814. <span class="text-muted"><%- item.role %></span>
  815. </dd>
  816. <% } %>
  817. <% });%>
  818. </div>
  819. <% }) %>
  820. </dl>
  821. </div>
  822. </div>
  823. <div class="modal-height-max100" style="overflow: visible" id="xs-list">
  824. <% for (const xs of change.xsAuditors) { %>
  825. <span class="d-inline-block">
  826. <span class="badge badge-light">
  827. <%- xs.name %>
  828. <% if (ctx.helper._.indexOf(ctx.helper._.map(change.auditors2, 'aid'), ctx.session.sessionUser.accountId) !== -1) { %>
  829. <span class="dropdown">
  830. <a href="javascript:void(0)" class="btn-sm text-danger px-1" title="移除" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-remove"></i></a>
  831. <div class="dropdown-menu">
  832. <a class="dropdown-item" href="javascript:void(0);">确认移除协审人?</a>
  833. <div class="dropdown-divider"></div>
  834. <div class="px-2 py-1 text-center">
  835. <button class="btn btn-sm btn-danger" aid="<%- xs.aid %>">移除</button>
  836. <button class="btn btn-sm btn-secondary">取消</button>
  837. </div>
  838. </div>
  839. </span>
  840. <% } %>
  841. </span>
  842. </span>
  843. <% } %>
  844. </div>
  845. </div>
  846. </div>
  847. <div class="modal-footer">
  848. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  849. </div>
  850. </div>
  851. </div>
  852. </div>
  853. <% if (ctx.change.status === auditConst.status.checked && ctx.change.finalAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0) { %>
  854. <% if (!authMobile && ctx.session.sessionUser.loginStatus === 0) { %>
  855. <!--终审重新审批-->
  856. <div class="modal fade" id="sp-down-back" data-backdrop="static">
  857. <div class="modal-dialog" role="document">
  858. <div class="modal-content">
  859. <div class="modal-header">
  860. <h5 class="modal-title">重新审批</h5>
  861. </div>
  862. <div class="modal-body">
  863. <h5>重新审批需要您的手机短信验证</h5>
  864. <h5>您目前还没设置认证手机,请先设置。</h5>
  865. </div>
  866. <div class="modal-footer">
  867. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  868. <a href="/profile/sms" class="btn btn-sm btn-primary">去设置</a>
  869. </div>
  870. </div>
  871. </div>
  872. </div>
  873. <% } else { %>
  874. <!--重新审批-->
  875. <div class="modal fade" id="sp-down-back" data-backdrop="static">
  876. <div class="modal-dialog" role="document">
  877. <form id="againForm" class="modal-content" method="post" action="/tender/<%- tender.id %>/change/project/check/again" onsubmit="return false;">
  878. <div class="modal-header">
  879. <h5 class="modal-title">重新审批</h5>
  880. </div>
  881. <div class="modal-body">
  882. <h5>确认由「终审-<%= ctx.change.auditors2[ctx.change.auditors2.length-1].name %>」重新审批「<%= change.code %>」?</h5>
  883. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  884. <div class="form-group">
  885. <label>重审需要验证码确认,验证码将发送至尾号<%- authMobile.slice(-4) %>的手机</label>
  886. <div class="input-group input-group-sm mb-3">
  887. <input class="form-control" type="text" readonly="readonly" name="code" placeholder="输入短信中的6位验证码" />
  888. <div class="input-group-append">
  889. <button class="btn btn-outline-secondary get-code" type="button">获取验证码</button>
  890. </div>
  891. </div>
  892. </div>
  893. <% } %>
  894. </div>
  895. <div class="modal-footer">
  896. <input type="hidden" name="cpid" value="<%= change.id %>">
  897. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  898. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  899. <button type="button" id="re-shenpi-btn" class="btn btn-warning btn-sm" <% if (ctx.session.sessionUser.loginStatus === 0) { %>disabled<% } %>>确定重审</button>
  900. </div>
  901. </form>
  902. </div>
  903. </div>
  904. <% } %>
  905. <% } %>
  906. <% if (ctx.change.status === auditConst.status.checked && ctx.session.sessionUser.accountId === ctx.change.uid) { %>
  907. <% if (!authMobile && ctx.session.sessionUser.loginStatus === 0) { %>
  908. <!--原报修订变更-->
  909. <div class="modal fade" id="sp-down-revise" data-backdrop="static">
  910. <div class="modal-dialog" role="document">
  911. <div class="modal-content">
  912. <div class="modal-header">
  913. <h5 class="modal-title">修订变更</h5>
  914. </div>
  915. <div class="modal-body">
  916. <h5>修订变更需要您的手机短信验证</h5>
  917. <h5>您目前还没设置认证手机,请先设置。</h5>
  918. </div>
  919. <div class="modal-footer">
  920. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  921. <a href="/profile/sms" class="btn btn-sm btn-primary">去设置</a>
  922. </div>
  923. </div>
  924. </div>
  925. </div>
  926. <% } else { %>
  927. <!--修订变更-->
  928. <div class="modal fade" id="sp-down-revise" data-backdrop="static">
  929. <div class="modal-dialog" role="document">
  930. <form id="reviseForm" class="modal-content" method="post" action="/tender/<%- tender.id %>/change/project/check/revise" onsubmit="return false;">
  931. <div class="modal-header">
  932. <h5 class="modal-title">修订变更</h5>
  933. </div>
  934. <div class="modal-body">
  935. <h5>确认需要修订变更「<%= change.code %>」?</h5>
  936. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  937. <div class="form-group">
  938. <label>修订需要验证码确认,验证码将发送至尾号<%- authMobile.slice(-4) %>的手机</label>
  939. <div class="input-group input-group-sm mb-3">
  940. <input class="form-control" type="text" readonly="readonly" name="code" placeholder="输入短信中的6位验证码" />
  941. <div class="input-group-append">
  942. <button class="btn btn-outline-secondary get-code" type="button">获取验证码</button>
  943. </div>
  944. </div>
  945. </div>
  946. <% } %>
  947. </div>
  948. <div class="modal-footer">
  949. <input type="hidden" name="cpid" value="<%= ctx.change.id %>">
  950. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  951. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  952. <button type="button" id="re-shenpi-btn2" class="btn btn-warning btn-sm" <% if (ctx.session.sessionUser.loginStatus === 0) { %>disabled<% } %>>确定修订</button>
  953. </div>
  954. </form>
  955. </div>
  956. </div>
  957. <% } %>
  958. <% } %>
  959. <% if (ctx.change.cancancel) { %>
  960. <div class="modal fade" id="sp-down-cancel" data-backdrop="static">
  961. <div class="modal-dialog" role="document">
  962. <div class="modal-content">
  963. <div class="modal-header">
  964. <h5 class="modal-title">撤回</h5>
  965. </div>
  966. <div class="modal-body">
  967. <h5>撤回后将回退到你的操作状态,确定撤回?</h5>
  968. </div>
  969. <div class="modal-footer">
  970. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">取消</button>
  971. <button type="submit" class="btn btn-danger btn-sm" id="cancel-shenpi-btn">确定撤回</button>
  972. </div>
  973. </div>
  974. </div>
  975. </div>
  976. <% } %>
  977. <% if (ctx.change && ctx.change.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  978. <!--上报审批-->
  979. <div class="modal fade" id="sub-sp2" data-backdrop="static">
  980. <div class="modal-dialog" style="max-width: 650px" role="document">
  981. <div class="modal-content">
  982. <div class="modal-header">
  983. <h5 class="modal-title">修改审批流程</h5>
  984. </div>
  985. <div class="modal-body">
  986. <div class="card mt-1">
  987. <div class="modal-height-500" style="overflow: auto">
  988. <style>
  989. #admin-edit-shenpi thead th {
  990. border-bottom: 0;
  991. }
  992. #admin-edit-shenpi td, #admin-edit-shenpi th {
  993. padding: 0.75rem;
  994. }
  995. #admin-edit-shenpi th {
  996. background: none;
  997. color: #212529;
  998. border-top: 0;
  999. }
  1000. </style>
  1001. <table class="table table-hover" id="admin-edit-shenpi">
  1002. <thead>
  1003. <tr class="card-header text-center">
  1004. <th width="100px">审批流程</th>
  1005. <th>审批人员</th>
  1006. <th width="80" style="text-align: center">审批状态</th>
  1007. <th width="200" style="text-align: center">操作</th>
  1008. </tr>
  1009. </thead>
  1010. <tbody id="admin-edit-shenpi-list">
  1011. <% for (const [i, group] of ctx.change.auditors2.entries()) { %>
  1012. <% if (i === 0) continue; %>
  1013. <% for (const [j, auditor] of group.entries()) { %>
  1014. <tr>
  1015. <td class="text-left d-flex">
  1016. <% if (j === 0) { %>
  1017. <%- i + '审' %>
  1018. <% if (auditor.audit_type !== auditType.key.common) { %>
  1019. <span class="ml-2 badge badge-pill badge-<%- auditType.info[auditor.audit_type].class %> p-1"><small><%- auditType.info[auditor.audit_type].short %></small></span>
  1020. <% } %>
  1021. <% } %>
  1022. </td>
  1023. <td></span> <%- auditor.name %> <small class="text-muted"><%- auditor.role %></small></td>
  1024. <td style="text-align: center"><span class="<%- auditConst.auditStringClass[auditor.status] %>"><%- auditor.status !== auditConst.status.uncheck ? auditConst.auditString[auditor.status] : '待审批' %></span></td>
  1025. <td style="text-align: center">
  1026. <% if (auditor.status === auditConst.status.checking && j === group.length - 1) { %>
  1027. <span class="dropdown mr-2">
  1028. <a href="javascript: void(0)" class="add-audit" id="<%- auditor.aid %>_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>
  1029. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_add_dropdownMenu" aria-labelledby="<%- auditor.aid %>_add_dropdownMenuButton" style="width:220px">
  1030. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  1031. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_add"></div>
  1032. <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="add">
  1033. <% accountGroup.forEach((group, idx) => { %>
  1034. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  1035. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  1036. <div class="dd-content" data-toggleid="<%- idx %>">
  1037. <% group.groupList.forEach(item => { %>
  1038. <% if (item.id !== ctx.change.uid) { %>
  1039. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  1040. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  1041. class="ml-auto"><%- item.mobile %></span></p>
  1042. <span class="text-muted"><%- item.role %></span>
  1043. </dd>
  1044. <% } %>
  1045. <% });%>
  1046. </div>
  1047. <% }) %>
  1048. </dl>
  1049. </div>
  1050. </span>
  1051. <% } %>
  1052. <% if (auditor.status === auditConst.status.uncheck) { %>
  1053. <% if (j === group.length - 1) { %>
  1054. <span class="dropdown mr-2">
  1055. <a href="javascript: void(0)" class="add-audit" id="<%- auditor.aid %>_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>
  1056. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_add_dropdownMenu" aria-labelledby="<%- auditor.aid %>_add_dropdownMenuButton" style="width:220px">
  1057. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  1058. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_add"></div>
  1059. <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="add">
  1060. <% accountGroup.forEach((group, idx) => { %>
  1061. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  1062. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  1063. <div class="dd-content" data-toggleid="<%- idx %>">
  1064. <% group.groupList.forEach(item => { %>
  1065. <% if (item.id !== ctx.change.uid) { %>
  1066. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  1067. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  1068. class="ml-auto"><%- item.mobile %></span></p>
  1069. <span class="text-muted"><%- item.role %></span>
  1070. </dd>
  1071. <% } %>
  1072. <% });%>
  1073. </div>
  1074. <% }) %>
  1075. </dl>
  1076. </div>
  1077. </span>
  1078. <% if (auditor.audit_type !== auditType.key.common) { %>
  1079. <span class="dropdown mr-2">
  1080. <a href="javascript: void(0)" class="add-audit" id="<%- auditor.aid %>_add-sibling_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">平级</a>
  1081. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_add-sibling_dropdownMenu" aria-labelledby="<%- auditor.aid %>_add-sibling_dropdownMenuButton" style="width:220px">
  1082. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  1083. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_add-sibling"></div>
  1084. <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="add-sibling">
  1085. <% accountGroup.forEach((group, idx) => { %>
  1086. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  1087. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  1088. <div class="dd-content" data-toggleid="<%- idx %>">
  1089. <% group.groupList.forEach(item => { %>
  1090. <% if (item.id !== ctx.change.uid) { %>
  1091. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  1092. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  1093. class="ml-auto"><%- item.mobile %></span></p>
  1094. <span class="text-muted"><%- item.role %></span>
  1095. </dd>
  1096. <% } %>
  1097. <% });%>
  1098. </div>
  1099. <% }) %>
  1100. </dl>
  1101. </div>
  1102. </span>
  1103. <% } %>
  1104. <% } %>
  1105. <span class="dropdown mr-2">
  1106. <a href="javascript: void(0)" class="change-audit" id="<%- auditor.aid %>_change_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">更换</a>
  1107. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_change_dropdownMenu" aria-labelledby="<%- auditor.aid %>_change_dropdownMenuButton" style="width:220px">
  1108. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  1109. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_change"></div>
  1110. <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="change">
  1111. <% accountGroup.forEach((group, idx) => { %>
  1112. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  1113. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  1114. <div class="dd-content" data-toggleid="<%- idx %>">
  1115. <% group.groupList.forEach(item => { %>
  1116. <% if (item.id !== ctx.change.uid) { %>
  1117. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  1118. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  1119. class="ml-auto"><%- item.mobile %></span></p>
  1120. <span class="text-muted"><%- item.role %></span>
  1121. </dd>
  1122. <% } %>
  1123. <% });%>
  1124. </div>
  1125. <% }) %>
  1126. </dl>
  1127. </div>
  1128. </span>
  1129. <span class="dropdown">
  1130. <a href="javascript: void(0)" class="text-danger" title="移除" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">移除</a>
  1131. <div class="dropdown-menu">
  1132. <span class="dropdown-item" href="javascript:void(0);">确认移除审批人?</span>
  1133. <div class="dropdown-divider"></div>
  1134. <div class="px-2 py-1 text-center">
  1135. <button class="remove-audit btn btn-sm btn-danger" data-id="<%- auditor.aid %>">移除</button>
  1136. <button class="btn btn-sm btn-secondary">取消</button>
  1137. </div>
  1138. </div>
  1139. </span>
  1140. <% } %>
  1141. </td>
  1142. </tr>
  1143. <% } %>
  1144. <% } %>
  1145. </tbody>
  1146. </table>
  1147. </div>
  1148. </div>
  1149. </div>
  1150. <form class="modal-footer">
  1151. <div class="mr-auto text-warning">
  1152. <span class="mr-3">增加:后级审核人</span>
  1153. <span class="">平级:会签/或签增加平级审核人</span>
  1154. </div>
  1155. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  1156. </form>
  1157. </div>
  1158. </div>
  1159. </div>
  1160. <% } %>
  1161. <script>
  1162. const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
  1163. const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
  1164. const cur_uid = parseInt('<%- ctx.session.sessionUser.accountId %>');
  1165. const csrf = '<%= ctx.csrf %>';
  1166. const authMobile = '<%= authMobile %>';
  1167. const auditType = JSON.parse('<%- JSON.stringify(auditType) %>');
  1168. const shenpi_status = <%- ctx.tender.info.shenpi.change %>;
  1169. const shenpiConst = JSON.parse('<%- JSON.stringify(shenpiConst) %>');
  1170. $(function () {
  1171. $('.sp-location-list').on('shown.bs.modal', function () {
  1172. const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
  1173. const bdiv = (scrollBox.offset() && scrollBox.offset().top) || 0;
  1174. scrollBox.scrollTop(0);
  1175. const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
  1176. const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
  1177. if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
  1178. scrollBox.scrollTop(hdheight - bdiv);
  1179. }
  1180. });
  1181. function divSearch(div) {
  1182. if (div.length > 0) {
  1183. return true;
  1184. }
  1185. return false;
  1186. }
  1187. // 展开历史审核记录
  1188. $('.modal-body #fold-btn').click(function () {
  1189. const type = $(this).data('target')
  1190. const auditCard = $(this).parent().parent()
  1191. if (type === 'show') {
  1192. $(this).data('target', 'hide')
  1193. auditCard.find('.fold-card').slideDown('swing', () => {
  1194. auditCard.find('#fold-btn').text('收起历史审核记录')
  1195. })
  1196. } else {
  1197. $(this).data('target', 'show')
  1198. auditCard.find('.fold-card').slideUp('swing', () => {
  1199. auditCard.find('#fold-btn').text('展开历史审核记录')
  1200. })
  1201. }
  1202. });
  1203. $('.sp-list-btn').click(function () {
  1204. const type = $(this).data('type')
  1205. if (type === 'hide') {
  1206. $('.sp-list-item').hide()
  1207. $('.modal-title').text('审批流程')
  1208. } else {
  1209. $('.sp-list-item').show()
  1210. $('.modal-title').text('重新上报')
  1211. }
  1212. });
  1213. $('#re-shenpi-btn').click(function () {
  1214. const data = {
  1215. cpid: parseInt('<%- ctx.change.id %>'),
  1216. };
  1217. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  1218. const code = $("#againForm input[name='code']").val();
  1219. if ($(this).hasClass('disabled')) {
  1220. return false;
  1221. }
  1222. if (code.length < 6) {
  1223. // alert('请填写正确的验证码');
  1224. toastr.error('请填写正确的验证码');
  1225. return false;
  1226. }
  1227. data.code = code;
  1228. <% } %>
  1229. $.ajax({
  1230. url: '/tender/<%- tender.id %>/change/project/check/again?_csrf_j=' + csrf,
  1231. type: 'post',
  1232. data: data,
  1233. dataTye: 'json',
  1234. success: function(response) {
  1235. if (response.err === 0) {
  1236. window.location.href = response.url;
  1237. } else {
  1238. toastr.error(response.msg);
  1239. }
  1240. }
  1241. });
  1242. });
  1243. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  1244. // 重新审批获取手机验证码
  1245. // 获取验证码
  1246. let isPosting = false;
  1247. $(".get-code").on('click', function() {
  1248. if (isPosting) {
  1249. return false;
  1250. }
  1251. const btn = $(this);
  1252. $.ajax({
  1253. url: '/profile/code?_csrf_j=' + csrf,
  1254. type: 'post',
  1255. data: { mobile: authMobile, type: 'shenpi' },
  1256. dataTye: 'json',
  1257. error: function() {
  1258. isPosting = false;
  1259. },
  1260. beforeSend: function() {
  1261. isPosting = true;
  1262. },
  1263. success: function(response) {
  1264. isPosting = false;
  1265. if (response.err === 0) {
  1266. codeSuccess(btn);
  1267. $("input[name='code']").removeAttr('readonly');
  1268. $("#re-shenpi-btn").removeAttr('disabled');
  1269. $("#re-shenpi-btn2").removeAttr('disabled');
  1270. } else {
  1271. toastr.error(response.msg);
  1272. }
  1273. }
  1274. });
  1275. });
  1276. <% } %>
  1277. $('#re-shenpi-btn2').click(function () {
  1278. const data = {
  1279. cpid: parseInt('<%- ctx.change.id %>'),
  1280. };
  1281. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  1282. const code = $("#reviseForm input[name='code']").val();
  1283. if ($(this).hasClass('disabled')) {
  1284. return false;
  1285. }
  1286. if (code.length < 6) {
  1287. // alert('请填写正确的验证码');
  1288. toastr.error('请填写正确的验证码');
  1289. return false;
  1290. }
  1291. data.code = code;
  1292. <% } %>
  1293. $.ajax({
  1294. url: '/tender/<%- tender.id %>/change/project/check/revise?_csrf_j=' + csrf,
  1295. type: 'post',
  1296. data: data,
  1297. dataTye: 'json',
  1298. success: function(response) {
  1299. if (response.err === 0) {
  1300. window.location.href = response.url;
  1301. } else {
  1302. toastr.error(response.msg);
  1303. }
  1304. }
  1305. });
  1306. });
  1307. $('#cancel-revise-btn').click(function () {
  1308. const data = {
  1309. cpid: parseInt('<%- ctx.change.id %>'),
  1310. };
  1311. $.ajax({
  1312. url: '/tender/<%- tender.id %>/change/project/cancel/revise?_csrf_j=' + csrf,
  1313. type: 'post',
  1314. data: data,
  1315. dataTye: 'json',
  1316. success: function(response) {
  1317. if (response.err === 0) {
  1318. window.location.href = response.url;
  1319. } else {
  1320. toastr.error(response.msg);
  1321. }
  1322. }
  1323. });
  1324. });
  1325. <% if (ctx.change && ctx.change.cancancel) { %>
  1326. $("#cancel-shenpi-btn").click(function () {
  1327. const data = {
  1328. cpid: parseInt('<%- ctx.change.id %>'),
  1329. };
  1330. $.ajax({
  1331. url: '/tender/<%- tender.id %>/change/project/cancel/audit?_csrf_j=' + csrf,
  1332. type: 'post',
  1333. data: data,
  1334. dataTye: 'json',
  1335. success: function (response) {
  1336. if (response.err === 0) {
  1337. window.location.href = response.url;
  1338. } else {
  1339. toastr.error(response.msg);
  1340. }
  1341. }
  1342. });
  1343. });
  1344. <% } %>
  1345. })
  1346. /**
  1347. * 获取成功后的操作
  1348. *
  1349. * @param {Object} btn - 点击的按钮
  1350. * @return {void}
  1351. */
  1352. function codeSuccess(btn) {
  1353. let counter = 60;
  1354. btn.addClass('disabled').text('重新获取 ' + counter + 'S');
  1355. btn.parent().siblings('input').removeAttr('readonly').attr('placeholder', '输入短信中的6位验证码');
  1356. const bindBtn = $("#bind-btn");
  1357. bindBtn.removeClass('btn-secondary disabled').addClass('btn-primary');
  1358. const countDown = setInterval(function() {
  1359. const countString = counter - 1 <= 0 ? '' : ' ' + (counter - 1) + 'S';
  1360. // 倒数结束后
  1361. if (countString === '') {
  1362. clearInterval(countDown);
  1363. btn.removeClass('disabled');
  1364. }
  1365. const text = '重新获取' + countString;
  1366. btn.text(text);
  1367. counter -= 1;
  1368. }, 1000);
  1369. }
  1370. </script>
  1371. <% if (ctx.change && ctx.change.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  1372. <script>
  1373. const auditorList = JSON.parse(unescape('<%- escape(JSON.stringify(change.auditors2)) %>'));
  1374. $(function () {
  1375. $('a[f-target]').click(function () {
  1376. $($(this).attr('f-target')).modal('show');
  1377. });
  1378. // 多层modal关闭后的滚动bug修复
  1379. $('#sp-list').on('hidden.bs.modal', function (e) {
  1380. $(document.body).addClass('modal-open');
  1381. });
  1382. // 添加审批流程按钮逻辑
  1383. $('body').on('click', '#admin-edit-shenpi .book-list dt', function () {
  1384. const idx = $(this).find('.acc-btn').attr('data-groupid')
  1385. const type = $(this).find('.acc-btn').attr('data-type')
  1386. if (type === 'hide') {
  1387. $(this).parent().find(`div[data-toggleid="${idx}"]`).show(() => {
  1388. $(this).children().find('i').removeClass('fa-plus-square').addClass('fa-minus-square-o')
  1389. $(this).find('.acc-btn').attr('data-type', 'show')
  1390. })
  1391. } else {
  1392. $(this).parent().find(`div[data-toggleid="${idx}"]`).hide(() => {
  1393. $(this).children().find('i').removeClass('fa-minus-square-o').addClass('fa-plus-square')
  1394. $(this).find('.acc-btn').attr('data-type', 'hide')
  1395. })
  1396. }
  1397. return false
  1398. })
  1399. // 管理员更改审批流程js部分
  1400. let timer3 = null;
  1401. let oldSearchVal3 = null;
  1402. $('body').on('input propertychange', '#admin-edit-shenpi .gr-search', function(e) {
  1403. oldSearchVal3 = e.target.value;
  1404. timer3 && clearTimeout(timer3);
  1405. timer3 = setTimeout(() => {
  1406. const newVal = $(this).val();
  1407. const code = $(this).attr('data-code');
  1408. let html = '';
  1409. if (newVal && newVal === oldSearchVal3) {
  1410. accountList.filter(item => item && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
  1411. html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
  1412. <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
  1413. class="ml-auto">${item.mobile || ''}</span></p>
  1414. <span class="text-muted">${item.role || ''}</span>
  1415. </dd>`
  1416. });
  1417. $('#' + code + '_dropdownMenu .book-list').empty();
  1418. $('#' + code + '_dropdownMenu .book-list').append(html);
  1419. } else {
  1420. if (!$('#' + code + '_dropdownMenu .acc-btn').length) {
  1421. accountGroup.forEach((group, idx) => {
  1422. if (!group) return;
  1423. html += `<dt><a href="javascript: void(0);" class="acc-btn" data-groupid="${idx}" data-type="hide"><i class="fa fa-plus-square"></i>
  1424. </a> ${group.groupName}</dt>
  1425. <div class="dd-content" data-toggleid="${idx}">`;
  1426. group.groupList.forEach(item => {
  1427. if (item.id !== change.uid) {
  1428. html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
  1429. <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
  1430. class="ml-auto">${item.mobile || ''}</span></p>
  1431. <span class="text-muted">${item.role || ''}</span>
  1432. </dd>`;
  1433. }
  1434. });
  1435. html += '</div>';
  1436. });
  1437. $('#' + code + '_dropdownMenu .book-list').empty();
  1438. $('#' + code + '_dropdownMenu .book-list').append(html);
  1439. }
  1440. }
  1441. }, 400);
  1442. });
  1443. $('body').on('click', '#admin-edit-shenpi dl dd', function () {
  1444. const id = parseInt($(this).attr('data-id'));
  1445. if (!id) return;
  1446. let this_aid = parseInt($(this).parents('.book-list').attr('data-aid'));
  1447. let this_operate = $(this).parents('.book-list').attr('data-operate');
  1448. const user = _.find(accountList, function (item) {
  1449. return item.id === id;
  1450. });
  1451. const auditorIndex = _.findIndex(auditorList, { aid: id });
  1452. if (auditorIndex !== -1) {
  1453. toastr.warning('该审核人已存在,请勿重复添加');
  1454. return;
  1455. }
  1456. const prop = {
  1457. operate: this_operate,
  1458. old_aid: this_aid,
  1459. new_aid: user.id,
  1460. };
  1461. postData(window.location.pathname + '/audit/save', prop, (datas) => {
  1462. $('#admin-edit-shenpi-list').html(getAdminEditShenpiListHtml(datas));
  1463. changeLiucheng(datas);
  1464. });
  1465. });
  1466. // 移除审批人
  1467. $('body').on('click', '#admin-edit-shenpi .remove-audit', function () {
  1468. const id = parseInt($(this).attr('data-id'));
  1469. const prop = {
  1470. operate: 'del',
  1471. old_aid: id,
  1472. };
  1473. postData(window.location.pathname + '/audit/save', prop, (datas) => {
  1474. $('#admin-edit-shenpi-list').html(getAdminEditShenpiListHtml(datas));
  1475. changeLiucheng(datas);
  1476. });
  1477. });
  1478. const getAdminEditShenpiListHtml = function(auditGroup) {
  1479. const html = [];
  1480. for (const [i, group] of auditGroup.entries()) {
  1481. if (i === 0) continue;
  1482. for (const [j, auditor] of group.entries()) {
  1483. html.push('<tr>');
  1484. if (j === 0) {
  1485. const auditTypeHtml = auditor.type === auditType.key.common ? '' : `<span class="ml-2 badge badge-pill badge-${auditType.info[auditor.audit_type].class} p-1"><small>${auditType.info[auditor.audit_type].short}</small></span>`;
  1486. html.push(`<td class="text-left d-flex">${i + '审'}${auditTypeHtml}</td>`);
  1487. } else {
  1488. html.push(`<td class="text-left d-flex"></td>`);
  1489. }
  1490. html.push(`<td></span> ${auditor.name} <small class="text-muted">${auditor.role}</small></td>`);
  1491. html.push(`<td style="text-align: center"><span class="${auditConst.auditStringClass[auditor.status]}">${ auditor.status !== auditConst.status.uncheck ? auditConst.auditString[auditor.status] : '待审批' }</span></td>`);
  1492. html.push('<td style="text-align: center">');
  1493. if (auditor.status === auditConst.status.checking && j === group.length - 1) {
  1494. html.push('<span class="dropdown mr-2">',
  1495. `<a href="javascript: void(0)" class="add-audit" id="${auditor.aid}_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>`,
  1496. makeSelectAudit(auditor.aid+'_add', auditor.aid, 'add'),'</div>', '</span>');
  1497. }
  1498. if (auditor.status === auditConst.status.uncheck) {
  1499. if (j === group.length - 1) {
  1500. html.push('<span class="dropdown mr-2">',
  1501. `<a href="javascript: void(0)" class="add-audit" id="${auditor.aid}_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>`,
  1502. makeSelectAudit(auditor.aid+'_add', auditor.aid, 'add'),'</div>', '</span>');
  1503. if (auditor.audit_type !== auditType.key.common) {
  1504. html.push('<span class="dropdown mr-2">',
  1505. `<a href="javascript: void(0)" class="add-audit" id="${auditor.aid}_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">平级</a>`,
  1506. makeSelectAudit(auditor.aid+'_add-sibling', auditor.aid, 'add-sibling'),'</div>', '</span>');
  1507. }
  1508. }
  1509. html.push('<span class="dropdown mr-2">',
  1510. `<a href="javascript: void(0)" class="add-audit" id="${auditor.aid}_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">更换</a>`,
  1511. makeSelectAudit(auditor.aid+'_change', auditor.aid, 'change'),'</div>', '</span>');
  1512. html.push(`<span class="dropdown">
  1513. <a href="javascript: void(0)" class="text-danger" title="移除" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">移除</a>
  1514. <div class="dropdown-menu">
  1515. <span class="dropdown-item" href="javascript:void(0);">确认移除审批人?</span>
  1516. <div class="dropdown-divider"></div>
  1517. <div class="px-2 py-1 text-center">
  1518. <button class="remove-audit btn btn-sm btn-danger" data-id="${auditor.aid}">移除</button>
  1519. <button class="btn btn-sm btn-secondary">取消</button>
  1520. </div>
  1521. </div>
  1522. </span>`);
  1523. }
  1524. html.push('</td>');
  1525. html.push('</tr>');
  1526. }
  1527. }
  1528. return html.join('');
  1529. };
  1530. function changeLiucheng(datas) {
  1531. const auditorshtml = [];
  1532. let lastAuditorHtml = [];
  1533. for (const [index,data] of datas.entries()) {
  1534. auditorshtml.push(`<li class="list-group-item d-flex justify-content-between align-items-center" data-auditid="${index !== 0 ? data[0].aid : ''}">`);
  1535. auditorshtml.push('<span class="mr-1"><i class="fa ' + (index === 0 ? 'fa-play-circle fa-rotate-90' : index+1 === datas.length ? 'fa-stop-circle' : 'fa-chevron-circle-down') + '"></i></span>');
  1536. auditorshtml.push('<span class="text-muted">');
  1537. for (const u of data) {
  1538. auditorshtml.push(`<small class="d-inline-block text-dark mx-1" title="${u.company}" data-auditorId="${u.aid}">${u.name}</small>`);
  1539. }
  1540. auditorshtml.push('</span>');
  1541. auditorshtml.push('<div class="d-flex ml-auto">');
  1542. if (data[0].audit_type !== auditType.key.common) {
  1543. auditorshtml.push(`<span class="badge badge-pill badge-${auditType.info[data[0].audit_type].class} p-1"><small>${auditType.info[data[0].audit_type].short}</small></span>`);
  1544. }
  1545. if (index === 0) {
  1546. auditorshtml.push('<span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>');
  1547. } else if (index+1 === datas.length) {
  1548. auditorshtml.push('<span class="badge badge-light badge-pill"><small>终审</small></span>');
  1549. } else {
  1550. auditorshtml.push('<span class="badge badge-light badge-pill"><small>'+ transFormToChinese(index) +'审</small></span>');
  1551. }
  1552. auditorshtml.push('</div>');
  1553. auditorshtml.push('</li>');
  1554. if (data[0].status === auditConst.status.uncheck) {
  1555. lastAuditorHtml.push('<li class="timeline-list-item pb-2 is_uncheck">');
  1556. if (index < datas.length - 1) {
  1557. lastAuditorHtml.push('<div class="timeline-item-tail"></div>');
  1558. }
  1559. lastAuditorHtml.push('<div class="timeline-item-icon bg-secondary text-light"></div>');
  1560. lastAuditorHtml.push('<div class="timeline-item-content">');
  1561. lastAuditorHtml.push(`<div class="py-1">
  1562. <span class="text-black-50">
  1563. ${ index !== datas.length - 1 ? data[0].audit_order + '' : '终' }审 ${getAuditTypeText(data[0].audit_type)}
  1564. </span>
  1565. </div>`);
  1566. lastAuditorHtml.push('<div class="card"><div class="card-body px-3 py-0">');
  1567. for (const [i, auditor] of data.entries()) {
  1568. lastAuditorHtml.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
  1569. lastAuditorHtml.push(`<div class="col-10"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.company}${auditor.role ? ' - ' + auditor.role : ''}</span></div>`);
  1570. lastAuditorHtml.push('<div class="col">');
  1571. lastAuditorHtml.push('</div>');
  1572. lastAuditorHtml.push('</div>');
  1573. }
  1574. lastAuditorHtml.push('</div></div>');
  1575. lastAuditorHtml.push('</div>');
  1576. lastAuditorHtml.push('</li>');
  1577. }
  1578. }
  1579. $('.last-auditor-list .is_uncheck').remove();
  1580. $('.last-auditor-list').append(lastAuditorHtml.join(''));
  1581. $('.auditors-list').html(auditorshtml.join(''));
  1582. }
  1583. const getAuditTypeText = function (type) {
  1584. if (type === auditType.key.common) return '';
  1585. return `<span class="text-${auditType.info[type].class}">${auditType.info[type].long}</span>`;
  1586. };
  1587. // 审批流程-选择审批人html 生成
  1588. function makeSelectAudit(code, aid, status) {
  1589. let divhtml = '';
  1590. accountGroup.forEach((group, idx) => {
  1591. let didivhtml = '';
  1592. if(group) {
  1593. group.groupList.forEach(item => {
  1594. didivhtml += item.id !== change.uid ? '<dd class="border-bottom p-2 mb-0 " data-id="' + item.id + '" >\n' +
  1595. '<p class="mb-0 d-flex"><span class="text-primary">' + item.name + '</span><span\n' +
  1596. ' class="ml-auto">' + item.mobile + '</span></p>\n' +
  1597. ' <span class="text-muted">' + item.role + '</span>\n' +
  1598. ' </dd>\n' : '';
  1599. });
  1600. divhtml += '<dt><a href="javascript: void(0);" class="acc-btn" data-groupid="' + idx + '" data-type="hide"><i class="fa fa-plus-square"></i></a> ' + group.groupName + '</dt>\n' +
  1601. ' <div class="dd-content" data-toggleid="' + idx + '">\n' + didivhtml +
  1602. ' </div>\n';
  1603. }
  1604. });
  1605. let html = '<div class="dropdown-menu dropdown-menu-right" id="' + code + '_dropdownMenu" aria-labelledby="' + code + '_dropdownMenuButton" style="width:220px">\n' +
  1606. ' <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"\n' +
  1607. ' placeholder="姓名/手机 检索" autocomplete="off" data-code="' + code + '"></div>\n' +
  1608. ' <dl class="list-unstyled book-list" data-aid="'+ aid +'" data-operate="'+ status +'">\n' + divhtml +
  1609. ' </dl>\n' +
  1610. ' </div>\n' +
  1611. ' </div>\n' +
  1612. ' </span>\n' +
  1613. ' </span>\n' +
  1614. ' </li>';
  1615. return html;
  1616. }
  1617. });
  1618. </script>
  1619. <% } %>