Sfoglia il codice sorgente

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

TonyKang 4 anni fa
parent
commit
022be110a9

+ 1 - 0
.gitignore

@@ -11,3 +11,4 @@ app/public/upload/
 *.swp
 package-lock.json
 app/public/js/web
+.vscode/

+ 2 - 16
app/controller/material_controller.js

@@ -257,7 +257,8 @@ module.exports = app => {
                         mb_id: mbd.id,
                     };
                     for (const m of material_month) {
-                        const one_mm = _.find(materialMonthList, { mb_id: mbd.id, yearmonth: m });
+                        const mb_id = ctx.material.highOrder !== ctx.material.order ? mbd.mb_id : mbd.id;
+                        const one_mm = _.find(materialMonthList, { mb_id, yearmonth: m });
                         one_mb[m] = one_mm.msg_tp;
                     }
                     monthsList.push(one_mb);
@@ -283,21 +284,6 @@ module.exports = app => {
                         _.forEach(result, function(value, key) {
                             renderData.materialBillsData[mindex][key] = result ? result[key] : null;
                         });
-                        // if (result) {
-                        //     renderData.materialBillsData[mindex].quantity = result.quantity;
-                        //     renderData.materialBillsData[mindex].expr = result.expr;
-                        //     renderData.materialBillsData[mindex].msg_tp = result.msg_tp;
-                        //     renderData.materialBillsData[mindex].msg_times = result.msg_times;
-                        //     renderData.materialBillsData[mindex].msg_spread = result.msg_spread;
-                        //     renderData.materialBillsData[mindex].m_up_risk = result.m_up_risk;
-                        //     renderData.materialBillsData[mindex].m_down_risk = result.m_down_risk;
-                        //     renderData.materialBillsData[mindex].m_spread = result.m_spread;
-                        //     renderData.materialBillsData[mindex].pre_tp = result.pre_tp;
-                        // } else {
-                        //     this._.forEach(renderData.materialBillsData[mindex], function(value, key) {
-                        //         renderData.materialBillsData[mindex][key] = null;
-                        //     });
-                        // }
                     }
                 }
                 // 取所有已被调用的工料清单表

+ 11 - 0
app/extend/helper.js

@@ -1216,4 +1216,15 @@ module.exports = {
         const reg = /(.png)|(.gif)|(.txt)|(.jpg)|(.jpeg)|(.pdf)/;
         return reg.test(ext);
     },
+
+    /**
+     * 查找数组中某个字符的个数
+     * @param {Array} array 数组
+     * @param {string} val 字符串
+     * @return {Boolean} 匹配结果
+     */
+    arrayCount(array, val) {
+        const counts = (arr, value) => arr.reduce((a, v) => { return v === value ? a + 1 : a + 0; }, 0);
+        return counts(array, val);
+    },
 };

+ 2 - 6
app/public/css/main.css

@@ -1127,12 +1127,8 @@ a.maintain-icon:hover .fa{
   overflow-y: auto;
 }
 .book-list dt{
-  padding-left:5px;
-  background-color: #e2e6ea
-}
-.book-list dd{
-  padding-left:15px;
-  cursor: pointer;
+  padding:5px 0 5px 5px;
+  background-color: #f2f2f2;
 }
 .book-list dd:hover{
   background-color: #f2f2f2

+ 6 - 7
app/public/js/advance.js

@@ -80,10 +80,12 @@ $(document).ready(function () {
             $('#auditor-list').empty()
             $('#auditor-list').append(auditorsHTML)
             auditHistory.forEach((auditors, idx) => {
+                if(idx === auditHistory.length - 1 && auditHistory.length !== 1) {
+                    historyHTML += `<div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
+                    >展开历史审批流程</a></div>`
+                }
                 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>
+                <div class="text-center text-muted">${idx+1}#</div>
                 <ul class="timeline-list list-unstyled mt-2">`
                 auditors.forEach((auditor, index) => {
                     if (index === 0) {
@@ -200,10 +202,7 @@ $(document).ready(function () {
                     }
                 })
                 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)

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

@@ -175,7 +175,7 @@ $(document).ready(function () {
         return parseFloat(parseFloat(s).toFixed(decimal))
     }
     // 自动转换支付比例和本期金额
-    $('.pay-input').on('input propertychange', function(e) {
+    $('.pay-input').on('change', function(e) {
         let val = parseFloat(e.target.value)
         const p_amount = prevAdvance && prevAdvance.prev_total_amount || 0 // 截止本期金额
         const re_amount = ZhCalc.sub(advancePayTotal, p_amount) // 剩余未付款的总额
@@ -234,7 +234,7 @@ $(document).ready(function () {
                 update(data)
                 clearTimeout(timer)
             }
-        }, 2000);
+        }, 500);
     })
 
     function checkInput() {
@@ -245,7 +245,7 @@ $(document).ready(function () {
         return newVal.cur_amount === oldVal.cur_amount && newVal.remark === oldVal.remark
     }
 
-    $('#ad-remark').on('input propertychange', function(e) {
+    $('#ad-remark').on('change', function(e) {
         const remark = filterText(e.target.value);
         oldVal = {
             pay_ratio: parseFloat($(`.pay-input[data-type=${0}]`).val()),
@@ -259,7 +259,7 @@ $(document).ready(function () {
                 update(data)
                 clearTimeout(timer)
             }
-        }, 2000);
+        }, 500);
     })
 
     function filterText(text) {

+ 5 - 1
app/public/js/material.js

@@ -573,10 +573,14 @@ $(document).ready(() => {
         getValue: {
             average_msg_tp: function (data) {
                 let msg_tp = 0;
+                let hadnum = 0;
                 for (const m of months) {
                     msg_tp += data[m];
+                    if (data[m] !== null && data[m] !== '') {
+                        hadnum++;
+                    }
                 }
-                const average_tp = ZhCalc.round(ZhCalc.div(msg_tp, months.length), 3);
+                const average_tp = hadnum !== 0 ? ZhCalc.round(ZhCalc.div(msg_tp, hadnum), 3) : ZhCalc.round(ZhCalc.div(msg_tp, months.length), 3);
                 return average_tp;
             },
         },

+ 6 - 7
app/public/js/measure_material.js

@@ -41,10 +41,12 @@ $(function () {
             $('#auditor-list').empty()
             $('#auditor-list').append(auditorsHTML)
             auditHistory.forEach((auditors, idx) => {
+                if(idx === auditHistory.length - 1 && auditHistory.length !== 1) {
+                    historyHTML += `<div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
+                    >展开历史审批流程</a></div>`
+                }
                 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>
+                <div class="text-center text-muted">${idx + 1}#</div>
                 <ul class="timeline-list list-unstyled mt-2">`
                 auditors.forEach((auditor, index) => {
                     if (index === 0) {
@@ -161,10 +163,7 @@ $(function () {
                     }
                 })
                 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)

+ 6 - 7
app/public/js/measure_stage.js

@@ -41,10 +41,12 @@ $('a[data-target="#sp-list" ]').on('click', function () {
         $('#auditor-list').empty()
         $('#auditor-list').append(auditorsHTML)
         auditHistory.forEach((auditors, idx) => {
+            if(idx === auditHistory.length - 1 && auditHistory.length !== 1) {
+                historyHTML += `<div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
+                >展开历史审批流程</a></div>`
+            }
             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>
+            <div class="text-center text-muted">${idx + 1}#</div>
             <ul class="timeline-list list-unstyled mt-2">`
             auditors.forEach((auditor, index) => {
                 if (index === 0) {
@@ -161,10 +163,7 @@ $('a[data-target="#sp-list" ]').on('click', function () {
                 }
             })
             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)

+ 2 - 2
app/public/js/shares/cs_tools.js

@@ -195,7 +195,7 @@ const showSideTools = function (show) {
                     {title: '行号', field: 'serialNo', hAlign: 1, width: 40, formatter: '@'},
                     {title: '项目节编号', field: 'code', width: 80, formatter: '@'},
                     {title: '清单编号', field: 'b_code', width: 80, formatter: '@'},
-                    {title: '清单名称', field: 'name', width: 150, formatter: '@'},
+                    {title: '名称', field: 'name', width: 150, formatter: '@'},
                 ],
                 emptyRows: 0,
                 headRows: 1,
@@ -573,4 +573,4 @@ const showSideTools = function (show) {
         });
         return {spread: resultSpread};
     };
-})(jQuery);
+})(jQuery);

+ 11 - 6
app/service/material_month.js

@@ -59,7 +59,8 @@ module.exports = app => {
                         insertArray.push(one_month);
                         if (monthList.length !== 0) {
                             const mb_msg_tp_sum = this._.sumBy(this._.filter(monthList, { mb_id: mb.id }), 'msg_tp');
-                            const new_msg_tp = this.ctx.helper.round(this.ctx.helper.div(this.ctx.helper.add(mb_msg_tp_sum, one_month.msg_tp), material_month.length), 3);
+                            const month_num = material_month.length - this.ctx.helper.arrayCount(this._.concat(this._.map(this._.filter(monthList, { mb_id: mb.id }), 'msg_tp'), one_month.msg_tp), null);
+                            const new_msg_tp = this.ctx.helper.round(this.ctx.helper.div(this.ctx.helper.add(mb_msg_tp_sum, one_month.msg_tp), month_num), 3);
                             const [newmsg_spread, newm_spread] = await this.ctx.service.materialBills.getSpread(mb, new_msg_tp);
                             updateArray.push({
                                 id: mb.id,
@@ -107,7 +108,8 @@ module.exports = app => {
                                 return data.indexOf(m.yearmonth) !== -1;
                             });
                             const mb_msg_tp_sum = this._.sumBy(this._.filter(monthList, { mb_id: mb.id }), 'msg_tp');
-                            const new_msg_tp = material_month.length !== 0 ? this.ctx.helper.round(this.ctx.helper.div(mb_msg_tp_sum, material_month.length), 3) : null;
+                            const month_num = material_month.length - this.ctx.helper.arrayCount(this._.map(this._.filter(monthList, { mb_id: mb.id }), 'msg_tp'), null);
+                            const new_msg_tp = month_num !== 0 ? this.ctx.helper.round(this.ctx.helper.div(mb_msg_tp_sum, month_num), 3) : null;
                             const [newmsg_spread, newm_spread] = await this.ctx.service.materialBills.getSpread(mb, new_msg_tp);
                             updateArray.push({
                                 id: mb.id,
@@ -142,12 +144,14 @@ module.exports = app => {
             const transaction = await this.db.beginTransaction();
             try {
                 const material_month = this.ctx.material.months ? this.ctx.material.months.split(',') : [];
-                await transaction.update(this.tableName, { msg_tp: data.value }, { where: { mb_id: data.mb_id, yearmonth: data.yearmonth } });
-                const monthList = await transaction.select(this.tableName, { where: { mb_id: data.mb_id } });
+                await transaction.update(this.tableName, { msg_tp: data.value }, { where: { mb_id: data.mb_id, yearmonth: data.yearmonth, mid: this.ctx.material.id } });
+                const monthList = await transaction.select(this.tableName, { where: { mb_id: data.mb_id, mid: this.ctx.material.id } });
                 const mbInfo = await transaction.get(this.ctx.service.materialBills.tableName, { id: data.mb_id });
                 if (monthList.length !== 0) {
+                    console.log(monthList);
                     const mb_msg_tp_sum = this._.sumBy(monthList, 'msg_tp');
-                    const new_msg_tp = this.ctx.helper.round(this.ctx.helper.div(mb_msg_tp_sum, material_month.length), 3);
+                    const month_num = material_month.length - this.ctx.helper.arrayCount(this._.map(monthList, 'msg_tp'), null);
+                    const new_msg_tp = month_num !== 0 ? this.ctx.helper.round(this.ctx.helper.div(mb_msg_tp_sum, month_num), 3) : null;
                     const [newmsg_spread, newm_spread] = await this.ctx.service.materialBills.getSpread(mbInfo, new_msg_tp);
                     await transaction.update(this.ctx.service.materialBills.tableName, {
                         id: mbInfo.id,
@@ -198,7 +202,8 @@ module.exports = app => {
                     const mbUpdateArray = [];
                     for (const mb of mbList) {
                         const mb_msg_tp_sum = this._.sumBy(this._.filter(monthList, { mb_id: mb.id }), 'msg_tp');
-                        const new_msg_tp = material_month.length !== 0 ? this.ctx.helper.round(this.ctx.helper.div(mb_msg_tp_sum, material_month.length), 3) : null;
+                        const month_num = material_month.length - this.ctx.helper.arrayCount(this._.map(this._.filter(monthList, { mb_id: mb.id }), 'msg_tp'), null);
+                        const new_msg_tp = month_num !== 0 ? this.ctx.helper.round(this.ctx.helper.div(mb_msg_tp_sum, month_num), 3) : null;
                         const [newmsg_spread, newm_spread] = await this.ctx.service.materialBills.getSpread(mb, new_msg_tp);
                         mbUpdateArray.push({
                             id: mb.id,

+ 2 - 1
app/service/stage_audit.js

@@ -478,6 +478,7 @@ module.exports = app => {
         }
 
         async _checkNo(pid, stageId, checkData, times) {
+            console.log('checkData', checkData);
             const time = new Date();
             // 整理当前流程审核人状态更新
             const audit = await this.getDataByCondition({ sid: stageId, times, status: auditConst.status.checking });
@@ -518,7 +519,7 @@ module.exports = app => {
                         content: noticeContent,
                     });
                 });
-                await transaction.insert('zh_notice', records);
+                await transaction.insert(this.ctx.service.noticePush.tableName, records);
 
                 // 计算并合同支付最终数据
                 const [yfPay, sfPay] = await this.ctx.service.stagePay.calcAllStagePays(this.ctx.stage, transaction);

+ 123 - 125
app/view/advance/detail.ejs

@@ -123,13 +123,13 @@
                                     </div>
                                 </td>
                                 <td width="70%">
-                                    <div class="dropdown">
+                                    <div class="dropdown text-right">
                                         <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button"
                                             id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
                                             aria-expanded="false">
                                             添加审批流程
                                         </button>
-                                        <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"
+                                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton"
                                             style="width:220px">
                                             <div class="mb-2 p-2"><input class="form-control form-control-sm"
                                                     placeholder="姓名/手机 检索" id="gr-search" autocomplete="off"></div>
@@ -212,137 +212,137 @@
                                     </div>
                                 </td>
                                 <td width="70%">
+
                                     <% auditHistory.forEach((auditors, idx) => { %>
-                                    <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) { %>
-                                            <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>
+                                        <!-- 展开/收起历史流程 -->
+                                        <% if(idx === auditHistory.length - 1 && auditHistory.length !== 1) { %>
+                                            <div class="text-right">
+                                                <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                                            </div>
+                                        <% } %>
+                                        <div class="<%- idx < auditHistory.length - 1 ? 'fold-card' : '' %>">
+                                            <div class="text-center text-muted" ><%- 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>
-                                                </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>
-                                                <% } %>
-                                                <% 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] %>"><%- auditConst.statusString[auditor.status] %></span>
-                                                                </p>
-                                                                <p class="text-muted mb-0"><%- auditor.role %></p>
+                                                </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>
+                                                    <% } %>
+                                                    <% 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] %>"><%- auditConst.statusString[auditor.status] %></span>
+                                                                    </p>
+                                                                    <p class="text-muted mb-0"><%- auditor.role %></p>
+                                                                </div>
                                                             </div>
+                                                            <!--审批意见-->
+                                                            <% if (auditor.opinion) { %>
+                                                            <div class="card-body p-3 border-top">
+                                                                <p style="margin: 0;"><%- auditor.opinion %></p>
+                                                            </div>
+                                                            <% } %>
                                                         </div>
-                                                        <!--审批意见-->
-                                                        <% if (auditor.opinion) { %>
-                                                        <div class="card-body p-3 border-top">
-                                                            <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>
-                                                <% } %>
-                                                <% 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>
+                                                </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>
+                                                    <% } %>
+                                                    <% 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>
+                                                            <!--审批意见-->
+                                                            <% if (auditor.opinion) { %>
+                                                            <div class="card-body p-3 border-top">
+                                                                <p style="margin: 0;"><%- auditor.opinion %></p>
+                                                            </div>
+                                                            <% } %>
                                                         </div>
-                                                        <!--审批意见-->
-                                                        <% if (auditor.opinion) { %>
-                                                        <div class="card-body p-3 border-top">
-                                                            <p style="margin: 0;"><%- auditor.opinion %></p>
-                                                        </div>
-                                                        <% } %>
                                                     </div>
-                                                </div>
-                                            </li>
-                                            <% } %>
-                                            <% }) %>
-                                        </ul>
-                                    </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>
-                                    <% } %>
+                                                </li>
+                                                <% } %>
+                                                <% }) %>
+                                            </ul>
+                                        </div>
                                     <% }) %>
                                 </td>
                             </tr>
@@ -374,13 +374,11 @@
         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('展开历史审核记录')
             })
         }

+ 25 - 28
app/view/advance/modal_audit.ejs

@@ -78,10 +78,14 @@
                     </div>
                     <div class="col-8 modal-height-500" style="overflow: auto">
                         <% auditHistory.forEach((auditors, idx) => { %>
+                            <!-- 展开/收起历史流程 -->
+                        <% if(idx === auditHistory.length - 1 && auditHistory.length !== 1) { %>
+                            <div class="text-right">
+                                <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                            </div>
+                        <% } %>
                         <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>
+                            <div class="text-center text-muted"><%- idx+1 %>#</div>
                             <ul class="timeline-list list-unstyled mt-2">
                                 <% auditors.forEach((auditor, index) => { %>
                                 <% if (index === 0) { %>
@@ -202,12 +206,7 @@
                                 <% }) %>
                             </ul>
                         </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>
                 </div>
@@ -258,10 +257,14 @@
                             </div>
                             <div class="col-8 modal-height-500" style="overflow: auto">
                                 <% auditHistory.forEach((auditors, idx) => { %>
+                                    <!-- 展开/收起历史流程 -->
+                                <% if(idx === auditHistory.length - 1 && auditHistory.length !== 1) { %>
+                                    <div class="text-right">
+                                        <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                                    </div>
+                                    <% } %>
                                 <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>
+                                    <div class="text-center text-muted"><%- idx+1 %>#</div>
                                     <ul class="timeline-list list-unstyled mt-2">
                                         <% auditors.forEach((auditor, index) => { %>
                                         <% if (index === 0) { %>
@@ -393,11 +396,7 @@
                                         <% }) %>
                                     </ul>
                                 </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>
                         </div>
@@ -450,10 +449,14 @@
                             </div>
                             <div class="col-8 modal-height-500" style="overflow: auto">
                                 <% auditHistory.forEach((auditors, idx) => { %>
+                                    <!-- 展开/收起历史流程 -->
+                                <% if(idx === auditHistory.length - 1 && auditHistory.length !== 1) { %>
+                                    <div class="text-right">
+                                        <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                                    </div>
+                                    <% } %>
                                 <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>
+                                    <div class="text-center text-muted"><%- idx+1 %>#</div>
                                     <ul class="timeline-list list-unstyled mt-2">
                                         <% auditors.forEach((auditor, index) => { %>
                                         <% if (index === 0) { %>
@@ -628,11 +631,7 @@
                                         <% }) %>
                                     </ul>
                                 </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>
                         </div>
@@ -682,7 +681,7 @@
         scrollBox.scrollTop(0);
         const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
         const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
-        if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 390 && hdheight - bdiv > 390) {
+        if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
             scrollBox.scrollTop(hdheight - bdiv);
         }
     });
@@ -724,13 +723,11 @@
         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('展开历史审核记录')
             })
         }

+ 1 - 1
app/view/change/info_modal.ejs

@@ -776,7 +776,7 @@
         scrollBox.scrollTop(0);
         const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
         const hdheight = hdiv ? hdiv.parents('.list-group-item').offset().top : null;
-        if (hdiv && scrollBox.length &&  scrollBox[0].scrollHeight > 450 && hdheight - bdiv > 450) {
+        if (hdiv && scrollBox.length &&  scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
             scrollBox.scrollTop(hdheight - bdiv);
         }
     });

+ 25 - 28
app/view/ledger/audit_modal.ejs

@@ -37,10 +37,14 @@
                     </div>
                     <div class="col-8 modal-height-500" style="overflow: auto">
                         <% auditHistory.forEach((auditors, idx) => { %>
+                            <!-- 展开/收起历史流程 -->
+                        <% if(idx === auditHistory.length - 1 && auditHistory.length !== 1) { %>
+                            <div class="text-right">
+                                <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                            </div>
+                            <% } %>
                         <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>
+                            <div class="text-center text-muted"><%- idx+1 %>#</div>
                             <ul class="timeline-list list-unstyled mt-2">
                                 <% auditors.forEach((auditor, index) => { %>
                                 <% if (index === 0) { %>
@@ -172,11 +176,7 @@
                                 <% }) %>
                             </ul>
                         </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>
                 </div>
@@ -229,10 +229,14 @@
                     </div>
                     <div class="col-8 modal-height-500" style="overflow: auto">
                         <% auditHistory.forEach((auditors, idx) => { %>
+                            <!-- 展开/收起历史流程 -->
+                        <% if(idx === auditHistory.length - 1 && auditHistory.length !== 1) { %>
+                            <div class="text-right">
+                                <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                            </div>
+                            <% } %>
                         <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>
+                            <div class="text-center text-muted"><%- idx+1 %>#</div>
                             <ul class="timeline-list list-unstyled mt-2">
                                 <% auditors.forEach((auditor, index) => { %>
                                 <% if (index === 0) { %>
@@ -367,11 +371,7 @@
                                 <% }) %>
                             </ul>
                         </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>
                 </div>
@@ -427,10 +427,14 @@
                     </div>
                     <div class="col-8 modal-height-500" style="overflow: auto">
                         <% auditHistory.forEach((auditors, idx) => { %>
+                            <!-- 展开/收起历史流程 -->
+                        <% if(idx === auditHistory.length - 1 && auditHistory.length !== 1) { %>
+                            <div class="text-right">
+                                <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                            </div>
+                        <% } %>
                         <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>
+                            <div class="text-center text-muted"><%- idx+1 %>#</div>
                             <ul class="timeline-list list-unstyled mt-2">
                                 <% auditors.forEach((auditor, index) => { %>
                                 <% if (index === 0) { %>
@@ -551,12 +555,7 @@
                                 <% }) %>
                             </ul>
                         </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>
                 </div>
@@ -580,7 +579,7 @@
         scrollBox.scrollTop(0);
         const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
         const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
-        if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 390 && hdheight - bdiv > 390) {
+        if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
             scrollBox.scrollTop(hdheight - bdiv);
         }
     });
@@ -598,13 +597,11 @@
         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('展开历史审核记录')
             })
         }

+ 10 - 13
app/view/ledger/explode_modal.ejs

@@ -93,13 +93,13 @@
                 <h5 class="modal-title">上报审批</h5>
             </div>
             <div class="modal-body">
-                <div class="dropdown">
+                <div class="dropdown text-right">
                     <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button"
                         id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
                         aria-expanded="false">
                         添加审批流程
                     </button>
-                    <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"
+                    <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton"
                         style="width:220px">
                         <div class="mb-2 p-2"><input class="form-control form-control-sm"
                                 placeholder="姓名/手机 检索" id="gr-search" autocomplete="off"></div>
@@ -187,10 +187,14 @@
                     </div>
                     <div class="col-8 modal-height-500" style="overflow: auto">
                         <% auditHistory.forEach((auditors, idx) => { %>
+                            <!-- 展开/收起历史流程 -->
+                        <% if(idx === auditHistory.length - 1 && auditHistory.length !== 1) { %>
+                            <div class="text-right">
+                                <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                            </div>
+                        <% } %>
                         <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>
+                            <div class="text-center text-muted"><%- idx+1 %>#</div>
                             <ul class="timeline-list list-unstyled mt-2">
                                 <% auditors.forEach((auditor, index) => { %>
                                 <% if (index === 0) { %>
@@ -311,12 +315,7 @@
                                 <% }) %>
                             </ul>
                         </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>
                 </div>
@@ -378,13 +377,11 @@
         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('展开历史审核记录')
             })
         }

+ 20 - 22
app/view/material/audit_modal.ejs

@@ -7,13 +7,13 @@
                 <h5 class="modal-title">上报审批</h5>
             </div>
             <div class="modal-body">
-                <div class="dropdown">
+                <div class="dropdown text-right">
                     <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button"
                         id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
                         aria-expanded="false">
                         添加审批流程
                     </button>
-                    <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"
+                    <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton"
                         style="width:220px">
                         <div class="mb-2 p-2"><input class="form-control form-control-sm"
                                 placeholder="姓名/手机 检索" id="gr-search" autocomplete="off"></div>
@@ -287,10 +287,14 @@
                             </div>
                             <div class="col-8 modal-height-500" style="overflow: auto">
                                 <% ctx.material.auditHistory.forEach((auditors, idx) => { %>
+                                    <!-- 展开/收起历史流程 -->
+                                <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.auditHistory.length !== 1) { %>
+                                    <div class="text-right">
+                                        <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                                    </div>
+                                    <% } %>
                                 <div class="<%- idx < ctx.material.auditHistory.length - 1 ? 'fold-card' : '' %>">
-                                    <div class="text-center text-muted"
-                                        <%- idx === ctx.material.auditHistory.length - 1 ? `id="end-target"` : "" %>>
-                                        <%- idx === ctx.material.auditHistory.length - 1 ? 1 : idx+1 %>#</div>
+                                    <div class="text-center text-muted"><%- idx+1 %>#</div>
                                     <ul class="timeline-list list-unstyled mt-2">
                                         <% auditors.forEach((auditor, index) => { %>
                                         <% if (index === 0) { %>
@@ -422,11 +426,7 @@
                                         <% }) %>
                                     </ul>
                                 </div>
-                                <!-- 展开/收起历史流程 -->
-                                <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.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>
                         </div>
@@ -479,10 +479,14 @@
                             </div>
                             <div class="col-8 modal-height-500" style="overflow: auto">
                                 <% ctx.material.auditHistory.forEach((auditors, idx) => { %>
+                                    <!-- 展开/收起历史流程 -->
+                                <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.auditHistory.length !== 1) { %>
+                                    <div class="text-right">
+                                        <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                                    </div>
+                                    <% } %>
                                 <div class="<%- idx < ctx.material.auditHistory.length - 1 ? 'fold-card' : '' %>">
-                                    <div class="text-center text-muted"
-                                        <%- idx === ctx.material.auditHistory.length - 1 ? `id="end-target"` : "" %>>
-                                        <%- idx === ctx.material.auditHistory.length - 1 ? 1 : idx+1 %>#</div>
+                                    <div class="text-center text-muted"><%- idx+1 %>#</div>
                                     <ul class="timeline-list list-unstyled mt-2">
                                         <% auditors.forEach((auditor, index) => { %>
                                         <% if (index === 0) { %>
@@ -657,11 +661,7 @@
                                         <% }) %>
                                     </ul>
                                 </div>
-                                <!-- 展开/收起历史流程 -->
-                                <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.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>
                         </div>
@@ -682,14 +682,14 @@
     </script>
 <% } %>
 <script>
-    // const cur_uid  = parseInt('<%- ctx.session.sessionUser.accountId %>');
+    const cur_uid  = parseInt('<%- ctx.session.sessionUser.accountId %>');
     $('.sp-location-list').on('shown.bs.modal', function () {
         const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
         const bdiv = (scrollBox.offset() && scrollBox.offset().top) || 0;
         scrollBox.scrollTop(0);
         const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
         const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
-        if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 390 && hdheight - bdiv > 390) {
+        if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
             scrollBox.scrollTop(hdheight - bdiv);
         }
     });
@@ -707,13 +707,11 @@
         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('展开历史审核记录')
             })
         }

+ 3 - 4
app/view/material/info.ejs

@@ -63,15 +63,15 @@
             <div class="c-body col-4">
                 <div class="tab-content" style="width: 100%">
                     <div id="qianyue" class="tab-pane active">
+                        <% if ((material.status === auditConst.status.uncheck || material.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === material.user_id) {%>
                         <div class="sjs-bar-1">
-                            <% if ((material.status === auditConst.status.uncheck || material.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === material.user_id) {%>
                             <div class="pb-1">
                                 <a href="#add-month" data-toggle="modal" data-target="#add-month" class="btn btn-sm btn-primary">创建月信息价</a>
                                 <a href="#remove-month" data-toggle="modal" data-target="#remove-month" class="btn btn-sm btn-outline-danger">移除月信息价</a>
                             </div>
-                            <% } %>
                         </div>
-                        <div id="material-month-spread">
+                        <% } %>
+                        <div class="sjs-height-1" id="material-month-spread">
                         </div>
                     </div>
                 </div>
@@ -103,5 +103,4 @@
     const calcBase = JSON.parse('<%- JSON.stringify(calcBase) %>');
     const months = JSON.parse('<%- JSON.stringify(months) %>');
     let monthsList = JSON.parse('<%- JSON.stringify(monthsList) %>');
-    console.log(monthsList);
 </script>

+ 8 - 11
app/view/revise/history_modal.ejs

@@ -36,10 +36,14 @@
                     </div>
                     <div class="col-8 modal-height-500" style="overflow: auto">
                         <% auditHistory.forEach((auditors, idx) => { %>
+                            <!-- 展开/收起历史流程 -->
+                        <% if(idx === auditHistory.length - 1 && auditHistory.length !== 1) { %>
+                            <div class="text-right">
+                                <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                            </div>
+                        <% } %>
                         <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>
+                            <div class="text-center text-muted"><%- idx+1 %>#</div>
                             <ul class="timeline-list list-unstyled mt-2">
                                 <% auditors.forEach((auditor, index) => { %>
                                 <% if (index === 0) { %>
@@ -160,12 +164,7 @@
                                 <% }) %>
                             </ul>
                         </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>
                 </div>
@@ -184,13 +183,11 @@
         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('展开历史审核记录')
             })
         }

+ 350 - 351
app/view/revise/info_modal.ejs

@@ -44,28 +44,28 @@
                 <h5 class="modal-title">上报审批</h5>
             </div>
             <div class="modal-body">
-                <div class="dropdown">
-                    <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button"
-                        id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
-                        aria-expanded="false">
+                <div class="dropdown text-right">
+                    <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="dropdownMenuButton"
+                        data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                         添加审批流程
                     </button>
-                    <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"
+                    <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton"
                         style="width:220px">
-                        <div class="mb-2 p-2"><input class="form-control form-control-sm"
-                                placeholder="姓名/手机 检索" id="gr-search" autocomplete="off"></div>
+                        <div class="mb-2 p-2"><input class="form-control form-control-sm" placeholder="姓名/手机 检索"
+                                id="gr-search" autocomplete="off"></div>
                         <dl class="list-unstyled book-list">
                             <% accountGroup.forEach((group, idx) => { %>
-                                <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>
-                                <div class="dd-content" data-toggleid="<%- idx %>">
-                                    <% group.groupList.forEach(item => { %>
-                                        <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
-                                            <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
-                                                    class="ml-auto"><%- item.mobile %></span></p>
-                                            <span class="text-muted"><%- item.role %></span>
-                                        </dd>
-                                    <% });%>
-                                </div>
+                            <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>
+                            <div class="dd-content" data-toggleid="<%- idx %>">
+                                <% group.groupList.forEach(item => { %>
+                                <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
+                                    <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
+                                            class="ml-auto"><%- item.mobile %></span></p>
+                                    <span class="text-muted"><%- item.role %></span>
+                                </dd>
+                                <% });%>
+                            </div>
                             <% }) %>
                         </dl>
                     </div>
@@ -75,19 +75,20 @@
                         审批流程
                     </div>
                     <div class="modal-height-500" style="overflow: auto">
-                    <ul class="list-group list-group-flush" id="auditors">
-                        <% for (let i = 0, iLen = auditorList.length; i < iLen; i++) { %>
-                        <li class="list-group-item" auditorId="<%- auditorList[i].audit_id %>">
-                            <a href="javascript: void(0)" class="text-danger pull-right">移除</a>
-                            <%- auditorList[i].audit_order %> <%- auditorList[i].name %>
-                            <small class="text-muted"><%- auditorList[i].role %></small>
-                        </li>
-                        <% } %>
-                    </ul>
+                        <ul class="list-group list-group-flush" id="auditors">
+                            <% for (let i = 0, iLen = auditorList.length; i < iLen; i++) { %>
+                            <li class="list-group-item" auditorId="<%- auditorList[i].audit_id %>">
+                                <a href="javascript: void(0)" class="text-danger pull-right">移除</a>
+                                <%- auditorList[i].audit_order %> <%- auditorList[i].name %>
+                                <small class="text-muted"><%- auditorList[i].role %></small>
+                            </li>
+                            <% } %>
+                        </ul>
                     </div>
                 </div>
             </div>
-            <form class="modal-footer" method="post" action="/tender/<%- ctx.tender.id %>/revise/audit/start" onsubmit="return checkAuditorFrom()">
+            <form class="modal-footer" method="post" action="/tender/<%- ctx.tender.id %>/revise/audit/start"
+                onsubmit="return checkAuditorFrom()">
                 <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
                 <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
                 <button class="btn btn-primary btn-sm" type="submit">确认上报</button>
@@ -97,11 +98,12 @@
 </div>
 <% } %>
 <% if (revise.status === auditConst.status.checking || revise.status === auditConst.status.checkNoPre) { %>
-    <% if (curAuditor && curAuditor.audit_id === ctx.session.sessionUser.accountId) { %>
-    <<!--审批通过-->
+<% if (curAuditor && curAuditor.audit_id === ctx.session.sessionUser.accountId) { %>
+<<!--审批通过-->
     <div class="modal fade sp-location-list" id="sp-done" data-backdrop="static">
         <div class="modal-dialog modal-lg" role="document">
-            <form class="modal-content" action="<%- preUrl %>/revise/audit/check" method="post" onsubmit="return auditCheck(0);">
+            <form class="modal-content" action="<%- preUrl %>/revise/audit/check" method="post"
+                onsubmit="return auditCheck(0);">
                 <div class="modal-header">
                     <h5 class="modal-title">审批通过</h5>
                 </div>
@@ -136,10 +138,14 @@
                         </div>
                         <div class="col-8 modal-height-500" style="overflow: auto">
                             <% auditHistory.forEach((auditors, idx) => { %>
+                            <!-- 展开/收起历史流程 -->
+                            <% if(idx === auditHistory.length - 1 && auditHistory.length !== 1) { %>
+                            <div class="text-right">
+                                <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                            </div>
+                            <% } %>
                             <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>
+                                <div class="text-center text-muted"><%- idx+1 %>#</div>
                                 <ul class="timeline-list list-unstyled mt-2">
                                     <% auditors.forEach((auditor, index) => { %>
                                     <% if (index === 0) { %>
@@ -155,8 +161,7 @@
                                             <div class="card">
                                                 <div class="card-body p-3">
                                                     <div class="card-text">
-                                                        <p class="mb-1"><span
-                                                                class="h5"><%- user.name %></span><span
+                                                        <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>
@@ -271,11 +276,7 @@
                                     <% }) %>
                                 </ul>
                             </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>
                     </div>
@@ -328,10 +329,14 @@
                         </div>
                         <div class="col-8 modal-height-500" style="overflow: auto">
                             <% auditHistory.forEach((auditors, idx) => { %>
+                            <!-- 展开/收起历史流程 -->
+                            <% if(idx === auditHistory.length - 1 && auditHistory.length !== 1) { %>
+                            <div class="text-right">
+                                <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                            </div>
+                            <% } %>
                             <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>
+                                <div class="text-center text-muted"><%- idx+1 %>#</div>
                                 <ul class="timeline-list list-unstyled mt-2">
                                     <% auditors.forEach((auditor, index) => { %>
                                     <% if (index === 0) { %>
@@ -347,8 +352,7 @@
                                             <div class="card">
                                                 <div class="card-body p-3">
                                                     <div class="card-text">
-                                                        <p class="mb-1"><span
-                                                                class="h5"><%- user.name %></span><span
+                                                        <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>
@@ -402,15 +406,16 @@
                                                     <div id="reject-process" class="alert alert-warning"
                                                         style="margin-top: 15px;">
                                                         <div class="form-check form-check-inline">
-                                                            <input class="form-check-input" type="radio" name="checkType"
-                                                                id="inlineRadio1" value="<%- auditConst.status.checkNo %>">
+                                                            <input class="form-check-input" type="radio"
+                                                                name="checkType" id="inlineRadio1"
+                                                                value="<%- auditConst.status.checkNo %>">
                                                             <label class="form-check-label" for="inlineRadio1">退回原报
                                                                 <%- user.name %></label>
                                                         </div>
                                                         <% if (auditor.order > 1 && auditor.audit_id !== auditors[0].audit_id) { %>
                                                         <div class="form-check form-check-inline">
-                                                            <input class="form-check-input" type="radio" name="checkType"
-                                                                id="inlineRadio2"
+                                                            <input class="form-check-input" type="radio"
+                                                                name="checkType" id="inlineRadio2"
                                                                 value="<%- auditConst.status.checkNoPre %>">
                                                             <label class="form-check-label" for="inlineRadio2">退回上一审批人
                                                                 <%- auditors[index-1].name %></label>
@@ -472,26 +477,27 @@
                                                     <label>审批意见<b class="text-danger">*</b></label>
                                                     <textarea class="form-control form-control-sm"
                                                         name="opinion">不同意</textarea>
-                                                        <% if (curAuditor.audit_id === auditor.audit_id ) { %>
-                                                        <div id="reject-process" class="alert alert-warning"
-                                                            style="margin-top: 15px;">
-                                                            <div class="form-check form-check-inline">
-                                                                <input class="form-check-input" type="radio" name="checkType"
-                                                                    id="inlineRadio1" value="<%- auditConst.status.checkNo %>">
-                                                                <label class="form-check-label" for="inlineRadio1">退回原报
-                                                                    <%- user.name %></label>
-                                                            </div>
-                                                            <% if (auditor.order > 1 && auditor.audit_id !== auditors[0].audit_id) { %>
-                                                            <div class="form-check form-check-inline">
-                                                                <input class="form-check-input" type="radio" name="checkType"
-                                                                    id="inlineRadio2"
-                                                                    value="<%- auditConst.status.checkNoPre %>">
-                                                                <label class="form-check-label" for="inlineRadio2">退回上一审批人
-                                                                    <%- auditors[index-1].name %></label>
-                                                            </div>
-                                                            <% } %>
+                                                    <% if (curAuditor.audit_id === auditor.audit_id ) { %>
+                                                    <div id="reject-process" class="alert alert-warning"
+                                                        style="margin-top: 15px;">
+                                                        <div class="form-check form-check-inline">
+                                                            <input class="form-check-input" type="radio"
+                                                                name="checkType" id="inlineRadio1"
+                                                                value="<%- auditConst.status.checkNo %>">
+                                                            <label class="form-check-label" for="inlineRadio1">退回原报
+                                                                <%- user.name %></label>
+                                                        </div>
+                                                        <% if (auditor.order > 1 && auditor.audit_id !== auditors[0].audit_id) { %>
+                                                        <div class="form-check form-check-inline">
+                                                            <input class="form-check-input" type="radio"
+                                                                name="checkType" id="inlineRadio2"
+                                                                value="<%- auditConst.status.checkNoPre %>">
+                                                            <label class="form-check-label" for="inlineRadio2">退回上一审批人
+                                                                <%- auditors[index-1].name %></label>
                                                         </div>
                                                         <% } %>
+                                                    </div>
+                                                    <% } %>
                                                     <% } else { %>
                                                     <p style="margin: 0;"><%- auditor.opinion %></p>
                                                     <% } %>
@@ -506,11 +512,7 @@
                                     <% }) %>
                                 </ul>
                             </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>
                     </div>
@@ -524,213 +526,212 @@
         </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"><%- revise.status === auditConst.status.checking ? '审批流程' : '重新上报' %></h5>
-            </div>
-            <div class="modal-body">
-                <div class="row">
-                    <div class="col-4">
-                        <% if(revise.status === auditConst.status.checkNo) { %>
-                            <a class="sp-list-item" href="#sub-sp" data-toggle="modal" data-target="#sub-sp" id="hideSp">修改审批流程</a>
-                        <% } %>
-                        <div class="card mt-3">
-                            <ul class="list-group list-group-flush">
-                                <% 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>
-                                <% } 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 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"><%- revise.status === auditConst.status.checking ? '审批流程' : '重新上报' %></h5>
+                </div>
+                <div class="modal-body">
+                    <div class="row">
+                        <div class="col-4">
+                            <% if(revise.status === auditConst.status.checkNo) { %>
+                            <a class="sp-list-item" href="#sub-sp" data-toggle="modal" data-target="#sub-sp"
+                                id="hideSp">修改审批流程</a>
+                            <% } %>
+                            <div class="card mt-3">
+                                <ul class="list-group list-group-flush">
+                                    <% 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>
+                                    <% } 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>
-                    <div class="col-8 modal-height-500" style="overflow: auto">
-                        <% auditHistory.forEach((auditors, idx) => { %>
-                        <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) { %>
-                                <li class="timeline-list-item pb-2">
-                                    <div class="timeline-item-date">
-                                        <%- ctx.helper.formatDate(auditor.begin_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 class="col-8 modal-height-500" style="overflow: auto">
+                            <% auditHistory.forEach((auditors, idx) => { %>
+                            <!-- 展开/收起历史流程 -->
+                            <% if(idx === auditHistory.length - 1 && auditHistory.length !== 1) { %>
+                            <div class="text-right">
+                                <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                            </div>
+                            <% } %>
+                            <div class="<%- idx < auditHistory.length - 1 ? 'fold-card' : '' %>">
+                                <div class="text-center text-muted"><%- 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.begin_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>
-                                    </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>
-                                    <% } %>
-                                    <% 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] %>"><%- auditConst.statusString[auditor.status] %></span>
-                                                    </p>
-                                                    <p class="text-muted mb-0"><%- auditor.role %></p>
+                                    </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>
+                                        <% } %>
+                                        <% 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] %>"><%- auditConst.statusString[auditor.status] %></span>
+                                                        </p>
+                                                        <p class="text-muted mb-0"><%- auditor.role %></p>
+                                                    </div>
                                                 </div>
-                                            </div>
 
-                                            <!--审批意见-->
-                                            <% if (auditor.opinion) { %>
-                                            <div class="card-body p-3 border-top">
-                                                <p style="margin: 0;"><%- auditor.opinion %></p>
+                                                <!--审批意见-->
+                                                <% if (auditor.opinion) { %>
+                                                <div class="card-body p-3 border-top">
+                                                    <p style="margin: 0;"><%- auditor.opinion %></p>
+                                                </div>
+                                                <% } %>
                                             </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>
-                                    <% } %>
-                                    <% 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
+                                        </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>
+                                        <% } %>
+                                        <% 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 ? user.name : '' %>
-                                                            <%- auditor.status === auditConst.status.checkNoPre ? auditors[index-1].name : '' %>
-                                                        </span>
-                                                    </p>
-                                                    <p class="text-muted mb-0"><%- auditor.role %></p>
+                                                                <%- 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) { %>
+                                                <div class="card-body p-3 border-top">
+                                                    <p style="margin: 0;"><%- auditor.opinion %></p>
+                                                </div>
+                                                <% } %>
                                             </div>
-                                            <!--审批意见-->
-                                            <% if (auditor.opinion) { %>
-                                            <div class="card-body p-3 border-top">
-                                                <p style="margin: 0;"><%- auditor.opinion %></p>
-                                            </div>
-                                            <% } %>
                                         </div>
-                                    </div>
-                                </li>
-                                <% } %>
-                                <% }) %>
-                            </ul>
-                        </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>
+                                    </li>
+                                    <% } %>
+                                    <% }) %>
+                                </ul>
                             </div>
-                        <% } %>
-                        <% }) %>
+                            <% }) %>
+                        </div>
                     </div>
                 </div>
-            </div>
-            <form class="modal-footer" method="post" action="<%- preUrl %>/revise/audit/start" onsubmit="return checkAuditorFrom()">
-                <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
-                <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
-                <% if(revise.status === auditConst.status.checkNo && ctx.session.sessionUser.accountId === revise.uid) { %>
+                <form class="modal-footer" method="post" action="<%- preUrl %>/revise/audit/start"
+                    onsubmit="return checkAuditorFrom()">
+                    <input type="hidden" name="_csrf" value="<%= ctx.csrf %>">
+                    <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
+                    <% if(revise.status === auditConst.status.checkNo && ctx.session.sessionUser.accountId === revise.uid) { %>
                     <button class="btn btn-primary btn-sm sp-list-item" type="submit">确认上报</button>
-                <% } %>
-            </form>
+                    <% } %>
+                </form>
+            </div>
         </div>
     </div>
-</div>
-<% include ../shares/merge_peg_modal.ejs %>
-<% include ../shares/import_excel_modal.ejs %>
-<% include ../shares/delete_hint_modal.ejs %>
-<% include ../shares/check_data_modal.ejs %>
-<% include ../shares/ledger_check_modal.ejs %>
-<% if(ctx.session.sessionUser.accountId === revise.uid && (revise.status === auditConst.status.uncheck || revise.status === auditConst.status.checkNo)) { %>
+    <% include ../shares/merge_peg_modal.ejs %>
+    <% include ../shares/import_excel_modal.ejs %>
+    <% include ../shares/delete_hint_modal.ejs %>
+    <% include ../shares/check_data_modal.ejs %>
+    <% include ../shares/ledger_check_modal.ejs %>
+    <% if(ctx.session.sessionUser.accountId === revise.uid && (revise.status === auditConst.status.uncheck || revise.status === auditConst.status.checkNo)) { %>
     <script>
         const cur_uid = '<%- ctx.session.sessionUser.accountId %>';
         const accountList = JSON.parse('<%- JSON.stringify(accountList) %>');
-        const accountGroup  = JSON.parse('<%- JSON.stringify(accountGroup ) %>');
+        const accountGroup = JSON.parse('<%- JSON.stringify(accountGroup ) %>');
         let timer = null;
         let oldSearchVal = null;
 
-        $('#gr-search').bind('input propertychange', function(e) {
+        $('#gr-search').bind('input propertychange', function (e) {
             oldSearchVal = e.target.value
             timer && clearTimeout(timer)
             timer = setTimeout(() => {
                 const newVal = $('#gr-search').val()
                 let html = ''
                 if (newVal && newVal === oldSearchVal) {
-                    accountList.filter(item => item  && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
+                    accountList.filter(item => item && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
                         html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
                             <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
                                     class="ml-auto">${item.mobile || ''}</span></p>
@@ -784,8 +785,8 @@
                     // 重新上报时。令其它的审批人流程图标转换
                     $('#auditors-list li i').removeClass('fa-stop-circle').addClass('fa-chevron-circle-down');
                     for (let i = 0; i < $('#auditors-list li').length; i++) {
-                        $('#auditors-list li').eq(i).find('.pull-right').text(transFormToChinese(i+1) + '审');
-                        $('#auditors-list2 li').eq(i).find('.pull-right').text(transFormToChinese(i+1) + '审');
+                        $('#auditors-list li').eq(i).find('.pull-right').text(transFormToChinese(i + 1) + '审');
+                        $('#auditors-list2 li').eq(i).find('.pull-right').text(transFormToChinese(i + 1) + '审');
                     }
                     // 添加新审批人
                     auditorshtml.push('<li class="list-group-item" data-auditid="' + data.audit_id + '">');
@@ -825,17 +826,17 @@
                 // 令最后一个图标转换
                 $('#auditors-list li[data-auditid="' + data.auditorId + '"]').remove();
                 if ($('#auditors-list li').length !== 0 && !$('#auditors-list li i').hasClass('fa-stop-circle')) {
-                    $('#auditors-list li').eq($('#auditors-list li').length-1).children('i')
+                    $('#auditors-list li').eq($('#auditors-list li').length - 1).children('i')
                         .removeClass('fa-chevron-circle-down').addClass('fa-stop-circle');
                 }
                 $('#auditors-list2 li[data-auditid="' + data.auditorId + '"]').remove();
                 if ($('#auditors-list2 li').length !== 0 && !$('#auditors-list2 li i').hasClass('fa-stop-circle')) {
-                    $('#auditors-list2 li').eq($('#auditors-list2 li').length-1).children('i')
+                    $('#auditors-list2 li').eq($('#auditors-list2 li').length - 1).children('i')
                         .removeClass('fa-chevron-circle-down').addClass('fa-stop-circle');
                 }
                 for (let i = 0; i < $('#auditors-list li').length; i++) {
-                    $('#auditors-list li').eq(i).find('.pull-right').text((i+1 === $('#auditors-list li').length ? '终' : transFormToChinese(i+1)) + '审');
-                    $('#auditors-list2 li').eq(i).find('.pull-right').text((i+1 === $('#auditors-list2 li').length ? '终' : transFormToChinese(i+1)) + '审');
+                    $('#auditors-list li').eq(i).find('.pull-right').text((i + 1 === $('#auditors-list li').length ? '终' : transFormToChinese(i + 1)) + '审');
+                    $('#auditors-list2 li').eq(i).find('.pull-right').text((i + 1 === $('#auditors-list2 li').length ? '终' : transFormToChinese(i + 1)) + '审');
                 }
             });
         });
@@ -868,108 +869,106 @@
             $(document.body).addClass('modal-open');
         });
     </script>
-<% } %>
-<script>
-    $('.sp-list-btn').click(function () {
-        const type = $(this).data('type')
-        if (type === 'hide') {
-            $('.sp-list-item').hide()
-            $('.modal-title').text('审批流程')
-        } else {
-            $('.sp-list-item').show()
-            $('.modal-title').text('重新上报')
-        }
-    });
-    // 检查上报情况
-    function checkAuditorFrom () {
-        const content = $('#content').val();
-        const orgContent = $('#content').attr('org-value');
-        if (!content || content === '') {
-            toastr.error('请先填写修订内容,再上报数据');
-            return false;
-        } else if (orgContent !== content) {
-            toastr.warning('修订内容未保存,请先保存,再上报数据');
-            return false;
-        }
-        if ($('#auditors li').length === 0) {
-            toastr.error('请先选择审批人,再上报数据');
-            return false;
+    <% } %>
+    <script>
+        $('.sp-list-btn').click(function () {
+            const type = $(this).data('type')
+            if (type === 'hide') {
+                $('.sp-list-item').hide()
+                $('.modal-title').text('审批流程')
+            } else {
+                $('.sp-list-item').show()
+                $('.modal-title').text('重新上报')
+            }
+        });
+        // 检查上报情况
+        function checkAuditorFrom() {
+            const content = $('#content').val();
+            const orgContent = $('#content').attr('org-value');
+            if (!content || content === '') {
+                toastr.error('请先填写修订内容,再上报数据');
+                return false;
+            } else if (orgContent !== content) {
+                toastr.warning('修订内容未保存,请先保存,再上报数据');
+                return false;
+            }
+            if ($('#auditors li').length === 0) {
+                toastr.error('请先选择审批人,再上报数据');
+                return false;
+            }
+            $('#hide-all').show();
+            return true;
         }
-        $('#hide-all').show();
-        return true;
-    }
 
-    // texterea换行
-    function auditCheck(i) {
-        const inlineRadio1 = $('#inlineRadio1:checked').val()
-        const inlineRadio2 = $('#inlineRadio2:checked').val()
-        const opinion = $('textarea[name="opinion"]').eq(i).val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
-        $('textarea[name="opinion"]').eq(i).val(opinion);
-        if (i === 1) {
-            if (!inlineRadio1 && !inlineRadio2) {
-                if (!$('#warning-text').length) {
-                    $('#reject-process').prepend('<p id="warning-text" style="color: red; margin: 0;">请选择退回流程</p>');
+        // texterea换行
+        function auditCheck(i) {
+            const inlineRadio1 = $('#inlineRadio1:checked').val()
+            const inlineRadio2 = $('#inlineRadio2:checked').val()
+            const opinion = $('textarea[name="opinion"]').eq(i).val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' ');
+            $('textarea[name="opinion"]').eq(i).val(opinion);
+            if (i === 1) {
+                if (!inlineRadio1 && !inlineRadio2) {
+                    if (!$('#warning-text').length) {
+                        $('#reject-process').prepend('<p id="warning-text" style="color: red; margin: 0;">请选择退回流程</p>');
+                    }
+                    return false;
                 }
-                return false;
+                if ($('#warning-text').length) $('#warning-text').remove()
             }
-            if ($('#warning-text').length) $('#warning-text').remove()
-        }
-        return true;
-    }
-    $('.sp-location-list').on('shown.bs.modal', function () {
-        const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
-        const bdiv = (scrollBox.offset() && scrollBox.offset().top) || 0;
-        scrollBox.scrollTop(0);
-        const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
-        const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
-        if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 390 && hdheight - bdiv > 390) {
-            scrollBox.scrollTop(hdheight - bdiv);
-        }
-    });
-    function divSearch(div) {
-        if (div.length > 0) {
             return true;
         }
-        return false;
-    }
+        $('.sp-location-list').on('shown.bs.modal', function () {
+            const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
+            const bdiv = (scrollBox.offset() && scrollBox.offset().top) || 0;
+            scrollBox.scrollTop(0);
+            const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
+            const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
+            if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
+                scrollBox.scrollTop(hdheight - bdiv);
+            }
+        });
+        function divSearch(div) {
+            if (div.length > 0) {
+                return true;
+            }
+            return false;
+        }
 
-    // 退回选择修改审批人流程
-    $('#hideSp').click(function () {
-        $('#sp-list').modal('hide');
-    });
-    $('a[f-target]').click(function () {
-        $($(this).attr('f-target')).modal('show');
-    });
+        // 退回选择修改审批人流程
+        $('#hideSp').click(function () {
+            $('#sp-list').modal('hide');
+        });
+        $('a[f-target]').click(function () {
+            $($(this).attr('f-target')).modal('show');
+        });
 
-    // 多层modal关闭后的滚动bug修复
-    $('#sp-list').on('hidden.bs.modal', function (e) {
-        $(document.body).addClass('modal-open');
-    });
+        // 多层modal关闭后的滚动bug修复
+        $('#sp-list').on('hidden.bs.modal', function (e) {
+            $(document.body).addClass('modal-open');
+        });
 
-    // 展开历史审核记录
-    $('.modal-body #fold-btn').click(function () {
-        const type = $(this).data('target')
-        const auditCard = $(this).parent().parent()
-        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('展开历史审核记录')
-            })
-        }
-    });
-    // 检查上报情况
-    function checkAuditorFrom () {
-        if ($('#auditors li').length === 0) {
-            toast('请先选择审批人,再上报数据', 'error', 'exclamation-circle');
-            return false;
+        // 展开历史审核记录
+        $('.modal-body #fold-btn').click(function () {
+            const type = $(this).data('target')
+            const auditCard = $(this).parent().parent()
+            if (type === 'show') {
+                $(this).data('target', 'hide')
+                auditCard.find('.fold-card').slideDown('swing', () => {
+                    auditCard.find('#fold-btn').text('收起历史审核记录')
+                })
+            } else {
+                $(this).data('target', 'show')
+                auditCard.find('.fold-card').slideUp('swing', () => {
+                    auditCard.find('#fold-btn').text('展开历史审核记录')
+                })
+            }
+        });
+        // 检查上报情况
+        function checkAuditorFrom() {
+            if ($('#auditors li').length === 0) {
+                toast('请先选择审批人,再上报数据', 'error', 'exclamation-circle');
+                return false;
+            }
+            $('#hide-all').show();
         }
-        $('#hide-all').show();
-    }
-</script>
+    </script>

+ 5 - 9
app/view/revise/modal.ejs

@@ -114,10 +114,11 @@
                 $('#auditor-list').empty()
                 $('#auditor-list').append(auditorsHTML)
                 auditHistory.forEach((auditors, idx) => {
+                    if(idx === auditHistory.length - 1 && auditHistory.length !== 1) {
+                        historyHTML += `<div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a></div>`
+                    }
                     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>
+                    <div class="text-center text-muted">${idx + 1}#</div>
                     <ul class="timeline-list list-unstyled mt-2">`
                     auditors.forEach((auditor, index) => {
                         if (index === 0) {
@@ -234,10 +235,7 @@
                         }
                     })
                     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)
@@ -278,13 +276,11 @@
         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('展开历史审核记录')
             })
         }

+ 3 - 3
app/view/shares/ledger_check_modal.ejs

@@ -65,7 +65,7 @@
             $('[name=check-status]', '#ledger-check-modal').removeClass('text-success').addClass('text-muted').html('待检查');
             $('#ledger-check-begin').show();
             $('#ledger-check-waiting').hide();
-            $('#ledger-check-hint').hide();
+            $('#ledger-check-hint').removeClass('text-warning').addClass('text-success').html('检查完成,现在您可以查看结果。').hide();
             $('#ledger-check-show').hide();
         }
 
@@ -181,7 +181,7 @@
             $('#ledger-check-waiting').hide();
             setting.checkList.clearCheckData();
             if (checkData.warning_data.length > 0) {
-                $('#ledger-check-hint').html('检查完成,现在您可以查看结果。').show();
+                $('#ledger-check-hint').removeClass('text-success').addClass('text-warning').html('检查完成,发现问题,请查阅检查结果。').show();
                 $('#ledger-check-show').show();
                 setting.checkList.loadCheckData(checkData);
             } else {
@@ -198,4 +198,4 @@
             setting.checkList.show();
         });
     }
-</script>
+</script>

+ 134 - 138
app/view/stage/audit_modal.ejs

@@ -8,14 +8,14 @@
                     <h5 class="modal-title">上报审批</h5>
                 </div>
                 <div class="modal-body">
-                    <div class="dropdown">
+                    <div class="dropdown text-right">
                         <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="dropdownMenuButton"
                             data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                             添加审批流程
                         </button>
-                        <div class="dropdown-menu" aria-labelledby="dropdownMenuButton" style="width:220px">
+                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton" style="width:220px">
                             <div class="mb-2 p-2"><input class="form-control form-control-sm" placeholder="姓名/手机 检索"
-                                    id="gr-search"></div>
+                                    id="gr-search" autocomplete="off"></div>
                             <dl class="list-unstyled book-list">
                                 <% accountGroup.forEach((group, idx) => { %>
                                 <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
@@ -106,137 +106,137 @@
                             </div>
                         </div>
                         <div class="col-8 modal-height-500" style="overflow: auto">
+
                             <% ctx.stage.auditHistory.forEach((auditors, idx) => { %>
-                            <div class="<%- idx < ctx.stage.auditHistory.length - 1 ? 'fold-card' : '' %>">
-                                <div class="text-center text-muted"
-                                    <%- idx === ctx.stage.auditHistory.length - 1 ? `id="end-target"` : "" %>>
-                                    <%- idx === ctx.stage.auditHistory.length - 1 ? 1 : 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.begin_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"><%- ctx.stage.user.name %></span><span
-                                                                class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
-                                                        </p>
-                                                        <p class="text-muted mb-0"><%- ctx.stage.user.role %></p>
+                                <!-- 展开/收起历史流程 -->
+                                <% if(idx === ctx.stage.auditHistory.length - 1 && ctx.stage.auditHistory.length !== 1) { %>
+                                    <div class="text-right">
+                                        <a href="javascript: void(0);" id="fold-btn" data-target="show" >展开历史审批流程</a>
+                                    </div>
+                                <% } %>
+                                <div class="<%- idx < ctx.stage.auditHistory.length - 1 ? 'fold-card' : '' %>">
+                                    <div class="text-center text-muted"><%- 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.begin_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"><%- ctx.stage.user.name %></span><span
+                                                                    class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
+                                                            </p>
+                                                            <p class="text-muted mb-0"><%- ctx.stage.user.role %></p>
+                                                        </div>
                                                     </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>
-                                        <% } %>
-                                        <% 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] %>"><%- auditConst.statusString[auditor.status] %></span>
-                                                        </p>
-                                                        <p class="text-muted mb-0"><%- auditor.role %></p>
+                                        </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>
+                                            <% } %>
+                                            <% 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] %>"><%- auditConst.statusString[auditor.status] %></span>
+                                                            </p>
+                                                            <p class="text-muted mb-0"><%- auditor.role %></p>
+                                                        </div>
                                                     </div>
-                                                </div>
 
-                                                <!--审批意见-->
-                                                <% if (auditor.opinion) { %>
-                                                <div class="card-body p-3 border-top">
-                                                    <p style="margin: 0;"><%- auditor.opinion %></p>
+                                                    <!--审批意见-->
+                                                    <% if (auditor.opinion) { %>
+                                                    <div class="card-body p-3 border-top">
+                                                        <p style="margin: 0;"><%- auditor.opinion %></p>
+                                                    </div>
+                                                    <% } %>
                                                 </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>
-                                        <% } %>
-                                        <% 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 ? ctx.stage.user.name : '' %>
-                                                                <%- auditor.status === auditConst.status.checkNoPre ? auditors[index-1].name : '' %>
-                                                            </span>
-                                                        </p>
-                                                        <p class="text-muted mb-0"><%- auditor.role %></p>
+                                        </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>
+                                            <% } %>
+                                            <% 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 ? ctx.stage.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) { %>
+                                                    <div class="card-body p-3 border-top">
+                                                        <p style="margin: 0;"><%- auditor.opinion %></p>
+                                                    </div>
+                                                    <% } %>
                                                 </div>
-                                                <!--审批意见-->
-                                                <% if (auditor.opinion) { %>
-                                                <div class="card-body p-3 border-top">
-                                                    <p style="margin: 0;"><%- auditor.opinion %></p>
-                                                </div>
-                                                <% } %>
                                             </div>
-                                        </div>
-                                    </li>
-                                    <% } %>
-                                    <% }) %>
-                                </ul>
-                            </div>
-                            <!-- 展开/收起历史流程 -->
-                            <% if(idx === ctx.stage.auditHistory.length - 1 && ctx.stage.auditHistory.length !== 1) { %>
-                            <div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
-                                    data-idx="<%- idx + 1 %>">展开历史审批流程</a>
-                            </div>
-                            <% } %>
+                                        </li>
+                                        <% } %>
+                                        <% }) %>
+                                    </ul>
+                                </div>
+
                             <% }) %>
                         </div>
                     </div>
@@ -293,10 +293,14 @@
                         </div>
                         <div class="col-8 modal-height-500" style="overflow: auto">
                             <% ctx.stage.auditHistory.forEach((auditors, idx) => { %>
+                                <!-- 展开/收起历史流程 -->
+                            <% if(idx === ctx.stage.auditHistory.length - 1 && ctx.stage.auditHistory.length !== 1) { %>
+                                <div class="text-right">
+                                    <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
+                                </div>
+                                <% } %>
                             <div class="<%- idx < ctx.stage.auditHistory.length - 1 ? 'fold-card' : '' %>">
-                                <div class="text-center text-muted"
-                                    <%- idx === ctx.stage.auditHistory.length - 1 ? `id="end-target"` : "" %>>
-                                    <%- idx === ctx.stage.auditHistory.length - 1 ? 1 : idx+1 %>#</div>
+                                <div class="text-center text-muted"><%- idx+1 %>#</div>
                                 <ul class="timeline-list list-unstyled mt-2">
                                     <% auditors.forEach((auditor, index) => { %>
                                     <% if (index === 0) { %>
@@ -428,11 +432,7 @@
                                     <% }) %>
                                 </ul>
                             </div>
-                            <!-- 展开/收起历史流程 -->
-                            <% if(idx === ctx.stage.auditHistory.length - 1 && ctx.stage.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>
                     </div>
@@ -486,9 +486,7 @@
                         <div class="col-8 modal-height-500" style="overflow: auto">
                             <% ctx.stage.auditHistory.forEach((auditors, idx) => { %>
                             <div class="<%- idx < ctx.stage.auditHistory.length - 1 ? 'fold-card' : '' %>">
-                                <div class="text-center text-muted"
-                                    <%- idx === ctx.stage.auditHistory.length - 1 ? `id="end-target"` : "" %>>
-                                    <%- idx === ctx.stage.auditHistory.length - 1 ? 1 : idx+1 %>#</div>
+                                <div class="text-center text-muted"><%- idx+1 %>#</div>
                                 <ul class="timeline-list list-unstyled mt-2">
                                     <% auditors.forEach((auditor, index) => { %>
                                     <% if (index === 0) { %>
@@ -855,7 +853,7 @@
         function auditCheck(i) {
             const checkType = parseInt($(i === 0 ? '[name=checkType]' : '[name=checkType]:checked').val())
             const data = {
-                opinion: $('[name=opinion]').val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
+                opinion: $(`${i === 0 ? '#sp-done' : '#sp-back'}`).find('[name=opinion]').val().replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>').replace(/\s/g, ' '),
                 checkType,
             }
             if (i === 1) {
@@ -914,7 +912,7 @@
         scrollBox.scrollTop(0);
         const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
         const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
-        if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 390 && hdheight - bdiv > 390) {
+        if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
             scrollBox.scrollTop(hdheight - bdiv);
         }
     });
@@ -932,13 +930,11 @@
         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('展开历史审核记录')
             })
         }

+ 1 - 1
app/view/stage/index.ejs

@@ -589,7 +589,7 @@
     let attData = JSON.parse('<%- JSON.stringify(attData) %>');
     const ckColSetting = 'stage-col-visible-1.0.3-<%- tender.id %>';
     const auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
-    const cur_uid = '<%- ctx.session.sessionUser.accountId %>';
+    const cur_uid = parseInt('<%- ctx.session.sessionUser.accountId %>');
     const curAuditor = JSON.parse('<%- JSON.stringify(curAuditor) %>');
     const thirdParty = JSON.parse('<%- JSON.stringify(thirdParty) %>');
 </script>