|
@@ -29,16 +29,28 @@ class StageIm {
|
|
|
calcFields: ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp'],
|
|
|
calc: function (node) {
|
|
|
if (node.children && node.children.length === 0) {
|
|
|
+ node.pre_gather_qty = self.ctx.helper.add(node.pre_contract_qty, node.pre_qc_qty);
|
|
|
node.gather_qty = self.ctx.helper.add(node.contract_qty, node.qc_qty);
|
|
|
+ node.end_contract_qty = self.ctx.helper.add(node.pre_contract_qty, node.contract_qty);
|
|
|
+ node.end_qc_qty = self.ctx.helper.add(node.pre_qc_qty, node.qc_qty);
|
|
|
+ node.end_gather_qty = self.ctx.helper.add(node.pre_gather_qty, node.gather_qty);
|
|
|
}
|
|
|
+ node.pre_gather_tp = self.ctx.helper.add(node.pre_contract_tp, node.pre_qc_tp);
|
|
|
node.gather_tp = self.ctx.helper.add(node.contract_tp, node.qc_tp);
|
|
|
+ node.end_contract_tp = self.ctx.helper.add(node.pre_contract_tp, node.contract_tp);
|
|
|
+ node.end_qc_tp = self.ctx.helper.add(node.pre_qc_tp, node.qc_tp);
|
|
|
+ node.end_gather_tp = self.ctx.helper.add(node.pre_gather_tp, node.gather_tp);
|
|
|
}
|
|
|
});
|
|
|
this.pos = new Ledger.pos({
|
|
|
id: 'id', ledgerId: 'lid',
|
|
|
updateFields: ['contract_qty', 'qc_qty', 'postil'],
|
|
|
calc: function (p) {
|
|
|
+ p.pre_gather_qty = self.ctx.helper.add(p.pre_contract_qty, p.pre_qc_qty);
|
|
|
p.gather_qty = self.ctx.helper.add(p.contract_qty, p.qc_qty);
|
|
|
+ p.end_contract_qty = self.ctx.helper.add(p.pre_contract_qty, p.contract_qty);
|
|
|
+ p.end_qc_qty = self.ctx.helper.add(p.pre_qc_qty, p.qc_qty);
|
|
|
+ p.end_gather_qty = self.ctx.helper.add(p.pre_gather_qty, p.gather_qty);
|
|
|
}
|
|
|
});
|
|
|
// relaData
|
|
@@ -67,6 +79,11 @@ class StageIm {
|
|
|
{data: curStage, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp'], prefix: '', relaId: 'lid'}
|
|
|
]);
|
|
|
}
|
|
|
+ const preStage = this.ctx.stage.order > 1 ? await this.ctx.service.stageBillsFinal.getFinalData(this.ctx.tender, this.ctx.stage.order - 1) : [];
|
|
|
+
|
|
|
+ this.ctx.helper.assignRelaData(billsData, [
|
|
|
+ {data: preStage, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp'], prefix: 'pre_', relaId: 'lid'}
|
|
|
+ ]);
|
|
|
this.billsTree.loadDatas(billsData);
|
|
|
this.billsTree.calculateAll();
|
|
|
|
|
@@ -83,6 +100,10 @@ class StageIm {
|
|
|
{data: curPosStage, fields: ['contract_qty', 'qc_qty'], prefix: '', relaId: 'pid'}
|
|
|
]);
|
|
|
}
|
|
|
+ const prePosStage = this.ctx.stage.order > 1 ? await this.ctx.service.stagePosFinal.getFinalData(this.ctx.tender, this.ctx.stage.order - 1) : [];
|
|
|
+ this.ctx.helper.assignRelaData(posData, [
|
|
|
+ {data: prePosStage, fields: ['contract_qty', 'qc_qty'], prefix: 'pre_', relaId: 'pid'}
|
|
|
+ ]);
|
|
|
this.pos.loadDatas(posData);
|
|
|
this.pos.calculateAll();
|
|
|
}
|
|
@@ -303,6 +324,14 @@ class StageIm {
|
|
|
b.jl = this.ctx.helper.add(b.jl, p.gather_qty);
|
|
|
b.contract_jl = this.ctx.helper.add(b.contract_jl, p.contract_qty);
|
|
|
b.qc_jl = this.ctx.helper.add(b.qc_jl, p.qc_qty);
|
|
|
+
|
|
|
+ b.pre_jl = this.ctx.helper.add(b.pre_jl, p.pre_gather_qty);
|
|
|
+ b.pre_contract_jl = this.ctx.helper.add(b.pre_contract_jl, p.pre_contract_qty);
|
|
|
+ b.pre_qc_jl = this.ctx.helper.add(b.pre_qc_jl, p.pre_qc_qty);
|
|
|
+
|
|
|
+ b.end_jl = this.ctx.helper.add(b.end_jl, p.end_gather_qty);
|
|
|
+ b.end_contract_jl = this.ctx.helper.add(b.end_contract_jl, p.end_contract_qty);
|
|
|
+ b.end_qc_jl = this.ctx.helper.add(b.end_qc_jl, p.end_qc_qty);
|
|
|
this._generateTzPosData(p, b);
|
|
|
}
|
|
|
}
|
|
@@ -350,6 +379,8 @@ class StageIm {
|
|
|
id: this.ImData.length + 1,
|
|
|
lid: node.id, pid: '', code: node.code,
|
|
|
jl: node.gather_tp, contract_jl: node.contract_tp, qc_jl: node.qc_tp,
|
|
|
+ pre_jl: node.pre_gather_tp, pre_contract_jl: node.pre_contract_tp, pre_qc_jl: node.pre_qc_tp,
|
|
|
+ end_jl: node.end_gather_tp, end_contract_jl: node.end_contract_tp, end_qc_jl: node.end_qc_tp,
|
|
|
peg: peg ? this._getPegStr(peg.name) : '', drawing_code: this._getDrawingCode(node),
|
|
|
};
|
|
|
if (this.ctx.stage.im_gather && node.check) {
|
|
@@ -454,6 +485,8 @@ class StageIm {
|
|
|
id: this.ImData.length + 1,
|
|
|
lid: node.id, pid: '', code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price,
|
|
|
jl: 0, contract_jl: 0, qc_jl: 0,
|
|
|
+ pre_jl: 0, pre_contract_jl: 0, pre_qc_jl: 0,
|
|
|
+ end_jl: 0, end_contract_jl: 0, end_qc_jl: 0,
|
|
|
peg: peg ? this._getPegStr(peg.name) : ''
|
|
|
};
|
|
|
if (this.ctx.stage.im_gather && node.check) {
|
|
@@ -478,6 +511,14 @@ class StageIm {
|
|
|
im.jl = this.ctx.helper.add(im.jl, p.gather_qty);
|
|
|
im.contract_jl = this.ctx.helper.add(im.contract_jl, p.contract_qty);
|
|
|
im.qc_jl = this.ctx.helper.add(im.qc_jl, p.qc_qty);
|
|
|
+
|
|
|
+ im.pre_jl = this.ctx.helper.add(im.pre_jl, p.pre_gather_qty);
|
|
|
+ im.pre_contract_jl = this.ctx.helper.add(im.pre_contract_jl, p.pre_contract_qty);
|
|
|
+ im.pre_qc_jl = this.ctx.helper.add(im.pre_qc_jl, p.pre_qc_qty);
|
|
|
+
|
|
|
+ im.end_jl = this.ctx.helper.add(im.end_jl, p.end_gather_qty);
|
|
|
+ im.end_contract_jl = this.ctx.helper.add(im.end_contract_jl, p.end_contract_qty);
|
|
|
+ im.end_qc_jl = this.ctx.helper.add(im.end_qc_jl, p.end_qc_qty);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -496,6 +537,8 @@ class StageIm {
|
|
|
id: this.ImData.length + 1,
|
|
|
lid: node.id, code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price, pid: pp.id,
|
|
|
jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty,
|
|
|
+ pre_jl: pp.pre_gather_qty, pre_contract_jl: pp.pre_contract_qty, pre_qc_jl: pp.pre_qc_qty,
|
|
|
+ end_jl: pp.end_gather_qty, end_contract_jl: pp.end_contract_qty, end_qc_jl: pp.end_qc_qty,
|
|
|
bw: bw,
|
|
|
peg: this._checkPeg(pp.name) ? this._getPegStr(pp.name) : (peg ? this._getPegStr(peg.name) : ''),
|
|
|
xm: pp.name,
|
|
@@ -520,6 +563,8 @@ class StageIm {
|
|
|
id: this.ImData.length + 1,
|
|
|
lid: node.id, code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price, pid: '',
|
|
|
jl: p.gather_qty, contract_jl: p.contract_qty, qc_jl: p.qc_qty,
|
|
|
+ pre_jl: p.pre_gather_qty, pre_contract_jl: p.pre_contract_qty, pre_qc_jl: p.pre_qc_qty,
|
|
|
+ end_jl: p.end_gather_qty, end_contract_jl: p.end_contract_qty, end_qc_jl: p.end_qc_qty,
|
|
|
bw: bw,
|
|
|
peg: peg ? this._getPegStr(peg.name) : '',
|
|
|
xm: node.name,
|