information_modal.ejs 118 KB

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