|
@@ -49,10 +49,15 @@ module.exports = app => {
|
|
|
where: { project_id: ctx.session.sessionProject.id, enable: 1 },
|
|
|
columns: ['id', 'name', 'company', 'role', 'enable', 'is_admin', 'account_group', 'mobile'],
|
|
|
});
|
|
|
- const accountGroupList = accountGroup.map((item, idx) => {
|
|
|
- const groupList = accountList.filter(item => item.account_group === idx);
|
|
|
- return { groupName: item, groupList };
|
|
|
+ const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: projectId } });
|
|
|
+ const accountGroupList = unitList.map(item => {
|
|
|
+ const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
|
+ return { groupName: item.name, groupList };
|
|
|
});
|
|
|
+ // const accountGroupList = accountGroup.map((item, idx) => {
|
|
|
+ // const groupList = accountList.filter(item => item.account_group === idx);
|
|
|
+ // return { groupName: item, groupList };
|
|
|
+ // });
|
|
|
renderData.permissionAudits = permissionAudits;
|
|
|
renderData.accountList = accountList;
|
|
|
renderData.accountGroup = accountGroupList;
|
|
@@ -192,9 +197,9 @@ module.exports = app => {
|
|
|
await ctx.service.paymentTender.update(updateData, conditionData);
|
|
|
} else {
|
|
|
const folderInfo = await ctx.service.paymentFolder.getDataById(conditionData.id);
|
|
|
- if (!folderInfo) throw '目录不存在';
|
|
|
+ if (!folderInfo) throw '文件夹不存在';
|
|
|
if (folderInfo.uid !== ctx.session.sessionUser.accountId && !ctx.session.sessionUser.is_admin) {
|
|
|
- throw '您没有权限重命名此目录';
|
|
|
+ throw '您没有权限重命名此文件夹';
|
|
|
}
|
|
|
await ctx.service.paymentFolder.update(updateData, conditionData);
|
|
|
}
|
|
@@ -384,12 +389,27 @@ module.exports = app => {
|
|
|
const rptAudit = await ctx.service.paymentRptAudit.getDataByCondition({ td_id: ctx.detail.id, uid: ctx.session.sessionUser.accountId });
|
|
|
if (report_json.items[0].interact_cells.length > 0) {
|
|
|
for (const [i, cell] of report_json.items[0].interact_cells.entries()) {
|
|
|
+ cell.index = i;
|
|
|
+ }
|
|
|
+ const numberList = ctx.helper._.filter(report_json.items[0].interact_cells, { DataType: 'intact_type_number' });
|
|
|
+ for (const [i, cell] of report_json.items[0].interact_cells.entries()) {
|
|
|
+ if (cell.Label.indexOf('大写') !== -1 && cell.link === undefined) {
|
|
|
+ if (numberList.length > 0) {
|
|
|
+ const numberInfo = ctx.helper._.find(ctx.helper._.orderBy(numberList, ['index'], ['desc']), function(item) {
|
|
|
+ return item.index < i;
|
|
|
+ });
|
|
|
+ cell.link = numberInfo ? numberInfo.index : '';
|
|
|
+ } else {
|
|
|
+ cell.link = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
const push_item = {
|
|
|
type: paymentConst.rpt_dataType[cell.DataType],
|
|
|
value: cell.Prefix ? ctx.helper._.replace(cell.Value, cell.Prefix, '') : cell.Value,
|
|
|
label: cell.Label,
|
|
|
index: i,
|
|
|
};
|
|
|
+ if (cell.link !== undefined) push_item.link = cell.link;
|
|
|
const thisBandName = paymentConst.rpt_band_name[cell.BandName] ? cell.BandName : 'content';
|
|
|
const oneShowContent = ctx.helper._.find(content, { BandName: thisBandName });
|
|
|
if (oneShowContent) {
|
|
@@ -402,6 +422,7 @@ module.exports = app => {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+ renderData.numberList = numberList;
|
|
|
if (rptAudit && ((ctx.detail.status !== auditConst.status.checkNo && ctx.detail.status !== auditConst.status.checked) ||
|
|
|
(ctx.detail.status === auditConst.status.checked && !renderData.nextDetail) ||
|
|
|
(ctx.detail.status === auditConst.status.checkNo && ctx.detail.uid === ctx.session.sessionUser.accountId))) {
|
|
@@ -434,10 +455,12 @@ module.exports = app => {
|
|
|
columns: ['id', 'name', 'company', 'role', 'enable', 'is_admin', 'account_group', 'mobile'],
|
|
|
});
|
|
|
renderData.accountList = accountList;
|
|
|
- renderData.accountGroup = accountGroup.map((item, idx) => {
|
|
|
- const groupList = accountList.filter(item => item.account_group === idx);
|
|
|
- return { groupName: item, groupList };
|
|
|
+ const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
|
|
|
+ const accountGroupList = unitList.map(item => {
|
|
|
+ const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
|
+ return { groupName: item.name, groupList };
|
|
|
});
|
|
|
+ renderData.accountGroup = accountGroupList;
|
|
|
}
|
|
|
await this.layout('payment/detail.ejs', renderData, 'payment/detail_modal.ejs');
|
|
|
} catch (err) {
|
|
@@ -641,9 +664,10 @@ module.exports = app => {
|
|
|
where: { project_id: ctx.session.sessionProject.id, enable: 1 },
|
|
|
columns: ['id', 'name', 'company', 'role', 'enable', 'is_admin', 'account_group', 'mobile'],
|
|
|
});
|
|
|
- const accountGroupList = accountGroup.map((item, idx) => {
|
|
|
- const groupList = accountList.filter(item => item.account_group === idx);
|
|
|
- return { groupName: item, groupList };
|
|
|
+ const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
|
|
|
+ const accountGroupList = unitList.map(item => {
|
|
|
+ const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
|
+ return { groupName: item.name, groupList };
|
|
|
});
|
|
|
const renderData = {
|
|
|
tender: ctx.tender,
|
|
@@ -823,9 +847,10 @@ module.exports = app => {
|
|
|
where: { project_id: ctx.session.sessionProject.id, enable: 1 },
|
|
|
columns: ['id', 'name', 'company', 'role', 'enable', 'is_admin', 'account_group', 'mobile'],
|
|
|
});
|
|
|
- const accountGroupList = accountGroup.map((item, idx) => {
|
|
|
- const groupList = accountList.filter(item => item.account_group === idx);
|
|
|
- return { groupName: item, groupList };
|
|
|
+ const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
|
|
|
+ const accountGroupList = unitList.map(item => {
|
|
|
+ const groupList = accountList.filter(item1 => item1.company === item.name);
|
|
|
+ return { groupName: item.name, groupList };
|
|
|
});
|
|
|
renderData.accountList = accountList;
|
|
|
renderData.accountGroup = accountGroupList;
|