|
@@ -142,11 +142,10 @@ module.exports = app => {
|
|
|
async list(ctx) {
|
|
|
try {
|
|
|
// 获取用户新建标段权利
|
|
|
- const accountInfo = await this.ctx.service.projectAccount.getDataById(this.ctx.session.sessionUser.accountId);
|
|
|
+ const accountInfo = await this.ctx.service.projectAccount.getDataById(ctx.session.sessionUser.accountId);
|
|
|
const userPermission = accountInfo !== undefined && accountInfo.permission !== '' ? JSON.parse(accountInfo.permission) : null;
|
|
|
|
|
|
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)) {
|
|
@@ -156,9 +155,14 @@ module.exports = app => {
|
|
|
}
|
|
|
if (t.ledger_status === auditConst.ledger.status.checked) {
|
|
|
t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
|
|
|
- if (t.lastStage) {
|
|
|
- await this.ctx.service.stage.checkStageGatherData(t.lastStage);
|
|
|
+
|
|
|
+ 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);
|
|
|
}
|
|
|
}
|
|
|
const categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
|