info_modal.ejs 64 KB

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