|
@@ -91,8 +91,11 @@ module.exports = app => {
|
|
|
async index(ctx) {
|
|
|
try {
|
|
|
// 分页相关
|
|
|
- const count = await ctx.service.ledgerRevise.count({ tid: ctx.tender.id });
|
|
|
- const ledgerRevise = await ctx.service.ledgerRevise.getReviseList(ctx.tender.id);
|
|
|
+ const user = await this.ctx.service.projectAccount.getDataById(ctx.session.sessionUser.accountId);
|
|
|
+ const condition = { tid: ctx.tender.id };
|
|
|
+ if (!user.show_revise_invalid) condition.valid = 1;
|
|
|
+ const count = await ctx.service.ledgerRevise.count(condition);
|
|
|
+ const ledgerRevise = await ctx.service.ledgerRevise.getReviseList(ctx.tender.id, user.show_revise_invalid);
|
|
|
if (ledgerRevise.length > 0) {
|
|
|
const revise = ledgerRevise[0];
|
|
|
if (ctx.page === 1) {
|
|
@@ -131,6 +134,7 @@ module.exports = app => {
|
|
|
auditConst2: JSON.stringify(audit.revise),
|
|
|
stdBills,
|
|
|
stdChapters,
|
|
|
+ show_invalid: user.show_revise_invalid,
|
|
|
};
|
|
|
await this.layout('revise/index.ejs', renderData, 'revise/modal.ejs');
|
|
|
} catch (err) {
|
|
@@ -139,6 +143,15 @@ module.exports = app => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ async showInvalid(ctx) {
|
|
|
+ try {
|
|
|
+ await ctx.service.projectAccount.defaultUpdate({ id: ctx.session.sessionUser.accountId, show_revise_invalid: ctx.query.show });
|
|
|
+ } catch (err) {
|
|
|
+ this.log(err);
|
|
|
+ }
|
|
|
+ ctx.redirect(ctx.request.header.referer);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 修订审批流程(Get)
|
|
|
* @param ctx
|