project_information_modal.ejs 116 KB

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