Browse Source

中间计量,提交数据后,刷新问题

MaiXinRong 5 years ago
parent
commit
b7c411a9ee
1 changed files with 8 additions and 1 deletions
  1. 8 1
      app/public/js/stage_im.js

+ 8 - 1
app/public/js/stage_im.js

@@ -650,7 +650,14 @@ const stageIm = (function () {
             }
             let imData = _.find(ImData, {lid: d.lid, uuid: d.uuid});
             if (!imData) {
-                imData = _.find(ImData, {lid: d.lid, code: d.code, name: d.name, unit: d.unit, unit_price: d.unit_price});
+                imData = ImData.find(function (im) {
+                    return im.lid === d.lid &&
+                        (!im.code || im.code === d.code) &&
+                        (!im.name || im.name === d.name) &&
+                        (!im.unit || im.unit === d.unit) &&
+                        checkZero(ZhCalc.sub(im.unit_price, d.unit_price)) &&
+                        (!im.pid || im.pid === d.pid);
+                });
             }
             if (imData) {
                 _.assignInWith(imData, d, function (oV, sV, key) {