info_modal.ejs 62 KB

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