|
@@ -75,10 +75,21 @@ module.exports = app => {
|
|
|
// }
|
|
|
// }
|
|
|
tenderList.forEach(async t => {
|
|
|
+ if (t.user_id === this.ctx.session.sessionUser.accountId && (
|
|
|
+ t.ledger_status === auditConst.ledger.status.checkNo || t.ledger_status === auditConst.ledger.status.uncheck)) {
|
|
|
+ const sum = await this.ctx.service.ledger.addUp({ tender_id: t.id/* , is_leaf: true*/ });
|
|
|
+ t.total_price = sum.total_price;
|
|
|
+ t.deal_tp = sum.deal_tp;
|
|
|
+ }
|
|
|
t.advance_tp = await this.ctx.service.advance.getSumAdvance(t.id);
|
|
|
|
|
|
if (t.ledger_status === auditConst.ledger.status.checked) {
|
|
|
t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
|
|
|
+ if (t.lastStage.status === auditConst.stage.status.uncheck &&
|
|
|
+ t.lastStage.user_id !== this.ctx.session.sessionUser.accountId) {
|
|
|
+ t.lastStage = await this.ctx.service.stage.getLastestStage(t.id);
|
|
|
+ }
|
|
|
+ if (t.lastStage) await this.ctx.service.stage.checkStageGatherData(t.lastStage);
|
|
|
t.completeStage = await this.ctx.service.stage.getLastestCompleteStage(t.id);
|
|
|
}
|
|
|
if (t.lastStage) {
|