Browse Source

变更清单记录已选清单no.2

laiguoran 5 years ago
parent
commit
6ca8704b72
1 changed files with 5 additions and 2 deletions
  1. 5 2
      app/public/js/change_set.js

+ 5 - 2
app/public/js/change_set.js

@@ -538,17 +538,20 @@ function tableDataRemake(changeListData) {
     $('#code-list').html('');
     // 根据已添加的清单显示
     const changeList = $('#change-list').val().split('^_^');
+    console.log(changeList);
     if (changeList.length > 0 && changeList[0]) {
         for (const cl of changeList) {
             const clinfo = cl.split(';');
             const listinfo = changeListData[clinfo[8] - 1];
+            console.log(listinfo);
             $('#table-list-select tr[data-index="'+ clinfo[8] +'"]').addClass('table-success');
             let pushbwmx = '0;0';
             if (listinfo.leafXmjs !== undefined) {
                 const leafInfo = listinfo.leafXmjs.find(function (item) {
-                    return item.bwmx === clinfo[2] && item.quantity === parseFloat(clinfo[5]);
+                    return (item.bwmx === undefined || item.bwmx === clinfo[2]) && item.quantity === parseFloat(clinfo[5]);
                 });
-                pushbwmx = leafInfo.code + '_' + leafInfo.bwmx + ';' + leafInfo.quantity;
+                console.log(leafInfo);
+                pushbwmx = leafInfo.code + '_' + (leafInfo.bwmx !== undefined ? leafInfo.bwmx : '') + ';' + leafInfo.quantity;
             } else {
                 pushbwmx = '0;' + (listinfo.quantity !== null ? listinfo.quantity : 0);
             }