|
@@ -205,13 +205,8 @@
|
|
|
</td>
|
|
|
<td width="70%">
|
|
|
<% auditHistory.forEach((auditors, idx) => { %>
|
|
|
- <!-- 收起历史流程 -->
|
|
|
- <% if(idx > 0 && idx === 1) { %>
|
|
|
- <div class="text-right"><a href="javascript: void(0);" id="fold-btn1">收起历史审批流程</a></div>
|
|
|
- <% } %>
|
|
|
-
|
|
|
<div class="<%- idx < auditHistory.length - 1 ? 'fold-btn' : '' %>">
|
|
|
- <div class="text-center text-muted" <%- idx === auditHistory.length - 1 ? `id="end-target"` : "" %> ><%- idx+1 %>#</div>
|
|
|
+ <div class="text-center text-muted" <%- idx === auditHistory.length - 1 ? `id="end-target"` : "" %> ><%- idx === auditHistory.length - 1 ? 1 : idx+1 %>#</div>
|
|
|
<ul class="timeline-list list-unstyled mt-2">
|
|
|
<% auditors.forEach((auditor, index) => { %>
|
|
|
<% if (index === 0) { %>
|
|
@@ -333,9 +328,9 @@
|
|
|
<% }) %>
|
|
|
</ul>
|
|
|
</div>
|
|
|
- <!-- 展开历史流程 -->
|
|
|
+ <!-- 展开/收起历史流程 -->
|
|
|
<% if(idx === auditHistory.length - 1) { %>
|
|
|
- <div class="text-right"><a href="javascript: void(0);" id="fold-btn2" style="display: none;" data-target="<%- idx + 1 %>">展开历史审批流程</a></div>
|
|
|
+ <div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show" data-idx="<%- idx + 1 %>">展开历史审批流程</a></div>
|
|
|
<% } %>
|
|
|
<% }) %>
|
|
|
</td>
|
|
@@ -360,21 +355,23 @@
|
|
|
const whiteList = JSON.parse('<%- JSON.stringify(whiteList) %>');
|
|
|
const curAuditor = JSON.parse('<%- JSON.stringify(ctx.advance.curAuditor) %>');
|
|
|
|
|
|
- // 展开/收起历史审核记录
|
|
|
- $('#fold-btn1').click(function() {
|
|
|
- $('.fold-btn').slideUp('swing', () => {
|
|
|
- $('#end-target').text('1#')
|
|
|
- $('#fold-btn1').hide()
|
|
|
- $('#fold-btn2').show()
|
|
|
- });
|
|
|
- });
|
|
|
- $('#fold-btn2').click(function() {
|
|
|
- const idx = $(this).data('target')
|
|
|
- $('.fold-btn').slideDown('swing', () => {
|
|
|
- $('#end-target').text(idx + '#')
|
|
|
- $('#fold-btn1').show()
|
|
|
- $('#fold-btn2').hide()
|
|
|
- });
|
|
|
+ // 展开历史审核记录
|
|
|
+ $('.table #fold-btn').click(function() {
|
|
|
+ const type = $(this).data('target')
|
|
|
+ if (type === 'show') {
|
|
|
+ $(this).data('target', 'hide')
|
|
|
+ // 展开历史审核记录
|
|
|
+ $('.table .fold-btn').slideDown('swing', () => {
|
|
|
+ $('.table #end-target').text($(this).data('idx') + '#')
|
|
|
+ $('.table #fold-btn').text('收起历史审核记录')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ $(this).data('target', 'show')
|
|
|
+ $('.table .fold-btn').slideUp('swing', () => {
|
|
|
+ $('.table #end-target').text('1#')
|
|
|
+ $('.table #fold-btn').text('展开历史审核记录')
|
|
|
+ })
|
|
|
+ }
|
|
|
});
|
|
|
// 处理换行
|
|
|
advance.remark && $('#ad-remark').html(advance.remark.replace(/<br\/>/g, '\n').replace(/' '/, '\s'));
|
|
@@ -385,3 +382,8 @@
|
|
|
const accountList = JSON.parse('<%- JSON.stringify(accountList) %>');
|
|
|
</script>
|
|
|
<% } %>
|
|
|
+<style>
|
|
|
+ .fold-btn {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+</style>
|