Przeglądaj źródła

fix: 导入原始数据表问题,excel空单元格,可能实际上是有类型的

vian 3 lat temu
rodzic
commit
00fb69c070
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      modules/ration_repository/models/ration_item.js

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

@@ -962,9 +962,9 @@ rationItemDAO.prototype.batchAddFromExcel = async function(rationRepId, data) {
         }
         console.log(typeof tmp[0], tmp[0]);
         // 如果第一个字段为null则是工料机数据,放入上一个数据的工料机字段
-        if (tmp[0] === undefined && Object.keys(lastData).length > 0) {
+        if (!tmp[0] && Object.keys(lastData).length > 0) {
             // 如果不存在对应的工料机库数据则跳过
-            if (stdGLJList[tmp[1]] === undefined) {
+            if (!stdGLJList[tmp[1]]) {
                 const failString = '定额' + lastData.code + '下的' + tmp[1];
                 this.failGLJList.push(failString);
                 continue;