Explorar o código

修改合同计量,不计价不应丢失

MaiXinRong %!s(int64=2) %!d(string=hai) anos
pai
achega
c4e61adb51
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      app/service/stage_pos.js

+ 3 - 2
app/service/stage_pos.js

@@ -23,7 +23,7 @@ module.exports = app => {
             super(ctx);
             this.depart = 20;
             this.tableName = 'stage_pos';
-            this.qtyFields = ['contract_qty', 'qc_qty']
+            this.qtyFields = ['contract_qty', 'qc_qty', 'qc_minus_qty']
         }
 
         _getPosFilterSql(where, asTable = '') {
@@ -129,7 +129,7 @@ module.exports = app => {
             const self = this;
             const stagePos = await this.getLastestStageData2(tid, sid, where);
             const pids = this._.map(stagePos, function (sp) {
-                if (!self.ctx.helper.checkZero(sp.contract_qty) || !self.ctx.helper.checkZero(sp.qc_qty)) {
+                if (!self.ctx.helper.checkZero(sp.contract_qty) || !self.ctx.helper.checkZero(sp.qc_qty) || !self.ctx.helper.checkZero(sp.qc_minus_qty)) {
                     return sp.pid;
                 } else {
                     return -1;
@@ -310,6 +310,7 @@ module.exports = app => {
                         if (d.postil || osp) {
                             sp.postil = d.postil === undefined && osp ? osp.postil : d.postil;
                         }
+                        sp.qc_minus_qty = osp ? osp.qc_minus_qty : 0;
                         insertPosStage.push(sp);
                     }
                 }