plan_information_modal.ejs 113 KB

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