瀏覽代碼

报表数据预设,预付款,增加类型显示

MaiXinRong 3 年之前
父節點
當前提交
cb8db69339
共有 3 個文件被更改,包括 9 次插入6 次删除
  1. 4 2
      app/controller/tender_controller.js
  2. 4 3
      app/public/report/js/rpt_other_stage.js
  3. 1 1
      app/view/report/rpt_all_popup.ejs

+ 4 - 2
app/controller/tender_controller.js

@@ -24,6 +24,7 @@ const scheduleConst = require('../const/schedule');
 const changeConst = require('../const/change');
 const tenderInfoModel = require('../lib/tender_info');
 const mapConst = require('../const/map');
+const advanceConst = require('../const/advance');
 
 module.exports = app => {
 
@@ -1409,12 +1410,13 @@ module.exports = app => {
                             break;
                         case 'advance':
                             const advance = await ctx.service.advance.getAllDataByCondition({
-                                columns: [ 'id', 'order', 'status', 'selected' ],
+                                columns: [ 'id', 'order', 'status', 'selected', 'type' ],
                                 where,
-                                orders: [['create_time', 'desc']],
+                                orders: [['type', 'asc'], ['create_time', 'desc']],
                             });
                             advance.forEach(x => {
                                 x.statusStr = auditConst.advance.statusString[x.status];
+                                x.typeStr = advanceConst.typeColMap[x.type].text;
                             });
                             responseData.data[f] = advance;
                             break;

+ 4 - 3
app/public/report/js/rpt_other_stage.js

@@ -1,16 +1,17 @@
 const rptOtherStage = (function (){
     const info = {
-        advance: { title: '请选择预付款', colHeader: ['选择', '期', '审批状态'] },
+        advance: { title: '请选择预付款', colHeader: ['选择', '类型', '期', '审批状态'] },
     };
     const data = {};
     let curType = '';
     const initList = function () {
         const header = info[curType].colHeader;
-        $('#sos-header').html(`<tr class="text-center"><th>${header[0]}</th><th>${header[1]}</th><th>${header[2]}</th></tr>`);
+        const type = info[curType].type;
+        $('#sos-header').html(`<tr class="text-center"><th>${header[0]}</th><th>${header[1]}</th><th>${header[2]}</th><th>${header[3]}</th></tr>`);
         const html = [], arr = data[curType];
         for (const a of arr) {
             const checked = a.selected ? 'checked' : '';
-            html.push('<tr class="text-center">', `<td><input type="checkbox" name="sos-check" ${checked} value="${a.id}"></td>`, `<td>第${a.order}期</td>`, `<td>${a.statusStr}</td>`, '</tr>');
+            html.push('<tr class="text-center">', `<td><input type="checkbox" name="sos-check" ${checked} value="${a.id}"></td>`, `<td>${a.typeStr}</td>`, `<td>第${a.order}期</td>`, `<td>${a.statusStr}</td>`,  '</tr>');
         }
         $('#sos-list').html(html.join(''));
     };

+ 1 - 1
app/view/report/rpt_all_popup.ejs

@@ -544,7 +544,7 @@
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title" id="sos-title">请选择变更令</h5>
+                <h5 class="modal-title" id="sos-title">请选择预付款</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                     <span aria-hidden="true">&times;</span>
                 </button>