info_modal.ejs 62 KB

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