plan_information_modal.ejs 116 KB

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