|
@@ -453,12 +453,13 @@ class sumLoad {
|
|
|
this.ctx = ctx;
|
|
|
}
|
|
|
|
|
|
- recusiveLoadGatherGcl(node, parent, ignoreParent = false) {
|
|
|
+ recusiveLoadGatherGcl(node, parent, ignoreParent = false, match = false) {
|
|
|
+ const loadMatch = match || node.match || (parent && parent.match);
|
|
|
const isLeaf = !node.children || node.children.length === 0;
|
|
|
- const cur = (!ignoreParent || isLeaf) && node.b_code ? this.loadTree.gather(node, parent) : parent;
|
|
|
+ const cur = loadMatch && (!ignoreParent || isLeaf) && node.b_code ? this.loadTree.gather(node, parent) : parent;
|
|
|
if (isLeaf) return;
|
|
|
for (const child of node.children) {
|
|
|
- this.recusiveLoadGatherGcl(child, cur, ignoreParent);
|
|
|
+ this.recusiveLoadGatherGcl(child, cur, ignoreParent, loadMatch);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -555,7 +556,7 @@ class sumLoad {
|
|
|
async stageGatherGcl(select, maxId, tenders, defaultData, cover, ignore, loadChange) {
|
|
|
const ignoreParent = this.ctx.tender.info.fun_rela.sum_load.ignoreParent;
|
|
|
this.loadTree = new gatherStageGclTree(this.ctx, {
|
|
|
- parent: select, maxId, type: 'ledger', defaultData, ignoreParent, cover, ignoreNotFind: ignore, loadChange,
|
|
|
+ parent: select, maxId, type: 'ledger', defaultData, ignoreParent, cover, ignoreNotFind: ignore, loadChange
|
|
|
});
|
|
|
const posterity = await this.ctx.service.ledger.getPosterityByParentId(this.ctx.tender.id, select.ledger_id);
|
|
|
const extraData = await this.ctx.service.ledgerExtra.getData(this.ctx.tender.id, ['is_tp']);
|
|
@@ -599,6 +600,9 @@ class sumLoad {
|
|
|
stageId: 'id',
|
|
|
});
|
|
|
billsTree.loadDatas(billsData);
|
|
|
+ billsTree.nodes.forEach(x => {
|
|
|
+ x.match = tender.match_code ? x.code === tender.match_code : true;
|
|
|
+ });
|
|
|
for (const top of billsTree.children) {
|
|
|
if ([1].indexOf(top.node_type) < 0) continue;
|
|
|
this.recusiveLoadGatherGcl(top, null, ignoreParent);
|