瀏覽代碼

增加序号及增加滚动条

ellisran 10 月之前
父節點
當前提交
c03facd8b4
共有 2 個文件被更改,包括 31 次插入24 次删除
  1. 2 2
      app/service/change.js
  2. 29 22
      app/view/change/modal.ejs

+ 2 - 2
app/service/change.js

@@ -2099,7 +2099,7 @@ module.exports = app => {
 
         async getUncheckList(tid, shenpi_status) {
             const sql = 'select c.* from ?? as c where c.tid = ? ' +
-                'and (c.status = ? OR c.status = ?) AND c.code != "" AND c.name != "" AND c.content is not NULL AND c.content != ""';
+                'and (c.status = ? OR c.status = ?) AND c.code != "" AND c.name != "" AND c.content is not NULL AND c.content != "" ORDER BY CHAR_LENGTH(c.code) DESC,convert(c.code using gbk) DESC';
             const sqlParams = [this.tableName, tid, audit.change.status.uncheck, audit.change.status.checkNo];
             const list = await this.db.query(sql, sqlParams);
             const returnList = [];
@@ -2155,7 +2155,7 @@ module.exports = app => {
         }
 
         async getCheckingList(tid, uid, checking_count = false) {
-            const sql = 'select c.* from ?? as c LEFT JOIN ?? as ca ON c.cid = ca.cid where c.tid = ? and ca.status = ? and ca.uid = ? and ca.usite != 0';
+            const sql = 'select c.* from ?? as c LEFT JOIN ?? as ca ON c.cid = ca.cid where c.tid = ? and ca.status = ? and ca.uid = ? and ca.usite != 0 ORDER BY CHAR_LENGTH(c.code) DESC,convert(c.code using gbk) DESC';
             const sqlParams = [this.tableName, this.ctx.service.changeAudit.tableName, tid, audit.change.status.checking, uid];
             const list = await this.db.query(sql, sqlParams);
             if (checking_count) {

+ 29 - 22
app/view/change/modal.ejs

@@ -217,11 +217,12 @@
                 <div class="row">
                     <!-- 左侧变更令 -->
                     <div class="col-6" >
-                        <div class="modal-height-500" style="overflow-y:auto;">
+                        <div class="modal-height-500" style="height:521px;overflow-y:auto;">
                             <table class="table table-hover table-bordered">
                                 <thead>
                                 <tr>
-                                    <th width="15%" class="text-center"><div class="align-middle"><input id="select-all-uncheck" type="checkbox"></div></th>
+                                    <th width="10%" class="text-center"><div class="align-middle"><input id="select-all-uncheck" type="checkbox"></div></th>
+                                    <th width="7%">序号</th>
                                     <th width="40%">变更令编号</th>
                                     <th width="">原审批流程</th>
                                 </tr>
@@ -271,7 +272,7 @@
                     <div class="progress-tz-bar progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
                 </div>
                 <div class="mt-1 progress-tz-text">台账获取并处理中...</div>
-                <div class="change-progress">
+                <div class="change-progress modal-height-500" style="overflow-y:auto;">
                 </div>
             </div>
             <div class="modal-footer" style="display: none">
@@ -297,6 +298,7 @@
                         <thead>
                         <tr>
                             <th width="5%"><div class="align-middle text-center"><input type="checkbox" id="select-all-checking"></div></th>
+                            <th width="7%">序号</th>
                             <th width="25%">变更令编号</th>
                             <th width="">变更令名称</th>
                             <th width="25%">批量编号</th>
@@ -326,7 +328,7 @@
                     <div class="progress-tz-bar progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
                 </div>
                 <div class="mt-1 progress-tz-text">台账获取并处理中...</div>
-                <div class="change-progress">
+                <div class="change-progress modal-height-500" style="overflow-y:auto;">
                 </div>
             </div>
             <div class="modal-footer" style="display: none">
@@ -385,12 +387,14 @@
                 $('#select-all-uncheck').prop('checked', false);
                 shenpi_status = res.shenpi_status;
                 uncheckList = res.uncheckList;
-                for (const l of res.uncheckList) {
-                    html += '<tr>' +
-                        `<td class="text-center"><input type="checkbox" value="${l.cid}"></td>` +
-                        `<td class=""><a href="/tender/${tenderId}/change/${l.cid}/information" target="_blank">${l.code}</a></td>` +
-                        '<td>' + setAuditList(l.auditList) +'</td>' +
-                        '</tr>';
+                if (res.uncheckList.length > 0) {
+                    for (const [i, l] of res.uncheckList.entries()) {
+                        html += '<tr>' +
+                            `<td class="text-center"><input type="checkbox" value="${l.cid}"></td><td>${i + 1}</td>` +
+                            `<td class=""><a href="/tender/${tenderId}/change/${l.cid}/information" target="_blank">${l.code}</a></td>` +
+                            '<td>' + setAuditList(l.auditList) +'</td>' +
+                            '</tr>';
+                    }
                 }
                 $('#uncheck_list').html(html);
                 if (res.uncheckList.length > 0) {
@@ -511,7 +515,7 @@
                 toastr.success('同步流程成功');
                 uncheckList = res.uncheckList;
                 for (const index in res.uncheckList) {
-                    $('#uncheck_list tr').eq(index).children('td').eq(2).html(setAuditList(res.uncheckList[index].auditList));
+                    $('#uncheck_list tr').eq(index).children('td').eq(3).html(setAuditList(res.uncheckList[index].auditList));
                 }
             });
         });
@@ -741,10 +745,10 @@
                 for (const c of cids) {
                     const cInfo = uncheckList.find(item => item.cid === c);
                     if (cInfo) {
-                        $('#batch-sb-progress .change-progress').append(`<div id="change-${cInfo.cid}-progress"><div class="mt-3 progress">` +
+                        $('#batch-sb-progress .change-progress').append(`<div class="mt-3" id="change-${cInfo.cid}-progress"><div>变更令 <a href="/tender/${cInfo.tid}/change/${cInfo.cid}/information" target="_blank"><b>${cInfo.code}</b></a> :</div><div class="progress">` +
                             '<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>' +
-                    '</div>' +
-                    `<div class="mt-1">变更令 <b>${cInfo.code}</b> <span class="progress-change-text">上报处理中...</span></div></div>`);
+                            '</div>' +
+                    `<div class="mt-1"><span class="progress-change-text">上报处理中...</span></div></div>`);
                         await checkAndChange(cInfo, changeListData, result.changeLedgerList);
                     }
                 }
@@ -758,14 +762,17 @@
                 let html = '';
                 $('#select-all-checking').prop('checked', false);
                 checkingList = res.checkingList;
-                for (const l of res.checkingList) {
-                    const finalHtml = l.is_finalAudit ? `<input type="text" class="form-control form-control-sm final_pcode_input" data-cid="${l.cid}" value="${l.p_code}" />` : '';
-                    html += '<tr>' +
-                        `<td class="text-center"><input type="checkbox" value="${l.cid}"></td>` +
-                        `<td class=""><a href="/tender/${tenderId}/change/${l.cid}/information" target="_blank">${l.code}</a></td>` +
-                        `<td>${l.name}</td>` +
-                        `<td>${finalHtml}</td>` +
-                        '</tr>';
+                if (checkingList.length > 0) {
+                    for (const [i, l] of res.checkingList.entries()) {
+                        const finalHtml = l.is_finalAudit ? `<input type="text" class="form-control form-control-sm final_pcode_input" data-cid="${l.cid}" value="${l.p_code}" />` : '';
+                        html += '<tr>' +
+                            `<td class="text-center"><input type="checkbox" value="${l.cid}"></td>` +
+                            `<td>${i+1}</td>` +
+                            `<td class=""><a href="/tender/${tenderId}/change/${l.cid}/information" target="_blank">${l.code}</a></td>` +
+                            `<td>${l.name}</td>` +
+                            `<td>${finalHtml}</td>` +
+                            '</tr>';
+                    }
                 }
                 $('#checking_list').html(html);
             });