|
@@ -116,40 +116,6 @@ 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;
|
|
|
|
- // }
|
|
|
|
- // 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 : '';
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
for (const t of tenderList) {
|
|
for (const t of tenderList) {
|
|
if (t.user_id === this.ctx.session.sessionUser.accountId && (
|
|
if (t.user_id === this.ctx.session.sessionUser.accountId && (
|
|
t.ledger_status === auditConst.ledger.status.checkNo || t.ledger_status === auditConst.ledger.status.uncheck)) {
|
|
t.ledger_status === auditConst.ledger.status.checkNo || t.ledger_status === auditConst.ledger.status.uncheck)) {
|
|
@@ -162,7 +128,7 @@ module.exports = app => {
|
|
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 && t.lastStage.status === auditConst.stage.status.uncheck &&
|
|
if (t.lastStage && t.lastStage.status === auditConst.stage.status.uncheck &&
|
|
- t.lastStage.user_id !== this.ctx.session.sessionUser.accountId) {
|
|
|
|
|
|
+ t.lastStage.user_id !== this.ctx.session.sessionUser.accountId) {c
|
|
t.lastStage = await this.ctx.service.stage.getLastestStage(t.id);
|
|
t.lastStage = await this.ctx.service.stage.getLastestStage(t.id);
|
|
}
|
|
}
|
|
if (t.lastStage) await this.ctx.service.stage.checkStageGatherData(t.lastStage);
|
|
if (t.lastStage) await this.ctx.service.stage.checkStageGatherData(t.lastStage);
|
|
@@ -175,31 +141,6 @@ module.exports = app => {
|
|
await this._getLedgerAuditInfo(t);
|
|
await this._getLedgerAuditInfo(t);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // 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 && 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) {
|
|
|
|
- // await this._getStageAuditInfo(t, t.lastStage);
|
|
|
|
- // } else {
|
|
|
|
- // await this._getLedgerAuditInfo(t);
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
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 = {
|