|
@@ -40,29 +40,51 @@ module.exports = app => {
|
|
|
|
|
|
const tenderList = await this.ctx.service.tender.getList('', userPermission);
|
|
const tenderList = await this.ctx.service.tender.getList('', userPermission);
|
|
|
|
|
|
- for (const t of tenderList) {
|
|
|
|
- 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;
|
|
|
|
- }
|
|
|
|
|
|
+ // for (const t of tenderList) {
|
|
|
|
+ // 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;
|
|
|
|
+ // }
|
|
|
|
+ // if (t.ledger_status === auditConst.ledger.status.checked) {
|
|
|
|
+ // t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
|
|
|
|
+
|
|
|
|
+ // if (!t.lastStage) continue;
|
|
|
|
+ // 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) continue;
|
|
|
|
+ // await this.ctx.service.stage.checkStageGatherData(t.lastStage);
|
|
|
|
+ // }
|
|
|
|
+ // if (t.lastStage) {
|
|
|
|
+ // if (t.lastStage.status === auditConst.stage.status.uncheck) {
|
|
|
|
+ // const status_name = await this.ctx.service.projectAccount.getAccountInfoById(t.lastStage.user_id);
|
|
|
|
+ // t.status_users = status_name ? status_name.name : '';
|
|
|
|
+ // } else {
|
|
|
|
+ // const status_name = await this.ctx.service.stageAudit.getAuditorByStatus(t.lastStage.id, t.lastStage.status, t.lastStage.times);
|
|
|
|
+ // t.status_users = status_name ? status_name.name : '';
|
|
|
|
+ // }
|
|
|
|
+ // } else {
|
|
|
|
+ // if (t.ledger_status !== auditConst.ledger.status.uncheck) {
|
|
|
|
+ // const status_name = await this.ctx.service.ledgerAudit.getStatusName(t.id, t.ledger_times);
|
|
|
|
+ // t.status_users = status_name ? status_name.name : '';
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ tenderList.forEach(async t => {
|
|
if (t.ledger_status === auditConst.ledger.status.checked) {
|
|
if (t.ledger_status === auditConst.ledger.status.checked) {
|
|
t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
|
|
t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
|
|
-
|
|
|
|
- if (!t.lastStage) continue;
|
|
|
|
- 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) continue;
|
|
|
|
- await this.ctx.service.stage.checkStageGatherData(t.lastStage);
|
|
|
|
|
|
+ t.completeStage = await this.ctx.service.stage.getLastestCompleteStage(t.id);
|
|
}
|
|
}
|
|
if (t.lastStage) {
|
|
if (t.lastStage) {
|
|
if (t.lastStage.status === auditConst.stage.status.uncheck) {
|
|
if (t.lastStage.status === auditConst.stage.status.uncheck) {
|
|
const status_name = await this.ctx.service.projectAccount.getAccountInfoById(t.lastStage.user_id);
|
|
const status_name = await this.ctx.service.projectAccount.getAccountInfoById(t.lastStage.user_id);
|
|
t.status_users = status_name ? status_name.name : '';
|
|
t.status_users = status_name ? status_name.name : '';
|
|
|
|
+ // const status_name = await this.ctx.service.stageAudit.getStatusName(t.lastStage.id, t.lastStage.times - 1);
|
|
|
|
+ // t.status_users = status_name ? status_name.name : '';
|
|
} else {
|
|
} else {
|
|
const status_name = await this.ctx.service.stageAudit.getAuditorByStatus(t.lastStage.id, t.lastStage.status, t.lastStage.times);
|
|
const status_name = await this.ctx.service.stageAudit.getAuditorByStatus(t.lastStage.id, t.lastStage.status, t.lastStage.times);
|
|
t.status_users = status_name ? status_name.name : '';
|
|
t.status_users = status_name ? status_name.name : '';
|
|
@@ -73,7 +95,7 @@ module.exports = app => {
|
|
t.status_users = status_name ? status_name.name : '';
|
|
t.status_users = status_name ? status_name.name : '';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ });
|
|
const categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
|
|
const categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
|
|
const valuations = await this.ctx.service.valuation.getProjectValidValuation(this.ctx.session.sessionProject.id);
|
|
const valuations = await this.ctx.service.valuation.getProjectValidValuation(this.ctx.session.sessionProject.id);
|
|
const renderData = {
|
|
const renderData = {
|