Selaa lähdekoodia

feat: 增加预付款列表页审批弹窗

lanjianrong 4 vuotta sitten
vanhempi
commit
38d5039017

+ 26 - 22
app/controller/advance_controller.js

@@ -105,27 +105,6 @@ module.exports = app => {
         }
 
         /**
-         * 获取审批界面所需的 原报、审批人数据等
-         * @param {Object} ctx 全局上下文
-         * @private
-         */
-        async _getAdvanceAuditViewData(ctx) {
-            const times = ctx.advance.status === auditConst.status.checkNo ? ctx.advance.times - 1 : ctx.advance.times;
-            ctx.advance.user = await ctx.service.projectAccount.getAccountInfoById(ctx.advance.uid);
-            ctx.advance.auditHistory = [];
-            if (ctx.advance.times > 1) {
-                for (let i = 1; i < ctx.advance.times; i++) {
-                    ctx.advance.auditHistory.push(await ctx.service.advanceAudit.getAuditors(ctx.advance.id, i));
-                }
-            }
-            // 获取审批流程中左边列表
-            ctx.advance.auditors2 = await ctx.service.advanceAudit.getAuditGroupByList(ctx.advance.id, times);
-            if (ctx.advance.status === auditConst.status.uncheck || ctx.advance.status === auditConst.status.checkNo) {
-                ctx.advance.auditorList = await ctx.service.advanceAudit.getAuditors(ctx.advance.id, ctx.advance.times);
-            }
-        }
-
-        /**
          * 预付款详情页(AJAX) GET
          * @param {Object} ctx 全局上下文
          */
@@ -133,7 +112,6 @@ module.exports = app => {
             const advancePayTotal = ctx.advance.type === 0 ? ctx.tender.info.deal_param.startAdvance : ctx.tender.info.deal_param.materialAdvance;
             try {
                 const renderData = await this._getDefaultRenderData(ctx);
-                await this._getAdvanceAuditViewData(ctx);
                 const { uncheck, checkNo } = auditConst.status;
                 const { status } = ctx.advance;
                 // 获取上一期预付款记录
@@ -451,6 +429,32 @@ module.exports = app => {
                 }
             }
         }
+
+        /**
+         * 获取列表页所需的审核弹窗列表
+         * @param {object} ctx 全局上下文
+         */
+        async getAuditors(ctx) {
+            try {
+                const data = {};
+                // 获取审核人左边列表
+                data.auditors = await ctx.service.advanceAudit.getAuditorsWithOwner(ctx.advance.id, ctx.advance.times);
+                // 获取审批流程中右边列表
+                const auditHistory = [];
+                const times = ctx.advance.status === auditConst.status.checkNo ? ctx.advance.times - 1 : ctx.advance.times;
+                if (times >= 1) {
+                    for (let i = 1; i <= times; i++) {
+                        auditHistory.push(await ctx.service.advanceAudit.getAuditors(ctx.advance.id, i));
+                    }
+                }
+                data.auditHistory = auditHistory;
+                data.user = ctx.advance.user;
+                ctx.body = { err: 0, msg: '请求成功', data };
+            } catch (error) {
+                this.log(error);
+                ctx.body = { err: 0, msg: error.toString() };
+            }
+        }
     }
     return advanceController;
 };

+ 1 - 0
app/middleware/advance_check.js

@@ -41,6 +41,7 @@ module.exports = () => {
                 throw '预付款数据错误';
             }
 
+            advance.user = yield this.service.projectAccount.getAccountInfoById(advance.uid);
             // 读取审核人列表数据
             advance.auditors = yield this.service.advanceAudit.getAuditors(advance.id, advance.times);
             advance.curAuditor = yield this.service.advanceAudit.getCurAuditor(advance.id, advance.times);

+ 219 - 8
app/public/js/advance.js

@@ -14,9 +14,9 @@ $(document).ready(function () {
             const html = `<tr>
                 <td><a href="/tender/${res.tid}/advance/${res.id}/detail" data-id="${res.id}">第${res.order}期</a></td>
                 <td>${res.pay_ratio || 0}%</td>
-                <td class="text-right">${formatMoney(res.cur_amount || 0)}</td>
-                <td class="text-right">${formatMoney(res.prev_amount || 0)}</td>
-                <td class="text-right">${formatMoney(res.prev_total_amount || 0)}</td>
+                <td class="text-right">${formatMoney((res.cur_amount || 0), ',', decimal)}</td>
+                <td class="text-right">${formatMoney((res.prev_amount || 0), ',', decimal)}</td>
+                <td class="text-right">${formatMoney((res.prev_total_amount || 0),',', decimal)}</td>
                 <td><a class="btn btn-sm" href="#file" data-toggle="modal" data-target="#file"><i class="fa fa-paperclip "></i> 3</a></td>
                 <td>${auditConst.statusString[res.status]}</td>
                 <td><a href="/tender/${res.tid}/advance/${res.id}/detail" class="btn btn-primary btn-sm">编辑</a></td>
@@ -49,15 +49,226 @@ $(document).ready(function () {
         })
         $('#file-content').append(html)
     })
-    function formatMoney(s, dot = ',') {
-        if (!s) return '0.00';
-        s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(2) + '';
-        let l = s.split('.')[0].split('').reverse(),
+
+    $('a[data-target="#sp-list" ]').on('click', function () {
+        const id = $(this).data('vid')
+        postData(`${window.location.pathname}/${id}/auditors`, {}, (res) => {
+            const { auditHistory, auditors, user } = res
+            let auditorsHTML = ''
+            let historyHTML = ''
+            auditors.forEach((auditor, idx) => {
+                if (idx === 0) {
+                    auditorsHTML += `<li class="list-group-item">
+                        <i class="fa fa fa-play-circle fa-rotate-90"></i> ${auditor.name}
+                        <small class="text-muted">${auditor.role}</small>
+                        <span class="pull-right">原报</span>
+                    </li>`
+                } else if(idx === auditors.length -1 && idx !== 0) {
+                    auditorsHTML += `<li class="list-group-item">
+                        <i class="fa fa fa-stop-circle"></i> ${auditor.name}
+                        <small class="text-muted">${auditor.role}</small>
+                        <span class="pull-right">终审</span>
+                    </li>`
+                } else {
+                    auditorsHTML += `<li class="list-group-item">
+                        <i class="fa fa-chevron-circle-down"></i> ${auditor.name}
+                        <small class="text-muted">${auditor.role}</small>
+                        <span class="pull-right">${transFormToChinese(idx)}审</span>
+                    </li>`
+                }
+            })
+            $('#auditor-list').empty()
+            $('#auditor-list').append(auditorsHTML)
+            auditHistory.forEach((auditors, idx) => {
+                historyHTML += `<div class="${idx < auditHistory.length - 1 ? 'fold-card' : ''}">
+                <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) {
+                        historyHTML += `<li class="timeline-list-item pb-2">
+                            <div class="timeline-item-date">
+                                ${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">${user.name}</span><span
+                                                    class="pull-right text-success">${idx !== 0 ? '重新' : ''}上报审批</span>
+                                            </p>
+                                            <p class="text-muted mb-0">${user.role}</p>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                        </li>
+                        <li class="timeline-list-item pb-2">
+                            <div class="timeline-item-date">
+                                ${formatDate(auditor.end_time)}
+                            </div>`
+
+                            if(index < auditors.length - 1) {
+                                historyHTML += `<div class="timeline-item-tail"></div>`
+                            }
+                            if(auditor.status === auditConst.status.checked) {
+                                historyHTML += `<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) {
+                                historyHTML += `<div class="timeline-item-icon bg-warning text-light">
+                                    <i class="fa fa-level-up"></i>
+                                </div>`
+                            } else if(auditor.status === auditConst.status.checking) {
+                                historyHTML += `<div class="timeline-item-icon bg-warning text-light">
+                                    <i class="fa fa-ellipsis-h"></i>
+                                </div>`
+                            } else {
+                                historyHTML += `<div class="timeline-item-icon bg-secondary text-light"></div>`
+
+                            }
+                            historyHTML += `<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>`
+                            if (auditor.opinion) {
+                            historyHTML += `<div class="card-body p-3 border-top">
+                                    <p style="margin: 0;">${auditor.opinion}</p>
+                                </div>`
+                            }
+                            historyHTML += `</div></div></li>`
+                    } else {
+                        historyHTML += `<li class="timeline-list-item pb-2">
+                        <div class="timeline-item-date">
+                            ${formatDate(auditor.end_time)}
+                        </div>`
+
+                        if(index < auditors.length - 1) {
+                            historyHTML += `<div class="timeline-item-tail"></div>`
+                        }
+                        if(auditor.status === auditConst.status.checked) {
+                            historyHTML += `<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) {
+                            historyHTML += `<div class="timeline-item-icon bg-warning text-light">
+                                <i class="fa fa-level-up"></i>
+                            </div>`
+
+                        } else if(auditor.status === auditConst.status.checking) {
+                            historyHTML += `<div class="timeline-item-icon bg-warning text-light">
+                                <i class="fa fa-ellipsis-h"></i>
+                            </div>`
+                        } else {
+                            historyHTML += `<div class="timeline-item-icon bg-secondary text-light"></div>`
+                        }
+                        historyHTML += `<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 ? user.name : ''}
+                                            ${auditor.status === auditConst.status.checkNoPre ? auditors[index-1].name : ''}
+                                        </span>
+                                    </p>
+                                    <p class="text-muted mb-0">${auditor.role}</p>
+                                </div>
+                            </div>`
+
+                        if (auditor.opinion) {
+                        historyHTML += `<div class="card-body p-3 border-top">
+                            <p style="margin: 0;">${auditor.opinion} </p>
+                        </div>`
+                        }
+                        historyHTML += `</div></div></li>`
+                    }
+                })
+                historyHTML += '</ul></div>'
+                if(idx === auditHistory.length - 1 && auditHistory.length !== 1) {
+                    historyHTML += `<div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
+                    data-idx="${idx + 1}">展开历史审批流程</a></div>`
+                }
+            })
+            $('#audit-list').empty()
+            $('#audit-list').append(historyHTML)
+        })
+    })
+    function formatMoney(s, dot = ',', decimal = 2) {
+        if (!s) {
+            s = 0;
+            return s.toFixed(decimal);
+        }
+        s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(decimal) + '';
+        if (!decimal) {
+            s += '.';
+        }
+        const l = s.split('.')[0].split('').reverse(),
             r = s.split('.')[1];
         let t = '';
         for (let i = 0; i < l.length; i++) {
             t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? dot : '');
         }
-        return t.split('').reverse().join('') + '.' + r;
+        return t.split('').reverse().join('') + (decimal === 0 ? '' : '.' + r);
+    }
+
+    function transFormToChinese(num) {
+        const changeNum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
+        const unit = ['', '十', '百', '千', '万'];
+        num = parseInt(num);
+        const getWan = temp => {
+            const strArr = temp.toString().split('').reverse();
+            let newNum = '';
+            for (let i = 0; i < strArr.length; i++) {
+                newNum = (i == 0 && strArr[i] == 0 ? '' : (i > 0 && strArr[i] == 0 && strArr[i - 1] == 0 ? '' : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i]))) + newNum;
+            }
+            return strArr.length === 2 && newNum.indexOf('一十') !== -1 ? newNum.replace('一十', '十') : newNum;
+        };
+        const overWan = Math.floor(num / 10000);
+        let noWan = num % 10000;
+        if (noWan.toString().length < 4) noWan = '0' + noWan;
+        return overWan ? getWan(overWan) + '万' + getWan(noWan) : getWan(num);
+    }
+
+    function formatDate(date) {
+        if (!date) return '';
+        date = new Date(date)
+        const year = date.getFullYear();
+        let mon = date.getMonth() + 1;
+        let day = date.getDate();
+        let hour = date.getHours();
+        let minute = date.getMinutes();
+        let scond = date.getSeconds();
+        if (mon < 10) {
+            mon = '0' + mon.toString();
+        }
+        if (day < 10) {
+            day = '0' + day.toString();
+        }
+        if (hour < 10) {
+            hour = '0' + hour.toString();
+        }
+        if (minute < 10) {
+            minute = '0' + minute.toString();
+        }
+        if (scond < 10) {
+            scond = '0' + scond.toString();
+        }
+        return `${year}<span>${mon}-${day}</span><span>${hour}:${minute}:${scond}</span>`;
     }
 })

+ 10 - 4
app/public/js/advance_audit.js

@@ -159,6 +159,9 @@ $(document).ready(function () {
             // 截止本期金额文案更新
             $('#p_total2').text(formatMoney(ZhCalc.add(val, p_amount), ',', decimal))
         } else {
+            if (val.toFixed(1) === max.toFixed(1)) {
+                val = max
+            }
             // 支付比例转化
             $(this).val(fixedToSub(val)) // 重新赋值限制只有两位小数
             const cur_m_input = $(`.pay-input[data-type=${reverse(type)}]`)
@@ -310,16 +313,19 @@ function reverse(num){
 }
 
 function formatMoney(s, dot = ',', decimal = 2) {
-    if (!s) return '0.00';
+    if (!s) {
+        s = 0;
+        return s.toFixed(decimal);
+    }
     s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(decimal) + '';
     if (!decimal) {
         s += '.';
     }
-    let l = s.split('.')[0].split('').reverse(),
-        r = s.split('.')[1].slice(0, decimal);
+    const l = s.split('.')[0].split('').reverse(),
+        r = s.split('.')[1];
     let t = '';
     for (let i = 0; i < l.length; i++) {
         t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? dot : '');
     }
-    return t.split('').reverse().join('') + (decimal === 0 ? '' : '.' + r)
+    return t.split('').reverse().join('') + (decimal === 0 ? '' : '.' + r);
 }

+ 1 - 0
app/router.js

@@ -121,6 +121,7 @@ module.exports = app => {
     app.post('/tender/:id/advance/:order/file/upload', sessionAuth, tenderCheck, advanceCheck, 'advanceController.upload');
     app.get('/tender/:id/advance/:order/file/:fid/download', sessionAuth, tenderCheck, 'advanceController.downloadFile');
     app.post('/tender/:id/advance/:order/file/del', sessionAuth, tenderCheck, advanceCheck, 'advanceController.deleteFile');
+    app.post('/tender/:id/advance/:order/auditors', sessionAuth, tenderCheck, advanceCheck, 'advanceController.getAuditors');
 
     // 标段协作办公
     app.get('/tender/:id/cooperation', sessionAuth, tenderCheck, 'tenderController.tenderCooperation');

+ 9 - 9
app/view/advance/detail.ejs

@@ -206,7 +206,7 @@
                                 </td>
                                 <td width="70%">
                                     <% auditHistory.forEach((auditors, idx) => { %>
-                                    <div class="<%- idx < auditHistory.length - 1 ? 'fold-btn' : '' %>">
+                                    <div class="<%- idx < auditHistory.length - 1 ? 'fold-card' : '' %>">
                                         <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) => { %>
@@ -358,20 +358,20 @@
     const curAuditor = JSON.parse('<%- JSON.stringify(ctx.advance.curAuditor) %>');
 
     // 展开历史审核记录
-    $('.table #fold-btn').click(function() {
+    $('td #fold-btn').click(function () {
         const type = $(this).data('target')
+        const auditCard = $(this).parent().parent()
         if (type === 'show') {
             $(this).data('target', 'hide')
-            // 展开历史审核记录
-            $('.table .fold-btn').slideDown('swing', () => {
-                $('.table #end-target').text($(this).data('idx') + '#')
-                $('.table #fold-btn').text('收起历史审核记录')
+            auditCard.find('.fold-card').slideDown('swing', () => {
+                auditCard.find('#end-target').text($(this).data('idx') + '#')
+                auditCard.find('#fold-btn').text('收起历史审核记录')
             })
         } else {
             $(this).data('target', 'show')
-            $('.table .fold-btn').slideUp('swing', () => {
-                $('.table #end-target').text('1#')
-                $('.table #fold-btn').text('展开历史审核记录')
+            auditCard.find('.fold-card').slideUp('swing', () => {
+                auditCard.find('#end-target').text('1#')
+                auditCard.find('#fold-btn').text('展开历史审核记录')
             })
         }
     });

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

@@ -64,10 +64,10 @@
                                 <td class="text-right"><%- ctx.helper.formatMoney(item.prev_amount, ',', decimal)%></td>
                                 <td class="text-right"><%- ctx.helper.formatMoney(item.prev_total_amount, ',', decimal)%></td>
                                 <td><a class="btn btn-sm" href="#file" data-toggle="modal" data-target="#file" data-id="<%- item.id %>"><i
-                                            class="fa fa-paperclip"></i><%- item.fileList.length %></a></td>
+                                            class="fa fa-paperclip"></i> <%- item.fileList.length %></a></td>
                                 <td>
                                     <% if (item.curAuditor) { %>
-                                        <a href="/tender/<%- ctx.tender.id %>/advance/<%- item.id %>/detail" m-order="<%- item.order %>"><%- item.curAuditor.name %><%if (item.curAuditor.role !== '' && item.curAuditor.role !== null) { %>-<%- item.curAuditor.role %><% } %></a>
+                                        <a href="#sp-list" data-toggle="modal" data-target="#sp-list" data-vid="<%- item.id %>"><%- item.curAuditor.name %><%if (item.curAuditor.role !== '' && item.curAuditor.role !== null) { %>-<%- item.curAuditor.role %><% } %></a>
                                     <% } %>
                                     <span class="<%- auditConst.statusClass[item.status] %>">
                                         <%- auditConst.statusString[item.status] %>

+ 68 - 0
app/view/advance/modal.ejs

@@ -19,3 +19,71 @@
         </div>
     </div>
 </div>
+<!--审批流程/结果-->
+<div class="modal fade" id="sp-list" data-backdrop="static">
+    <div class="modal-dialog modal-lg" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">审批流程</h5>
+            </div>
+            <div class="modal-body">
+                <div class="row">
+                    <div class="col-4">
+                        <div class="card mt-3">
+                            <ul class="list-group list-group-flush" id="auditor-list">
+                            </ul>
+                        </div>
+                    </div>
+                    <div class="col-8 modal-height-500" style="overflow: auto" id="audit-list">
+                    </div>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
+<style>
+    .fold-card {
+        display: none;
+    }
+</style>
+<script>
+    // 展开历史审核记录
+    $('#audit-list').on('click', 'a', function() {
+        const type = $(this).data('target')
+        const auditCard = $(this).parent().parent()
+        console.log('auditCard', auditCard)
+        if (type === 'show') {
+            $(this).data('target', 'hide')
+            auditCard.find('.fold-card').slideDown('swing', () => {
+                auditCard.find('#end-target').text($(this).data('idx') + '#')
+                auditCard.find('#fold-btn').text('收起历史审核记录')
+            })
+        } else {
+            $(this).data('target', 'show')
+            auditCard.find('.fold-card').slideUp('swing', () => {
+                auditCard.find('#end-target').text('1#')
+                auditCard.find('#fold-btn').text('展开历史审核记录')
+            })
+        }
+    })
+    // $('td #fold-btn').click(function () {
+    //     const type = $(this).data('target')
+    //     const auditCard = $(this).parent().parent()
+    //     if (type === 'show') {
+    //         $(this).data('target', 'hide')
+    //         auditCard.find('.fold-btn').slideDown('swing', () => {
+    //             auditCard.find('#end-target').text($(this).data('idx') + '#')
+    //             auditCard.find('#fold-btn').text('收起历史审核记录')
+    //         })
+    //     } else {
+    //         $(this).data('target', 'show')
+    //         auditCard.find('.fold-btn').slideUp('swing', () => {
+    //             auditCard.find('#end-target').text('1#')
+    //             auditCard.find('#fold-btn').text('展开历史审核记录')
+    //         })
+    //     }
+    // });
+</script>

+ 13 - 12
app/view/advance/modal_audit.ejs

@@ -78,7 +78,7 @@
                     </div>
                     <div class="col-8 modal-height-500" style="overflow: auto">
                         <% auditHistory.forEach((auditors, idx) => { %>
-                        <div class="<%- idx < auditHistory.length - 1 ? 'fold-btn' : '' %>">
+                        <div class="<%- idx < auditHistory.length - 1 ? 'fold-card' : '' %>">
                             <div class="text-center text-muted"
                                 <%- idx === auditHistory.length - 1 ? `id="end-target"` : "" %>>
                                 <%- idx === auditHistory.length - 1 ? 1 : idx+1 %>#</div>
@@ -204,8 +204,9 @@
                         </div>
                         <!-- 展开/收起历史流程 -->
                         <% if(idx === auditHistory.length - 1 && auditHistory.length !== 1) { %>
-                        <div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
-                                data-idx="<%- 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>
                         <% } %>
                         <% }) %>
                     </div>
@@ -257,7 +258,7 @@
                             </div>
                             <div class="col-8 modal-height-500" style="overflow: auto">
                                 <% auditHistory.forEach((auditors, idx) => { %>
-                                <div class="<%- idx < auditHistory.length - 1 ? 'fold-btn' : '' %>">
+                                <div class="<%- idx < auditHistory.length - 1 ? 'fold-card' : '' %>">
                                     <div class="text-center text-muted"
                                         <%- idx === auditHistory.length - 1 ? `id="end-target"` : "" %>>
                                         <%- idx === auditHistory.length - 1 ? 1 : idx+1 %>#</div>
@@ -449,7 +450,7 @@
                             </div>
                             <div class="col-8 modal-height-500" style="overflow: auto">
                                 <% auditHistory.forEach((auditors, idx) => { %>
-                                <div class="<%- idx < auditHistory.length - 1 ? 'fold-btn' : '' %>">
+                                <div class="<%- idx < auditHistory.length - 1 ? 'fold-card' : '' %>">
                                     <div class="text-center text-muted"
                                         <%- idx === auditHistory.length - 1 ? `id="end-target"` : "" %>>
                                         <%- idx === auditHistory.length - 1 ? 1 : idx+1 %>#</div>
@@ -707,18 +708,18 @@
     // 展开历史审核记录
     $('.modal-body #fold-btn').click(function () {
         const type = $(this).data('target')
+        const auditCard = $(this).parent().parent()
         if (type === 'show') {
             $(this).data('target', 'hide')
-            // 展开历史审核记录
-            $('.modal-body .fold-btn').slideDown('swing', () => {
-                $('.modal-body #end-target').text($(this).data('idx') + '#')
-                $('.modal-body #fold-btn').text('收起历史审核记录')
+            auditCard.find('.fold-card').slideDown('swing', () => {
+                auditCard.find('#end-target').text($(this).data('idx') + '#')
+                auditCard.find('#fold-btn').text('收起历史审核记录')
             })
         } else {
             $(this).data('target', 'show')
-            $('.modal-body .fold-btn').slideUp('swing', () => {
-                $('.modal-body #end-target').text('1#')
-                $('.modal-body #fold-btn').text('展开历史审核记录')
+            auditCard.find('.fold-card').slideUp('swing', () => {
+                auditCard.find('#end-target').text('1#')
+                auditCard.find('#fold-btn').text('展开历史审核记录')
             })
         }
     });