info_modal.ejs 62 KB

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