audit_modal.ejs 85 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073
  1. <% if ((ctx.material.status === auditConst.status.uncheck || ctx.material.status === auditConst.status.checkNo) && (ctx.session.sessionUser.accountId === ctx.material.user_id || ctx.tender.isTourist)) { %>
  2. <!--上报审批-->
  3. <div class="modal fade" id="sub-sp" data-backdrop="static">
  4. <div class="modal-dialog" role="document">
  5. <div class="modal-content">
  6. <div class="modal-header">
  7. <h5 class="modal-title">上报审批</h5>
  8. </div>
  9. <div class="modal-body">
  10. <div class="dropdown text-right">
  11. <% if (ctx.tender.info.shenpi.material !== shenpiConst.sp_status.gdspl && ctx.session.sessionUser.accountId === ctx.material.user_id) { %>
  12. <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button"
  13. id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
  14. aria-expanded="false">
  15. 添加审批流程
  16. </button>
  17. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton"
  18. style="width:220px">
  19. <div class="mb-2 p-2"><input class="form-control form-control-sm"
  20. placeholder="姓名/手机 检索" id="gr-search" autocomplete="off"></div>
  21. <dl class="list-unstyled book-list" id="book-list">
  22. <% accountGroup.forEach((group, idx) => { %>
  23. <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>
  24. <div class="dd-content" data-toggleid="<%- idx %>">
  25. <% group.groupList.forEach(item => { %>
  26. <% if (item.id !== ctx.session.sessionUser.accountId) { %>
  27. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
  28. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  29. class="ml-auto"><%- item.mobile %></span></p>
  30. <span class="text-muted"><%- item.role %></span>
  31. </dd>
  32. <% } %>
  33. <% });%>
  34. </div>
  35. <% }) %>
  36. </dl>
  37. </div>
  38. <% } %>
  39. </div>
  40. <div class="card mt-3">
  41. <div class="card-header">
  42. 审批流程
  43. </div>
  44. <div class="modal-height-500" style="overflow: auto">
  45. <ul class="list-group list-group-flush" id="auditors">
  46. <% for (let i = 0, iLen = ctx.material.auditorGroups.length; i < iLen; i++) { %>
  47. <li class="list-group-item d-flex" auditorId="<%- ctx.material.auditorGroups[i][0].aid %>">
  48. <div class="col-auto"><%- i+1 %></div>
  49. <div class="col">
  50. <% for (const auditor of ctx.material.auditorGroups[i]) { %>
  51. <div class="d-inline-block mx-1" auditorId="<%- auditor.aid %>">
  52. <i class="fa fa-user text-muted"></i> <%- auditor.name %> <small class="text-muted"><%- auditor.role %></small>
  53. </div>
  54. <% } %>
  55. </div>
  56. <div class="col-auto">
  57. <% if (ctx.material.auditorGroups[i][0].audit_type !== auditType.key.common) { %>
  58. <span class="badge badge-pill badge-<%- auditType.info[ctx.material.auditorGroups[i][0].audit_type].class %> badge-bg-small"><small><%- auditType.info[ctx.material.auditorGroups[i][0].audit_type].long%></small></span>
  59. <% } %>
  60. <% if ((ctx.tender.info.shenpi.material === shenpiConst.sp_status.sqspr ||
  61. (ctx.tender.info.shenpi.material === shenpiConst.sp_status.gdzs && i+1 !== iLen)) && ctx.session.sessionUser.accountId === ctx.material.user_id && !ctx.tender.isTourist) { %>
  62. <a href="javascript: void(0)" class="text-danger pull-right">移除</a>
  63. <% } %>
  64. </div>
  65. </li>
  66. <% } %>
  67. </ul>
  68. </div>
  69. </div>
  70. </div>
  71. <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkAuditorFrom()">
  72. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  73. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  74. <% if (ctx.session.sessionUser.accountId === ctx.material.user_id) { %>
  75. <button class="btn btn-primary btn-sm" type="submit">确认上报</button>
  76. <% } %>
  77. </form>
  78. </div>
  79. </div>
  80. </div>
  81. <% } %>
  82. <% if(ctx.material && (ctx.material.status !== auditConst.status.uncheck)) { %>
  83. <!--审批流程/结果-->
  84. <div class="modal fade" id="sp-list" data-backdrop="static">
  85. <div class="modal-dialog modal-lg" role="document">
  86. <div class="modal-content">
  87. <div class="modal-header">
  88. <h5 class="modal-title"><%- ctx.material.status === auditConst.status.checking ? '审批流程' : '重新上报' %></h5>
  89. </div>
  90. <div class="modal-body">
  91. <div class="row">
  92. <div class="col-4">
  93. <% if(ctx.material.status === auditConst.status.checkNo && ctx.session.sessionUser.accountId === ctx.material.user_id) { %>
  94. <a class="sp-list-item" href="#sub-sp" data-toggle="modal" data-target="#sub-sp" id="hideSp">修改审批流程</a>
  95. <% } else if(ctx.material.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  96. <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2"
  97. id="hideSp">修改审批流程</a>
  98. <% } %>
  99. <div class="card modal-height-500 mt-3" style="overflow: auto">
  100. <ul class="list-group list-group-flush auditors-list" id="auditors-list">
  101. <% ctx.material.auditors2.forEach((item, idx) => { %>
  102. <% if (idx === 0) { %>
  103. <li class="list-group-item d-flex justify-content-between align-items-center">
  104. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  105. <span class="text-muted">
  106. <% for (const u of item) { %>
  107. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  108. <% } %>
  109. </span>
  110. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  111. </li>
  112. <% } else if(idx === ctx.material.auditors2.length -1 && idx !== 0) { %>
  113. <li class="list-group-item d-flex justify-content-between align-items-center">
  114. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  115. <span class="text-muted">
  116. <% for (const u of item) { %>
  117. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  118. <% } %>
  119. </span>
  120. <div class="d-flex ml-auto">
  121. <% if (item[0].audit_type !== auditType.key.common) { %>
  122. <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>
  123. <% } %>
  124. <span class="badge badge-light badge-pill"><small>终审</small></span>
  125. </div>
  126. </li>
  127. <% } else {%>
  128. <li class="list-group-item d-flex justify-content-between align-items-center">
  129. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  130. <span class="text-muted">
  131. <% for (const u of item) { %>
  132. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  133. <% } %>
  134. </span>
  135. <div class="d-flex ml-auto">
  136. <% if (item[0].audit_type !== auditType.key.common) { %>
  137. <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>
  138. <% } %>
  139. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  140. </div>
  141. </li>
  142. <% } %>
  143. <% }) %>
  144. </ul>
  145. </div>
  146. </div>
  147. <div class="col-8 modal-height-500" style="overflow: auto">
  148. <% ctx.material.auditHistory.forEach((his, idx) => { %>
  149. <!-- 展开/收起历史流程 -->
  150. <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.auditHistory.length !== 1) { %>
  151. <div class="text-right">
  152. <a href="javascript: void(0);" id="fold-btn" data-target="show" >展开历史审批流程</a>
  153. </div>
  154. <% } %>
  155. <div class="<%- idx < ctx.material.auditHistory.length - 1 ? 'fold-card' : '' %>">
  156. <div class="text-center text-muted"><%- idx+1 %>#</div>
  157. <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.material.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  158. <% his.forEach((group, index) => { %>
  159. <% if (index === 0) { %>
  160. <li class="timeline-list-item pb-2">
  161. <div class="timeline-item-date">
  162. <%- group.beginYear %>
  163. <span><%- group.beginDate %></span>
  164. <span><%- group.beginTime %></span>
  165. </div>
  166. <div class="timeline-item-tail"></div>
  167. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  168. <div class="timeline-item-content">
  169. <div class="py-1">
  170. <span class="text-black-50">原报</span>
  171. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  172. </div>
  173. <div class="card">
  174. <div class="card-body px-3 py-0">
  175. <div class="card-text p-2 py-3 row">
  176. <div class="col">
  177. <span class="h6"><%- ctx.material.user.name %></span>
  178. <span class="text-muted ml-1"><%- ctx.material.user.role %></span>
  179. </div>
  180. <div class="col">
  181. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. </li>
  188. <% } %>
  189. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === ctx.material.auditHistory.length - 1) { %>is_uncheck<% } %>">
  190. <% if (group.endYear) { %>
  191. <div class="timeline-item-date">
  192. <%- group.endYear %>
  193. <span><%- group.endDate %></span>
  194. <span><%- group.endTime %></span>
  195. </div>
  196. <% } %>
  197. <% if (index < his.length - 1) { %>
  198. <div class="timeline-item-tail"></div>
  199. <% } %>
  200. <% if (group.status === auditConst.status.checked) { %>
  201. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  202. <% } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.status.checkCancel) { %>
  203. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  204. <% } else if (group.status === auditConst.status.checking) { %>
  205. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  206. <% } else { %>
  207. <div class="timeline-item-icon bg-secondary text-light"></div>
  208. <% } %>
  209. <div class="timeline-item-content">
  210. <div class="py-1">
  211. <span class="text-black-50">
  212. <%- (!group.is_final ? group.audit_order : '终') %>审
  213. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  214. </span>
  215. <% if (group.status !== auditConst.status.uncheck) { %>
  216. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  217. <% } %>
  218. </div>
  219. <div class="card">
  220. <div class="card-body px-3 py-0">
  221. <% for (const [i, auditor] of group.auditors.entries()) { %>
  222. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  223. <div class="col">
  224. <span class="h6"><%- auditor.name %></span>
  225. <span class="text-muted ml-1"><%- auditor.role %></span>
  226. </div>
  227. <div class="col">
  228. <% if (auditor.status === auditConst.status.checked) { %>
  229. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  230. <% } else if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || auditor.status === auditConst.status.checkCancel) { %>
  231. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  232. <% } %>
  233. </div>
  234. <% if (auditor.opinion) { %>
  235. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  236. <% } %>
  237. </div>
  238. <% } %>
  239. </div>
  240. </div>
  241. </div>
  242. </li>
  243. <% }) %>
  244. </ul>
  245. </div>
  246. <% }) %>
  247. </div>
  248. </div>
  249. </div>
  250. <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkAuditorFrom()">
  251. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  252. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  253. <% if(ctx.material.status === auditConst.status.checkNo && ctx.session.sessionUser.accountId === ctx.material.user_id) { %>
  254. <button class="btn btn-primary btn-sm sp-list-item" type="submit">确认上报</button>
  255. <% } %>
  256. </form>
  257. </div>
  258. </div>
  259. </div>
  260. <% } %>
  261. <% if (ctx.material.status === auditConst.status.checking || ctx.material.status === auditConst.status.checkNoPre) { %>
  262. <% if (ctx.material.curAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0) { %>
  263. <!--审批通过-->
  264. <div class="modal fade sp-location-list" id="sp-done" data-backdrop="static">
  265. <div class="modal-dialog modal-lg" role="document">
  266. <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck(0);">
  267. <div class="modal-header">
  268. <h5 class="modal-title">审批通过</h5>
  269. </div>
  270. <div class="modal-body">
  271. <div class="row">
  272. <div class="col-4">
  273. <% if(ctx.material.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  274. <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2"
  275. id="hideSp">修改审批流程</a>
  276. <% } %>
  277. <div class="card modal-height-500 mt-3" style="overflow: auto">
  278. <ul class="list-group list-group-flush auditors-list">
  279. <% ctx.material.auditors2.forEach((item, idx) => { %>
  280. <% if (idx === 0) { %>
  281. <li class="list-group-item d-flex justify-content-between align-items-center">
  282. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  283. <span class="text-muted">
  284. <% for (const u of item) { %>
  285. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  286. <% } %>
  287. </span>
  288. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  289. </li>
  290. <% } else if(idx === ctx.material.auditors2.length -1 && idx !== 0) { %>
  291. <li class="list-group-item d-flex justify-content-between align-items-center">
  292. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  293. <span class="text-muted">
  294. <% for (const u of item) { %>
  295. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  296. <% } %>
  297. </span>
  298. <div class="d-flex ml-auto">
  299. <% if (item[0].audit_type !== auditType.key.common) { %>
  300. <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>
  301. <% } %>
  302. <span class="badge badge-light badge-pill"><small>终审</small></span>
  303. </div>
  304. </li>
  305. <% } else {%>
  306. <li class="list-group-item d-flex justify-content-between align-items-center">
  307. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  308. <span class="text-muted">
  309. <% for (const u of item) { %>
  310. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  311. <% } %>
  312. </span>
  313. <div class="d-flex ml-auto">
  314. <% if (item[0].audit_type !== auditType.key.common) { %>
  315. <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>
  316. <% } %>
  317. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  318. </div>
  319. </li>
  320. <% } %>
  321. <% }) %>
  322. </ul>
  323. </div>
  324. </div>
  325. <div class="col-8 modal-height-500" style="overflow: auto">
  326. <% ctx.material.auditHistory.forEach((his, idx) => { %>
  327. <!-- 展开/收起历史流程 -->
  328. <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.auditHistory.length !== 1) { %>
  329. <div class="text-right">
  330. <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
  331. </div>
  332. <% } %>
  333. <div class="<%- idx < ctx.material.auditHistory.length - 1 ? 'fold-card' : '' %>">
  334. <div class="text-center text-muted"><%- idx+1 %>#</div>
  335. <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.material.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  336. <% his.forEach((group, index) => { %>
  337. <% if (index === 0) { %>
  338. <li class="timeline-list-item pb-2">
  339. <div class="timeline-item-date">
  340. <%- group.beginYear %>
  341. <span><%- group.beginDate %></span>
  342. <span><%- group.beginTime %></span>
  343. </div>
  344. <div class="timeline-item-tail"></div>
  345. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  346. <div class="timeline-item-content">
  347. <div class="py-1">
  348. <span class="text-black-50">原报</span>
  349. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  350. </div>
  351. <div class="card">
  352. <div class="card-body px-3 py-0">
  353. <div class="card-text p-2 py-3 row">
  354. <div class="col">
  355. <span class="h6"><%- ctx.material.user.name %></span>
  356. <span class="text-muted ml-1"><%- ctx.material.user.role %></span>
  357. </div>
  358. <div class="col">
  359. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  360. </div>
  361. </div>
  362. </div>
  363. </div>
  364. </div>
  365. </li>
  366. <% } %>
  367. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === ctx.material.auditHistory.length - 1) { %>is_uncheck<% } %>">
  368. <% if (group.endYear) { %>
  369. <div class="timeline-item-date">
  370. <%- group.endYear %>
  371. <span><%- group.endDate %></span>
  372. <span><%- group.endTime %></span>
  373. </div>
  374. <% } %>
  375. <% if (index < his.length - 1) { %>
  376. <div class="timeline-item-tail"></div>
  377. <% } %>
  378. <% if (group.status === auditConst.status.checked) { %>
  379. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  380. <% } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.status.checkCancel) { %>
  381. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  382. <% } else if (group.status === auditConst.status.checking) { %>
  383. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  384. <% } else { %>
  385. <div class="timeline-item-icon bg-secondary text-light"></div>
  386. <% } %>
  387. <div class="timeline-item-content">
  388. <div class="py-1">
  389. <span class="text-black-50">
  390. <%- (!group.is_final ? group.audit_order : '终') %>审
  391. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  392. </span>
  393. <% if (group.status !== auditConst.status.uncheck) { %>
  394. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  395. <% } %>
  396. </div>
  397. <div class="card">
  398. <div class="card-body px-3 py-0">
  399. <% for (const [i, auditor] of group.auditors.entries()) { %>
  400. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  401. <div class="col">
  402. <span class="h6"><%- auditor.name %></span>
  403. <span class="text-muted ml-1"><%- auditor.role %></span>
  404. </div>
  405. <div class="col">
  406. <% if (auditor.status === auditConst.status.checked) { %>
  407. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  408. <% } if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || auditor.status === auditConst.status.checkCancel) { %>
  409. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  410. <% } else if (auditor.status === auditConst.status.checking) { %>
  411. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  412. <% } %>
  413. </div>
  414. <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
  415. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  416. <% } %>
  417. <% if (auditor.status === auditConst.status.checking && auditor.aid === ctx.session.sessionUser.accountId) { %>
  418. <div class="col-12 py-1 bg-light">
  419. <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
  420. </div>
  421. <% } %>
  422. </div>
  423. <% } %>
  424. </div>
  425. </div>
  426. </div>
  427. </li>
  428. <% }) %>
  429. </ul>
  430. </div>
  431. <% }) %>
  432. </div>
  433. </div>
  434. </div>
  435. <div class="modal-footer">
  436. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  437. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  438. <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
  439. <button type="submit" class="btn btn-success btn-sm">确认通过</button>
  440. </div>
  441. </form>
  442. </div>
  443. </div>
  444. <!--审批退回-->
  445. <div class="modal fade sp-location-list" id="sp-back" data-backdrop="static">
  446. <div class="modal-dialog modal-lg" role="document">
  447. <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post"
  448. onsubmit="return auditCheck(1);">
  449. <div class="modal-header">
  450. <h5 class="modal-title">审批退回</h5>
  451. </div>
  452. <div class="modal-body">
  453. <div class="row">
  454. <div class="col-4">
  455. <% if(ctx.material.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  456. <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2"
  457. id="hideSp">修改审批流程</a>
  458. <% } %>
  459. <div class="card modal-height-500 mt-3" style="overflow: auto">
  460. <ul class="list-group list-group-flush auditors-list">
  461. <% ctx.material.auditors2.forEach((item, idx) => { %>
  462. <% if (idx === 0) { %>
  463. <li class="list-group-item d-flex justify-content-between align-items-center">
  464. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  465. <span class="text-muted">
  466. <% for (const u of item) { %>
  467. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  468. <% } %>
  469. </span>
  470. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  471. </li>
  472. <% } else if(idx === ctx.material.auditors2.length -1 && idx !== 0) { %>
  473. <li class="list-group-item d-flex justify-content-between align-items-center">
  474. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  475. <span class="text-muted">
  476. <% for (const u of item) { %>
  477. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  478. <% } %>
  479. </span>
  480. <div class="d-flex ml-auto">
  481. <% if (item[0].audit_type !== auditType.key.common) { %>
  482. <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>
  483. <% } %>
  484. <span class="badge badge-light badge-pill"><small>终审</small></span>
  485. </div>
  486. </li>
  487. <% } else {%>
  488. <li class="list-group-item d-flex justify-content-between align-items-center">
  489. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  490. <span class="text-muted">
  491. <% for (const u of item) { %>
  492. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  493. <% } %>
  494. </span>
  495. <div class="d-flex ml-auto">
  496. <% if (item[0].audit_type !== auditType.key.common) { %>
  497. <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>
  498. <% } %>
  499. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  500. </div>
  501. </li>
  502. <% } %>
  503. <% }) %>
  504. </ul>
  505. </div>
  506. </div>
  507. <div class="col-8 modal-height-500" style="overflow: auto">
  508. <% ctx.material.auditHistory.forEach((his, idx) => { %>
  509. <!-- 展开/收起历史流程 -->
  510. <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.auditHistory.length !== 1) { %>
  511. <div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
  512. data-idx="<%- idx + 1 %>">展开历史审批流程</a></div>
  513. <% } %>
  514. <div class="<%- idx < ctx.material.auditHistory.length - 1 ? 'fold-card' : '' %>">
  515. <div class="text-center text-muted"><%- idx+1 %>#</div>
  516. <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.material.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  517. <% his.forEach((group, index) => { %>
  518. <% if (index === 0) { %>
  519. <li class="timeline-list-item pb-2">
  520. <div class="timeline-item-date">
  521. <%- group.beginYear %>
  522. <span><%- group.beginDate %></span>
  523. <span><%- group.beginTime %></span>
  524. </div>
  525. <div class="timeline-item-tail"></div>
  526. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  527. <div class="timeline-item-content">
  528. <div class="py-1">
  529. <span class="text-black-50">原报</span>
  530. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  531. </div>
  532. <div class="card">
  533. <div class="card-body px-3 py-0">
  534. <div class="card-text p-2 py-3 row">
  535. <div class="col">
  536. <span class="h6"><%- ctx.material.user.name %></span>
  537. <span class="text-muted ml-1"><%- ctx.material.user.role %></span>
  538. </div>
  539. <div class="col">
  540. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  541. </div>
  542. </div>
  543. </div>
  544. </div>
  545. </div>
  546. </li>
  547. <% } %>
  548. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === ctx.material.auditHistory.length - 1) { %>is_uncheck<% } %>">
  549. <% if (his.endYear) { %>
  550. <div class="timeline-item-date">
  551. <%- group.endYear %>
  552. <span><%- group.endDate %></span>
  553. <span><%- group.endTime %></span>
  554. </div>
  555. <% } %>
  556. <% if (index < his.length - 1) { %>
  557. <div class="timeline-item-tail"></div>
  558. <% } %>
  559. <% if (group.status === auditConst.status.checked) { %>
  560. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  561. <% } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.status.checkCancel) { %>
  562. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  563. <% } else if (group.status === auditConst.status.checking) { %>
  564. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  565. <% } else { %>
  566. <div class="timeline-item-icon bg-secondary text-light"></div>
  567. <% } %>
  568. <div class="timeline-item-content">
  569. <div class="py-1">
  570. <span class="text-black-50">
  571. <%- (!group.is_final ? group.audit_order : '终') %>审
  572. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  573. </span>
  574. <% if (group.status !== auditConst.status.uncheck) { %>
  575. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  576. <% } %>
  577. </div>
  578. <div class="card">
  579. <div class="card-body px-3 py-0">
  580. <% for (const [i, auditor] of group.auditors.entries()) { %>
  581. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  582. <div class="col">
  583. <span class="h6"><%- auditor.name %></span>
  584. <span class="text-muted ml-1"><%- auditor.role %></span>
  585. </div>
  586. <div class="col">
  587. <% if (auditor.status === auditConst.status.checked) { %>
  588. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  589. <% } if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || auditor.status === auditConst.status.checkCancel) { %>
  590. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  591. <% } else if (auditor.status === auditConst.status.checking) { %>
  592. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  593. <% } %>
  594. </div>
  595. <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
  596. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  597. <% } %>
  598. <% if (auditor.status === auditConst.status.checking && auditor.aid === ctx.session.sessionUser.accountId) { %>
  599. <div class="col-12 py-1 bg-light">
  600. <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
  601. <div class="alert alert-warning mt-1 mb-0 p-2" id="reject-process">
  602. <div class="form-check form-check-inline">
  603. <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>">
  604. <label class="form-check-label" for="inlineRadio1">退回原报 <%- ctx.material.user.name %></label>
  605. </div>
  606. <% if (auditor.audit_order > 1) { %>
  607. <div class="form-check form-check-inline">
  608. <input class="form-check-input" type="radio" name="checkType" id="inlineRadio2" value="<%- auditConst.status.checkNoPre %>">
  609. <label class="form-check-label" for="inlineRadio2">退回上一审批人
  610. <% const pre = ctx.helper._.findLast(his, x => { return x.audit_order === auditor.audit_order - 1 }); %>
  611. <%- (pre.audit_type === auditType.key.common ? pre.auditors[0].name : `${pre.audit_order}审`)%>
  612. </label>
  613. </div>
  614. <% } %>
  615. </div>
  616. </div>
  617. <% } %>
  618. </div>
  619. <% } %>
  620. </div>
  621. </div>
  622. </div>
  623. </li>
  624. <% }) %>
  625. </ul>
  626. </div>
  627. <% }) %>
  628. </div>
  629. </div>
  630. </div>
  631. <div class="modal-footer">
  632. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  633. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  634. <button type="submit" class="btn btn-warning btn-sm">确认退回</button>
  635. </div>
  636. </form>
  637. </div>
  638. </div>
  639. <% } %>
  640. <% } %>
  641. <!--材料调差-小数位数-->
  642. <div class="modal fade" id="cc-digits" data-backdrop="static">
  643. <div class="modal-dialog" role="document">
  644. <form action="/tender/<%- ctx.tender.id %>/measure/material/<%- ctx.material.order %>/save/decimal" method="post" onsubmit="return checkSetDecimal();" class="modal-content">
  645. <div class="modal-header">
  646. <h5 class="modal-title">设置</h5>
  647. </div>
  648. <div class="modal-body">
  649. <div class="form-group mb-3">
  650. <h5>小数位数</h5>
  651. <div class="row">
  652. <div class="col-4">
  653. <div class="input-group input-group-sm">
  654. <div class="input-group-prepend">
  655. <span class="input-group-text">单价</span>
  656. </div>
  657. <input type="number" step="1" min="0" max="6" id="decimal_up" name="up" class="form-control" value="<%- material.decimal.up %>" <% if (!((material.status === auditConst.status.uncheck || material.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === material.user_id)) { %>disabled<% } %>>
  658. </div>
  659. </div>
  660. <div class="col-4">
  661. <div class="input-group input-group-sm">
  662. <div class="input-group-prepend">
  663. <span class="input-group-text">金额</span>
  664. </div>
  665. <input type="number" step="1" min="0" max="6" id="decimal_tp" name="tp" class="form-control" value="<%- material.decimal.tp %>" <% if (!((material.status === auditConst.status.uncheck || material.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === material.user_id)) { %>disabled<% } %>>
  666. </div>
  667. </div>
  668. <div class="col-4">
  669. <div class="input-group input-group-sm">
  670. <div class="input-group-prepend">
  671. <span class="input-group-text">数量</span>
  672. </div>
  673. <input type="number" step="1" min="0" max="6" id="decimal_qty" name="qty" class="form-control" value="<%- material.decimal.qty %>" <% if (!((material.status === auditConst.status.uncheck || material.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === material.user_id)) { %>disabled<% } %>>
  674. </div>
  675. </div>
  676. </div>
  677. </div>
  678. <div class="form-group">
  679. <h5>计量期数据来源</h5>
  680. <div>
  681. <% if ((material.status === auditConst.status.uncheck || material.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === material.user_id && (material.is_new_qty || (!material.is_new_qty && !(ctx.url.indexOf('/file') !== -1 || ctx.url.indexOf('/exponent') !== -1)))) { %>
  682. <% for (const qs of qtySourceConst) { %>
  683. <div class="form-check form-check-inline">
  684. <input type="radio" name="qty_source" id="<%- qs.key %>_source" class="form-check-input" value="<%- qs.value %>" <% if (material.qty_source === qtySourceValueConst[qs.key]) { %>checked<% } %>>
  685. <label class="form-check-label" for="<%- qs.key %>_source"><%- qs.name %></label>
  686. </div>
  687. <% } %>
  688. <% } else { %>
  689. <div class="form-check form-check-inline">
  690. <input type="radio" class="form-check-input" checked disabled>
  691. <label class="form-check-label"><%- ctx.helper._.find(qtySourceConst, { value: material.qty_source }).name %></label>
  692. </div>
  693. <% } %>
  694. </div>
  695. </div>
  696. </div>
  697. <div class="modal-footer">
  698. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  699. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  700. <% if ((material.status === auditConst.status.uncheck || material.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === material.user_id) { %>
  701. <button type="submit" class="btn btn-sm btn-primary">确认修改</button>
  702. <% } %>
  703. </div>
  704. </form>
  705. </div>
  706. </div>
  707. <% if (ctx.material.auditors !== undefined && ctx.material.finalAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0 && ctx.material.status === auditConst.status.checked && ctx.material.order === ctx.material.highOrder) { %>
  708. <% if (ctx.material && !ctx.material.authMobile && ctx.session.sessionUser.loginStatus === 0) { %>
  709. <!--终审重新审批-->
  710. <div class="modal fade" id="sp-down-back" data-backdrop="static">
  711. <div class="modal-dialog" role="document">
  712. <div class="modal-content">
  713. <div class="modal-header">
  714. <h5 class="modal-title">重新审批</h5>
  715. </div>
  716. <div class="modal-body">
  717. <h5>重新审批需要您的手机短信验证</h5>
  718. <h5>您目前还没设置认证手机,请先设置。</h5>
  719. </div>
  720. <div class="modal-footer">
  721. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  722. <a href="/profile/sms" class="btn btn-sm btn-primary">去设置</a>
  723. </div>
  724. </div>
  725. </div>
  726. </div>
  727. <% } else { %>
  728. <div class="modal fade" id="sp-down-back" data-backdrop="static">
  729. <div class="modal-dialog" role="document">
  730. <div class="modal-content">
  731. <div class="modal-header">
  732. <h5 class="modal-title">重新审批</h5>
  733. </div>
  734. <div class="modal-body">
  735. <h5>确认由「终审-<%= ctx.session.sessionUser.name %>」重新审批「第<%= ctx.material.order %>期」?
  736. </h5>
  737. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  738. <div class="form-group">
  739. <label>重审需要验证码确认,验证码将发送至尾号<%- ctx.material.authMobile.slice(-4) %>的手机</label>
  740. <div class="input-group input-group-sm mb-3">
  741. <input class="form-control" type="text" readonly="readonly" name="code"
  742. placeholder="输入短信中的6位验证码" />
  743. <div class="input-group-append">
  744. <button class="btn btn-outline-secondary" type="button" id="get-code">获取验证码</button>
  745. </div>
  746. </div>
  747. </div>
  748. <% } %>
  749. </div>
  750. <div class="modal-footer">
  751. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  752. <!--<a href="<%- preUrl %>/audit/check/again" disabled class="btn btn-warning btn-sm">确定重审</a>-->
  753. <button <% if (ctx.session.sessionUser.loginStatus === 0) { %>disabled<% } %> id="re-shenpi-btn"
  754. class="btn btn-warning btn-sm">确定重审</button>
  755. </div>
  756. </div>
  757. </div>
  758. </div>
  759. <% } %>
  760. <% } %>
  761. <% if (ctx.material && ctx.material.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  762. <!--上报审批-->
  763. <div class="modal fade" id="sub-sp2" data-backdrop="static">
  764. <div class="modal-dialog" style="max-width: 650px" role="document">
  765. <div class="modal-content">
  766. <div class="modal-header">
  767. <h5 class="modal-title">修改审批流程</h5>
  768. </div>
  769. <div class="modal-body">
  770. <div class="card mt-1">
  771. <div class="modal-height-500" style="overflow: auto">
  772. <style>
  773. #admin-edit-shenpi thead th {
  774. border-bottom: 0;
  775. }
  776. #admin-edit-shenpi td, #admin-edit-shenpi th {
  777. padding: 0.75rem;
  778. }
  779. #admin-edit-shenpi th {
  780. background: none;
  781. color: #212529;
  782. border-top: 0;
  783. }
  784. </style>
  785. <table class="table table-hover" id="admin-edit-shenpi">
  786. <thead>
  787. <tr class="card-header text-center">
  788. <th width="100px">审批流程</th>
  789. <th>审批人员</th>
  790. <th width="80" style="text-align: center">审批状态</th>
  791. <th width="200" style="text-align: center">操作</th>
  792. </tr>
  793. </thead>
  794. <tbody id="admin-edit-shenpi-list">
  795. <% for (const [i, group] of ctx.material.auditors2.entries()) { %>
  796. <% if (i === 0) continue; %>
  797. <% for (const [j, auditor] of group.entries()) { %>
  798. <tr>
  799. <td class="text-left d-flex">
  800. <% if (j === 0) { %>
  801. <%- i + '审' %>
  802. <% if (auditor.audit_type !== auditType.key.common) { %>
  803. <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>
  804. <% } %>
  805. <% } %>
  806. </td>
  807. <td></span> <%- auditor.name %> <small class="text-muted"><%- auditor.role %></small></td>
  808. <td style="text-align: center"><span class="<%- auditConst.auditStringClass[auditor.status] %>"><%- auditor.status !== auditConst.status.uncheck ? auditConst.auditString[auditor.status] : '待审批' %></span></td>
  809. <td style="text-align: center">
  810. <% if (auditor.status === auditConst.status.checking && j === group.length - 1) { %>
  811. <span class="dropdown mr-2">
  812. <a href="javascript: void(0)" class="add-audit" id="<%- auditor.aid %>_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>
  813. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_add_dropdownMenu" aria-labelledby="<%- auditor.aid %>_add_dropdownMenuButton" style="width:220px">
  814. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  815. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_add"></div>
  816. <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="add">
  817. <% accountGroup.forEach((group, idx) => { %>
  818. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  819. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  820. <div class="dd-content" data-toggleid="<%- idx %>">
  821. <% group.groupList.forEach(item => { %>
  822. <% if (item.id !== ctx.material.user_id) { %>
  823. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  824. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  825. class="ml-auto"><%- item.mobile %></span></p>
  826. <span class="text-muted"><%- item.role %></span>
  827. </dd>
  828. <% } %>
  829. <% });%>
  830. </div>
  831. <% }) %>
  832. </dl>
  833. </div>
  834. </span>
  835. <% } %>
  836. <% if (auditor.status === auditConst.status.uncheck) { %>
  837. <% if (j === group.length - 1) { %>
  838. <span class="dropdown mr-2">
  839. <a href="javascript: void(0)" class="add-audit" id="<%- auditor.aid %>_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>
  840. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_add_dropdownMenu" aria-labelledby="<%- auditor.aid %>_add_dropdownMenuButton" style="width:220px">
  841. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  842. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_add"></div>
  843. <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="add">
  844. <% accountGroup.forEach((group, idx) => { %>
  845. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  846. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  847. <div class="dd-content" data-toggleid="<%- idx %>">
  848. <% group.groupList.forEach(item => { %>
  849. <% if (item.id !== ctx.material.user_id) { %>
  850. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  851. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  852. class="ml-auto"><%- item.mobile %></span></p>
  853. <span class="text-muted"><%- item.role %></span>
  854. </dd>
  855. <% } %>
  856. <% });%>
  857. </div>
  858. <% }) %>
  859. </dl>
  860. </div>
  861. </span>
  862. <% if (auditor.audit_type !== auditType.key.common) { %>
  863. <span class="dropdown mr-2">
  864. <a href="javascript: void(0)" class="add-audit" id="<%- auditor.aid %>_add-sibling_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">平级</a>
  865. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_add-sibling_dropdownMenu" aria-labelledby="<%- auditor.aid %>_add-sibling_dropdownMenuButton" style="width:220px">
  866. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  867. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_add-sibling"></div>
  868. <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="add-sibling">
  869. <% accountGroup.forEach((group, idx) => { %>
  870. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  871. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  872. <div class="dd-content" data-toggleid="<%- idx %>">
  873. <% group.groupList.forEach(item => { %>
  874. <% if (item.id !== ctx.material.user_id) { %>
  875. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  876. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  877. class="ml-auto"><%- item.mobile %></span></p>
  878. <span class="text-muted"><%- item.role %></span>
  879. </dd>
  880. <% } %>
  881. <% });%>
  882. </div>
  883. <% }) %>
  884. </dl>
  885. </div>
  886. </span>
  887. <% } %>
  888. <% } %>
  889. <span class="dropdown mr-2">
  890. <a href="javascript: void(0)" class="change-audit" id="<%- auditor.aid %>_change_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">更换</a>
  891. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_change_dropdownMenu" aria-labelledby="<%- auditor.aid %>_change_dropdownMenuButton" style="width:220px">
  892. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  893. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_change"></div>
  894. <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="change">
  895. <% accountGroup.forEach((group, idx) => { %>
  896. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  897. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  898. <div class="dd-content" data-toggleid="<%- idx %>">
  899. <% group.groupList.forEach(item => { %>
  900. <% if (item.id !== ctx.material.user_id) { %>
  901. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  902. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  903. class="ml-auto"><%- item.mobile %></span></p>
  904. <span class="text-muted"><%- item.role %></span>
  905. </dd>
  906. <% } %>
  907. <% });%>
  908. </div>
  909. <% }) %>
  910. </dl>
  911. </div>
  912. </span>
  913. <span class="dropdown">
  914. <a href="javascript: void(0)" class="text-danger" title="移除" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">移除</a>
  915. <div class="dropdown-menu">
  916. <span class="dropdown-item" href="javascript:void(0);">确认移除审批人?</span>
  917. <div class="dropdown-divider"></div>
  918. <div class="px-2 py-1 text-center">
  919. <button class="remove-audit btn btn-sm btn-danger" data-id="<%- auditor.aid %>">移除</button>
  920. <button class="btn btn-sm btn-secondary">取消</button>
  921. </div>
  922. </div>
  923. </span>
  924. <% } %>
  925. </td>
  926. </tr>
  927. <% } %>
  928. <% } %>
  929. </tbody>
  930. </table>
  931. </div>
  932. </div>
  933. </div>
  934. <form class="modal-footer">
  935. <div class="mr-auto text-warning">
  936. <span class="mr-3">增加:后级审核人</span>
  937. <span class="">平级:会签/或签增加平级审核人</span>
  938. </div>
  939. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  940. </form>
  941. </div>
  942. </div>
  943. </div>
  944. <% } %>
  945. <script type="text/javascript">
  946. const csrf = '<%= ctx.csrf %>';
  947. const authMobile = '<%= ctx.material.authMobile %>';
  948. const sam_auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
  949. const auditType = JSON.parse('<%- JSON.stringify(auditType) %>');
  950. </script>
  951. <% if (ctx.session.sessionUser.accountId === ctx.material.user_id && (ctx.material.status === auditConst.status.uncheck || ctx.material.status === auditConst.status.checkNo)) { %>
  952. <script>
  953. const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
  954. const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
  955. const shenpi_status = <%- ctx.tender.info.shenpi.material %>;
  956. const shenpiConst = JSON.parse('<%- JSON.stringify(shenpiConst) %>');
  957. </script>
  958. <% } else if (ctx.material && ctx.material.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  959. <script type="text/javascript">
  960. const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
  961. const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
  962. const material_uid = parseInt('<%= ctx.material.user_id %>');
  963. const auditorList = JSON.parse(unescape('<%- escape(JSON.stringify(ctx.material.auditors2)) %>'));
  964. const cur_tenderid = parseInt('<%- ctx.tender.id %>');
  965. </script>
  966. <% } %>
  967. <script>const cur_uid = parseInt('<%- ctx.session.sessionUser.accountId %>');</script>
  968. <script>
  969. $('.sp-location-list').on('shown.bs.modal', function () {
  970. const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
  971. const bdiv = (scrollBox.offset() && scrollBox.offset().top) || 0;
  972. scrollBox.scrollTop(0);
  973. const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
  974. const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
  975. if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
  976. scrollBox.scrollTop(hdheight - bdiv);
  977. }
  978. });
  979. function divSearch(div) {
  980. if (div.length > 0) {
  981. return true;
  982. }
  983. return false;
  984. }
  985. // 展开历史审核记录
  986. $('.modal-body #fold-btn').click(function () {
  987. const type = $(this).data('target')
  988. const auditCard = $(this).parent().parent()
  989. if (type === 'show') {
  990. $(this).data('target', 'hide')
  991. auditCard.find('.fold-card').slideDown('swing', () => {
  992. auditCard.find('#fold-btn').text('收起历史审核记录')
  993. })
  994. } else {
  995. $(this).data('target', 'show')
  996. auditCard.find('.fold-card').slideUp('swing', () => {
  997. auditCard.find('#fold-btn').text('展开历史审核记录')
  998. })
  999. }
  1000. });
  1001. $('.sp-list-btn').click(function () {
  1002. const type = $(this).data('type')
  1003. if (type === 'hide') {
  1004. $('.sp-list-item').hide()
  1005. $('.modal-title').text('审批流程')
  1006. } else {
  1007. $('.sp-list-item').show()
  1008. $('.modal-title').text('重新上报')
  1009. }
  1010. });
  1011. $('#cc-digits').on('shown.bs.modal', function () {
  1012. $('#decimal_up').val(<%- material.decimal.up %>);
  1013. $('#decimal_tp').val(<%- material.decimal.tp %>);
  1014. $('#decimal_qty').val(<%- material.decimal.qty %>);
  1015. });
  1016. // 小数位设置
  1017. function checkSetDecimal() {
  1018. const up = parseInt($('#decimal_up').val());
  1019. const tp = parseInt($('#decimal_tp').val());
  1020. const qty = parseInt($('#decimal_qty').val());
  1021. let flag = false;
  1022. if(_.isNaN(up) || up > 6 || up < 0) {
  1023. toastr.error('单价小数位数设置不能大于6或小于0');
  1024. flag = true;
  1025. }
  1026. if(_.isNaN(tp) || tp > 6 || tp < 0) {
  1027. toastr.error('金额小数位数设置不能大于6或小于0');
  1028. flag = true;
  1029. }
  1030. if(_.isNaN(qty) || qty > 6 || qty < 0) {
  1031. toastr.error('数量小数位数设置不能大于6或小于0');
  1032. flag = true;
  1033. }
  1034. if (flag) {
  1035. return false;
  1036. }
  1037. }
  1038. // 重新审批按钮
  1039. $("#re-shenpi-btn").click(function () {
  1040. const data = {
  1041. };
  1042. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  1043. const code = $("#sp-down-back input[name='code']").val();
  1044. if ($(this).hasClass('disabled')) {
  1045. return false;
  1046. }
  1047. if (code.length < 6) {
  1048. // alert('请填写正确的验证码');
  1049. toastr.error('请填写正确的验证码');
  1050. return false;
  1051. }
  1052. data.code = code;
  1053. <% } %>
  1054. $.ajax({
  1055. url: '<%- preUrl %>/audit/check/again',
  1056. type: 'get',
  1057. data: data,
  1058. dataTye: 'json',
  1059. success: function (response) {
  1060. if (response.err === 0) {
  1061. window.location.href = response.url;
  1062. } else {
  1063. toastr.error(response.msg);
  1064. }
  1065. }
  1066. });
  1067. });
  1068. </script>