info_modal.ejs 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923
  1. <!--批量添加清单部位-->
  2. <div class="modal fade" id="batch" data-backdrop="static">
  3. <div class="modal-dialog modal-xl" role="document">
  4. <div class="modal-content">
  5. <div class="modal-header">
  6. <h5 class="modal-title">批量插入清单-计量单元</h5>
  7. </div>
  8. <div class="modal-body">
  9. <div class="row">
  10. <div class="col-6">
  11. <div class="d-inline-flex">
  12. <h6 class="mr-2 mt-1">签约清单</h6>
  13. <div class="mx-2 mb-2">
  14. <div class="input-group input-group-sm">
  15. <input type="text" class="form-control" id="batch-dbs-keyword" placeholder="输入编号/名称查找">
  16. <div class="input-group-append" >
  17. <span class="input-group-text" id="batch-dbs-count">结果:0</span>
  18. </div>
  19. <div class="input-group-append" >
  20. <button class="btn btn-outline-secondary" id="batch-dbs-pre" type="button" title="上一个"><i class="fa fa-angle-double-left"></i></button>
  21. <button class="btn btn-outline-secondary" id="batch-dbs-next" type="button" title="下一个"><i class="fa fa-angle-double-right"></i></button>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="batch-r">
  27. </div>
  28. </div>
  29. <div class="col-6">
  30. <div class="d-flex">
  31. <h6 class="mr-2 mt-1">清单信息</h6>
  32. <div class="ml-auto">
  33. <div class="custom-control custom-checkbox mb-2 d-inline-block">
  34. <label class="form-check-label">
  35. <input class="form-check-input" type="checkbox" name="batch-filter">
  36. 过滤无计量单元的清单
  37. </label>
  38. </div>
  39. <div class="custom-control custom-checkbox mb-2 d-inline-block">
  40. <label class="form-check-label">
  41. <input class="form-check-input" type="checkbox" name="batch-transpose">
  42. 竖向粘贴
  43. </label>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="batch-l-t">
  48. </div>
  49. <h6>计量单元数量复核表</h6>
  50. <div class="batch-l-b">
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="modal-footer">
  56. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">取消</button>
  57. <button type="button" class="btn btn-primary btn-sm" id="batch-ok">确定</button>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <% if ((revise.status === audit.status.uncheck || revise.status === audit.status.checkNo) && ctx.session.sessionUser.accountId === revise.uid) { %>
  63. <!--上报审批-->
  64. <div class="modal fade" id="sub-sp" data-backdrop="static">
  65. <div class="modal-dialog" role="document">
  66. <div class="modal-content">
  67. <div class="modal-header">
  68. <h5 class="modal-title">上报审批</h5>
  69. </div>
  70. <div class="modal-body">
  71. <div class="dropdown text-right">
  72. <% if (ctx.tender.info.shenpi.revise !== shenpiConst.sp_status.gdspl) { %>
  73. <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="dropdownMenuButton"
  74. data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  75. 添加审批流程
  76. </button>
  77. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton"
  78. style="width:220px">
  79. <div class="mb-2 p-2"><input class="form-control form-control-sm" placeholder="姓名/手机 检索"
  80. id="gr-search" autocomplete="off"></div>
  81. <dl class="list-unstyled book-list">
  82. <% accountGroup.forEach((group, idx) => { %>
  83. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  84. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  85. <div class="dd-content" data-toggleid="<%- idx %>">
  86. <% group.groupList.forEach(item => { %>
  87. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  88. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  89. class="ml-auto"><%- item.mobile %></span></p>
  90. <span class="text-muted"><%- item.role %></span>
  91. </dd>
  92. <% });%>
  93. </div>
  94. <% }) %>
  95. </dl>
  96. </div>
  97. <% } %>
  98. </div>
  99. <div class="card mt-3">
  100. <div class="card-header">
  101. 审批流程
  102. </div>
  103. <div class="modal-height-500" style="overflow: auto">
  104. <ul class="list-group list-group-flush" id="auditors">
  105. <% for (let i = 0, iLen = revise.auditorGroups.length; i < iLen; i++) { %>
  106. <li class="list-group-item d-flex" auditorId="<%- revise.auditorGroups[i][0].audit_id %>">
  107. <div class="col-auto"><%- i+1 %></div>
  108. <div class="col">
  109. <% for (const auditor of revise.auditorGroups[i]) { %>
  110. <div class="d-inline-block mx-1" auditorId="<%- auditor.audit_id %>">
  111. <i class="fa fa-user text-muted"></i> <%- auditor.name %> <small class="text-muted"><%- auditor.role %></small>
  112. </div>
  113. <% } %>
  114. </div>
  115. <div class="col-auto">
  116. <% if (revise.auditorGroups[i][0].audit_type !== auditType.key.common) { %>
  117. <span class="badge badge-pill badge-<%- auditType.info[revise.auditorGroups[i][0].audit_type].class %> badge-bg-small"><small><%- auditType.info[revise.auditorGroups[i][0].audit_type].long%></small></span>
  118. <% } %>
  119. <% if (ctx.tender.info.shenpi.revise === shenpiConst.sp_status.sqspr ||
  120. (ctx.tender.info.shenpi.revise === shenpiConst.sp_status.gdzs && i+1 !== iLen)) { %>
  121. <a href="javascript: void(0)" class="text-danger pull-right">移除</a>
  122. <% } %>
  123. </div>
  124. </li>
  125. <% } %>
  126. </ul>
  127. </div>
  128. </div>
  129. </div>
  130. <form class="modal-footer" method="post" action="/tender/<%- ctx.tender.id %>/revise/audit/start"
  131. name="revise-start">
  132. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  133. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  134. <button class="btn btn-primary btn-sm" type="submit">确认上报</button>
  135. </form>
  136. </div>
  137. </div>
  138. </div>
  139. <% } %>
  140. <% if (revise.status === auditConst.status.checking && revise.curAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0) { %>
  141. <<!--审批通过-->
  142. <div class="modal fade sp-location-list" id="sp-done" data-backdrop="static">
  143. <div class="modal-dialog modal-lg" role="document">
  144. <form class="modal-content" action="/tender/<%- ctx.tender.id %>/revise/audit/check" method="post" onsubmit="return auditCheck(0);">
  145. <div class="modal-header">
  146. <h5 class="modal-title">审批通过</h5>
  147. </div>
  148. <div class="modal-body">
  149. <div class="row">
  150. <div class="col-4">
  151. <div class="card mt-3 modal-height-500 scroll-y">
  152. <ul class="list-group list-group-flush auditors-list" id="auditors-list">
  153. <% revise.userGroups.forEach((group, idx) => { %>
  154. <% if (idx === 0) { %>
  155. <li class="list-group-item d-flex justify-content-between align-items-center">
  156. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  157. <span class="text-muted">
  158. <% for (const u of group) { %>
  159. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  160. <% } %>
  161. </span>
  162. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  163. </li>
  164. <% } else if(idx === revise.userGroups.length -1 && idx !== 0) { %>
  165. <li class="list-group-item d-flex justify-content-between align-items-center">
  166. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  167. <span class="text-muted">
  168. <% for (const u of group) { %>
  169. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  170. <% } %>
  171. </span>
  172. <div class="d-flex ml-auto">
  173. <% if (group[0].audit_type !== auditType.key.common) { %>
  174. <span class="badge badge-pill badge-<%- auditType.info[group[0].audit_type].class %> p-1"><small><%- auditType.info[group[0].audit_type].short %></small></span>
  175. <% } %>
  176. <span class="badge badge-light badge-pill"><small>终审</small></span>
  177. </div>
  178. </li>
  179. <% } else {%>
  180. <li class="list-group-item d-flex justify-content-between align-items-center">
  181. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  182. <span class="text-muted">
  183. <% for (const u of group) { %>
  184. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  185. <% } %>
  186. </span>
  187. <div class="d-flex ml-auto">
  188. <% if (group[0].audit_type !== auditType.key.common) { %>
  189. <span class="badge badge-pill badge-<%- auditType.info[group[0].audit_type].class %> p-1"><small><%- auditType.info[group[0].audit_type].short %></small></span>
  190. <% } %>
  191. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  192. </div>
  193. </li>
  194. <% } %>
  195. <% }) %>
  196. </ul>
  197. </div>
  198. </div>
  199. <div class="col-8 modal-height-500 scroll-y">
  200. <% revise.auditHistory.forEach((his, idx) => { %>
  201. <!-- 展开/收起历史流程 -->
  202. <% if(idx === revise.auditHistory.length - 1 && revise.auditHistory.length !== 1) { %>
  203. <div class="text-right">
  204. <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
  205. </div>
  206. <% } %>
  207. <div class="<%- idx < revise.auditHistory.length - 1 ? 'fold-card' : '' %>">
  208. <div class="text-center text-muted"><%- idx+1 %>#</div>
  209. <ul class="timeline-list list-unstyled mt-2 <% if (idx === revise.auditHistory.length - 1 && revise.auditHistory.length > 1) { %>last-auditor-list<% } %>">
  210. <% his.forEach((group, index) => { %>
  211. <% if (index === 0) { %>
  212. <li class="timeline-list-item pb-2">
  213. <div class="timeline-item-date">
  214. <%- group.beginYear %>
  215. <span><%- group.beginDate %></span>
  216. <span><%- group.beginTime %></span>
  217. </div>
  218. <div class="timeline-item-tail"></div>
  219. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  220. <div class="timeline-item-content">
  221. <div class="py-1">
  222. <span class="text-black-50">原报</span>
  223. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  224. </div>
  225. <div class="card">
  226. <div class="card-body px-3 py-0">
  227. <div class="card-text p-2 py-3 row">
  228. <div class="col">
  229. <span class="h6"><%- revise.user.name %></span>
  230. <span class="text-muted ml-1"><%- revise.user.role %></span>
  231. </div>
  232. <div class="col">
  233. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. </li>
  240. <% } %>
  241. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === revise.auditHistory.length - 1 && revise.auditHistory.length > 1) { %>is_uncheck<% } %>">
  242. <% if (group.endYear) { %>
  243. <div class="timeline-item-date">
  244. <%- group.endYear %>
  245. <span><%- group.endDate %></span>
  246. <span><%- group.endTime %></span>
  247. </div>
  248. <% } %>
  249. <% if (index < his.length - 1) { %>
  250. <div class="timeline-item-tail"></div>
  251. <% } %>
  252. <% if (group.status === auditConst.status.checked) { %>
  253. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  254. <% } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.status.checkCancel) { %>
  255. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  256. <% } else if (group.status === auditConst.status.checking) { %>
  257. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  258. <% } else { %>
  259. <div class="timeline-item-icon bg-secondary text-light"></div>
  260. <% } %>
  261. <div class="timeline-item-content">
  262. <div class="py-1">
  263. <span class="text-black-50">
  264. <%- (!group.is_final ? group.audit_order : '终') %>审
  265. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  266. </span>
  267. <% if (group.status !== auditConst.status.uncheck) { %>
  268. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  269. <% } %>
  270. </div>
  271. <div class="card">
  272. <div class="card-body px-3 py-0">
  273. <% for (const [i, auditor] of group.auditors.entries()) { %>
  274. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  275. <div class="col">
  276. <span class="h6"><%- auditor.name %></span>
  277. <span class="text-muted ml-1"><%- auditor.role %></span>
  278. </div>
  279. <div class="col">
  280. <% if (auditor.status === auditConst.status.checked) { %>
  281. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  282. <% } if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || auditor.status === auditConst.status.checkCancel) { %>
  283. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  284. <% } else if (auditor.status === auditConst.status.checking) { %>
  285. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  286. <% } %>
  287. </div>
  288. <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
  289. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  290. <% } %>
  291. <% if (auditor.status === auditConst.status.checking && auditor.audit_id === ctx.session.sessionUser.accountId) { %>
  292. <div class="col-12 py-1 bg-light">
  293. <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
  294. </div>
  295. <% } %>
  296. </div>
  297. <% } %>
  298. </div>
  299. </div>
  300. </div>
  301. </li>
  302. <% }) %>
  303. </ul>
  304. </div>
  305. <% }) %>
  306. </div>
  307. </div>
  308. </div>
  309. <div class="modal-footer">
  310. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  311. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  312. <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
  313. <button type="submit" class="btn btn-success btn-sm">确认通过</button>
  314. </div>
  315. </form>
  316. </div>
  317. </div>
  318. <!--审批退回-->
  319. <div class="modal fade sp-location-list" id="sp-back" data-backdrop="static">
  320. <div class="modal-dialog modal-lg" role="document">
  321. <form class="modal-content modal-lg" action="/tender/<%- ctx.tender.id %>/revise/audit/check" method="post" onsubmit="return auditCheck(1);">
  322. <div class="modal-header">
  323. <h5 class="modal-title">审批退回</h5>
  324. </div>
  325. <div class="modal-body">
  326. <div class="row">
  327. <div class="col-4">
  328. <div class="card mt-3 modal-height-500 scroll-y">
  329. <ul class="list-group list-group-flush auditors-list" id="auditors-list">
  330. <% revise.userGroups.forEach((group, idx) => { %>
  331. <% if (idx === 0) { %>
  332. <li class="list-group-item d-flex justify-content-between align-items-center">
  333. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  334. <span class="text-muted">
  335. <% for (const u of group) { %>
  336. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  337. <% } %>
  338. </span>
  339. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  340. </li>
  341. <% } else if(idx === revise.userGroups.length -1 && idx !== 0) { %>
  342. <li class="list-group-item d-flex justify-content-between align-items-center">
  343. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  344. <span class="text-muted">
  345. <% for (const u of group) { %>
  346. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  347. <% } %>
  348. </span>
  349. <div class="d-flex ml-auto">
  350. <% if (group[0].audit_type !== auditType.key.common) { %>
  351. <span class="badge badge-pill badge-<%- auditType.info[group[0].audit_type].class %> p-1"><small><%- auditType.info[group[0].audit_type].short %></small></span>
  352. <% } %>
  353. <span class="badge badge-light badge-pill"><small>终审</small></span>
  354. </div>
  355. </li>
  356. <% } else {%>
  357. <li class="list-group-item d-flex justify-content-between align-items-center">
  358. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  359. <span class="text-muted">
  360. <% for (const u of group) { %>
  361. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  362. <% } %>
  363. </span>
  364. <div class="d-flex ml-auto">
  365. <% if (group[0].audit_type !== auditType.key.common) { %>
  366. <span class="badge badge-pill badge-<%- auditType.info[group[0].audit_type].class %> p-1"><small><%- auditType.info[group[0].audit_type].short %></small></span>
  367. <% } %>
  368. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  369. </div>
  370. </li>
  371. <% } %>
  372. <% }) %>
  373. </ul>
  374. </div>
  375. </div>
  376. <div class="col-8 modal-height-500" style="overflow: auto">
  377. <% revise.auditHistory.forEach((his, idx) => { %>
  378. <!-- 展开/收起历史流程 -->
  379. <% if(idx === revise.auditHistory.length - 1 && revise.auditHistory.length !== 1) { %>
  380. <div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
  381. data-idx="<%- idx + 1 %>">展开历史审批流程</a></div>
  382. <% } %>
  383. <div class="<%- idx < revise.auditHistory.length - 1 ? 'fold-card' : '' %>">
  384. <div class="text-center text-muted"><%- idx+1 %>#</div>
  385. <ul class="timeline-list list-unstyled mt-2 <% if (idx === revise.auditHistory.length - 1 && revise.auditHistory.length !== 1) { %>last-auditor-list<% } %>">
  386. <% his.forEach((group, index) => { %>
  387. <% if (index === 0) { %>
  388. <li class="timeline-list-item pb-2">
  389. <div class="timeline-item-date">
  390. <%- group.beginYear %>
  391. <span><%- group.beginDate %></span>
  392. <span><%- group.beginTime %></span>
  393. </div>
  394. <div class="timeline-item-tail"></div>
  395. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  396. <div class="timeline-item-content">
  397. <div class="py-1">
  398. <span class="text-black-50">原报</span>
  399. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  400. </div>
  401. <div class="card">
  402. <div class="card-body px-3 py-0">
  403. <div class="card-text p-2 py-3 row">
  404. <div class="col">
  405. <span class="h6"><%- revise.user.name %></span>
  406. <span class="text-muted ml-1"><%- revise.user.role %></span>
  407. </div>
  408. <div class="col">
  409. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  410. </div>
  411. </div>
  412. </div>
  413. </div>
  414. </div>
  415. </li>
  416. <% } %>
  417. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === revise.auditHistory.length - 1 && revise.auditHistory.length !== 1) { %>is_uncheck<% } %>">
  418. <% if (his.endYear) { %>
  419. <div class="timeline-item-date">
  420. <%- group.endYear %>
  421. <span><%- group.endDate %></span>
  422. <span><%- group.endTime %></span>
  423. </div>
  424. <% } %>
  425. <% if (index < his.length - 1) { %>
  426. <div class="timeline-item-tail"></div>
  427. <% } %>
  428. <% if (group.status === auditConst.status.checked) { %>
  429. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  430. <% } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.status.checkCancel) { %>
  431. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  432. <% } else if (group.status === auditConst.status.checking) { %>
  433. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  434. <% } else { %>
  435. <div class="timeline-item-icon bg-secondary text-light"></div>
  436. <% } %>
  437. <div class="timeline-item-content">
  438. <div class="py-1">
  439. <span class="text-black-50">
  440. <%- (!group.is_final ? group.audit_order : '终') %>审
  441. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  442. </span>
  443. <% if (group.status !== auditConst.status.uncheck) { %>
  444. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  445. <% } %>
  446. </div>
  447. <div class="card">
  448. <div class="card-body px-3 py-0">
  449. <% for (const [i, auditor] of group.auditors.entries()) { %>
  450. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  451. <div class="col">
  452. <span class="h6"><%- auditor.name %></span>
  453. <span class="text-muted ml-1"><%- auditor.role %></span>
  454. </div>
  455. <div class="col">
  456. <% if (auditor.status === auditConst.status.checked) { %>
  457. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  458. <% } if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || auditor.status === auditConst.status.checkCancel) { %>
  459. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  460. <% } else if (auditor.status === auditConst.status.checking) { %>
  461. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  462. <% } %>
  463. </div>
  464. <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
  465. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  466. <% } %>
  467. <% if (auditor.status === auditConst.status.checking && auditor.audit_id === ctx.session.sessionUser.accountId) { %>
  468. <div class="col-12 py-1 bg-light">
  469. <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
  470. </div>
  471. <% } %>
  472. </div>
  473. <% } %>
  474. </div>
  475. </div>
  476. </div>
  477. </li>
  478. <% }) %>
  479. </ul>
  480. </div>
  481. <% }) %>
  482. </div>
  483. </div>
  484. </div>
  485. <div class="modal-footer">
  486. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  487. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  488. <input type="hidden" name="checkType" value="<%= auditConst.status.checkNo %>" />
  489. <button type="submit" class="btn btn-warning btn-sm">确认退回</button>
  490. </div>
  491. </form>
  492. </div>
  493. </div>
  494. <% } %>
  495. <!--审批流程/结果-->
  496. <div class="modal fade" id="sp-list" data-backdrop="static">
  497. <div class="modal-dialog modal-lg" role="document">
  498. <div class="modal-content">
  499. <div class="modal-header">
  500. <h5 class="modal-title"><%- revise.status === auditConst.status.checking ? '审批流程' : '重新上报' %></h5>
  501. </div>
  502. <div class="modal-body">
  503. <div class="row">
  504. <div class="col-4">
  505. <% if(revise.status === auditConst.status.checkNo && revise.uid === ctx.session.sessionUser.accountId) { %>
  506. <a class="sp-list-item" href="#sub-sp" data-toggle="modal" data-target="#sub-sp"
  507. id="hideSp">修改审批流程</a>
  508. <% } %>
  509. <div class="card modal-height-500 mt-3 scroll-y">
  510. <ul class="list-group list-group-flush auditors-list" id="auditors-list">
  511. <% revise.userGroups.forEach((item, idx) => { %>
  512. <% if (idx === 0) { %>
  513. <li class="list-group-item d-flex justify-content-between align-items-center">
  514. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  515. <span class="text-muted">
  516. <% for (const u of item) { %>
  517. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  518. <% } %>
  519. </span>
  520. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  521. </li>
  522. <% } else if(idx === revise.userGroups.length -1 && idx !== 0) { %>
  523. <li class="list-group-item d-flex justify-content-between align-items-center">
  524. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  525. <span class="text-muted">
  526. <% for (const u of item) { %>
  527. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  528. <% } %>
  529. </span>
  530. <div class="d-flex ml-auto">
  531. <% if (item[0].audit_type !== auditType.key.common) { %>
  532. <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>
  533. <% } %>
  534. <span class="badge badge-light badge-pill"><small>终审</small></span>
  535. </div>
  536. </li>
  537. <% } else {%>
  538. <li class="list-group-item d-flex justify-content-between align-items-center">
  539. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  540. <span class="text-muted">
  541. <% for (const u of item) { %>
  542. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.audit_id %>"><%- u.name %></small>
  543. <% } %>
  544. </span>
  545. <div class="d-flex ml-auto">
  546. <% if (item[0].audit_type !== auditType.key.common) { %>
  547. <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>
  548. <% } %>
  549. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  550. </div>
  551. </li>
  552. <% } %>
  553. <% }) %>
  554. </ul>
  555. </div>
  556. </div>
  557. <div class="col-8 modal-height-500 scroll-y">
  558. <% revise.auditHistory.forEach((his, idx) => { %>
  559. <!-- 展开/收起历史流程 -->
  560. <% if(idx === revise.auditHistory.length - 1 && revise.auditHistory.length !== 1) { %>
  561. <div class="text-right">
  562. <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
  563. </div>
  564. <% } %>
  565. <div class="<%- idx < revise.auditHistory.length - 1 ? 'fold-card' : '' %>">
  566. <div class="text-center text-muted"><%- idx+1 %>#</div>
  567. <ul class="timeline-list list-unstyled mt-2 <% if (idx === revise.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  568. <% his.forEach((group, index) => { %>
  569. <% if (index === 0) { %>
  570. <li class="timeline-list-item pb-2">
  571. <div class="timeline-item-date">
  572. <%- group.beginYear %>
  573. <span><%- group.beginDate %></span>
  574. <span><%- group.beginTime %></span>
  575. </div>
  576. <div class="timeline-item-tail"></div>
  577. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  578. <div class="timeline-item-content">
  579. <div class="py-1">
  580. <span class="text-black-50">原报</span>
  581. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  582. </div>
  583. <div class="card">
  584. <div class="card-body px-3 py-0">
  585. <div class="card-text p-2 py-3 row">
  586. <div class="col">
  587. <span class="h6"><%- revise.user.name %></span>
  588. <span class="text-muted ml-1"><%- revise.user.role %></span>
  589. </div>
  590. <div class="col">
  591. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  592. </div>
  593. </div>
  594. </div>
  595. </div>
  596. </div>
  597. </li>
  598. <% } %>
  599. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === revise.auditHistory.length - 1 && revise.auditHistory.length !== 1) { %>is_uncheck<% } %>">
  600. <% if (group.endYear) { %>
  601. <div class="timeline-item-date">
  602. <%- group.endYear %>
  603. <span><%- group.endDate %></span>
  604. <span><%- group.endTime %></span>
  605. </div>
  606. <% } %>
  607. <% if (index < his.length - 1) { %>
  608. <div class="timeline-item-tail"></div>
  609. <% } %>
  610. <% if (group.status === auditConst.status.checked) { %>
  611. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  612. <% } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.status.checkCancel) { %>
  613. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  614. <% } else if (group.status === auditConst.status.checking) { %>
  615. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  616. <% } else { %>
  617. <div class="timeline-item-icon bg-secondary text-light"></div>
  618. <% } %>
  619. <div class="timeline-item-content">
  620. <div class="py-1">
  621. <span class="text-black-50">
  622. <%- (!group.is_final ? group.audit_order : '终') %>审
  623. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  624. </span>
  625. <% if (group.status !== auditConst.status.uncheck) { %>
  626. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  627. <% } %>
  628. </div>
  629. <div class="card">
  630. <div class="card-body px-3 py-0">
  631. <% for (const [i, auditor] of group.auditors.entries()) { %>
  632. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  633. <div class="col">
  634. <span class="h6"><%- auditor.name %></span>
  635. <span class="text-muted ml-1"><%- auditor.role %></span>
  636. </div>
  637. <div class="col">
  638. <% if (auditor.status === auditConst.status.checked) { %>
  639. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  640. <% } else if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || auditor.status === auditConst.status.checkCancel) { %>
  641. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  642. <% } %>
  643. </div>
  644. <% if (auditor.opinion) { %>
  645. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  646. <% } %>
  647. </div>
  648. <% } %>
  649. </div>
  650. </div>
  651. </div>
  652. </li>
  653. <% }) %>
  654. </ul>
  655. </div>
  656. <% }) %>
  657. </div>
  658. </div>
  659. </div>
  660. <form class="modal-footer" method="post" action="/tender/<%- ctx.tender.id %>/revise/audit/start" name="revise-start">
  661. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  662. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  663. <% if(revise.status === auditConst.status.checkNo && ctx.session.sessionUser.accountId === revise.uid) { %>
  664. <button class="btn btn-primary btn-sm sp-list-item" type="submit">确认上报</button>
  665. <% } %>
  666. </form>
  667. </div>
  668. </div>
  669. </div>
  670. <% include ../shares/batch_replace_modal.ejs %>
  671. <% include ../shares/upload_att.ejs %>
  672. <% include ../shares/merge_peg_modal.ejs %>
  673. <% include ../shares/import_excel_modal.ejs %>
  674. <% include ../shares/delete_hint_modal.ejs %>
  675. <% include ../shares/check_data_modal.ejs %>
  676. <% include ../shares/check_modal2.ejs %>
  677. <% include ../shares/new_tag_modal.ejs %>
  678. <% include ../shares/tender_select_modal.ejs %>';
  679. <% if(ctx.session.sessionUser.accountId === revise.uid && (revise.status === auditConst.status.uncheck || revise.status === auditConst.status.checkNo)) { %>
  680. <script>
  681. const cur_uid = '<%- ctx.session.sessionUser.accountId %>';
  682. const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
  683. const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup )) %>'));
  684. const shenpi_status = <%- ctx.tender.info.shenpi.revise %>;
  685. const shenpiConst = JSON.parse('<%- JSON.stringify(shenpiConst) %>');
  686. let timer = null;
  687. let oldSearchVal = null;
  688. $('#gr-search').bind('input propertychange', function (e) {
  689. oldSearchVal = e.target.value
  690. timer && clearTimeout(timer)
  691. timer = setTimeout(() => {
  692. const newVal = $('#gr-search').val()
  693. let html = ''
  694. if (newVal && newVal === oldSearchVal) {
  695. accountList.filter(item => item && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
  696. html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
  697. <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
  698. class="ml-auto">${item.mobile || ''}</span></p>
  699. <span class="text-muted">${item.role || ''}</span>
  700. </dd>`
  701. })
  702. $('.book-list').empty()
  703. $('.book-list').append(html)
  704. } else {
  705. if (!$('.acc-btn').length) {
  706. accountGroup.forEach((group, idx) => {
  707. if (!group) return
  708. html += `<dt><a href="javascript: void(0);" class="acc-btn" data-groupid="${idx}" data-type="hide"><i class="fa fa-plus-square"></i>
  709. </a> ${group.groupName}</dt>
  710. <div class="dd-content" data-toggleid="${idx}">`
  711. group.groupList.forEach(item => {
  712. if (item.id !== cur_uid) {
  713. html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
  714. <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
  715. class="ml-auto">${item.mobile || ''}</span></p>
  716. <span class="text-muted">${item.role || ''}</span>
  717. </dd>`
  718. }
  719. });
  720. html += '</div>'
  721. })
  722. $('.book-list').empty()
  723. $('.book-list').append(html)
  724. }
  725. }
  726. }, 400);
  727. });
  728. $('dl').on('click', 'dd', function () {
  729. const auditorId = parseInt($(this).data('id'));
  730. if (!auditorId) return;
  731. postData('/tender/<%- ctx.tender.id %>/revise/audit/add', { auditorId }, (datas) => {
  732. const html = [];
  733. // 如果是重新上报,添加到重新上报列表中
  734. const auditorshtml = [];
  735. for (const [index,data] of datas.entries()) {
  736. if (index !== 0) {
  737. html.push('<li class="list-group-item d-flex" auditorId="'+ data[0].audit_id +'">');
  738. html.push(`<div class="col-auto">${index}</div>`);
  739. html.push('<div class="col">');
  740. for (const auditor of data) {
  741. html.push(`<div class="d-inline-block mx-1"><i class="fa fa-user text-muted"></i> ${auditor.name} <small class="text-muted">${auditor.role}</small></div>`);
  742. }
  743. html.push('</div>');
  744. html.push('<div class="col-auto">');
  745. if (data[0].audit_type !== auditType.key.common) {
  746. html.push(`<span class="badge badge-pill badge-${auditType.info[data[0].audit_type].class} badge-bg-small"><small>${auditType.info[data[0].audit_type].long}</small></span>`);
  747. }
  748. if (shenpi_status === shenpiConst.sp_status.sqspr || (shenpi_status === shenpiConst.sp_status.gdzs && index+1 !== datas.length)) {
  749. html.push('<a href="javascript: void(0)" class="text-danger pull-right ml-1">移除</a>');
  750. }
  751. html.push('</div>');
  752. html.push('</li>');
  753. }
  754. auditorshtml.push('<li class="list-group-item" data-auditorid="' + data.audit_id + '">');
  755. auditorshtml.push('<i class="fa ' + (index+1 === datas.length ? 'fa-stop-circle' : 'fa-chevron-circle-down') + '"></i> ');
  756. auditorshtml.push(data.name + ' <small class="text-muted">' + data.role + '</small>');
  757. if (index === 0) {
  758. auditorshtml.push('<span class="pull-right">原报</span>');
  759. } else if (index+1 === datas.length) {
  760. auditorshtml.push('<span class="pull-right">终审</span>');
  761. } else {
  762. auditorshtml.push('<span class="pull-right">'+ transFormToChinese(index) +'审</span>');
  763. }
  764. auditorshtml.push('</li>');
  765. }
  766. $('#auditors').html(html.join(''));
  767. $('#auditors-list').html(auditorshtml.join(''));
  768. });
  769. });
  770. $('body').on('click', '#auditors li>div>a', function () {
  771. const li = $(this).parent().parent();
  772. const data = {
  773. auditorId: parseInt(li.attr('auditorId')),
  774. };
  775. postData('/tender/<%- ctx.tender.id %>/revise/audit/remove', data, (data2) => {
  776. li.remove();
  777. for (const a of data2) {
  778. const aLi = $('li[auditorId=' + a.audit_id + ']');
  779. aLi.children
  780. $('div:first', aLi).text(a.audit_order);
  781. }
  782. // 如果是重新上报
  783. // 令最后一个图标转换
  784. $('#auditors-list li[data-auditorid="' + data.auditorId + '"]').remove();
  785. if ($('#auditors-list li').length !== 0 && !$('#auditors-list li i').hasClass('fa-stop-circle')) {
  786. $('#auditors-list li').eq($('#auditors-list li').length - 1).children('i')
  787. .removeClass('fa-chevron-circle-down').addClass('fa-stop-circle');
  788. }
  789. // $('#auditors-list2 li[data-auditid="' + data.auditorId + '"]').remove();
  790. // if ($('#auditors-list2 li').length !== 0 && !$('#auditors-list2 li i').hasClass('fa-stop-circle')) {
  791. // $('#auditors-list2 li').eq($('#auditors-list2 li').length - 1).children('i')
  792. // .removeClass('fa-chevron-circle-down').addClass('fa-stop-circle');
  793. // }
  794. for (let i = 0; i < $('#auditors-list li').length; i++) {
  795. $('#auditors-list li').eq(i).find('.pull-right').text(i === 0 ? '原报' : (i+1 === $('#auditors-list li').length ? '终' : transFormToChinese(i)) + '审');
  796. // $('#auditors-list2 li').eq(i).find('.pull-right').text((i + 1 === $('#auditors-list2 li').length ? '终' : transFormToChinese(i + 1)) + '审');
  797. }
  798. });
  799. });
  800. // 添加审批流程按钮逻辑
  801. $('.book-list').on('click', 'dt', function () {
  802. const idx = $(this).find('.acc-btn').attr('data-groupid')
  803. const type = $(this).find('.acc-btn').attr('data-type')
  804. if (type === 'hide') {
  805. $(this).parent().find(`div[data-toggleid="${idx}"]`).show(() => {
  806. $(this).children().find('i').removeClass('fa-plus-square').addClass('fa-minus-square-o')
  807. $(this).find('.acc-btn').attr('data-type', 'show')
  808. })
  809. } else {
  810. $(this).parent().find(`div[data-toggleid="${idx}"]`).hide(() => {
  811. $(this).children().find('i').removeClass('fa-minus-square-o').addClass('fa-plus-square')
  812. $(this).find('.acc-btn').attr('data-type', 'hide')
  813. })
  814. }
  815. return false
  816. });
  817. $('#hideSp').click(function () {
  818. $('#sub-sp').modal('hide');
  819. });
  820. // 多层modal关闭后的滚动bug修复
  821. $('#sub-sp').on('hidden.bs.modal', function (e) {
  822. $(document.body).addClass('modal-open');
  823. });
  824. </script>
  825. <% } %>
  826. <script>
  827. $('.sp-list-btn').click(function () {
  828. const type = $(this).data('type')
  829. if (type === 'hide') {
  830. $('.sp-list-item').hide()
  831. $('.modal-title').text('审批流程')
  832. } else {
  833. $('.sp-list-item').show()
  834. $('.modal-title').text('重新上报')
  835. }
  836. });
  837. // 检查上报情况
  838. function checkAuditorFrom() {
  839. const content = $('#content').val();
  840. const orgContent = $('#content').attr('org-value');
  841. if (!content || content === '') {
  842. toastr.error('请先填写修订内容,再上报数据');
  843. return false;
  844. } else if (orgContent !== content) {
  845. toastr.warning('修订内容未保存,请先保存,再上报数据');
  846. return false;
  847. }
  848. if ($('#auditors li').length === 0) {
  849. if(shenpi_status === shenpiConst.sp_status.gdspl) {
  850. toastr.error('请联系管理员添加审批人');
  851. } else {
  852. toastr.error('请先选择审批人,再上报数据');
  853. }
  854. return false;
  855. }
  856. $('#hide-all').show();
  857. return true;
  858. }
  859. // texterea换行
  860. function auditCheck(i) {
  861. const opinion = $('textarea[name="opinion"]').eq(i).val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
  862. $('textarea[name="opinion"]').eq(i).val(opinion);
  863. return true;
  864. }
  865. $('.sp-location-list').on('shown.bs.modal', function () {
  866. const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
  867. const bdiv = (scrollBox.offset() && scrollBox.offset().top) || 0;
  868. scrollBox.scrollTop(0);
  869. const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
  870. const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
  871. if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
  872. scrollBox.scrollTop(hdheight - bdiv);
  873. }
  874. });
  875. function divSearch(div) {
  876. if (div.length > 0) {
  877. return true;
  878. }
  879. return false;
  880. }
  881. // 退回选择修改审批人流程
  882. $('#hideSp').click(function () {
  883. $('#sp-list').modal('hide');
  884. });
  885. $('a[f-target]').click(function () {
  886. $($(this).attr('f-target')).modal('show');
  887. });
  888. // 多层modal关闭后的滚动bug修复
  889. $('#sp-list').on('hidden.bs.modal', function (e) {
  890. $(document.body).addClass('modal-open');
  891. });
  892. // 展开历史审核记录
  893. $('.modal-body #fold-btn').click(function () {
  894. const type = $(this).data('target')
  895. const auditCard = $(this).parent().parent()
  896. if (type === 'show') {
  897. $(this).data('target', 'hide')
  898. auditCard.find('.fold-card').slideDown('swing', () => {
  899. auditCard.find('#fold-btn').text('收起历史审核记录')
  900. })
  901. } else {
  902. $(this).data('target', 'show')
  903. auditCard.find('.fold-card').slideUp('swing', () => {
  904. auditCard.find('#fold-btn').text('展开历史审核记录')
  905. })
  906. }
  907. });
  908. </script>