|
@@ -1736,6 +1736,30 @@ module.exports = app => {
|
|
|
await this.ctx.service.tender.checkTender(tid);
|
|
|
return await this._getContractPay({ spid: this.ctx.tender.spid, contract_type });
|
|
|
}
|
|
|
+
|
|
|
+ async getPhasePay(tid, sid) {
|
|
|
+ await this.ctx.service.tender.checkTender(tid);
|
|
|
+ await this.ctx.service.stage.checkStage(sid);
|
|
|
+ await this.ctx.service.phasePay.checkStageRelaPhasePay(sid);
|
|
|
+
|
|
|
+ return this.ctx.stageRelaPhasePay || {};
|
|
|
+ }
|
|
|
+
|
|
|
+ async getPhasePayDetail(tid, sid) {
|
|
|
+ await this.ctx.service.tender.checkTender(tid);
|
|
|
+ await this.ctx.service.stage.checkStage(sid);
|
|
|
+ await this.ctx.service.phasePay.checkStageRelaPhasePay(sid);
|
|
|
+
|
|
|
+ if (!this.ctx.stageRelaPhasePay) return [];
|
|
|
+ const data = this.ctx.service.phasePayDetail.getDetailData(this.ctx.stageRelaPhasePay);
|
|
|
+ const payTree = new Ledger.baseTree(this.ctx, {
|
|
|
+ id: 'tree_id', pid: 'tree_pid', order: 'tree_order',
|
|
|
+ level: 'tree_level', isLeaf: 'tree_is_leaf', fullPath: 'tree_full_path',
|
|
|
+ rootId: -1, calcField: [],
|
|
|
+ });
|
|
|
+ payTree.loadDatas(data);
|
|
|
+ return payTree.getDefaultDatas();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return ReportMemory;
|