Procházet zdrojové kódy

计量期审批流程页面排版更改

laiguoran před 5 roky
rodič
revize
ea99e00780

+ 17 - 0
app/extend/helper.js

@@ -764,6 +764,23 @@ module.exports = {
         }
         return t.split("").reverse().join("") + "." + r;
     },
+    transFormToChinese(num) {
+        const changeNum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
+        const unit = ["", "十", "百", "千", "万"];
+        num = parseInt(num);
+        let getWan = (temp) => {
+            let strArr = temp.toString().split("").reverse();
+            let newNum = "";
+            for (var i = 0; i < strArr.length; i++) {
+                newNum = (i == 0 && strArr[i] == 0 ? "" : (i > 0 && strArr[i] == 0 && strArr[i - 1] == 0 ? "" : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i]))) + newNum;
+            }
+            return newNum;
+        }
+        let overWan = Math.floor(num / 10000);
+        let noWan = num % 10000;
+        if (noWan.toString().length < 4) noWan = "0" + noWan;
+        return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num);
+    },
 
     async sendUserSms(userId, type, judge, msg) {
         const mobiles = [];

+ 30 - 24
app/public/js/measure_stage.js

@@ -19,12 +19,12 @@ $('a[data-target="#sp-list" ]').on('click', function () {
        const auditHistory = result.auditHistory;
        // 生成左边列表流程
        const lefthtml = [];
-       lefthtml.push('<li class="list-group-item"><i class="fa fa fa-play-circle fa-rotate-90"></i> '+ stageAuditor.name +'  <small class="text-muted">'+ stageAuditor.role +'</small></li>');
+       lefthtml.push('<li class="list-group-item"><i class="fa fa fa-play-circle fa-rotate-90"></i> '+ stageAuditor.name +'  <small class="text-muted">'+ stageAuditor.role +'</small><span class="pull-right">原报</span></li>');
        for (const [index,a] of auditors.entries()) {
            if (index+1 === auditors.length) {
-               lefthtml.push('<li class="list-group-item"><i class="fa fa-stop-circle"></i> '+ a.name +'  <small class="text-muted">'+ a.role +'</small></li>');
+               lefthtml.push('<li class="list-group-item"><i class="fa fa-stop-circle"></i> '+ a.name +'  <small class="text-muted">'+ a.role +'</small><span class="pull-right">终审</span></li>');
            } else {
-               lefthtml.push('<li class="list-group-item"><i class="fa fa-chevron-circle-down"></i> '+ a.name +'  <small class="text-muted">'+ a.role +'</small></li>');
+               lefthtml.push('<li class="list-group-item"><i class="fa fa-chevron-circle-down"></i> '+ a.name +'  <small class="text-muted">'+ a.role +'</small><span class="pull-right">' + transFormToChinese(index+1) + '审</span></li>');
            }
        }
        $('#auditor-list').html(lefthtml.join(''));
@@ -36,41 +36,47 @@ $('a[data-target="#sp-list" ]').on('click', function () {
            for (let iA = 0; iA < ah.length; iA++) {
                if (iA === 0) {
                    righthtml.push('<li class="list-group-item">');
-                   righthtml.push('<span class="text-success pull-right">'+ (auditHistory.indexOf(ah) > 0 ? '重新' : '') +'上报</span>');
                    righthtml.push('<h5 class="card-title">');
-                   righthtml.push('<i class="fa fa-play-circle fa-rotate-90 text-success"></i> '+ stageAuditor.name +' <small class="text-muted">'+ stageAuditor.role +'</small></h5>');
-                   righthtml.push('<p class="card-text"><small class="text-muted">' + (ah[iA].begin_time ? moment(ah[iA].begin_time).format('YYYY-MM-DD') : '') + '</small></p></li>');
+                   righthtml.push('<i class="fa fa-play-circle fa-rotate-90 text-success"></i> '+ stageAuditor.name +' <small class="text-muted">'+ stageAuditor.role +'</small><span class="pull-right">原报</span></h5>');
+                   righthtml.push('<div class="ml-3">');
+                   righthtml.push('<span class="text-success"><small>' + (ah[iA].begin_time ? moment(ah[iA].begin_time).format('YYYY-MM-DD') : '') + '</small> '+ (auditHistory.indexOf(ah) > 0 ? '重新' : '') + '上报</span></div></li>');
                    righthtml.push('<li class="list-group-item">');
+                   righthtml.push('<h5 class="card-title"><i class="fa '+ (iA === ah.length - 1 ? 'fa-stop-circle ' : 'fa-chevron-circle-down ') + auditConst.statusClass[ah[iA].status] +'"></i> '+ ah[iA].name +' <small class="text-muted">'+ ah[iA].role +'</small><span class="pull-right">' + (ah[iA].sort === ah[iA].max_sort ? '终' : transFormToChinese(ah[iA].sort)) + '审</span></h5>');
+                   righthtml.push('<div class="ml-3">');
                    if (ah[iA].status !== auditConst.status.uncheck) {
-                       righthtml.push('<span class="'+ auditConst.statusClass[ah[iA].status] +' pull-right">' + auditConst.statusString[ah[iA].status] + (ah[iA].status === auditConst.status.checkNo ? ' ' + stageAuditor.name : '') + '</span>');
-                   }
-                   righthtml.push('<h5 class="card-title"><i class="fa '+ (iA === ah.length - 1 ? 'fa-stop-circle ' : 'fa-chevron-circle-down ') + auditConst.statusClass[ah[iA].status] +'"></i> '+ ah[iA].name +' <small class="text-muted">'+ ah[iA].role +'</small></h5>');
-                   if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) {
-                       righthtml.push('<p class="card-text mb-1">'+ ah[iA].opinion +'</p>');
-                       righthtml.push('<p class="card-text"><small class="text-muted">'+ (ah[iA].end_time ? moment(ah[iA].end_time).format('YYYY-MM-DD') : '') +'</small></p>');
+                       let timeHtml = '';
+                       if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) {
+                           timeHtml = '<small>'+ (ah[iA].end_time ? moment(ah[iA].end_time).format('YYYY-MM-DD') : '') +'</small> ';
+                       }
+                       righthtml.push('<span class="' + auditConst.statusClass[ah[iA].status] +'">'+ timeHtml + auditConst.statusString[ah[iA].status] + (ah[iA].status === auditConst.status.checkNo ? ' ' + stageAuditor.name : '') + '</span>');
                    }
+                   righthtml.push('<p class="card-text">'+ ah[iA].opinion !== null ? ah[iA].opinion : '' +'</p></div>');
                    righthtml.push('</li>');
                } else if (iA === ah.length - 1) {
                    righthtml.push('<li class="list-group-item">');
+                   righthtml.push('<h5 class="card-title"><i class="fa fa-stop-circle '+ auditConst.statusClass[ah[iA].status] +'"></i> '+ ah[iA].name +' <small class="text-muted">'+ ah[iA].role +'</small><span class="pull-right">终审</span></h5>');
+                   righthtml.push('<div class="ml-3">');
                    if (ah[iA].status !== auditConst.status.uncheck) {
-                       righthtml.push('<span class="'+ auditConst.statusClass[ah[iA].status] +' pull-right">' + auditConst.statusString[ah[iA].status] + (ah[iA].status === auditConst.status.checkNo ? ' ' + stageAuditor.name : '') + '</span>');
-                   }
-                   righthtml.push('<h5 class="card-title"><i class="fa fa-stop-circle '+ auditConst.statusClass[ah[iA].status] +'"></i> '+ ah[iA].name +' <small class="text-muted">'+ ah[iA].role +'</small></h5>');
-                   if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) {
-                       righthtml.push('<p class="card-text mb-1">'+ ah[iA].opinion +'</p>');
-                       righthtml.push('<p class="card-text"><small class="text-muted">'+ (ah[iA].end_time ? moment(ah[iA].end_time).format('YYYY-MM-DD') : '') +'</small></p>');
+                       let timeHtml = '';
+                       if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) {
+                           timeHtml = '<small>'+ (ah[iA].end_time ? moment(ah[iA].end_time).format('YYYY-MM-DD') : '') +'</small> ';
+                       }
+                       righthtml.push('<span class="' + auditConst.statusClass[ah[iA].status] +'">' + timeHtml + auditConst.statusString[ah[iA].status] + (ah[iA].status === auditConst.status.checkNo ? ' ' + stageAuditor.name : '') + '</span>');
                    }
+                   righthtml.push('<p class="card-text">'+ ah[iA].opinion !== null ? ah[iA].opinion : '' +'</p></div>');
                    righthtml.push('</li>');
                } else {
                    righthtml.push('<li class="list-group-item">');
+                   righthtml.push('<h5 class="card-title"><i class="fa '+ (iA === ah.length - 1 ? 'fa-stop-circle ' : 'fa-chevron-circle-down ') + auditConst.statusClass[ah[iA].status] +'"></i> '+ ah[iA].name +' <small class="text-muted">'+ ah[iA].role +'</small><span class="pull-right">' + (ah[iA].sort === ah[iA].max_sort ? '终' : transFormToChinese(ah[iA].sort)) + '审</span></h5>');
+                   righthtml.push('<div class="ml-3">');
                    if (ah[iA].status !== auditConst.status.uncheck) {
-                       righthtml.push('<span class="'+ auditConst.statusClass[ah[iA].status] +' pull-right">' + auditConst.statusString[ah[iA].status] + (ah[iA].status === auditConst.status.checkNo ? ' ' + stageAuditor.name : '') + '</span>');
-                   }
-                   righthtml.push('<h5 class="card-title"><i class="fa fa-chevron-circle-down '+ auditConst.statusClass[ah[iA].status] +'"></i> '+ ah[iA].name +' <small class="text-muted">'+ ah[iA].role +'</small></h5>');
-                   if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) {
-                       righthtml.push('<p class="card-text mb-1">'+ ah[iA].opinion +'</p>');
-                       righthtml.push('<p class="card-text"><small class="text-muted">'+ (ah[iA].end_time ? moment(ah[iA].end_time).format('YYYY-MM-DD') : '') +'</small></p>');
+                       let timeHtml = '';
+                       if (ah[iA].status === auditConst.status.checked || ah[iA].status === auditConst.status.checkNo || ah[iA].status === auditConst.status.checkNoPre) {
+                           timeHtml = '<small>'+ (ah[iA].end_time ? moment(ah[iA].end_time).format('YYYY-MM-DD') : '') +'</small> ';
+                       }
+                       righthtml.push('<span class="' + auditConst.statusClass[ah[iA].status] +'">'+ timeHtml + auditConst.statusString[ah[iA].status] + (ah[iA].status === auditConst.status.checkNo ? ' ' + stageAuditor.name : '') + '</span>');
                    }
+                   righthtml.push('<p class="card-text">'+ ah[iA].opinion !== null ? ah[iA].opinion : '' +'</p></div>');
                    righthtml.push('</li>');
                }
            }

+ 19 - 1
app/public/js/number-precision.js

@@ -148,4 +148,22 @@ var NP = (function (exports) {
 
     return exports;
 
-}({}));
+}({}));
+
+function transFormToChinese(num) {
+    const changeNum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
+    const unit = ["", "十", "百", "千", "万"];
+    num = parseInt(num);
+    let getWan = (temp) => {
+        let strArr = temp.toString().split("").reverse();
+        let newNum = "";
+        for (var i = 0; i < strArr.length; i++) {
+            newNum = (i == 0 && strArr[i] == 0 ? "" : (i > 0 && strArr[i] == 0 && strArr[i - 1] == 0 ? "" : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i]))) + newNum;
+        }
+        return newNum;
+    }
+    let overWan = Math.floor(num / 10000);
+    let noWan = num % 10000;
+    if (noWan.toString().length < 4) noWan = "0" + noWan;
+    return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num);
+}

+ 11 - 2
app/public/js/stage_audit.js

@@ -84,10 +84,14 @@ $(document).ready(function () {
                 const auditorshtml = [];
                 // 重新上报时。令其它的审批人流程图标转换
                 $('#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) + '审');
+                }
                 // 添加新审批人
                 auditorshtml.push('<li class="list-group-item" data-auditid="' + data.aid + '">');
                 auditorshtml.push('<i class="fa fa-stop-circle"></i> ');
                 auditorshtml.push(data.name + ' <small class="text-muted">' + data.role + '</small>');
+                auditorshtml.push('<span class="pull-right">终审</span>');
                 auditorshtml.push('</li>');
                 $('#auditors-list').append(auditorshtml.join(''));
 
@@ -97,8 +101,9 @@ $(document).ready(function () {
                 // 添加新审批人
                 auditorshtml2.push('<li class="list-group-item" data-auditid="' + data.aid + '">');
                 auditorshtml2.push('<h5 class="card-title"><i class="fa fa-stop-circle"></i> ');
-                auditorshtml2.push(data.name + ' <small class="text-muted">' + data.role + '</small></h5>');
-                auditorshtml2.push('</li>');
+                auditorshtml2.push(data.name + ' <small class="text-muted">' + data.role + '</small>');
+                auditorshtml2.push('<span class="pull-right">终审</span>');
+                auditorshtml2.push('</h5></li>');
                 $('#auditors-list2').append(auditorshtml2.join(''));
             });
         }
@@ -128,6 +133,10 @@ $(document).ready(function () {
                 $('#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)) + '审');
+            }
         });
     });
     // 退回选择修改审批人流程

+ 12 - 5
app/service/stage_audit.js

@@ -50,11 +50,18 @@ module.exports = app => {
          * @returns {Promise<*>}
          */
         async getAuditors(stageId, times = 1) {
-            const sql = 'SELECT la.`aid`, pa.`name`, pa.`company`, pa.`role`, pa.`mobile`, pa.`telephone`, la.`times`, la.`order`, la.`status`, la.`opinion`, la.`begin_time`, la.`end_time` ' +
-                'FROM ?? AS la, ?? AS pa ' +
-                'WHERE la.`sid` = ? and la.`times` = ? and la.`aid` = pa.`id` order by la.`order`';
-            const sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, stageId, times];
-            return await this.db.query(sql, sqlParam);
+            const sql = 'SELECT la.`aid`, pa.`name`, pa.`company`, pa.`role`, pa.`mobile`, pa.`telephone`, la.`times`, la.`order`, la.`status`, la.`opinion`, la.`begin_time`, la.`end_time`, g.`sort` ' +
+                'FROM ?? AS la, ?? AS pa, (SELECT `aid`,(@i:=@i+1) as `sort` FROM ??, (select @i:=0) as it WHERE `sid` = ? AND `times` = ? GROUP BY `aid`) as g ' +
+                'WHERE la.`sid` = ? and la.`times` = ? and la.`aid` = pa.`id` and g.`aid` = la.`aid` order by la.`order`';
+            const sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, this.tableName, stageId, times, stageId, times];
+            const result = await this.db.query(sql, sqlParam);
+            const sql2 = 'SELECT COUNT(a.`aid`) as num FROM (SELECT `aid` FROM ?? WHERE `sid` = ? AND `times` = ? GROUP BY `aid`) as a';
+            const sqlParam2 = [this.tableName, stageId, times];
+            const count = await this.db.queryOne(sql2, sqlParam2);
+            for (const i in result) {
+                result[i].max_sort = count.num;
+            }
+            return result;
         }
 
         /**

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

@@ -27,7 +27,7 @@
             <input id="tenderName" value="<%= tender.name %>" type="hidden">
             <input id="tenderId" value="<%= tender.id %>" type="hidden">
             <div class="sjs-height-0">
-                <table class="table">
+                <table class="table table-bordered">
                     <thead>
                     <tr>
                         <th width="32%">申请编号/变更令号</th><th width="30%">工程名称</th>

+ 7 - 0
app/view/change/info.ejs

@@ -169,6 +169,7 @@
     </div>
     <div class="content-wrap tab-content">
         <div class="c-body tab-pane active" role="tabpanel" id="info">
+            <div class="sjs-height-0 container-fluid">
             <!--变更信息-->
             <% if (auditStatus === 1 || auditStatus === 2) { %>
             <form action="/change/save?_csrf=<%= ctx.csrf %>" method="post" id="change_form">
@@ -400,9 +401,11 @@
                 </div>
             </div>
             <% } %>
+            </div>
         </div>
 
         <div class="c-body tab-pane first-bill-pane" role="tabpanel" id="bills">
+            <div class="sjs-height-0">
             <!--变更清单-->
             <% if (auditStatus === 1 || auditStatus === 2) { %>
             <table class="table table-striped table-bordered nowrap qd-table table-list" id="tablelist" cellspacing="0" style="width:100%">
@@ -677,9 +680,11 @@
                     </tfoot>
                 </table>
             <% } %>
+            </div>
         </div>
 
         <div class="c-body tab-pane" role="tabpanel" id="files">
+            <div class="sjs-height-0">
             <table class="table table-bordered">
                 <thead>
                 <tr>
@@ -708,6 +713,7 @@
                 <% } %>
                 </tbody>
             </table>
+            </div>
         </div>
     </div>
 </div>
@@ -715,6 +721,7 @@
     let table = '';
     const totalPriceUnit = '<%- tpUnit %>';
     const unitPriceUnit = '<%- upUnit %>';
+    autoFlashHeight();
 </script>
 <script src="/public/js/datatable/jquery.dataTables.min.js"></script>
 <script src="/public/js/datatable/dataTables.bootstrap4.min.js"></script>

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1073 - 906
app/view/stage/audit_modal.ejs