Browse Source

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

laiguoran 5 năm trước cách đây
mục cha
commit
0bfdcccdb7

+ 5 - 0
app/controller/advance_controller.js

@@ -1,6 +1,7 @@
 'use strict';
 const accountGroup = require('../const/account_group').group;
 const auditConst = require('../const/audit').advance;
+const ledgerAuditConst = require('../const/audit').ledger.status;
 const sendToWormhole = require('stream-wormhole');
 const path = require('path');
 const fs = require('fs');
@@ -17,8 +18,10 @@ module.exports = app => {
             const latestOrder = await ctx.service.advance.getLastestAdvance(ctx.tender.id, type, true);
             const advancePayTotal = ctx.tender.info.deal_param.startAdvance;
             const progress = await ctx.service.advance.calcProgress(latestOrder, advancePayTotal);
+            const showAddBtn = ctx.tender.data.ledger_status !== ledgerAuditConst.uncheck && ctx.tender.data.user_id === ctx.session.sessionUser.accountId ? !latestOrder || (latestOrder.status === auditConst.status.checked && latestOrder.prev_total_amount < advancePayTotal) : false;
             const renderData = {
                 type,
+                showAddBtn,
                 advanceList,
                 latestOrder,
                 auditConst,
@@ -40,8 +43,10 @@ module.exports = app => {
             const latestOrder = await ctx.service.advance.getLastestAdvance(ctx.tender.id, type, true);
             const advancePayTotal = ctx.tender.info.deal_param.materialAdvance;
             const progress = await ctx.service.advance.calcProgress(latestOrder, advancePayTotal);
+            const showAddBtn = ctx.tender.data.ledger_status !== ledgerAuditConst.uncheck && ctx.tender.data.user_id === ctx.session.sessionUser.accountId ? !latestOrder || (latestOrder.status === auditConst.status.checked && latestOrder.prev_total_amount < advancePayTotal) : false;
             const renderData = {
                 type,
+                showAddBtn,
                 advanceList,
                 latestOrder,
                 auditConst,

+ 1 - 0
app/middleware/tender_check.js

@@ -43,6 +43,7 @@ module.exports = options => {
                 tender.data.ledger_times = 1;
             }
             if (tender.data.project_id !== this.session.sessionProject.id) {
+
                 throw '您无权查看该项目';
             } else {
                 const accountId = this.session.sessionUser.accountId;

+ 4 - 2
app/service/advance.js

@@ -81,6 +81,8 @@ module.exports = app => {
                     prev_amount: 0.00,
                     prev_total_amount: 0.00,
                 };
+            } else {
+                latestOrder.order = latestOrder.order + 1;
             }
             const record = await this.db.insert(this.tableName, { type, uid, tid, status: auditConst.status.uncheck, order: latestOrder.order, prev_amount: latestOrder.prev_total_amount, prev_total_amount: latestOrder.prev_total_amount });
             return await this.getDataById(record.insertId);
@@ -123,8 +125,8 @@ module.exports = app => {
             }
             const surplus = ctx.helper.sub(payTotal, latest.prev_total_amount || 0);
             const p_ratio = ctx.helper.mul(ctx.helper.div(latest.prev_amount || 0, payTotal), 100, 2); // 截止上期金额总数
-            const c_ratio = ctx.helper.mul(ctx.helper.div(latest.cur_amount || 0, payTotal), 100, 0); // 截止本期金额总数
-            const s_ratio = ctx.helper.mul(ctx.helper.div(surplus, payTotal), 100, 0); // 剩余金额总数
+            const c_ratio = ctx.helper.mul(ctx.helper.div(latest.cur_amount || 0, payTotal), 100, 2); // 截止本期金额总数
+            const s_ratio = ctx.helper.mul(ctx.helper.div(surplus, payTotal), 100, 2); // 剩余金额总数
             return {
                 p_amount: latest.prev_amount,
                 c_amount: latest.cur_amount,

+ 0 - 1
app/service/advance_file.js

@@ -1,5 +1,4 @@
 'use strict';
-const auditConst = require('../const/audit');
 /**
  * 附件表 数据模型
  * @author LanJianRong

+ 26 - 23
app/view/advance/detail.ejs

@@ -129,6 +129,7 @@
                                         <div class="input-group">
                                             <div class="input-group-prepend">
                                                 <select class="form-control" id="account_group">
+                                                    <option value="0">所有分组</option>
                                                     <% for (const dw in accountGroup) { %>
                                                     <option value="<%= dw %>"><%= accountGroup[dw] %></option>
                                                     <% } %>
@@ -205,13 +206,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 +329,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 +356,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 +383,8 @@
     const accountList = JSON.parse('<%- JSON.stringify(accountList) %>');
 </script>
 <% } %>
+<style>
+    .fold-btn {
+        display: none;
+    }
+</style>

+ 2 - 2
app/view/advance/index.ejs

@@ -29,7 +29,7 @@
                 </div>
             </div>
             <div>
-                <% if(!latestOrder || (latestOrder.status === auditConst.status.checked && latestOrder.prev_total_amount < advancePayTotal)) { %>
+                <% if(showAddBtn) { %>
                     <form action="<%- preUrl %>" method="POST">
                         <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
                         <button type="submit" class="btn btn-primary btn-sm pull-right">开始新一期</button>
@@ -59,7 +59,7 @@
                         <% advanceList.forEach(item => { %>
                             <tr>
                                 <td><a href="/tender/<%- ctx.tender.id %>/advance/<%- item.id %>/detail" data-id="<%- item.id %>">第<%- item.order %>期</a></td>
-                                <td><%- item.pay_ratio || 0%>%</td>
+                                <td><%- item.cur_amount && ctx.helper.mul(ctx.helper.div(item.cur_amount, advancePayTotal), 100) || 0%>%</td>
                                 <td class="text-right"><%- ctx.helper.formatMoney(item.cur_amount)%></td>
                                 <td class="text-right"><%- ctx.helper.formatMoney(item.prev_amount)%></td>
                                 <td class="text-right"><%- ctx.helper.formatMoney(item.prev_total_amount)%></td>

+ 171 - 153
app/view/advance/modal_audit.ejs

@@ -54,170 +54,171 @@
                     <div class="col-4">
                         <div class="card mt-3">
                             <ul class="list-group list-group-flush">
-                                <li class="list-group-item">
-                                    <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- ctx.advance.user.name %>
-                                    <small class="text-muted"><%- ctx.advance.user.role %></small><span
-                                        class="pull-right">原报</span>
+                                <% auditors.forEach((item, idx) => { %>
+                                <% if (idx === 0) { %>
+                                <li class="list-group-item" data-auditorId="<%- item.audit_id %>">
+                                    <i class="fa fa fa-play-circle fa-rotate-90"></i> <%- item.name %>
+                                    <small class="text-muted"><%- item.role %></small>
+                                    <span class="pull-right">原报</span>
                                 </li>
-                                <% for (let i = 0; i < ctx.advance.auditors2.length; i++) { %>
-                                <li class="list-group-item">
-                                    <% if (i < ctx.advance.auditors2.length - 1) { %>
-                                    <i class="fa fa-chevron-circle-down"></i> <%- ctx.advance.auditors2[i].name %>
-                                    <small class="text-muted"><%- ctx.advance.auditors2[i].role %></small><span
-                                        class="pull-right"><%= ctx.helper.transFormToChinese(i+1) %>审</span>
-                                    <% } else { %>
-                                    <i class="fa fa fa-stop-circle"></i> <%- ctx.advance.auditors2[i].name %> <small
-                                        class="text-muted"><%- ctx.advance.auditors2[i].role %></small><span
-                                        class="pull-right">终审</span>
-                                    <% } %>
+                                <% } else if(idx === auditors.length -1 && idx !== 0) { %>
+                                <li class="list-group-item" data-auditorId="<%- item.audit_id %>">
+                                    <i class="fa fa fa-stop-circle"></i> <%- item.name %>
+                                    <small class="text-muted"><%- item.role %></small>
+                                    <span class="pull-right">终审</span>
+                                </li>
+                                <% } else {%>
+                                <li class="list-group-item" data-auditorId="<%- item.audit_id %>">
+                                    <i class="fa fa-chevron-circle-down"></i> <%- item.name %>
+                                    <small class="text-muted"><%- item.role %></small>
+                                    <span class="pull-right"><%= ctx.helper.transFormToChinese(idx) %>审</span>
                                 </li>
                                 <% } %>
+                                <% }) %>
                             </ul>
                         </div>
                     </div>
                     <div class="col-8 modal-height-500" style="overflow: auto">
-                        <% for (const ah of ctx.advance.auditHistory) { %>
-                        <div class="card mt-3">
-                            <ul class="list-group list-group-flush">
-                                <% for (let iA = 0; iA < ah.length; iA++) { %>
-                                <% if (iA === 0) { %>
-                                <li class="list-group-item">
-                                    <h5 class="card-title">
-                                        <i class="fa fa-play-circle fa-rotate-90 text-success"></i>
-                                        <%- ctx.advance.user.name %> <small
-                                            class="text-muted"><%- ctx.advance.user.role %></small><span
-                                            class="pull-right">原报</span>
-                                    </h5>
-                                    <div class="ml-3">
-                                        <span
-                                            class="text-success"><small><%- ctx.helper.formatFullDate(ah[iA].create_time) %></small>
-                                            <% if (ctx.advance.auditHistory.indexOf(ah) > 0) { %>重新<% } %>上报</span>
-                                    </div>
-                                </li>
-                                <li class="list-group-item">
-                                    <h5 class="card-title">
-                                        <i
-                                            class="fa <%if (iA === ah.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[ah[iA].status] %>"></i>
-                                        <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span
-                                            class="pull-right"><%= ah[iA].sort === ah[iA].max_sort ? '终' : ctx.helper.transFormToChinese(ah[iA].sort) %>审</span>
-                                    </h5>
-                                    <div class="ml-3">
-                                        <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                        <span
-                                            class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small>
-                                            <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %>
-                                            <%- ctx.advance.user.name %><% } %></span>
+                        <% 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>
+                                <ul class="timeline-list list-unstyled mt-2">
+                                    <% auditors.forEach((auditor, index) => { %>
+                                    <% if (index === 0) { %>
+                                    <li class="timeline-list-item pb-2">
+                                        <div class="timeline-item-date">
+                                            <%- ctx.helper.formatDate(auditor.create_time) %>
+                                        </div>
+                                        <div class="timeline-item-tail"></div>
+                                        <div class="timeline-item-icon bg-success text-light">
+                                            <i class="fa fa-caret-down"></i>
+                                        </div>
+                                        <div class="timeline-item-content">
+                                            <div class="card">
+                                                <div class="card-body p-3">
+                                                    <div class="card-text">
+                                                        <p class="mb-1"><span
+                                                                class="h5"><%- advance.user.name %></span><span
+                                                                class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
+                                                        </p>
+                                                        <p class="text-muted mb-0"><%- advance.user.role %></p>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </li>
+                                    <li class="timeline-list-item pb-2">
+                                        <div class="timeline-item-date">
+                                            <%- ctx.helper.formatDate(auditor.end_time) %>
+                                        </div>
+                                        <% if(index < auditors.length - 1) { %>
+                                            <div class="timeline-item-tail"></div>
                                         <% } %>
-                                        <p class="card-text"><%- ah[iA].opinion %></p>
-                                    </div>
-                                </li>
-                                <% } else if (iA === ah.length - 1) { %>
-                                <li class="list-group-item">
-                                    <h5 class="card-title">
-                                        <i class="fa fa-stop-circle <%- auditConst.statusClass[ah[iA].status] %>"></i>
-                                        <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span
-                                            class="pull-right">终审</span>
-                                    </h5>
-                                    <div class="ml-3">
-                                        <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                        <span
-                                            class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small>
-                                            <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %>
-                                            <%- ctx.advance.user.name %><% } %></span>
+                                        <% if(auditor.status === auditConst.status.checked) { %>
+                                        <div class="timeline-item-icon bg-success text-light">
+                                            <i class="fa fa-check"></i>
+                                        </div>
+                                        <% } else if(auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre) {%>
+                                        <div class="timeline-item-icon bg-warning text-light">
+                                            <i class="fa fa-level-up"></i>
+                                        </div>
+                                        <% } else if(auditor.status === auditConst.status.checking) { %>
+                                        <div class="timeline-item-icon bg-warning text-light">
+                                            <i class="fa fa-ellipsis-h"></i>
+                                        </div>
+                                        <% } else {%>
+                                        <div class="timeline-item-icon bg-secondary text-light">
+                                        </div>
                                         <% } %>
-                                        <p class="card-text"><%- ah[iA].opinion %></p>
-                                    </div>
-                                </li>
-                                <% } else { %>
-                                <li class="list-group-item">
-                                    <h5 class="card-title">
-                                        <i
-                                            class="fa <%if (iA === ah.length - 1) { %>fa-stop-circle<% } else { %>fa-chevron-circle-down<% } %> <%- auditConst.statusClass[ah[iA].status] %>"></i>
-                                        <%- ah[iA].name %> <small class="text-muted"><%- ah[iA].role %></small><span
-                                            class="pull-right"><%= ah[iA].sort === ah[iA].max_sort ? '终' : ctx.helper.transFormToChinese(ah[iA].sort) %>审</span>
-                                    </h5>
-                                    <div class="ml-3">
-                                        <% if (ah[iA].status !== auditConst.status.uncheck) { %>
-                                        <span
-                                            class="<%- auditConst.statusClass[ah[iA].status] %>"><% if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo) { %><small><%- ctx.helper.formatFullDate(ah[iA].end_time) %></small>
-                                            <% } %><%- auditConst.statusString[ah[iA].status]%><% if (ah[iA].status === auditConst.status.checkNo) { %>
-                                            <%- ctx.advance.user.name %><% } %></span>
+                                        <div class="timeline-item-content">
+                                            <div class="card">
+                                                <div class="card-body p-3">
+                                                    <div class="card-text">
+                                                        <p class="mb-1"><span
+                                                                class="h5"><%- auditor.name %></span><span
+                                                                class="pull-right <%- auditConst.statusClass[auditor.status] %>"><%- auditConst.statusString[auditor.status] %></span>
+                                                        </p>
+                                                        <p class="text-muted mb-0"><%- auditor.role %></p>
+                                                    </div>
+                                                </div>
+                                                <!--审批意见-->
+                                                <div class="card-body p-3 border-top">
+                                                    <% if (auditor.status === auditConst.status.checking) { %>
+                                                        <label>审批意见<b class="text-danger">*</b></label>
+                                                        <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
+                                                    <% } else { %>
+                                                        <p style="margin: 0;"><%- auditor.opinion %></p>
+                                                    <% } %>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </li>
+                                    <% } else {%>
+                                    <li class="timeline-list-item pb-2">
+                                        <div class="timeline-item-date">
+                                            <%- ctx.helper.formatDate(auditor.end_time) %>
+                                        </div>
+                                        <% if(index < auditors.length - 1) { %>
+                                            <div class="timeline-item-tail"></div>
                                         <% } %>
-                                        <p class="card-text"><%- ah[iA].opinion %></p>
-                                    </div>
-                                </li>
-                                <% } %>
-                                <% } %>
-                            </ul>
-                        </div>
-                        <% } %>
-                        <div class="card mt-3">
-                            <ul class="list-group list-group-flush">
-                                <li class="list-group-item">
-                                    <h5 class="card-title">
-                                        <i class="fa fa-play-circle fa-rotate-90 text-success"></i>
-                                        <%- ctx.advance.user.name %> <small
-                                            class="text-muted"><%- ctx.advance.user.role %></small><span
-                                            class="pull-right">原报</span>
-                                    </h5>
-                                    <div class="ml-3">
-                                        <span
-                                            class="text-success"><small><%- ctx.helper.formatFullDate(ctx.advance.auditors[0].create_time) %></small>
-                                            上报</span>
-                                    </div>
-                                </li>
-                                <% for (let iA = 0; iA < ctx.advance.auditors.length; iA++) { %>
-                                <% const auditors = ctx.advance.auditors; %>
-                                <li class="list-group-item">
-                                    <% if (auditors[iA].status === auditConst.status.checked) { %>
-                                    <h5 class="card-title">
-                                        <i
-                                            class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down text-success' : 'fa fa-stop-circle text-success') %>"></i>
-                                        <%- auditors[iA].name %> <small
-                                            class="text-muted"><%- auditors[iA].role %></small><span
-                                            class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
-                                    </h5>
-                                    <div class="ml-3">
-                                        <span
-                                            class="text-success"><small><%- ctx.helper.formatFullDate(auditors[iA].end_time) %></small>
-                                            审批通过</span>
-                                        <p class="card-text"><%- auditors[iA].opinion %></p>
-                                    </div>
-                                    <% } else if (auditors[iA].stauts == auditConst.status.checking) { %>
-                                    <h5 class="card-title">
-                                        <i
-                                            class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i>
-                                        <%- auditors[iA].name %> <small
-                                            class="text-muted"><%- auditors[iA].role %></small><span
-                                            class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
-                                    </h5>
-                                    <div class="ml-3">
-                                        <span>审批中</span>
-                                        <p class="card-text"><%- auditors[iA].opinion %></p>
-                                    </div>
-                                    <% } else { %>
-                                    <h5 class="card-title">
-                                        <i
-                                            class="<%- (iA < auditors.length - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i>
-                                        <%- auditors[iA].name %> <small
-                                            class="text-muted"><%- auditors[iA].role %></small><span
-                                            class="pull-right"><%= auditors[iA].sort === auditors[iA].max_sort ? '终' : ctx.helper.transFormToChinese(auditors[iA].sort) %>审</span>
-                                    </h5>
-                                    <div class="ml-3">
-                                        <p class="card-text"><%- auditors[iA].opinion %></p>
-                                    </div>
-                                    <% } %>
-                                    <% if (auditors[iA].status === auditConst.status.checked) { %>
-                                    <% } else if (auditors[iA].status === auditConst.status.checking) { %>
-                                    <div class="form-group">
-                                        <label>审批意见<b class="text-danger">*</b></label>
-                                        <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
-                                    </div>
+                                        <% if(auditor.status === auditConst.status.checked) { %>
+                                        <div class="timeline-item-icon bg-success text-light">
+                                            <i class="fa fa-check"></i>
+                                        </div>
+                                        <% } else if(auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre) {%>
+                                        <div class="timeline-item-icon bg-warning text-light">
+                                            <i class="fa fa-level-up"></i>
+                                        </div>
+                                        <% } else if(auditor.status === auditConst.status.checking) { %>
+                                        <div class="timeline-item-icon bg-warning text-light">
+                                            <i class="fa fa-ellipsis-h"></i>
+                                        </div>
+                                        <% } else { %>
+                                        <div class="timeline-item-icon bg-secondary text-light">
+                                        </div>
+                                        <% } %>
+                                        <div class="timeline-item-content">
+                                            <div class="card">
+                                                <div class="card-body p-3">
+                                                    <div class="card-text">
+                                                        <p class="mb-1"><span
+                                                                class="h5"><%- auditor.name %></span>
+                                                            <span
+                                                                class="pull-right
+                                                                            <%- auditConst.statusClass[auditor.status] %>"><%- auditor.status !== auditConst.status.uncheck ? auditConst.statusString[auditor.status] : ''%>
+                                                                <%- auditor.status === auditConst.status.checkNo ? advance.user.name : '' %>
+                                                                <%- auditor.status === auditConst.status.checkNoPre ? auditors[index-1].name : '' %>
+                                                            </span>
+                                                        </p>
+                                                        <p class="text-muted mb-0"><%- auditor.role %></p>
+                                                    </div>
+                                                </div>
+                                                <!--审批意见-->
+                                                    <div class="card-body p-3 border-top">
+                                                        <% if (auditor.status === auditConst.status.checking) { %>
+                                                            <label>审批意见<b class="text-danger">*</b></label>
+                                                            <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
+                                                        <% } else { %>
+                                                            <p style="margin: 0;"><%- auditor.opinion %></p>
+                                                        <% } %>
+                                                    </div>
+                                            </div>
+                                        </div>
+                                    </li>
                                     <% } %>
-                                </li>
-                                <% } %>
-                            </ul>
-                        </div>
+                                    <% }) %>
+                                </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>
                 </div>
             </div>
@@ -1194,4 +1195,21 @@
         if (!text) return null
         return text.replace(/(\r\n)|(\n)/g, '<br/>').replace(/\s/g, ' ')
     }
+
+    // 展开/收起历史审核记录
+    $('.modal-body #fold-btn1').click(function() {
+        $('.modal-body .fold-btn').slideUp('swing', () => {
+            $('.modal-body #end-target').text('1#')
+            $('.modal-body #fold-btn1').hide()
+            $('.modal-body #fold-btn2').show()
+        });
+    });
+    $('.modal-body #fold-btn2').click(function() {
+        const idx = $(this).data('target')
+        $('.modal-body .fold-btn').slideDown('swing', () => {
+            $('.modal-body #end-target').text(idx + '#')
+            $('.modal-body #fold-btn1').show()
+            $('.modal-body #fold-btn2').hide()
+        });
+    });
 </script>