information_modal.ejs 117 KB

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