apply_information_modal.ejs 113 KB

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