MaiXinRong пре 5 година
родитељ
комит
557a5676e9
2 измењених фајлова са 4 додато и 6 уклоњено
  1. 2 4
      app/public/js/stage_im.js
  2. 2 2
      app/service/stage_bills.js

+ 2 - 4
app/public/js/stage_im.js

@@ -642,9 +642,7 @@ const stageIm = (function () {
         for (const d of datas) {
             const detail = _.find(details, {uuid: d.uuid});
             if (detail) {
-                _.assignIn(detail, d, function (oV, sV, key) {
-                    return imFields.indexOf(key) > -1 && !_.isUndefined(sV) ? sV : oV;
-                });
+                _.assignIn(detail, d);
             } else {
                 details.push(d);
             }
@@ -661,7 +659,7 @@ const stageIm = (function () {
             }
             if (imData) {
                 _.assignInWith(imData, d, function (oV, sV, key) {
-                    return imFields.indexOf(key) > -1 && !_.isUndefined(sV) ? sV : oV;
+                    return imFields.indexOf(key) > -1 && !_.isUndefined(sV) && !_.isNull(sV) ? sV : oV;
                 });
             }
         }

+ 2 - 2
app/service/stage_bills.js

@@ -253,8 +253,8 @@ module.exports = app => {
          */
         async updateStageBillsQty(transaction, ledgerBills, stageBills, data) {
             if (stageBills) {
-                if ((updateData.contract_qty === undefined || stageBills.contract_qty !== updateData.contract_qty) ||
-                    (updateData.qc_qty === undefined || stageBills.qc_qty !== updateData.qc_qty)) {
+                if ((data.contract_qty === undefined || stageBills.contract_qty !== data.contract_qty) ||
+                    (data.qc_qty === undefined || stageBills.qc_qty !== data.qc_qty)) {
                     if (stageBills.times === this.ctx.stage.curTimes && stageBills.order === this.ctx.stage.curOrder) {
                         data.id = stageBills.id;
                         await transaction.update(this.tableName, data);