|
|
@@ -56,14 +56,14 @@ module.exports = app => {
|
|
|
}
|
|
|
const accountList = await ctx.service.projectAccount.getAllSubProjectAccount(ctx.subProject);
|
|
|
renderData.accountList = accountList;
|
|
|
- const unitList = await ctx.service.constructionUnit.getAllDataByCondition({where: {pid: ctx.session.sessionProject.id}});
|
|
|
+ const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
|
|
|
renderData.accountGroup = unitList.map(item => {
|
|
|
const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
|
return { groupName: item.name, groupList };
|
|
|
}).filter(x => { return x.groupList.length > 0; });
|
|
|
// renderData.permissionConst = ctx.service.subProjPermission.PermissionConst;
|
|
|
renderData.categoryData = await this.ctx.service.category.getAllCategory(ctx.subProject);
|
|
|
- renderData.companys = await this.ctx.service.constructionUnit.getAllDataByCondition({where: {pid: ctx.session.sessionProject.id}});
|
|
|
+ renderData.companys = await this.ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
|
|
|
// renderData.templates = await this.ctx.service.filingTemplateList.getAllTemplate(ctx.session.sessionProject.id);
|
|
|
await this.layout('contract/index.ejs', renderData, 'contract/modal.ejs');
|
|
|
} catch (err) {
|
|
|
@@ -280,7 +280,7 @@ module.exports = app => {
|
|
|
stdChapters,
|
|
|
};
|
|
|
|
|
|
- const contractColSet = await ctx.service.contractColSet.getContractColSet(ctx.session.sessionProject.id, ctx.contractOptions.tid, ctx.contract_type);
|
|
|
+ const contractColSet = await ctx.service.contractColSet.getContractColSet(ctx.subProject.id, ctx.contractOptions.tid, ctx.contract_type);
|
|
|
renderData.colSet = ctx.service.contractColSet.analysisColSetWithDefine(contractConst.colSet[ctx.contract_type], contractColSet.info, contractConst.defaultColSet[ctx.contract_type]);
|
|
|
if (ctx.session.sessionUser.is_admin) {
|
|
|
const accountList = await ctx.service.projectAccount.getAllSubProjectAccount(ctx.subProject);
|
|
|
@@ -302,14 +302,14 @@ module.exports = app => {
|
|
|
/**
|
|
|
* 保存列设置
|
|
|
* @param ctx
|
|
|
- * @returns {Promise<void>}
|
|
|
+ * @return {Promise<void>}
|
|
|
*/
|
|
|
async colSet(ctx) {
|
|
|
try {
|
|
|
const colType = ctx.request.body.col_type;
|
|
|
const colSet = JSON.parse(ctx.request.body.col_set);
|
|
|
const contractType = ctx.request.body.type;
|
|
|
- await ctx.service.contractColSet.setContractColSet(ctx.session.sessionProject.id, ctx.contractOptions.tid, contractType, colType, colSet);
|
|
|
+ await ctx.service.contractColSet.setContractColSet(ctx.subProject.id, ctx.contractOptions.tid, contractType, colType, colSet);
|
|
|
ctx.redirect(ctx.request.header.referer);
|
|
|
} catch (err) {
|
|
|
ctx.log(err);
|
|
|
@@ -343,7 +343,7 @@ module.exports = app => {
|
|
|
return { groupName: item.name, groupList };
|
|
|
}).filter(x => { return x.groupList.length > 0; });
|
|
|
responseData.data.contractAudits = contractAudits;
|
|
|
- responseData.data.accountGroup = ctx.helper._.filter(accountGroup, function (item) {
|
|
|
+ responseData.data.accountGroup = ctx.helper._.filter(accountGroup, function(item) {
|
|
|
return item.groupList.length > 0;
|
|
|
});
|
|
|
}
|