|
@@ -1179,10 +1179,14 @@ module.exports = app => {
|
|
const categoryData = await this.ctx.service.category.getAllCategory(ctx.subProject);
|
|
const categoryData = await this.ctx.service.category.getAllCategory(ctx.subProject);
|
|
const tenders = hadTender ? await ctx.service.tender.getAllDataByCondition({ where: tenderCondition, columns: ['id', 'name', 'category'] }) : [];
|
|
const tenders = hadTender ? await ctx.service.tender.getAllDataByCondition({ where: tenderCondition, columns: ['id', 'name', 'category'] }) : [];
|
|
const transfersCondition = { spid: ctx.subProject.id };
|
|
const transfersCondition = { spid: ctx.subProject.id };
|
|
|
|
+ let notTids = false;
|
|
if (filterTids) {
|
|
if (filterTids) {
|
|
|
|
+ if (filterTids.length === 0) {
|
|
|
|
+ notTids = true;
|
|
|
|
+ }
|
|
transfersCondition.tid = filterTids;
|
|
transfersCondition.tid = filterTids;
|
|
}
|
|
}
|
|
- const allTransfers = await ctx.service.financialTransferTender.getAllDataByCondition({ where: transfersCondition });
|
|
|
|
|
|
+ const allTransfers = !notTids ? await ctx.service.financialTransferTender.getAllDataByCondition({ where: transfersCondition }) : [];
|
|
const accountList = await ctx.service.projectAccount.getAllSubProjectAccount(ctx.subProject, ['id', 'account', 'name', 'company', 'company_id', 'role', 'enable', 'is_admin', 'account_group', 'mobile']);
|
|
const accountList = await ctx.service.projectAccount.getAllSubProjectAccount(ctx.subProject, ['id', 'account', 'name', 'company', 'company_id', 'role', 'enable', 'is_admin', 'account_group', 'mobile']);
|
|
const user = accountList.find(item => item.id === ctx.session.sessionUser.accountId) || null;
|
|
const user = accountList.find(item => item.id === ctx.session.sessionUser.accountId) || null;
|
|
const userCompany = user ? ctx.helper._.find(unitList, { name: user.company }) : null;
|
|
const userCompany = user ? ctx.helper._.find(unitList, { name: user.company }) : null;
|
|
@@ -1361,7 +1365,7 @@ module.exports = app => {
|
|
await this.layout('financial/pay_detail.ejs', renderData, 'financial/pay_detail_modal.ejs');
|
|
await this.layout('financial/pay_detail.ejs', renderData, 'financial/pay_detail_modal.ejs');
|
|
} catch (err) {
|
|
} catch (err) {
|
|
this.log(err);
|
|
this.log(err);
|
|
- ctx.redirect(`/sp/${ctx.subProject.id}/financial/pay`);
|
|
|
|
|
|
+ ctx.redirect(`/sp/${ctx.subProject.id}/financial/pay/stage`);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|