|
@@ -400,6 +400,16 @@ module.exports = app => {
|
|
|
const lastStage = stages.length > 0 ? stages[0] : null; // await ctx.service.stage.getLastestStage(ctx.tender.id);
|
|
|
if (lastStage) {
|
|
|
await this.ctx.service.stage.checkStageGatherData(lastStage);
|
|
|
+
|
|
|
+ if ((!bCalcTp) && tender.measure_type === measureType.gcl.value) {
|
|
|
+ bCalcTp = lastStage.status !== auditConst.stage.status.checked && !lastStage.readOnly;
|
|
|
+ }
|
|
|
+ if (bCalcTp) {
|
|
|
+ const sum = await this.ctx.service.ledger.addUp({ tender_id: tender.id/* , is_leaf: true*/ });
|
|
|
+ tender.total_price = sum.total_price;
|
|
|
+ tender.deal_tp = sum.deal_tp;
|
|
|
+ }
|
|
|
+
|
|
|
tender.gather_tp = ctx.helper.add(lastStage.contract_tp, lastStage.qc_tp);
|
|
|
tender.end_contract_tp = ctx.helper.add(lastStage.contract_tp, lastStage.pre_contract_tp);
|
|
|
tender.end_qc_tp = ctx.helper.add(lastStage.qc_tp, lastStage.pre_qc_tp);
|
|
@@ -435,10 +445,13 @@ module.exports = app => {
|
|
|
const times = lastStage.status === auditConst.stage.status.checkNo ? lastStage.times - 1 : lastStage.times;
|
|
|
lastStage.auditors = await ctx.service.stageAudit.getFinalAuditGroup(lastStage.id, times);
|
|
|
}
|
|
|
- if ((!bCalcTp) && tender.measure_type === measureType.gcl.value) {
|
|
|
- bCalcTp = lastStage.status !== auditConst.stage.status.checked && !lastStage.readOnly;
|
|
|
- }
|
|
|
} else {
|
|
|
+ if (bCalcTp) {
|
|
|
+ const sum = await this.ctx.service.ledger.addUp({ tender_id: tender.id/* , is_leaf: true*/ });
|
|
|
+ tender.total_price = sum.total_price;
|
|
|
+ tender.deal_tp = sum.deal_tp;
|
|
|
+ }
|
|
|
+
|
|
|
if (tender.ledger_status !== auditConst.ledger.status.uncheck) {
|
|
|
const status_name = await this.ctx.service.ledgerAudit.getStatusName(tender.id, tender.ledger_times);
|
|
|
tender.status_users = status_name ? status_name.name : '';
|
|
@@ -449,11 +462,7 @@ module.exports = app => {
|
|
|
tender.status_users = status_name ? status_name.name : '';
|
|
|
}
|
|
|
}
|
|
|
- if (bCalcTp) {
|
|
|
- const sum = await this.ctx.service.ledger.addUp({ tender_id: tender.id/* , is_leaf: true*/ });
|
|
|
- tender.total_price = sum.total_price;
|
|
|
- tender.deal_tp = sum.deal_tp;
|
|
|
- }
|
|
|
+
|
|
|
const tiModel = new tenderInfoModel(ctx);
|
|
|
const gclChapter = await tiModel.gatherChapter();
|
|
|
|