apply_information_modal.ejs 118 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593
  1. <!--添加附件-->
  2. <div class="modal fade" id="addfujian">
  3. <div class="modal-dialog" role="document">
  4. <div class="modal-content">
  5. <div class="modal-header">
  6. <h5 class="modal-title" id="myModalLabel">上传附件</h5>
  7. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  8. <span aria-hidden="true">&times;</span>
  9. </button>
  10. </div>
  11. <div class="modal-body">
  12. <div class="form-group">
  13. <label for="file-modal">单个文件大小限制:50MB,支持office等文档格式、图片格式、压缩包格式</label>
  14. <!-- <p><a href="javascript: void(0);" class="btn btn-primary" id="file-modal-target">选择文件</a></p> -->
  15. <input type="file" id="file-modal" multiple="multiple">
  16. </div>
  17. <div>
  18. <% for (const t of changeConst.file_type) { %>
  19. <div class="form-check form-check-inline">
  20. <input class="form-check-input" type="radio" name="type" id="file_type_<%- t.key %>" value="<%- t.key %>">
  21. <label class="form-check-label" for="file_type_<%- t.key %>"><%- t.value %></label>
  22. </div>
  23. <% } %>
  24. </div>
  25. </div>
  26. <div class="modal-footer">
  27. <button id="file-cancel" type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">取消</button>
  28. <button id="file-ok" type="button" class="btn btn-primary btn-sm">添加</button>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. <% if ((ctx.change.status === auditConst.status.uncheck || ctx.change.status === auditConst.status.checkNo || ctx.change.status === auditConst.status.revise) && (ctx.session.sessionUser.accountId === ctx.change.uid || ctx.tender.isTourist)) { %>
  34. <!--上报审批-->
  35. <div class="modal fade" id="sub-sp" data-backdrop="static">
  36. <div class="modal-dialog" role="document">
  37. <div class="modal-content">
  38. <div class="modal-header">
  39. <h5 class="modal-title">上报审批</h5>
  40. </div>
  41. <div class="modal-body">
  42. <div class="dropdown text-right">
  43. <% if (ctx.tender.info.shenpi.change !== shenpiConst.sp_status.gdspl) { %>
  44. <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button"
  45. id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
  46. aria-expanded="false">
  47. 添加审批流程
  48. </button>
  49. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton"
  50. style="width:220px">
  51. <div class="mb-2 p-2"><input class="form-control form-control-sm"
  52. placeholder="姓名/手机 检索" id="gr-search" autocomplete="off"></div>
  53. <dl class="list-unstyled book-list search-user-list">
  54. <% accountGroup.forEach((group, idx) => { %>
  55. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>" data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  56. <div class="dd-content" data-toggleid="<%- idx %>">
  57. <% group.groupList.forEach(item => { %>
  58. <% if (item.id !== ctx.session.sessionUser.accountId) { %>
  59. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
  60. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  61. class="ml-auto"><%- item.mobile %></span></p>
  62. <span class="text-muted"><%- item.role %></span>
  63. </dd>
  64. <% } %>
  65. <% });%>
  66. </div>
  67. <% }) %>
  68. </dl>
  69. </div>
  70. <% } else if(spGroupList.length > 0) { %>
  71. <div class="row">
  72. <div class="col-7"></div>
  73. <div class="col-5">
  74. <select class="form-control form-control-sm" id="change-sp-group">
  75. <% for (const g of spGroupList) { %>
  76. <option value="<%= g.id %>" <% if (g.id === change.sp_group) { %>selected<% } %>><%= g.name %></option>
  77. <% } %>
  78. </select>
  79. </div>
  80. </div>
  81. <% } %>
  82. </div>
  83. <div class="card mt-3">
  84. <div class="card-header">
  85. 审批流程
  86. </div>
  87. <div class="modal-height-500" style="overflow: auto">
  88. <ul class="list-group list-group-flush" id="auditors">
  89. <% for (let i = 0, iLen = ctx.change.auditorGroups.length; i < iLen; i++) { %>
  90. <li class="list-group-item d-flex" auditorId="<%- ctx.change.auditorGroups[i][0].aid %>">
  91. <div class="col-auto"><%- i+1 %></div>
  92. <div class="col">
  93. <% for (const auditor of ctx.change.auditorGroups[i]) { %>
  94. <div class="d-inline-block mx-1" auditorId="<%- auditor.aid %>">
  95. <i class="fa fa-user text-muted"></i> <%- auditor.name %> <small class="text-muted"><%- auditor.role %></small>
  96. </div>
  97. <% } %>
  98. </div>
  99. <div class="col-auto">
  100. <% if (ctx.change.auditorGroups[i][0].audit_type !== auditType.key.common) { %>
  101. <span class="badge badge-pill badge-<%- auditType.info[ctx.change.auditorGroups[i][0].audit_type].class %> badge-bg-small"><small><%- auditType.info[ctx.change.auditorGroups[i][0].audit_type].long%></small></span>
  102. <% } %>
  103. <% if ((ctx.tender.info.shenpi.change === shenpiConst.sp_status.sqspr ||
  104. (ctx.tender.info.shenpi.change === shenpiConst.sp_status.gdzs && i+1 !== iLen)) && ctx.session.sessionUser.accountId === ctx.change.uid) { %>
  105. <a href="javascript: void(0)" class="text-danger pull-right">移除</a>
  106. <% } %>
  107. </div>
  108. </li>
  109. <% } %>
  110. </ul>
  111. </div>
  112. </div>
  113. </div>
  114. <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkAuditorFrom()">
  115. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  116. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  117. <% if (ctx.session.sessionUser.accountId === ctx.change.uid) { %>
  118. <button class="btn btn-primary btn-sm" type="submit">确认上报</button>
  119. <% } %>
  120. </form>
  121. </div>
  122. </div>
  123. </div>
  124. <!-- 数量读取规则 -->
  125. <div class="modal fade" id="shuliangguize" data-backdrop="static">
  126. <div class="modal-dialog" role="document">
  127. <div class="modal-content">
  128. <div class="modal-header">
  129. <h5 class="modal-title">原设计数量读取规则</h5>
  130. </div>
  131. <div class="modal-body">
  132. <div class="form-group">
  133. <label for="">数据来源</label>
  134. <div>
  135. <div class="form-check form-check-inline">
  136. <input class="form-check-input" type="radio" name="data_source" id="gclGather" value="1" <% if(listRule.source === 1) { %>checked<% } %>>
  137. <label class="form-check-label" for="gclGather">台账数量</label>
  138. </div>
  139. <div class="form-check form-check-inline">
  140. <input class="form-check-input" type="radio" name="data_source" id="dealBills" value="2" <% if(listRule.source === 2) { %>checked<% } %>>
  141. <label class="form-check-label" for="dealBills">签约数量</label>
  142. </div>
  143. </div>
  144. </div>
  145. <div class="form-group">
  146. <label for="">匹配规则</label>
  147. <div>
  148. <div class="form-check form-check-inline">
  149. <input class="form-check-input" type="checkbox" id="rule_code" value="code" disabled checked>
  150. <label class="form-check-label" for="rule_code">编号</label>
  151. </div>
  152. <div class="form-check form-check-inline">
  153. <input class="form-check-input" type="checkbox" id="rule_code" value="name" disabled checked>
  154. <label class="form-check-label" for="rule_code">名称</label>
  155. </div>
  156. <div class="form-check form-check-inline">
  157. <input class="form-check-input" name="data_rule" type="checkbox" id="rule_unit" value="unit" <% if(ctx.helper._.indexOf(listRule.rule, 'unit') !== -1) { %>checked<% } %>>
  158. <label class="form-check-label" for="rule_unit">单位</label>
  159. </div>
  160. <div class="form-check form-check-inline">
  161. <input class="form-check-input" name="data_rule" type="checkbox" id="rule_unitprice" value="unit_price" <% if(ctx.helper._.indexOf(listRule.rule, 'unit_price') !== -1) { %>checked<% } %>>
  162. <label class="form-check-label" for="rule_unitprice">单价</label>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. <div class="modal-footer">
  168. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">取消</button>
  169. <button type="button" class="btn btn-primary btn-sm" id="setListRule">确定</button>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. <% if (ctx.change.status === auditConst.status.revise && (ctx.session.sessionUser.accountId === ctx.change.uid || ctx.session.sessionUser.is_admin)) { %>
  175. <!--撤销修订-->
  176. <div class="modal fade" id="sub-revoke" role="dialog" aria-labelledby="myModalLabel">
  177. <div class="modal-dialog" role="document">
  178. <form id="reviseForm" class="modal-content" method="post" action="/tender/<%- tender.id %>/change/apply/cancel/revise" onsubmit="return false;">
  179. <div class="modal-header">
  180. <h5 class="modal-title" id="myModalLabel">撤销修订</h5>
  181. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  182. <span aria-hidden="true">&times;</span>
  183. </button>
  184. </div>
  185. <div class="modal-body">
  186. <h5>撤销修订,所有修改的数据将全部会被还原。</h5>
  187. <h5>确认撤销修订?</h5>
  188. </div>
  189. <div class="modal-footer">
  190. <input type="hidden" name="caid" value="<%= ctx.change.id %>">
  191. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  192. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  193. <button type="button" id="cancel-revise-btn" class="btn btn-primary btn-sm">确认</button>
  194. </div>
  195. </form>
  196. </div>
  197. </div>
  198. <% } %>
  199. <% } %>
  200. <% if(ctx.change && (ctx.change.status !== auditConst.status.uncheck)) { %>
  201. <!--审批流程/结果-->
  202. <div class="modal fade" id="sp-list" data-backdrop="static">
  203. <div class="modal-dialog modal-lg" role="document">
  204. <div class="modal-content">
  205. <div class="modal-header">
  206. <h5 class="modal-title"><%- ctx.change.status === auditConst.status.checkNo || ctx.change.status === auditConst.status.revise ? '重新上报' : '审批流程' %></h5>
  207. </div>
  208. <div class="modal-body">
  209. <div class="row">
  210. <div class="col-4">
  211. <% if(ctx.change.status === auditConst.status.checkNo || ctx.change.status === auditConst.status.revise) { %>
  212. <a class="sp-list-item" href="#sub-sp" data-toggle="modal" data-target="#sub-sp" id="hideSp">修改审批流程</a>
  213. <% } else if(ctx.change.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  214. <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
  215. <% } %>
  216. <div class="card modal-height-500 mt-3" style="overflow: auto">
  217. <ul class="list-group list-group-flush auditors-list" id="auditors-list">
  218. <% ctx.change.auditors2.forEach((item, idx) => { %>
  219. <% if (idx === 0) { %>
  220. <li class="list-group-item d-flex justify-content-between align-items-center">
  221. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  222. <span class="text-muted">
  223. <% for (const u of item) { %>
  224. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  225. <% } %>
  226. </span>
  227. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  228. </li>
  229. <% } else if(idx === ctx.change.auditors2.length -1 && idx !== 0) { %>
  230. <li class="list-group-item d-flex justify-content-between align-items-center" data-auditorid="<%- item[0].aid %>">
  231. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  232. <span class="text-muted">
  233. <% for (const u of item) { %>
  234. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  235. <% } %>
  236. </span>
  237. <div class="d-flex ml-auto">
  238. <% if (item[0].audit_type !== auditType.key.common) { %>
  239. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  240. <% } %>
  241. <span class="badge badge-light badge-pill"><small>终审</small></span>
  242. </div>
  243. </li>
  244. <% } else {%>
  245. <li class="list-group-item d-flex justify-content-between align-items-center" data-auditorid="<%- item[0].aid %>">
  246. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  247. <span class="text-muted">
  248. <% for (const u of item) { %>
  249. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  250. <% } %>
  251. </span>
  252. <div class="d-flex ml-auto">
  253. <% if (item[0].audit_type !== auditType.key.common) { %>
  254. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  255. <% } %>
  256. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  257. </div>
  258. </li>
  259. <% } %>
  260. <% }) %>
  261. </ul>
  262. </div>
  263. </div>
  264. <div class="col-8 modal-height-500" style="overflow: auto">
  265. <% ctx.change.auditHistory.forEach((his, idx) => { %>
  266. <!-- 展开/收起历史流程 -->
  267. <% if(idx === ctx.change.auditHistory.length - 1 && ctx.change.auditHistory.length !== 1) { %>
  268. <div class="text-right">
  269. <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
  270. </div>
  271. <% } %>
  272. <div class="<%- idx < ctx.change.auditHistory.length - 1 ? 'fold-card' : '' %>">
  273. <div class="text-center text-muted"><%- idx+1 %>#</div>
  274. <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.change.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  275. <% his.forEach((group, index) => { %>
  276. <% if (index === 0) { %>
  277. <li class="timeline-list-item pb-2">
  278. <div class="timeline-item-date">
  279. <%- group.beginYear %>
  280. <span><%- group.beginDate %></span>
  281. <span><%- group.beginTime %></span>
  282. </div>
  283. <div class="timeline-item-tail"></div>
  284. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  285. <div class="timeline-item-content">
  286. <div class="py-1">
  287. <span class="text-black-50">原报</span>
  288. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  289. </div>
  290. <div class="card">
  291. <div class="card-body px-3 py-0">
  292. <div class="card-text p-2 py-3 row">
  293. <div class="col">
  294. <span class="h6"><%- ctx.change.user.name %></span>
  295. <span class="text-muted ml-1"><%- ctx.change.user.role %></span>
  296. </div>
  297. <div class="col">
  298. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  299. </div>
  300. </div>
  301. </div>
  302. </div>
  303. </div>
  304. </li>
  305. <% } %>
  306. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === ctx.change.auditHistory.length - 1) { %>is_uncheck<% } %>">
  307. <% if (group.endYear) { %>
  308. <div class="timeline-item-date">
  309. <%- group.endYear %>
  310. <span><%- group.endDate %></span>
  311. <span><%- group.endTime %></span>
  312. </div>
  313. <% } %>
  314. <% if (index < his.length - 1) { %>
  315. <div class="timeline-item-tail"></div>
  316. <% } %>
  317. <% if (group.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) { %>
  318. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  319. <% } else if (ctx.helper._.includes([auditConst.status.checkNo, auditConst.status.revise, auditConst.status.checkCancel], group.status)) { %>
  320. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  321. <% } else if (group.status === auditConst.status.checking) { %>
  322. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  323. <% } else if(group.status === auditConst.status.checkAgain) {%>
  324. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-check"></i></div>
  325. <% } else { %>
  326. <div class="timeline-item-icon bg-secondary text-light"></div>
  327. <% } %>
  328. <div class="timeline-item-content">
  329. <div class="py-1">
  330. <span class="text-black-50">
  331. <%- (group.audit_order === 0 ? '原报' : !group.is_final ? group.audit_order + '审' : '终审') %>
  332. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  333. </span>
  334. <% if (group.status !== auditConst.status.uncheck) { %>
  335. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  336. <% } %>
  337. </div>
  338. <div class="card">
  339. <div class="card-body px-3 py-0">
  340. <% for (const [i, auditor] of group.auditors.entries()) { %>
  341. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  342. <div class="col-10">
  343. <span class="h6"><%- auditor.name %></span>
  344. <% if (group.audit_order === 0) { %>
  345. <% if (auditor.role && auditor.role.trim()) { %>
  346. <span class="text-muted ml-1"><%- auditor.role %></span>
  347. <% } %>
  348. <% } else { %>
  349. <span class="text-muted ml-1">
  350. <%- auditor.company %>
  351. <% if (auditor.role && auditor.role.trim()) { %>
  352. - <%- auditor.role %>
  353. <% } %>
  354. </span>
  355. <% } %>
  356. </div>
  357. <div class="col">
  358. <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
  359. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  360. <% } else if (ctx.helper._.includes([auditConst.status.checkNo, auditConst.status.revise, auditConst.status.checkCancel], auditor.status)) { %>
  361. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  362. <% } else if(auditor.status === auditConst.status.checkAgain) {%>
  363. <span class="pull-right text-warning"><i class="fa fa-check-circle"></i></span>
  364. <% } else if (auditor.status === auditConst.status.checking) { %>
  365. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  366. <% } %>
  367. </div>
  368. <% if (auditor.opinion) { %>
  369. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion %></div>
  370. <% } %>
  371. </div>
  372. <% } %>
  373. </div>
  374. </div>
  375. </div>
  376. </li>
  377. <% }) %>
  378. </ul>
  379. </div>
  380. <% }) %>
  381. </div>
  382. </div>
  383. </div>
  384. <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkAuditorFrom()">
  385. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
  386. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  387. <% if((ctx.change.status === auditConst.status.checkNo || ctx.change.status === auditConst.status.revise) && ctx.session.sessionUser.accountId === ctx.change.uid) { %>
  388. <button class="btn btn-primary btn-sm sp-list-item" type="submit">确认上报</button>
  389. <% } %>
  390. </form>
  391. </div>
  392. </div>
  393. </div>
  394. <% } %>
  395. <% if (ctx.change.status === auditConst.status.checking) { %>
  396. <% if (ctx.change.curAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0) { %>
  397. <!--审批通过-->
  398. <div class="modal fade sp-location-list" id="sp-done" data-backdrop="static">
  399. <div class="modal-dialog modal-lg" role="document">
  400. <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck(0);">
  401. <div class="modal-header">
  402. <h5 class="modal-title">审批通过</h5>
  403. </div>
  404. <div class="modal-body">
  405. <div class="row">
  406. <div class="col-4">
  407. <% if(ctx.change.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  408. <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
  409. <% } %>
  410. <div class="card modal-height-500 mt-3" style="overflow: auto">
  411. <ul class="list-group list-group-flush auditors-list">
  412. <% ctx.change.auditors2.forEach((item, idx) => { %>
  413. <% if (idx === 0) { %>
  414. <li class="list-group-item d-flex justify-content-between align-items-center">
  415. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  416. <span class="text-muted">
  417. <% for (const u of item) { %>
  418. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  419. <% } %>
  420. </span>
  421. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  422. </li>
  423. <% } else if(idx === ctx.change.auditors2.length -1 && idx !== 0) { %>
  424. <li class="list-group-item d-flex justify-content-between align-items-center">
  425. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  426. <span class="text-muted">
  427. <% for (const u of item) { %>
  428. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  429. <% } %>
  430. </span>
  431. <div class="d-flex ml-auto">
  432. <% if (item[0].audit_type !== auditType.key.common) { %>
  433. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  434. <% } %>
  435. <span class="badge badge-light badge-pill"><small>终审</small></span>
  436. </div>
  437. </li>
  438. <% } else {%>
  439. <li class="list-group-item d-flex justify-content-between align-items-center">
  440. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  441. <span class="text-muted">
  442. <% for (const u of item) { %>
  443. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  444. <% } %>
  445. </span>
  446. <div class="d-flex ml-auto">
  447. <% if (item[0].audit_type !== auditType.key.common) { %>
  448. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1 ml-auto"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  449. <% } %>
  450. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  451. </div>
  452. </li>
  453. <% } %>
  454. <% }) %>
  455. </ul>
  456. </div>
  457. </div>
  458. <div class="col-8 modal-height-500" style="overflow: auto">
  459. <% ctx.change.auditHistory.forEach((his, idx) => { %>
  460. <!-- 展开/收起历史流程 -->
  461. <% if(idx === ctx.change.auditHistory.length - 1 && ctx.change.auditHistory.length !== 1) { %>
  462. <div class="text-right">
  463. <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
  464. </div>
  465. <% } %>
  466. <div class="<%- idx < ctx.change.auditHistory.length - 1 ? 'fold-card' : '' %>">
  467. <div class="text-center text-muted"><%- idx+1 %>#</div>
  468. <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.change.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  469. <% his.forEach((group, index) => { %>
  470. <% if (index === 0) { %>
  471. <li class="timeline-list-item pb-2">
  472. <div class="timeline-item-date">
  473. <%- group.beginYear %>
  474. <span><%- group.beginDate %></span>
  475. <span><%- group.beginTime %></span>
  476. </div>
  477. <div class="timeline-item-tail"></div>
  478. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  479. <div class="timeline-item-content">
  480. <div class="py-1">
  481. <span class="text-black-50">原报</span>
  482. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  483. </div>
  484. <div class="card">
  485. <div class="card-body px-3 py-0">
  486. <div class="card-text p-2 py-3 row">
  487. <div class="col">
  488. <span class="h6"><%- ctx.change.user.name %></span>
  489. <span class="text-muted ml-1"><%- ctx.change.user.role %></span>
  490. </div>
  491. <div class="col">
  492. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  493. </div>
  494. </div>
  495. </div>
  496. </div>
  497. </div>
  498. </li>
  499. <% } %>
  500. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === ctx.change.auditHistory.length - 1) { %>is_uncheck<% } %>">
  501. <% if (group.endYear) { %>
  502. <div class="timeline-item-date">
  503. <%- group.endYear %>
  504. <span><%- group.endDate %></span>
  505. <span><%- group.endTime %></span>
  506. </div>
  507. <% } %>
  508. <% if (index < his.length - 1) { %>
  509. <div class="timeline-item-tail"></div>
  510. <% } %>
  511. <% if (group.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) { %>
  512. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  513. <% } else if (ctx.helper._.includes([auditConst.status.checkNo, auditConst.status.revise, auditConst.status.checkCancel], group.status)) { %>
  514. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  515. <% } else if (group.status === auditConst.status.checking) { %>
  516. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  517. <% } else if(group.status === auditConst.status.checkAgain) {%>
  518. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-check"></i></div>
  519. <% } else { %>
  520. <div class="timeline-item-icon bg-secondary text-light"></div>
  521. <% } %>
  522. <div class="timeline-item-content">
  523. <div class="py-1">
  524. <span class="text-black-50">
  525. <%- (group.audit_order === 0 ? '原报' : !group.is_final ? group.audit_order + '审' : '终审') %>
  526. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  527. </span>
  528. <% if (group.status !== auditConst.status.uncheck) { %>
  529. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  530. <% } %>
  531. </div>
  532. <div class="card">
  533. <div class="card-body px-3 py-0">
  534. <% for (const [i, auditor] of group.auditors.entries()) { %>
  535. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  536. <div class="col-10">
  537. <span class="h6"><%- auditor.name %></span>
  538. <% if (group.audit_order === 0) { %>
  539. <% if (auditor.role && auditor.role.trim()) { %>
  540. <span class="text-muted ml-1"><%- auditor.role %></span>
  541. <% } %>
  542. <% } else { %>
  543. <span class="text-muted ml-1">
  544. <%- auditor.company %>
  545. <% if (auditor.role && auditor.role.trim()) { %>
  546. - <%- auditor.role %>
  547. <% } %>
  548. </span>
  549. <% } %>
  550. </div>
  551. <div class="col">
  552. <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
  553. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  554. <% } else if (ctx.helper._.includes([auditConst.status.checkNo, auditConst.status.revise, auditConst.status.checkCancel], auditor.status)) { %>
  555. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  556. <% } else if(auditor.status === auditConst.status.checkAgain) {%>
  557. <span class="pull-right text-warning"><i class="fa fa-check-circle"></i></span>
  558. <% } else if (auditor.status === auditConst.status.checking) { %>
  559. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  560. <% } %>
  561. </div>
  562. <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
  563. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  564. <% } %>
  565. <% if (auditor.status === auditConst.status.checking && auditor.aid === ctx.session.sessionUser.accountId) { %>
  566. <div class="col-12 py-1 bg-light">
  567. <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
  568. </div>
  569. <% if (group.is_final) { %>
  570. <!--终审填写批复编号-->
  571. <div class="col-12 form-group mt-3">
  572. <label>变更通知书<b class="text-danger">*&nbsp;</b></label>
  573. <input class="form-control form-control-sm" value="BGTZ-<%- change.code %>" name="notice_code" type="text">
  574. <input value="<%- auditor.aid %>" name="notice_uid" type="hidden">
  575. </div>
  576. <% } %>
  577. <% } %>
  578. </div>
  579. <% } %>
  580. </div>
  581. </div>
  582. </div>
  583. </li>
  584. <% }) %>
  585. </ul>
  586. </div>
  587. <% }) %>
  588. </div>
  589. </div>
  590. </div>
  591. <div class="modal-footer">
  592. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  593. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  594. <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
  595. <button type="submit" class="btn btn-success btn-sm">确认通过</button>
  596. </div>
  597. </form>
  598. </div>
  599. </div>
  600. <!--审批退回-->
  601. <div class="modal fade sp-location-list" id="sp-back" data-backdrop="static">
  602. <div class="modal-dialog modal-lg" role="document">
  603. <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post"
  604. onsubmit="return auditCheck(1);">
  605. <div class="modal-header">
  606. <h5 class="modal-title">审批退回</h5>
  607. </div>
  608. <div class="modal-body">
  609. <div class="row">
  610. <div class="col-4">
  611. <% if(ctx.change.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  612. <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2" id="hideSp">修改审批流程</a>
  613. <% } %>
  614. <div class="card modal-height-500 mt-3" style="overflow: auto">
  615. <ul class="list-group list-group-flush auditors-list">
  616. <% ctx.change.auditors2.forEach((item, idx) => { %>
  617. <% if (idx === 0) { %>
  618. <li class="list-group-item d-flex justify-content-between align-items-center">
  619. <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
  620. <span class="text-muted">
  621. <% for (const u of item) { %>
  622. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  623. <% } %>
  624. </span>
  625. <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
  626. </li>
  627. <% } else if(idx === ctx.change.auditors2.length -1 && idx !== 0) { %>
  628. <li class="list-group-item d-flex justify-content-between align-items-center">
  629. <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
  630. <span class="text-muted">
  631. <% for (const u of item) { %>
  632. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  633. <% } %>
  634. </span>
  635. <div class="d-flex ml-auto">
  636. <% if (item[0].audit_type !== auditType.key.common) { %>
  637. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  638. <% } %>
  639. <span class="badge badge-light badge-pill"><small>终审</small></span>
  640. </div>
  641. </li>
  642. <% } else {%>
  643. <li class="list-group-item d-flex justify-content-between align-items-center">
  644. <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
  645. <span class="text-muted">
  646. <% for (const u of item) { %>
  647. <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
  648. <% } %>
  649. </span>
  650. <div class="d-flex ml-auto">
  651. <% if (item[0].audit_type !== auditType.key.common) { %>
  652. <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
  653. <% } %>
  654. <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
  655. </div>
  656. </li>
  657. <% } %>
  658. <% }) %>
  659. </ul>
  660. </div>
  661. </div>
  662. <div class="col-8 modal-height-500" style="overflow: auto">
  663. <% ctx.change.auditHistory.forEach((his, idx) => { %>
  664. <!-- 展开/收起历史流程 -->
  665. <% if(idx === ctx.change.auditHistory.length - 1 && ctx.change.auditHistory.length !== 1) { %>
  666. <div class="text-right">
  667. <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
  668. </div>
  669. <% } %>
  670. <div class="<%- idx < ctx.change.auditHistory.length - 1 ? 'fold-card' : '' %>">
  671. <div class="text-center text-muted"><%- idx+1 %>#</div>
  672. <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.change.auditHistory.length - 1) { %>last-auditor-list<% } %>">
  673. <% his.forEach((group, index) => { %>
  674. <% if (index === 0) { %>
  675. <li class="timeline-list-item pb-2">
  676. <div class="timeline-item-date">
  677. <%- group.beginYear %>
  678. <span><%- group.beginDate %></span>
  679. <span><%- group.beginTime %></span>
  680. </div>
  681. <div class="timeline-item-tail"></div>
  682. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
  683. <div class="timeline-item-content">
  684. <div class="py-1">
  685. <span class="text-black-50">原报</span>
  686. <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
  687. </div>
  688. <div class="card">
  689. <div class="card-body px-3 py-0">
  690. <div class="card-text p-2 py-3 row">
  691. <div class="col">
  692. <span class="h6"><%- ctx.change.user.name %></span>
  693. <span class="text-muted ml-1"><%- ctx.change.user.role %></span>
  694. </div>
  695. <div class="col">
  696. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  697. </div>
  698. </div>
  699. </div>
  700. </div>
  701. </div>
  702. </li>
  703. <% } %>
  704. <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === ctx.change.auditHistory.length - 1) { %>is_uncheck<% } %>">
  705. <% if (his.endYear) { %>
  706. <div class="timeline-item-date">
  707. <%- group.endYear %>
  708. <span><%- group.endDate %></span>
  709. <span><%- group.endTime %></span>
  710. </div>
  711. <% } %>
  712. <% if (index < his.length - 1) { %>
  713. <div class="timeline-item-tail"></div>
  714. <% } %>
  715. <% if (group.status === auditConst.status.checked || group.status === auditConst.status.cancelRevise) { %>
  716. <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
  717. <% } else if (ctx.helper._.includes([auditConst.status.checkNo, auditConst.status.revise, auditConst.status.checkCancel], group.status)) { %>
  718. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
  719. <% } else if (group.status === auditConst.status.checking) { %>
  720. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
  721. <% } else if(group.status === auditConst.status.checkAgain) {%>
  722. <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-check"></i></div>
  723. <% } else { %>
  724. <div class="timeline-item-icon bg-secondary text-light"></div>
  725. <% } %>
  726. <div class="timeline-item-content">
  727. <div class="py-1">
  728. <span class="text-black-50">
  729. <%- (group.audit_order === 0 ? '原报' : !group.is_final ? group.audit_order + '审' : '终审') %>
  730. <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
  731. </span>
  732. <% if (group.status !== auditConst.status.uncheck) { %>
  733. <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
  734. <% } %>
  735. </div>
  736. <div class="card">
  737. <div class="card-body px-3 py-0">
  738. <% for (const [i, auditor] of group.auditors.entries()) { %>
  739. <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
  740. <div class="col">
  741. <span class="h6"><%- auditor.name %></span>
  742. <% if (group.audit_order === 0) { %>
  743. <% if (auditor.role && auditor.role.trim()) { %>
  744. <span class="text-muted ml-1"><%- auditor.role %></span>
  745. <% } %>
  746. <% } else { %>
  747. <span class="text-muted ml-1">
  748. <%- auditor.company %>
  749. <% if (auditor.role && auditor.role.trim()) { %>
  750. - <%- auditor.role %>
  751. <% } %>
  752. </span>
  753. <% } %>
  754. </div>
  755. <div class="col">
  756. <% if (auditor.status === auditConst.status.checked || auditor.status === auditConst.status.cancelRevise) { %>
  757. <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
  758. <% } else if (ctx.helper._.includes([auditConst.status.checkNo, auditConst.status.revise, auditConst.status.checkCancel], auditor.status)) { %>
  759. <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
  760. <% } else if(auditor.status === auditConst.status.checkAgain) {%>
  761. <span class="pull-right text-warning"><i class="fa fa-check-circle"></i></span>
  762. <% } else if (auditor.status === auditConst.status.checking) { %>
  763. <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
  764. <% } %>
  765. </div>
  766. <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
  767. <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
  768. <% } %>
  769. <% if (auditor.status === auditConst.status.checking && auditor.aid === ctx.session.sessionUser.accountId) { %>
  770. <div class="col-12 py-1 bg-light">
  771. <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
  772. <div class="alert alert-warning mt-1 mb-0 p-2">
  773. <div class="form-check form-check-inline">
  774. <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>" checked>
  775. <label class="form-check-label" for="inlineRadio1">退回原报 <%- ctx.change.user.name %></label>
  776. </div>
  777. </div>
  778. </div>
  779. <% } %>
  780. </div>
  781. <% } %>
  782. </div>
  783. </div>
  784. </div>
  785. </li>
  786. <% }) %>
  787. </ul>
  788. </div>
  789. <% }) %>
  790. </div>
  791. </div>
  792. </div>
  793. <div class="modal-footer">
  794. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  795. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  796. <button type="submit" class="btn btn-warning btn-sm">确认退回</button>
  797. </div>
  798. </form>
  799. </div>
  800. </div>
  801. <% } %>
  802. <% } %>
  803. <% if (ctx.change.status === auditConst.status.checked && ctx.change.finalAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0) { %>
  804. <% if (!authMobile && ctx.session.sessionUser.loginStatus === 0) { %>
  805. <!--终审重新审批-->
  806. <div class="modal fade" id="sp-down-back" data-backdrop="static">
  807. <div class="modal-dialog" role="document">
  808. <div class="modal-content">
  809. <div class="modal-header">
  810. <h5 class="modal-title">重新审批</h5>
  811. </div>
  812. <div class="modal-body">
  813. <h5>重新审批需要您的手机短信验证</h5>
  814. <h5>您目前还没设置认证手机,请先设置。</h5>
  815. </div>
  816. <div class="modal-footer">
  817. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  818. <a href="/profile/sms" class="btn btn-sm btn-primary">去设置</a>
  819. </div>
  820. </div>
  821. </div>
  822. </div>
  823. <% } else { %>
  824. <!--重新审批-->
  825. <div class="modal fade" id="sp-down-back" data-backdrop="static">
  826. <div class="modal-dialog" role="document">
  827. <form id="againForm" class="modal-content" method="post" action="/tender/<%- tender.id %>/change/apply/check/again" onsubmit="return false;">
  828. <div class="modal-header">
  829. <h5 class="modal-title">重新审批</h5>
  830. </div>
  831. <div class="modal-body">
  832. <h5>确认由「终审-<%= ctx.change.auditors2[ctx.change.auditors2.length-1].name %>」重新审批「<%= change.code %>」?</h5>
  833. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  834. <div class="form-group">
  835. <label>重审需要验证码确认,验证码将发送至尾号<%- authMobile.slice(-4) %>的手机</label>
  836. <div class="input-group input-group-sm mb-3">
  837. <input class="form-control" type="text" readonly="readonly" name="code" placeholder="输入短信中的6位验证码" />
  838. <div class="input-group-append">
  839. <button class="btn btn-outline-secondary get-code" type="button">获取验证码</button>
  840. </div>
  841. </div>
  842. </div>
  843. <% } %>
  844. </div>
  845. <div class="modal-footer">
  846. <input type="hidden" name="caid" value="<%= change.id %>">
  847. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  848. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  849. <button type="button" id="re-shenpi-btn" class="btn btn-warning btn-sm" <% if (ctx.session.sessionUser.loginStatus === 0) { %>disabled<% } %>>确定重审</button>
  850. </div>
  851. </form>
  852. </div>
  853. </div>
  854. <% } %>
  855. <% } %>
  856. <% if (ctx.change.status === auditConst.status.checked && ctx.session.sessionUser.accountId === ctx.change.uid) { %>
  857. <% if (!authMobile && ctx.session.sessionUser.loginStatus === 0) { %>
  858. <!--原报修订变更-->
  859. <div class="modal fade" id="sp-down-revise" data-backdrop="static">
  860. <div class="modal-dialog" role="document">
  861. <div class="modal-content">
  862. <div class="modal-header">
  863. <h5 class="modal-title">修订变更</h5>
  864. </div>
  865. <div class="modal-body">
  866. <h5>修订变更需要您的手机短信验证</h5>
  867. <h5>您目前还没设置认证手机,请先设置。</h5>
  868. </div>
  869. <div class="modal-footer">
  870. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  871. <a href="/profile/sms" class="btn btn-sm btn-primary">去设置</a>
  872. </div>
  873. </div>
  874. </div>
  875. </div>
  876. <% } else { %>
  877. <!--修订变更-->
  878. <div class="modal fade" id="sp-down-revise" data-backdrop="static">
  879. <div class="modal-dialog" role="document">
  880. <form id="reviseForm" class="modal-content" method="post" action="/tender/<%- tender.id %>/change/apply/check/revise" onsubmit="return false;">
  881. <div class="modal-header">
  882. <h5 class="modal-title">修订变更</h5>
  883. </div>
  884. <div class="modal-body">
  885. <h5>确认需要修订变更「<%= change.code %>」?</h5>
  886. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  887. <div class="form-group">
  888. <label>修订需要验证码确认,验证码将发送至尾号<%- authMobile.slice(-4) %>的手机</label>
  889. <div class="input-group input-group-sm mb-3">
  890. <input class="form-control" type="text" readonly="readonly" name="code" placeholder="输入短信中的6位验证码" />
  891. <div class="input-group-append">
  892. <button class="btn btn-outline-secondary get-code" type="button">获取验证码</button>
  893. </div>
  894. </div>
  895. </div>
  896. <% } %>
  897. </div>
  898. <div class="modal-footer">
  899. <input type="hidden" name="cpid" value="<%= ctx.change.id %>">
  900. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  901. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  902. <button type="button" id="re-shenpi-btn2" class="btn btn-warning btn-sm" <% if (ctx.session.sessionUser.loginStatus === 0) { %>disabled<% } %>>确定修订</button>
  903. </div>
  904. </form>
  905. </div>
  906. </div>
  907. <% } %>
  908. <% } %>
  909. <% if (ctx.change.cancancel) { %>
  910. <div class="modal fade" id="sp-down-cancel" data-backdrop="static">
  911. <div class="modal-dialog" role="document">
  912. <div class="modal-content">
  913. <div class="modal-header">
  914. <h5 class="modal-title">撤回</h5>
  915. </div>
  916. <div class="modal-body">
  917. <h5>撤回后将回退到你的操作状态,确定撤回?</h5>
  918. </div>
  919. <div class="modal-footer">
  920. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">取消</button>
  921. <button type="submit" class="btn btn-danger btn-sm" id="cancel-shenpi-btn">确定撤回</button>
  922. </div>
  923. </div>
  924. </div>
  925. </div>
  926. <% } %>
  927. <% if (ctx.change && ctx.change.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  928. <!--上报审批-->
  929. <div class="modal fade" id="sub-sp2" data-backdrop="static">
  930. <div class="modal-dialog" style="max-width: 650px" role="document">
  931. <div class="modal-content">
  932. <div class="modal-header">
  933. <h5 class="modal-title">修改审批流程</h5>
  934. </div>
  935. <div class="modal-body">
  936. <div class="card mt-1">
  937. <div class="modal-height-500" style="overflow: auto">
  938. <style>
  939. #admin-edit-shenpi thead th {
  940. border-bottom: 0;
  941. }
  942. #admin-edit-shenpi td, #admin-edit-shenpi th {
  943. padding: 0.75rem;
  944. }
  945. #admin-edit-shenpi th {
  946. background: none;
  947. color: #212529;
  948. border-top: 0;
  949. }
  950. </style>
  951. <table class="table table-hover" id="admin-edit-shenpi">
  952. <thead>
  953. <tr class="card-header text-center">
  954. <th width="100px">审批流程</th>
  955. <th>审批人员</th>
  956. <th width="80" style="text-align: center">审批状态</th>
  957. <th width="200" style="text-align: center">操作</th>
  958. </tr>
  959. </thead>
  960. <tbody id="admin-edit-shenpi-list">
  961. <% for (const [i, group] of ctx.change.auditors2.entries()) { %>
  962. <% if (i === 0) continue; %>
  963. <% for (const [j, auditor] of group.entries()) { %>
  964. <tr>
  965. <td class="text-left d-flex">
  966. <% if (j === 0) { %>
  967. <%- i + '审' %>
  968. <% if (auditor.audit_type !== auditType.key.common) { %>
  969. <span class="ml-2 badge badge-pill badge-<%- auditType.info[auditor.audit_type].class %> p-1"><small><%- auditType.info[auditor.audit_type].short %></small></span>
  970. <% } %>
  971. <% } %>
  972. </td>
  973. <td></span> <%- auditor.name %> <small class="text-muted"><%- auditor.role %></small></td>
  974. <td style="text-align: center"><span class="<%- auditConst.auditStringClass[auditor.status] %>"><%- auditor.status !== auditConst.status.uncheck ? auditConst.auditString[auditor.status] : '待审批' %></span></td>
  975. <td style="text-align: center">
  976. <% if (auditor.status === auditConst.status.checking && j === group.length - 1) { %>
  977. <span class="dropdown mr-2">
  978. <a href="javascript: void(0)" class="add-audit" id="<%- auditor.aid %>_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>
  979. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_add_dropdownMenu" aria-labelledby="<%- auditor.aid %>_add_dropdownMenuButton" style="width:220px">
  980. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  981. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_add"></div>
  982. <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="add">
  983. <% accountGroup.forEach((group, idx) => { %>
  984. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  985. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  986. <div class="dd-content" data-toggleid="<%- idx %>">
  987. <% group.groupList.forEach(item => { %>
  988. <% if (item.id !== ctx.change.uid) { %>
  989. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  990. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  991. class="ml-auto"><%- item.mobile %></span></p>
  992. <span class="text-muted"><%- item.role %></span>
  993. </dd>
  994. <% } %>
  995. <% });%>
  996. </div>
  997. <% }) %>
  998. </dl>
  999. </div>
  1000. </span>
  1001. <% } %>
  1002. <% if (auditor.status === auditConst.status.uncheck) { %>
  1003. <% if (j === group.length - 1) { %>
  1004. <span class="dropdown mr-2">
  1005. <a href="javascript: void(0)" class="add-audit" id="<%- auditor.aid %>_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>
  1006. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_add_dropdownMenu" aria-labelledby="<%- auditor.aid %>_add_dropdownMenuButton" style="width:220px">
  1007. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  1008. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_add"></div>
  1009. <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="add">
  1010. <% accountGroup.forEach((group, idx) => { %>
  1011. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  1012. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  1013. <div class="dd-content" data-toggleid="<%- idx %>">
  1014. <% group.groupList.forEach(item => { %>
  1015. <% if (item.id !== ctx.change.uid) { %>
  1016. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  1017. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  1018. class="ml-auto"><%- item.mobile %></span></p>
  1019. <span class="text-muted"><%- item.role %></span>
  1020. </dd>
  1021. <% } %>
  1022. <% });%>
  1023. </div>
  1024. <% }) %>
  1025. </dl>
  1026. </div>
  1027. </span>
  1028. <% if (auditor.audit_type !== auditType.key.common) { %>
  1029. <span class="dropdown mr-2">
  1030. <a href="javascript: void(0)" class="add-audit" id="<%- auditor.aid %>_add-sibling_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">平级</a>
  1031. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_add-sibling_dropdownMenu" aria-labelledby="<%- auditor.aid %>_add-sibling_dropdownMenuButton" style="width:220px">
  1032. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  1033. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_add-sibling"></div>
  1034. <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="add-sibling">
  1035. <% accountGroup.forEach((group, idx) => { %>
  1036. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  1037. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  1038. <div class="dd-content" data-toggleid="<%- idx %>">
  1039. <% group.groupList.forEach(item => { %>
  1040. <% if (item.id !== ctx.change.uid) { %>
  1041. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  1042. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  1043. class="ml-auto"><%- item.mobile %></span></p>
  1044. <span class="text-muted"><%- item.role %></span>
  1045. </dd>
  1046. <% } %>
  1047. <% });%>
  1048. </div>
  1049. <% }) %>
  1050. </dl>
  1051. </div>
  1052. </span>
  1053. <% } %>
  1054. <% } %>
  1055. <span class="dropdown mr-2">
  1056. <a href="javascript: void(0)" class="change-audit" id="<%- auditor.aid %>_change_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">更换</a>
  1057. <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_change_dropdownMenu" aria-labelledby="<%- auditor.aid %>_change_dropdownMenuButton" style="width:220px">
  1058. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  1059. placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_change"></div>
  1060. <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="change">
  1061. <% accountGroup.forEach((group, idx) => { %>
  1062. <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
  1063. data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
  1064. <div class="dd-content" data-toggleid="<%- idx %>">
  1065. <% group.groupList.forEach(item => { %>
  1066. <% if (item.id !== ctx.change.uid) { %>
  1067. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
  1068. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  1069. class="ml-auto"><%- item.mobile %></span></p>
  1070. <span class="text-muted"><%- item.role %></span>
  1071. </dd>
  1072. <% } %>
  1073. <% });%>
  1074. </div>
  1075. <% }) %>
  1076. </dl>
  1077. </div>
  1078. </span>
  1079. <span class="dropdown">
  1080. <a href="javascript: void(0)" class="text-danger" title="移除" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">移除</a>
  1081. <div class="dropdown-menu">
  1082. <span class="dropdown-item" href="javascript:void(0);">确认移除审批人?</span>
  1083. <div class="dropdown-divider"></div>
  1084. <div class="px-2 py-1 text-center">
  1085. <button class="remove-audit btn btn-sm btn-danger" data-id="<%- auditor.aid %>">移除</button>
  1086. <button class="btn btn-sm btn-secondary">取消</button>
  1087. </div>
  1088. </div>
  1089. </span>
  1090. <% } %>
  1091. </td>
  1092. </tr>
  1093. <% } %>
  1094. <% } %>
  1095. </tbody>
  1096. </table>
  1097. </div>
  1098. </div>
  1099. </div>
  1100. <form class="modal-footer">
  1101. <div class="mr-auto text-warning">
  1102. <span class="mr-3">增加:后级审核人</span>
  1103. <span class="">平级:会签/或签增加平级审核人</span>
  1104. </div>
  1105. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  1106. </form>
  1107. </div>
  1108. </div>
  1109. </div>
  1110. <% } %>
  1111. <script>
  1112. const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
  1113. const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
  1114. const cur_uid = parseInt('<%- ctx.session.sessionUser.accountId %>');
  1115. const csrf = '<%= ctx.csrf %>';
  1116. const authMobile = '<%= authMobile %>';
  1117. const auditType = JSON.parse('<%- JSON.stringify(auditType) %>');
  1118. const shenpi_status = <%- ctx.tender.info.shenpi.change %>;
  1119. const shenpiConst = JSON.parse('<%- JSON.stringify(shenpiConst) %>');
  1120. </script>
  1121. <script>
  1122. $(function () {
  1123. $('.sp-location-list').on('shown.bs.modal', function () {
  1124. const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
  1125. const bdiv = (scrollBox.offset() && scrollBox.offset().top) || 0;
  1126. scrollBox.scrollTop(0);
  1127. const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
  1128. const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
  1129. if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
  1130. scrollBox.scrollTop(hdheight - bdiv);
  1131. }
  1132. });
  1133. function divSearch(div) {
  1134. if (div.length > 0) {
  1135. return true;
  1136. }
  1137. return false;
  1138. }
  1139. // 展开历史审核记录
  1140. $('.modal-body #fold-btn').click(function () {
  1141. const type = $(this).data('target')
  1142. const auditCard = $(this).parent().parent()
  1143. if (type === 'show') {
  1144. $(this).data('target', 'hide')
  1145. auditCard.find('.fold-card').slideDown('swing', () => {
  1146. auditCard.find('#fold-btn').text('收起历史审核记录')
  1147. })
  1148. } else {
  1149. $(this).data('target', 'show')
  1150. auditCard.find('.fold-card').slideUp('swing', () => {
  1151. auditCard.find('#fold-btn').text('展开历史审核记录')
  1152. })
  1153. }
  1154. });
  1155. $('.sp-list-btn').click(function () {
  1156. const type = $(this).data('type')
  1157. if (type === 'hide') {
  1158. $('.sp-list-item').hide()
  1159. $('.modal-title').text('审批流程')
  1160. } else {
  1161. $('.sp-list-item').show()
  1162. $('.modal-title').text('重新上报')
  1163. }
  1164. });
  1165. $('#re-shenpi-btn').click(function () {
  1166. const data = {
  1167. caid: parseInt('<%- ctx.change.id %>'),
  1168. };
  1169. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  1170. const code = $("#againForm input[name='code']").val();
  1171. if ($(this).hasClass('disabled')) {
  1172. return false;
  1173. }
  1174. if (code.length < 6) {
  1175. // alert('请填写正确的验证码');
  1176. toastr.error('请填写正确的验证码');
  1177. return false;
  1178. }
  1179. data.code = code;
  1180. <% } %>
  1181. $.ajax({
  1182. url: '/tender/<%- tender.id %>/change/apply/check/again?_csrf_j=' + csrf,
  1183. type: 'post',
  1184. data: data,
  1185. dataTye: 'json',
  1186. success: function(response) {
  1187. if (response.err === 0) {
  1188. window.location.href = response.url;
  1189. } else {
  1190. toastr.error(response.msg);
  1191. }
  1192. }
  1193. });
  1194. })
  1195. $('#re-shenpi-btn2').click(function () {
  1196. const data = {
  1197. caid: parseInt('<%- ctx.change.id %>'),
  1198. };
  1199. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  1200. const code = $("#reviseForm input[name='code']").val();
  1201. if ($(this).hasClass('disabled')) {
  1202. return false;
  1203. }
  1204. if (code.length < 6) {
  1205. // alert('请填写正确的验证码');
  1206. toast('请填写正确的验证码', 'error');
  1207. return false;
  1208. }
  1209. data.code = code;
  1210. <% } %>
  1211. $.ajax({
  1212. url: '/tender/<%- tender.id %>/change/apply/check/revise?_csrf_j=' + csrf,
  1213. type: 'post',
  1214. data: data,
  1215. dataTye: 'json',
  1216. success: function(response) {
  1217. if (response.err === 0) {
  1218. window.location.href = response.url;
  1219. } else {
  1220. toastr.error(response.msg);
  1221. }
  1222. }
  1223. });
  1224. });
  1225. <% if (ctx.session.sessionUser.loginStatus === 0) { %>
  1226. // 重新审批获取手机验证码
  1227. // 获取验证码
  1228. let isPosting = false;
  1229. $(".get-code").on('click', function() {
  1230. if (isPosting) {
  1231. return false;
  1232. }
  1233. const btn = $(this);
  1234. $.ajax({
  1235. url: '/profile/code?_csrf_j=' + csrf,
  1236. type: 'post',
  1237. data: { mobile: authMobile, type: 'shenpi' },
  1238. dataTye: 'json',
  1239. error: function() {
  1240. isPosting = false;
  1241. },
  1242. beforeSend: function() {
  1243. isPosting = true;
  1244. },
  1245. success: function(response) {
  1246. isPosting = false;
  1247. if (response.err === 0) {
  1248. codeSuccess(btn);
  1249. $("input[name='code']").removeAttr('readonly');
  1250. $("#re-shenpi-btn").removeAttr('disabled');
  1251. $("#re-shenpi-btn2").removeAttr('disabled');
  1252. } else {
  1253. toastr.error(response.msg);
  1254. }
  1255. }
  1256. });
  1257. });
  1258. <% } %>
  1259. $('#cancel-revise-btn').click(function () {
  1260. const data = {
  1261. caid: parseInt('<%- ctx.change.id %>'),
  1262. };
  1263. $.ajax({
  1264. url: '/tender/<%- tender.id %>/change/apply/cancel/revise?_csrf_j=' + csrf,
  1265. type: 'post',
  1266. data: data,
  1267. dataTye: 'json',
  1268. success: function(response) {
  1269. if (response.err === 0) {
  1270. window.location.href = response.url;
  1271. } else {
  1272. toastr.error(response.msg);
  1273. }
  1274. }
  1275. });
  1276. })
  1277. <% if (ctx.change && ctx.change.cancancel) { %>
  1278. $("#cancel-shenpi-btn").click(function () {
  1279. const data = {
  1280. caid: parseInt('<%- ctx.change.id %>'),
  1281. };
  1282. $.ajax({
  1283. url: '/tender/<%- tender.id %>/change/apply/cancel/audit?_csrf_j=' + csrf,
  1284. type: 'post',
  1285. data: data,
  1286. dataTye: 'json',
  1287. success: function (response) {
  1288. if (response.err === 0) {
  1289. window.location.href = response.url;
  1290. } else {
  1291. toastr.error(response.msg);
  1292. }
  1293. }
  1294. });
  1295. });
  1296. <% } %>
  1297. })
  1298. /**
  1299. * 获取成功后的操作
  1300. *
  1301. * @param {Object} btn - 点击的按钮
  1302. * @return {void}
  1303. */
  1304. function codeSuccess(btn) {
  1305. let counter = 60;
  1306. btn.addClass('disabled').text('重新获取 ' + counter + 'S');
  1307. btn.parent().siblings('input').removeAttr('readonly').attr('placeholder', '输入短信中的6位验证码');
  1308. const bindBtn = $("#bind-btn");
  1309. bindBtn.removeClass('btn-secondary disabled').addClass('btn-primary');
  1310. const countDown = setInterval(function() {
  1311. const countString = counter - 1 <= 0 ? '' : ' ' + (counter - 1) + 'S';
  1312. // 倒数结束后
  1313. if (countString === '') {
  1314. clearInterval(countDown);
  1315. btn.removeClass('disabled');
  1316. }
  1317. const text = '重新获取' + countString;
  1318. btn.text(text);
  1319. counter -= 1;
  1320. }, 1000);
  1321. }
  1322. </script>
  1323. <% if (ctx.change && ctx.change.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
  1324. <script>
  1325. const auditorList = JSON.parse(unescape('<%- escape(JSON.stringify(change.auditors2)) %>'));
  1326. $(function () {
  1327. $('a[f-target]').click(function () {
  1328. $($(this).attr('f-target')).modal('show');
  1329. });
  1330. // 多层modal关闭后的滚动bug修复
  1331. $('#sp-list').on('hidden.bs.modal', function (e) {
  1332. $(document.body).addClass('modal-open');
  1333. });
  1334. // // 添加审批流程按钮逻辑
  1335. // $('body').on('click', '#admin-edit-shenpi .book-list dt', function () {
  1336. // const idx = $(this).find('.acc-btn').attr('data-groupid')
  1337. // const type = $(this).find('.acc-btn').attr('data-type')
  1338. // if (type === 'hide') {
  1339. // $(this).parent().find(`div[data-toggleid="${idx}"]`).show(() => {
  1340. // $(this).children().find('i').removeClass('fa-plus-square').addClass('fa-minus-square-o')
  1341. // $(this).find('.acc-btn').attr('data-type', 'show')
  1342. //
  1343. // })
  1344. // } else {
  1345. // $(this).parent().find(`div[data-toggleid="${idx}"]`).hide(() => {
  1346. // $(this).children().find('i').removeClass('fa-minus-square-o').addClass('fa-plus-square')
  1347. // $(this).find('.acc-btn').attr('data-type', 'hide')
  1348. // })
  1349. // }
  1350. // return false
  1351. // })
  1352. // 管理员更改审批流程js部分
  1353. let timer2 = null;
  1354. let oldSearchVal2 = null;
  1355. $('body').on('input propertychange', '#admin-edit-shenpi .gr-search', function(e) {
  1356. oldSearchVal2 = e.target.value;
  1357. timer2 && clearTimeout(timer2);
  1358. timer2 = setTimeout(() => {
  1359. const newVal = $(this).val();
  1360. const code = $(this).attr('data-code');
  1361. let html = '';
  1362. if (newVal && newVal === oldSearchVal2) {
  1363. accountList.filter(item => item && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
  1364. html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
  1365. <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
  1366. class="ml-auto">${item.mobile || ''}</span></p>
  1367. <span class="text-muted">${item.role || ''}</span>
  1368. </dd>`
  1369. });
  1370. $('#' + code + '_dropdownMenu .book-list').empty();
  1371. $('#' + code + '_dropdownMenu .book-list').append(html);
  1372. } else {
  1373. if (!$('#' + code + '_dropdownMenu .acc-btn').length) {
  1374. accountGroup.forEach((group, idx) => {
  1375. if (!group) return;
  1376. html += `<dt><a href="javascript: void(0);" class="acc-btn" data-groupid="${idx}" data-type="hide"><i class="fa fa-plus-square"></i>
  1377. </a> ${group.groupName}</dt>
  1378. <div class="dd-content" data-toggleid="${idx}">`;
  1379. group.groupList.forEach(item => {
  1380. if (item.id !== change.uid) {
  1381. html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
  1382. <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
  1383. class="ml-auto">${item.mobile || ''}</span></p>
  1384. <span class="text-muted">${item.role || ''}</span>
  1385. </dd>`;
  1386. }
  1387. });
  1388. html += '</div>';
  1389. });
  1390. $('#' + code + '_dropdownMenu .book-list').empty();
  1391. $('#' + code + '_dropdownMenu .book-list').append(html);
  1392. }
  1393. }
  1394. }, 400);
  1395. });
  1396. $('body').on('click', '#admin-edit-shenpi dl dd', function () {
  1397. const id = parseInt($(this).attr('data-id'));
  1398. if (!id) return;
  1399. let this_aid = parseInt($(this).parents('.book-list').attr('data-aid'));
  1400. let this_operate = $(this).parents('.book-list').attr('data-operate');
  1401. const user = _.find(accountList, function (item) {
  1402. return item.id === id;
  1403. });
  1404. const auditorIndex = _.findIndex(auditorList, { aid: id });
  1405. if (auditorIndex !== -1) {
  1406. toastr.warning('该审核人已存在,请勿重复添加');
  1407. return;
  1408. }
  1409. const prop = {
  1410. operate: this_operate,
  1411. old_aid: this_aid,
  1412. new_aid: user.id,
  1413. };
  1414. postData(window.location.pathname + '/audit/save', prop, (datas) => {
  1415. $('#admin-edit-shenpi-list').html(getAdminEditShenpiListHtml(datas));
  1416. changeLiucheng(datas);
  1417. });
  1418. });
  1419. // 移除审批人
  1420. $('body').on('click', '#admin-edit-shenpi .remove-audit', function () {
  1421. const id = parseInt($(this).attr('data-id'));
  1422. const prop = {
  1423. operate: 'del',
  1424. old_aid: id,
  1425. };
  1426. postData(window.location.pathname + '/audit/save', prop, (datas) => {
  1427. $('#admin-edit-shenpi-list').html(getAdminEditShenpiListHtml(datas));
  1428. changeLiucheng(datas);
  1429. });
  1430. });
  1431. const getAdminEditShenpiListHtml = function(auditGroup) {
  1432. const html = [];
  1433. for (const [i, group] of auditGroup.entries()) {
  1434. if (i === 0) continue;
  1435. for (const [j, auditor] of group.entries()) {
  1436. html.push('<tr>');
  1437. if (j === 0) {
  1438. const auditTypeHtml = auditor.type === auditType.key.common ? '' : `<span class="ml-2 badge badge-pill badge-${auditType.info[auditor.audit_type].class} p-1"><small>${auditType.info[auditor.audit_type].short}</small></span>`;
  1439. html.push(`<td class="text-left d-flex">${i + '审'}${auditTypeHtml}</td>`);
  1440. } else {
  1441. html.push(`<td class="text-left d-flex"></td>`);
  1442. }
  1443. html.push(`<td></span> ${auditor.name} <small class="text-muted">${auditor.role}</small></td>`);
  1444. html.push(`<td style="text-align: center"><span class="${auditConst.auditStringClass[auditor.status]}">${ auditor.status !== auditConst.status.uncheck ? auditConst.auditString[auditor.status] : '待审批' }</span></td>`);
  1445. html.push('<td style="text-align: center">');
  1446. if (auditor.status === auditConst.status.checking && j === group.length - 1) {
  1447. html.push('<span class="dropdown mr-2">',
  1448. `<a href="javascript: void(0)" class="add-audit" id="${auditor.aid}_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>`,
  1449. makeSelectAudit(auditor.aid+'_add', auditor.aid, 'add'),'</div>', '</span>');
  1450. }
  1451. if (auditor.status === auditConst.status.uncheck) {
  1452. if (j === group.length - 1) {
  1453. html.push('<span class="dropdown mr-2">',
  1454. `<a href="javascript: void(0)" class="add-audit" id="${auditor.aid}_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>`,
  1455. makeSelectAudit(auditor.aid+'_add', auditor.aid, 'add'),'</div>', '</span>');
  1456. if (auditor.audit_type !== auditType.key.common) {
  1457. html.push('<span class="dropdown mr-2">',
  1458. `<a href="javascript: void(0)" class="add-audit" id="${auditor.aid}_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">平级</a>`,
  1459. makeSelectAudit(auditor.aid+'_add-sibling', auditor.aid, 'add-sibling'),'</div>', '</span>');
  1460. }
  1461. }
  1462. html.push('<span class="dropdown mr-2">',
  1463. `<a href="javascript: void(0)" class="add-audit" id="${auditor.aid}_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">更换</a>`,
  1464. makeSelectAudit(auditor.aid+'_change', auditor.aid, 'change'),'</div>', '</span>');
  1465. html.push(`<span class="dropdown">
  1466. <a href="javascript: void(0)" class="text-danger" title="移除" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">移除</a>
  1467. <div class="dropdown-menu">
  1468. <span class="dropdown-item" href="javascript:void(0);">确认移除审批人?</span>
  1469. <div class="dropdown-divider"></div>
  1470. <div class="px-2 py-1 text-center">
  1471. <button class="remove-audit btn btn-sm btn-danger" data-id="${auditor.aid}">移除</button>
  1472. <button class="btn btn-sm btn-secondary">取消</button>
  1473. </div>
  1474. </div>
  1475. </span>`);
  1476. }
  1477. html.push('</td>');
  1478. html.push('</tr>');
  1479. }
  1480. }
  1481. return html.join('');
  1482. };
  1483. function changeLiucheng(datas) {
  1484. const auditorshtml = [];
  1485. let lastAuditorHtml = [];
  1486. for (const [index,data] of datas.entries()) {
  1487. auditorshtml.push(`<li class="list-group-item d-flex justify-content-between align-items-center" data-auditid="${index !== 0 ? data[0].aid : ''}">`);
  1488. auditorshtml.push('<span class="mr-1"><i class="fa ' + (index === 0 ? 'fa-play-circle fa-rotate-90' : index+1 === datas.length ? 'fa-stop-circle' : 'fa-chevron-circle-down') + '"></i></span>');
  1489. auditorshtml.push('<span class="text-muted">');
  1490. for (const u of data) {
  1491. auditorshtml.push(`<small class="d-inline-block text-dark mx-1" title="${u.role}" data-auditorId="${u.aid}">${u.name}</small>`);
  1492. }
  1493. auditorshtml.push('</span>');
  1494. auditorshtml.push('<div class="d-flex ml-auto">');
  1495. if (data[0].audit_type !== auditType.key.common) {
  1496. auditorshtml.push(`<span class="badge badge-pill badge-${auditType.info[data[0].audit_type].class} p-1"><small>${auditType.info[data[0].audit_type].short}</small></span>`);
  1497. }
  1498. if (index === 0) {
  1499. auditorshtml.push('<span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>');
  1500. } else if (index+1 === datas.length) {
  1501. auditorshtml.push('<span class="badge badge-light badge-pill"><small>终审</small></span>');
  1502. } else {
  1503. auditorshtml.push('<span class="badge badge-light badge-pill"><small>'+ transFormToChinese(index) +'审</small></span>');
  1504. }
  1505. auditorshtml.push('</div>');
  1506. auditorshtml.push('</li>');
  1507. if (data[0].status === auditConst.status.uncheck) {
  1508. lastAuditorHtml.push('<li class="timeline-list-item pb-2 is_uncheck">');
  1509. if (index < datas.length - 1) {
  1510. lastAuditorHtml.push('<div class="timeline-item-tail"></div>');
  1511. }
  1512. lastAuditorHtml.push('<div class="timeline-item-icon bg-secondary text-light"></div>');
  1513. lastAuditorHtml.push('<div class="timeline-item-content">');
  1514. lastAuditorHtml.push(`<div class="py-1">
  1515. <span class="text-black-50">
  1516. ${ index !== datas.length - 1 ? data[0].audit_order + '' : '终' }审 ${getAuditTypeText(data[0].audit_type)}
  1517. </span>
  1518. </div>`);
  1519. lastAuditorHtml.push('<div class="card"><div class="card-body px-3 py-0">');
  1520. for (const [i, auditor] of data.entries()) {
  1521. lastAuditorHtml.push(`<div class="card-text p-2 py-3 row ${ ( i > 0 ? 'border-top' : '') }">`);
  1522. lastAuditorHtml.push(`<div class="col"><span class="h6">${auditor.name}</span><span class="text-muted ml-1">${auditor.company}${auditor.role ? ' - ' + auditor.role : ''}</span></div>`);
  1523. lastAuditorHtml.push('<div class="col">');
  1524. lastAuditorHtml.push('</div>');
  1525. lastAuditorHtml.push('</div>');
  1526. }
  1527. lastAuditorHtml.push('</div></div>');
  1528. lastAuditorHtml.push('</div>');
  1529. lastAuditorHtml.push('</li>');
  1530. }
  1531. }
  1532. $('.last-auditor-list .is_uncheck').remove();
  1533. $('.last-auditor-list').append(lastAuditorHtml.join(''));
  1534. $('.auditors-list').html(auditorshtml.join(''));
  1535. }
  1536. const getAuditTypeText = function (type) {
  1537. if (type === auditType.key.common) return '';
  1538. return `<span class="text-${auditType.info[type].class}">${auditType.info[type].long}</span>`;
  1539. };
  1540. // 审批流程-选择审批人html 生成
  1541. function makeSelectAudit(code, aid, status) {
  1542. let divhtml = '';
  1543. accountGroup.forEach((group, idx) => {
  1544. let didivhtml = '';
  1545. if(group) {
  1546. group.groupList.forEach(item => {
  1547. didivhtml += item.id !== change.uid ? '<dd class="border-bottom p-2 mb-0 " data-id="' + item.id + '" >\n' +
  1548. '<p class="mb-0 d-flex"><span class="text-primary">' + item.name + '</span><span\n' +
  1549. ' class="ml-auto">' + item.mobile + '</span></p>\n' +
  1550. ' <span class="text-muted">' + item.role + '</span>\n' +
  1551. ' </dd>\n' : '';
  1552. });
  1553. divhtml += '<dt><a href="javascript: void(0);" class="acc-btn" data-groupid="' + idx + '" data-type="hide"><i class="fa fa-plus-square"></i></a> ' + group.groupName + '</dt>\n' +
  1554. ' <div class="dd-content" data-toggleid="' + idx + '">\n' + didivhtml +
  1555. ' </div>\n';
  1556. }
  1557. });
  1558. let html = '<div class="dropdown-menu dropdown-menu-right" id="' + code + '_dropdownMenu" aria-labelledby="' + code + '_dropdownMenuButton" style="width:220px">\n' +
  1559. ' <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"\n' +
  1560. ' placeholder="姓名/手机 检索" autocomplete="off" data-code="' + code + '"></div>\n' +
  1561. ' <dl class="list-unstyled book-list" data-aid="'+ aid +'" data-operate="'+ status +'">\n' + divhtml +
  1562. ' </dl>\n' +
  1563. ' </div>\n' +
  1564. ' </div>\n' +
  1565. ' </span>\n' +
  1566. ' </span>\n' +
  1567. ' </li>';
  1568. return html;
  1569. }
  1570. });
  1571. </script>
  1572. <% } %>