plan_information_modal.ejs 118 KB

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