瀏覽代碼

修复计量台账上报bug问题

laiguoran 5 年之前
父節點
當前提交
f235e14cbe
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      app/service/stage_other.js

+ 3 - 2
app/service/stage_other.js

@@ -150,6 +150,7 @@ module.exports = app => {
 
             const filter = {stimes: this.ctx.stage.curTimes, sorder: this.ctx.stage.curOrder};
             const updateDatas = [];
+            console.log(datas);
             for (const d of datas) {
                 const history = d.shistory && d.shistory !== '' ? JSON.parse(d.shistory) : [];
                 const his = this.ctx.helper._.find(datas, filter);
@@ -158,7 +159,7 @@ module.exports = app => {
                     if (d.sid === d.add_sid) his.total_price = d.total_price;
                 } else {
                     const nHis = { stimes: this.ctx.stage.curTimes, sorder: this.ctx.stage.curOrder, tp: d.tp };
-                    if (d.sid === d.add_sid) his.total_price = d.total_price;
+                    if (d.sid === d.add_sid) nHis.total_price = d.total_price;
                     history.push(nHis);
                 }
                 updateDatas.push({ id: d.id, shistory: JSON.stringify(history) });
@@ -188,4 +189,4 @@ module.exports = app => {
     }
 
     return StageOther;
-};
+};