|
@@ -369,7 +369,14 @@ module.exports = app => {
|
|
|
const users = await this.ctx.service.projectAccount.getAllDataByCondition({ where: { project_id: subProject.project_id, company: data.management }});
|
|
|
const orgMember = await this.ctx.service.subProjPermission.getAllDataByCondition({ where: { spid: subProject.id } });
|
|
|
const dm = [], um = [], im = [];
|
|
|
- const filing_type = this.ctx.service.filing.allFilingType.join(','), file_permission = '1,2';
|
|
|
+
|
|
|
+ const template = await this.ctx.service.filingTemplateList.getDataById(data.filingTemplate);
|
|
|
+ if (!template) throw '选择的文件类别不存在';
|
|
|
+
|
|
|
+ const templateFiling = await this.ctx.service.filingTemplate.getAllDataByCondition({
|
|
|
+ where: { temp_id: template.id, tree_level: 1 },
|
|
|
+ });
|
|
|
+ const filing_type = templateFiling.map(x => { return x.filing_type; }).join(','), file_permission = '1,2';
|
|
|
for (const u of users) {
|
|
|
const nm = orgMember.find(x => { return u.id === x.uid; });
|
|
|
if (nm) {
|
|
@@ -378,8 +385,6 @@ module.exports = app => {
|
|
|
im.push({ id: this.uuid.v4(), spid: subProject.id, pid: subProject.project_id, uid: u.id, file_permission, filing_type });
|
|
|
}
|
|
|
}
|
|
|
- const template = await this.ctx.service.filingTemplateList.getDataById(data.filingTemplate);
|
|
|
- if (!template) throw '选择的文件类别不存在';
|
|
|
|
|
|
const conn = await this.db.beginTransaction();
|
|
|
try {
|