apply_information_modal.ejs 117 KB

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