project_information_modal.ejs 120 KB

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