info_modal.ejs 64 KB

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