Explorar o código

导入变更数据,数据更新调整

MaiXinRong %!s(int64=3) %!d(string=hai) anos
pai
achega
7504f40ca3
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  1. 9 1
      app/lib/sum_load.js

+ 9 - 1
app/lib/sum_load.js

@@ -393,7 +393,15 @@ class gatherStageGclTree extends loadGclBaseTree {
                 continue;
                 continue;
             }
             }
             if (bn.contract_qty !== bn.org_contract_qty || bn.contract_tp !== bn.org_contract_tp || bn.qc_qty !== bn.org_qc_qty) {
             if (bn.contract_qty !== bn.org_contract_qty || bn.contract_tp !== bn.org_contract_tp || bn.qc_qty !== bn.org_qc_qty) {
-                result.update.push({ lid: bn.id, contract_qty: bn.contract_qty, contract_tp: bn.contract_tp, qc_qty: bn.qc_qty, qc_tp: bn.qc_tp });
+                let data = { lid: bn.id, contract_qty: bn.contract_qty, contract_tp: bn.contract_tp };
+                if (bn.is_import) {
+                    data.qc_qty = bn.qc_qty;
+                    data.qc_tp = bn.qc_tp;
+                } else {
+                    data.qc_qty = bn.org_qc_qty;
+                    data.qc_tp = bn.org_qc_tp;
+                }
+                result.update.push(data);
             }
             }
             if (bn.change_detail && bn.change_detail.length > 0) {
             if (bn.change_detail && bn.change_detail.length > 0) {
                 for (const cd of bn.change_detail) {
                 for (const cd of bn.change_detail) {