info_modal.ejs 63 KB

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