Browse Source

修改导出的逻辑

olym 7 years ago
parent
commit
e97c15e615
1 changed files with 4 additions and 2 deletions
  1. 4 2
      modules/ration_repository/models/ration_item.js

+ 4 - 2
modules/ration_repository/models/ration_item.js

@@ -633,12 +633,14 @@ rationItemDAO.prototype.exportExcelData = async function(rationRepId) {
         rationRepId: rationRepId
     };
     // @todo 限制导出的数量以防内存溢出
-    const rationDataList = await this.getRationItemByCondition(condition, ['name', 'code', 'ID']);
+    const rationDataList = await this.getRationItemByCondition(condition, ['name', 'code', 'ID', 'sectionId', 'feeType']);
 
     // 整理数据
     let rationData = [];
     for (const tmp of rationDataList) {
-        const ration = [null, null, tmp.ID, tmp.code, tmp.name];
+        const sectionId = tmp.sectionId <= 0 || tmp.sectionId === undefined ? null : tmp.sectionId;
+        const feeType = tmp.feeType === '' || tmp.feeType === undefined ? null : tmp.feeType;
+        const ration = [sectionId, feeType, tmp.ID, tmp.code, tmp.name];
         rationData.push(ration);
     }
     const excelData = [['树ID', '取费专业', '定额ID', '定额编码', '定额名']];