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