浏览代码

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

MaiXinRong 5 年之前
父节点
当前提交
16d466ef1a
共有 1 个文件被更改,包括 16 次插入4 次删除
  1. 16 4
      app/public/js/change_set.js

+ 16 - 4
app/public/js/change_set.js

@@ -615,6 +615,8 @@ function tableDataRemake(changeListData) {
             //     toastr.warning('台账清单列表已不存在'+ clinfo[0] +',故删除之');
             //     continue;
             // }
+            console.log(listinfo);
+            console.log(clinfo);
             if (listinfo === undefined) {
                 // 针对旧数据获取清单信息
                 listinfo = changeListData[clinfo[8] - 1];
@@ -629,7 +631,13 @@ function tableDataRemake(changeListData) {
                     const leafInfo = listinfo.leafXmjs.find(function (item) {
                         return (item.bwmx === undefined || item.bwmx === clinfo[2]) && (item.quantity !== null ? item.quantity === parseFloat(clinfo[5]) : 0 === parseFloat(clinfo[5]));
                     });
-                    pushbwmx = leafInfo.code + '_' + (leafInfo.bwmx !== undefined ? leafInfo.bwmx : '') + ';' + (leafInfo.quantity !== null ? leafInfo.quantity : 0);
+                    if (leafInfo) {
+                        pushbwmx = leafInfo.code + '_' + (leafInfo.bwmx !== undefined ? leafInfo.bwmx : '') + ';' + (leafInfo.quantity !== null ? leafInfo.quantity : 0);
+                    } else {
+                        toastr.warning('台账清单列表已不存在'+ clinfo[0] +',已更新变更清单列表');
+                        changeList.splice(index, 1);
+                        continue;
+                    }
                 } else {
                     pushbwmx = '0;' + (listinfo.quantity !== null ? listinfo.quantity : 0);
                 }
@@ -646,11 +654,15 @@ function tableDataRemake(changeListData) {
                 let pushbwmx = '0;0';
                 if (listinfo.leafXmjs !== undefined) {
                     const leafInfo = listinfo.leafXmjs.find(function (item) {
-                        console.log(item)
                         return (item.bwmx === undefined || item.bwmx === clinfo[2]) && (item.quantity !== null ? item.quantity === parseFloat(clinfo[5]) : 0 === parseFloat(clinfo[5]));
                     });
-                    console.log(listinfo.leafXmjs, clinfo);
-                    pushbwmx = leafInfo.code + '_' + (leafInfo.bwmx !== undefined ? leafInfo.bwmx : '') + ';' + (leafInfo.quantity !== null ? leafInfo.quantity : 0);
+                    if (leafInfo) {
+                        pushbwmx = leafInfo.code + '_' + (leafInfo.bwmx !== undefined ? leafInfo.bwmx : '') + ';' + (leafInfo.quantity !== null ? leafInfo.quantity : 0);
+                    } else {
+                        toastr.warning('台账清单列表已不存在'+ clinfo[0] +',已更新变更清单列表');
+                        changeList.splice(index, 1);
+                        continue;
+                    }
                 } else {
                     pushbwmx = '0;' + (listinfo.quantity !== null ? listinfo.quantity : 0);
                 }