|
@@ -330,6 +330,7 @@ class gatherStageGclTree extends loadGclBaseTree {
|
|
const relaPos = pos.filter(x => {return x.lid === d.id});
|
|
const relaPos = pos.filter(x => {return x.lid === d.id});
|
|
const baseNode = {
|
|
const baseNode = {
|
|
id: d.id,
|
|
id: d.id,
|
|
|
|
+ is_import: d.is_import,
|
|
ledger_id: d.ledger_id,
|
|
ledger_id: d.ledger_id,
|
|
ledger_pid: d.ledger_pid,
|
|
ledger_pid: d.ledger_pid,
|
|
level: d.level,
|
|
level: d.level,
|
|
@@ -339,10 +340,10 @@ class gatherStageGclTree extends loadGclBaseTree {
|
|
name: d.name,
|
|
name: d.name,
|
|
unit: d.unit,
|
|
unit: d.unit,
|
|
unit_price: d.unit_price,
|
|
unit_price: d.unit_price,
|
|
- org_contract_qty: this.cover ? d.contract_qty || 0 : 0,
|
|
|
|
- org_contract_tp: this.cover ? d.contract_tp || 0 : 0,
|
|
|
|
- org_qc_qty: d.is_import ? 0 : d.qc_qty || 0,
|
|
|
|
- org_qc_tp: d.is_import ? 0 : d.qc_tp || 0,
|
|
|
|
|
|
+ org_contract_qty: d.contract_qty || 0,
|
|
|
|
+ org_contract_tp: d.contract_tp || 0,
|
|
|
|
+ org_qc_qty: d.qc_qty || 0,
|
|
|
|
+ org_qc_tp: d.qc_tp || 0,
|
|
org_order: d.order,
|
|
org_order: d.order,
|
|
contract_qty: 0,
|
|
contract_qty: 0,
|
|
contract_tp: 0,
|
|
contract_tp: 0,
|
|
@@ -386,14 +387,13 @@ class gatherStageGclTree extends loadGclBaseTree {
|
|
getUpdateData() {
|
|
getUpdateData() {
|
|
const result = { update: [], errors: [], qc_detail: [] };
|
|
const result = { update: [], errors: [], qc_detail: [] };
|
|
for (const bn of this.baseNodes) {
|
|
for (const bn of this.baseNodes) {
|
|
|
|
+ if (!this.cover && !this.contract_qty && !this.qc_qty && !this.contract_tp) continue;
|
|
|
|
+
|
|
if (!bn.is_import && bn.org_qc_qty !== 0 && bn.qc_qty !== 0) {
|
|
if (!bn.is_import && bn.org_qc_qty !== 0 && bn.qc_qty !== 0) {
|
|
result.errors.push({ b_code: bn.b_code, name: bn.name, unit: bn.unit, qc_qty: bn.qc_qty, ledger_id: bn.ledger_id, type: 'qc-conflict'});
|
|
result.errors.push({ b_code: bn.b_code, name: bn.name, unit: bn.unit, qc_qty: bn.qc_qty, ledger_id: bn.ledger_id, type: 'qc-conflict'});
|
|
- if (bn.contract_qty !== bn.org_contract_qty || bn.contract_tp !== bn.org_contract_tp) {
|
|
|
|
- result.update.push({ lid: bn.id, contract_qty: bn.contract_qty, contract_tp: bn.contract_tp, qc_qty: bn.org_qc_qty, qc_tp: bn.org_qc_tp });
|
|
|
|
- }
|
|
|
|
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.is_import || this.cover || bn.contract_qty !== bn.org_contract_qty || bn.contract_tp !== bn.org_contract_tp || bn.qc_qty !== bn.org_qc_qty) {
|
|
let data = { lid: bn.id, contract_qty: bn.contract_qty, contract_tp: bn.contract_tp };
|
|
let data = { lid: bn.id, contract_qty: bn.contract_qty, contract_tp: bn.contract_tp };
|
|
if (!bn.is_import && bn.org_qc_qty) {
|
|
if (!bn.is_import && bn.org_qc_qty) {
|
|
data.qc_qty = bn.org_qc_qty;
|
|
data.qc_qty = bn.org_qc_qty;
|