|
@@ -8,6 +8,7 @@
|
|
* @version
|
|
* @version
|
|
*/
|
|
*/
|
|
const Ledger = require('../lib/ledger');
|
|
const Ledger = require('../lib/ledger');
|
|
|
|
+const auditConst = require('../const/audit');
|
|
|
|
|
|
class loadGclBaseTree {
|
|
class loadGclBaseTree {
|
|
/**
|
|
/**
|
|
@@ -394,12 +395,12 @@ class gatherStageGclTree extends loadGclBaseTree {
|
|
}
|
|
}
|
|
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) {
|
|
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) {
|
|
|
|
- data.qc_qty = bn.qc_qty;
|
|
|
|
- data.qc_tp = bn.qc_tp;
|
|
|
|
- } else {
|
|
|
|
|
|
+ if (!bn.is_import && bn.org_qc_qty) {
|
|
data.qc_qty = bn.org_qc_qty;
|
|
data.qc_qty = bn.org_qc_qty;
|
|
data.qc_tp = bn.org_qc_tp;
|
|
data.qc_tp = bn.org_qc_tp;
|
|
|
|
+ } else {
|
|
|
|
+ data.qc_qty = bn.qc_qty;
|
|
|
|
+ data.qc_tp = bn.qc_tp;
|
|
}
|
|
}
|
|
result.update.push(data);
|
|
result.update.push(data);
|
|
}
|
|
}
|
|
@@ -538,7 +539,9 @@ class sumLoad {
|
|
const stage = await this.ctx.service.stage.getDataByCondition({tid: tender.tid, order: tender.stage});
|
|
const stage = await this.ctx.service.stage.getDataByCondition({tid: tender.tid, order: tender.stage});
|
|
if (!stage) throw '选择的期不存在';
|
|
if (!stage) throw '选择的期不存在';
|
|
const curStageData = await this.ctx.service.stageBills.getLastestStageData2(tender.tid, stage.id);
|
|
const curStageData = await this.ctx.service.stageBills.getLastestStageData2(tender.tid, stage.id);
|
|
- const curStageChange = await this.ctx.service.stageChangeFinal.getSumLoadFinalData(stage.id);
|
|
|
|
|
|
+ const curStageChange = stage.status === auditConst.stage.status.checked
|
|
|
|
+ ? await this.ctx.service.stageChangeFinal.getSumLoadFinalData(stage.id)
|
|
|
|
+ : await this.ctx.service.stageChange.getSumLoadFinalData(stage.id);
|
|
this._loadCurStageAndChange(billsData, curStageData, curStageChange);
|
|
this._loadCurStageAndChange(billsData, curStageData, curStageChange);
|
|
const billsTree = new Ledger.billsTree(this.ctx, {
|
|
const billsTree = new Ledger.billsTree(this.ctx, {
|
|
id: 'ledger_id',
|
|
id: 'ledger_id',
|