information_modal.ejs 117 KB

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