info_modal.ejs 62 KB

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