|
|
@@ -19,7 +19,13 @@ module.exports = app => {
|
|
|
const userPermission = accountInfo !== undefined && accountInfo.permission !== '' ? JSON.parse(accountInfo.permission) : null;
|
|
|
if (userPermission !== null && userPermission.tender !== undefined && userPermission.tender.indexOf('1') !== -1) {
|
|
|
const subProject = await this.ctx.service.subProject.getDataById(projectId);
|
|
|
- const tenderList = await this.ctx.service.tender.getList('manage', userPermission, ctx.session.sessionUser.is_admin, '', subProject);
|
|
|
+ const tenderList = await this.ctx.service.tender.getList('', userPermission, ctx.session.sessionUser.is_admin, '', subProject);
|
|
|
+ for (const tender of tenderList) {
|
|
|
+ // 查询当前审批期以及状态
|
|
|
+ const stage = await this.ctx.service.stage.getLastestStage(tender.id, true);
|
|
|
+ tender.stage_order = stage && stage.order ? stage.order : null;
|
|
|
+ tender.stage_status = stage && stage.status ? stage.status : null;
|
|
|
+ }
|
|
|
const categoryData = await this.ctx.service.category.getAllCategory(subProject);
|
|
|
const renderData = {
|
|
|
categoryData,
|
|
|
@@ -155,8 +161,8 @@ module.exports = app => {
|
|
|
advance.auditors = await this.service.advanceAudit.getAuditors(advance.id, advance.times);
|
|
|
advance.curAuditor = await this.service.advanceAudit.getCurAuditor(advance.id, advance.times);
|
|
|
// 根据状态判断是否需要更新审批人列表
|
|
|
- if ((advance.status === status.uncheck || advance.status === status.checkNo) && this.tender.info.shenpi.advance !== shenpiConst.sp_status.sqspr) {
|
|
|
- const shenpi_status = this.tender.info.shenpi.advance;
|
|
|
+ if ((advance.status === status.uncheck || advance.status === status.checkNo) && ctx.tender.info.shenpi.advance !== shenpiConst.sp_status.sqspr) {
|
|
|
+ const shenpi_status = this.ctx.tender.info.shenpi.advance;
|
|
|
// 进一步比较审批流是否与审批流程设置的相同,不同则替换为固定审批流或固定的终审
|
|
|
const auditList = await this.service.advanceAudit.getAllDataByCondition({ where: { vid: advance.id, times: advance.times }, orders: [['order', 'asc']] });
|
|
|
const auditIdList = _.map(auditList, 'audit_id');
|
|
|
@@ -174,7 +180,7 @@ module.exports = app => {
|
|
|
await this.service.advanceAudit.updateLastAudit(advance, auditList, shenpiInfo.audit_id);
|
|
|
} else if (!shenpiInfo) {
|
|
|
// 不存在终审人的状态下这里恢复为授权审批人
|
|
|
- this.tender.info.shenpi.advance = shenpiConst.sp_status.sqspr;
|
|
|
+ this.ctx.tender.info.shenpi.advance = shenpiConst.sp_status.sqspr;
|
|
|
}
|
|
|
}
|
|
|
}
|