|
@@ -424,6 +424,10 @@ module.exports = app => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ const accountInfo = await this.ctx.service.projectAccount.getDataById(this.ctx.session.sessionUser.accountId);
|
|
|
+ const userPermission = accountInfo !== undefined && accountInfo.permission !== ''
|
|
|
+ ? JSON.parse(accountInfo.permission) : null;
|
|
|
+ const deleteFilePermission = userPermission && userPermission.change !== undefined && userPermission.change.indexOf('2') !== -1;
|
|
|
|
|
|
// 工程变更类别读取
|
|
|
const projectData = await ctx.service.project.getDataById(ctx.session.sessionProject.id);
|
|
@@ -467,6 +471,7 @@ module.exports = app => {
|
|
|
settleBills,
|
|
|
settlePos,
|
|
|
removeSettleNum,
|
|
|
+ deleteFilePermission,
|
|
|
};
|
|
|
// 获取是否已存在调用变更令
|
|
|
let changeUsedData = await ctx.service.stageChange.getAllFinalUsedData(ctx.tender.id, change.cid);
|
|
@@ -1224,7 +1229,11 @@ module.exports = app => {
|
|
|
if (!fileInfo || !Object.keys(fileInfo).length) {
|
|
|
throw '该文件不存在';
|
|
|
}
|
|
|
- if (!fileInfo.extra_upload && change.status === audit.change.status.checked) {
|
|
|
+ const accountInfo = await this.ctx.service.projectAccount.getDataById(this.ctx.session.sessionUser.accountId);
|
|
|
+ const userPermission = accountInfo !== undefined && accountInfo.permission !== ''
|
|
|
+ ? JSON.parse(accountInfo.permission) : null;
|
|
|
+ const deleteFilePermission = userPermission && userPermission.change !== undefined && userPermission.change.indexOf('2') !== -1;
|
|
|
+ if (!fileInfo.extra_upload && change.status === audit.change.status.checked && !deleteFilePermission) {
|
|
|
throw '无权限删除';
|
|
|
}
|
|
|
if (fileInfo !== undefined && fileInfo !== '') {
|