information_modal.ejs 117 KB

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