apply_information_modal.ejs 114 KB

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