apply_information_modal.ejs 119 KB

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