|
@@ -283,7 +283,7 @@ class ReportMemoryMaterial {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- async _getMaterialStageGatherBills(tender_id, stage_id, stage_order, stageSelf) {
|
|
|
+ async _getMaterialStageGatherBills(tender_id, stage_id, stage_order, stageSelf, stageIndex = 0) {
|
|
|
const decimal = this.materialGatherBase.decimal;
|
|
|
//const billsData = this.ctx.helper.clone(this.materialGatherBase.billsData);
|
|
|
const billsData = this.materialGatherBase.billsData;
|
|
@@ -322,6 +322,7 @@ class ReportMemoryMaterial {
|
|
|
const materialGl = stageSelf
|
|
|
? this.materialGatherBase.materialGl.filter(x => { return x.sid === parseInt(stage_id); })
|
|
|
: this.materialGatherBase.materialGl;
|
|
|
+ if (stageIndex) materialGl.forEach(x => { x.s_index = stageIndex });
|
|
|
const materialNotJoin = this.materialGatherBase.materialNotJoin;
|
|
|
|
|
|
const helper = this.ctx.helper;
|
|
@@ -331,10 +332,12 @@ class ReportMemoryMaterial {
|
|
|
if (!g.contract_qty && !g.qc_qty) continue;
|
|
|
g.sid = stage_id;
|
|
|
g.sorder = stage_order;
|
|
|
+ g.s_index = stageIndex;
|
|
|
g.jiacha = 0;
|
|
|
for (const x of g.leafXmjs) {
|
|
|
x.sid = stage_id;
|
|
|
x.sorder = stage_order;
|
|
|
+ x.s_index = stageIndex;
|
|
|
x.jiacha = 0;
|
|
|
const mnj = materialNotJoin.find(m => {
|
|
|
return m.gcl_id === x.org_gcl_id && m.xmj_id === x.id && (x.mx_id && x.mx_id !== x.id ? x.mx_id === m.mx_id : true);
|
|
@@ -388,7 +391,7 @@ class ReportMemoryMaterial {
|
|
|
const stageIds = material.stage_id.split(',');
|
|
|
const stageOrders = material.s_order.split(',');
|
|
|
for (const [i, sid] of stageIds.entries()) {
|
|
|
- const [gclList, leafXmjs] = await this._getMaterialStageGatherBills(tender_id, sid, stageOrders[i], true);
|
|
|
+ const [gclList, leafXmjs] = await this._getMaterialStageGatherBills(tender_id, sid, stageOrders[i], true, i + 1);
|
|
|
mem_material_gather_bills.push(...gclList);
|
|
|
mem_material_gather_xmj.push(...leafXmjs);
|
|
|
}
|