info_modal.ejs 63 KB

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