information_modal.ejs 118 KB

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