浏览代码

中间计量,变更令号含负变更令

MaiXinRong 3 年之前
父节点
当前提交
532591e252
共有 2 个文件被更改,包括 14 次插入44 次删除
  1. 7 23
      app/lib/stage_im.js
  2. 7 21
      app/public/js/stage_im.js

+ 7 - 23
app/lib/stage_im.js

@@ -488,9 +488,6 @@ class StageIm {
             if (p.children && p.children.length > 0) {
                 continue;
             }
-            if ((!p.qc_tp || p.qc_tp === 0)) {
-                continue;
-            }
             const posRange = this.pos.getLedgerPos(p.id);
             if (!posRange) {
                 for (const c of this.changes) {
@@ -501,9 +498,6 @@ class StageIm {
                 this.import_changes.forEach(x => { if (x.lid === p.id) im.changes.push(x) });
             } else {
                 for (const pp of posRange) {
-                    if ((!pp.qc_qty || pp.qc_qty === 0)) {
-                        continue;
-                    }
                     for (const c of this.changes) {
                         if (c.lid === p.id && c.pid === pp.id && c.qty && c.qty !== 0) {
                             im.changes.push(c);
@@ -803,9 +797,6 @@ class StageIm {
         if (!im.changes) {
             im.changes = [];
         }
-        if ((!node.qc_qty || node.qc_qty === 0)) {
-            return;
-        }
         const posRange = this.pos.getLedgerPos(node.id);
         if (!posRange) {
             for (const c of this.changes) {
@@ -816,9 +807,6 @@ class StageIm {
             this.import_changes.forEach(x => { if (x.lid === node.id) im.changes.push(x) });
         } else {
             for (const p of posRange) {
-                if ((!p.qc_qty || p.qc_qty === 0)) {
-                    continue;
-                }
                 for (const c of this.changes) {
                     if (c.lid === node.id && c.pid === p.id && c.qty && c.qty !== 0) {
                         im.changes.push(c);
@@ -950,11 +938,9 @@ class StageIm {
                     im.end_qc_tp = this.ctx.helper.mul(im.end_qc_jl, im.unit_price, tp_decimal);
                     im.calc_memo = '本期计量:' + (this.ctx.helper.checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit;
                     this.ImData.push(im);
-                    if (pp.qc_qty && pp.qc_qty !== 0) {
-                        for (const c of this.changes) {
-                            if (c.lid === p.id && c.pid === pp.id && c.qty && c.qty !== 0) {
-                                im.changes.push(c);
-                            }
+                    for (const c of this.changes) {
+                        if (c.lid === p.id && c.pid === pp.id && c.qty && c.qty !== 0) {
+                            im.changes.push(c);
                         }
                     }
                 }
@@ -982,14 +968,12 @@ class StageIm {
                 };
                 im.calc_memo = '本期计量:' + (this.ctx.helper.checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit;
                 this.ImData.push(im);
-                if (p.qc_qty && p.qc_qty !== 0) {
-                    for (const c of this.changes) {
-                        if (c.lid === p.id && c.pid == -1 && c.qty && c.qty !== 0) {
-                            im.changes.push(c);
-                        }
+                for (const c of this.changes) {
+                    if (c.lid === p.id && c.pid == -1 && c.qty && c.qty !== 0) {
+                        im.changes.push(c);
                     }
-                    this.import_changes.forEach(x => { if (x.lid === p.id) im.changes.push(x) });
                 }
+                this.import_changes.forEach(x => { if (x.lid === p.id) im.changes.push(x) });
             }
         }
     }

+ 7 - 21
app/public/js/stage_im.js

@@ -507,9 +507,6 @@ const stageIm = (function () {
             if (p.children && p.children.length > 0) {
                 continue;
             }
-            if ((!p.qc_tp || p.qc_tp === 0)) {
-                continue;
-            }
             const posRange = gsPos.getLedgerPos(p.id);
             if (!posRange) {
                 for (const c of changes) {
@@ -520,9 +517,6 @@ const stageIm = (function () {
                 importChanges.forEach(x => { if (x.lid === p.id) im.changes.push(x); });
             } else {
                 for (const pp of posRange) {
-                    if ((!pp.qc_qty || pp.qc_qty === 0)) {
-                        continue;
-                    }
                     for (const c of changes) {
                         if (c.lid === p.id && c.pid === pp.id && c.qty && c.qty !== 0) {
                             im.changes.push(c);
@@ -778,9 +772,6 @@ const stageIm = (function () {
         if (!im.changes) {
             im.changes = [];
         }
-        if ((!node.qc_qty || node.qc_qty === 0)) {
-            return;
-        }
         const posRange = gsPos.getLedgerPos(node.id);
         if (!posRange) {
             for (const c of changes) {
@@ -791,7 +782,6 @@ const stageIm = (function () {
             importChanges.forEach(x => { if (x.lid === node.id) im.changes.push(x); });
         } else {
             for (const p of posRange) {
-                if ((!p.qc_qty || p.qc_qty === 0)) continue;
                 for (const c of changes) {
                     if (c.lid === node.id && c.pid === p.id && c.qty && c.qty !== 0) {
                         im.changes.push(c);
@@ -879,11 +869,9 @@ const stageIm = (function () {
                     };
                     im.calc_memo = '本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit;
                     ImData.push(im);
-                    if (pp.qc_qty && pp.qc_qty !== 0) {
-                        for (const c of changes) {
-                            if (c.lid === p.id && c.pid === pp.id && c.qty && c.qty !== 0) {
-                                im.changes.push(c);
-                            }
+                    for (const c of changes) {
+                        if (c.lid === p.id && c.pid === pp.id && c.qty && c.qty !== 0) {
+                            im.changes.push(c);
                         }
                     }
                 }
@@ -907,14 +895,12 @@ const stageIm = (function () {
                 };
                 im.calc_memo = '本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit;
                 ImData.push(im);
-                if (p.qc_qty && p.qc_qty !== 0) {
-                    for (const c of changes) {
-                        if (c.lid === p.id && c.pid == -1 && c.qty && c.qty !== 0) {
-                            im.changes.push(c);
-                        }
+                for (const c of changes) {
+                    if (c.lid === p.id && c.pid == -1 && c.qty && c.qty !== 0) {
+                        im.changes.push(c);
                     }
-                    importChanges.forEach(x => { if (x.lid === p.id) im.changes.push(x); });
                 }
+                importChanges.forEach(x => { if (x.lid === p.id) im.changes.push(x); });
             }
         }
     }