Forráskód Böngészése

安全计量用户添加方式调整

ellisran 1 napja
szülő
commit
39bf0e6a5d

+ 2 - 1
app/controller/safe_controller.js

@@ -162,7 +162,8 @@ module.exports = app => {
                 const attList = await ctx.service.paymentDetailAtt.getPaymentDetailAttachment(ctx.safeStage.id, 'desc');
                 const attList = await ctx.service.paymentDetailAtt.getPaymentDetailAttachment(ctx.safeStage.id, 'desc');
                 const stdBills = await ctx.service.stdGclList.getSafeGcl();
                 const stdBills = await ctx.service.stdGclList.getSafeGcl();
                 // 流程审批人相关数据
                 // 流程审批人相关数据
-                const accountList = await ctx.service.projectAccount.getAllSubProjectAccountByPermission(ctx.subProject, 'payment_permission');
+                // const accountList = await ctx.service.projectAccount.getAllSubProjectAccountByPermission(ctx.subProject, 'payment_permission');
+                const accountList = await ctx.service.projectAccount.getAllSubProjectAccount(ctx.subProject);
                 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 } });
                 const accountGroup = unitList.map(item => {
                 const accountGroup = unitList.map(item => {
                     const groupList = accountList.filter(item1 => item1.company === item.name);
                     const groupList = accountList.filter(item1 => item1.company === item.name);

+ 1 - 1
app/service/safe_inspection_audit.js

@@ -715,7 +715,7 @@ module.exports = app => {
                             times: inspection.times, order: selfAudit.order + 1, status: auditConst.status.rectification,
                             times: inspection.times, order: selfAudit.order + 1, status: auditConst.status.rectification,
                             is_rectification: 1, begin_time: time, audit_order: selfAudit.audit_order + 1,
                             is_rectification: 1, begin_time: time, audit_order: selfAudit.audit_order + 1,
                         });
                         });
-                        const auditList = await this.ctx.service.tenderPermission.getPartsPermission(inspection.tid, ['inspection']);
+                        const auditList = await this.ctx.service.tenderPermission.getPartsPermission(inspection.tid, ['safe_inspection']);
                         const addAid = this._.includes(this._.map(auditList, 'uid'), checkData.rectification_uid);
                         const addAid = this._.includes(this._.map(auditList, 'uid'), checkData.rectification_uid);
                         if (!addAid) {
                         if (!addAid) {
                             const insert_members = [{
                             const insert_members = [{

+ 10 - 1
app/service/safe_stage_audit.js

@@ -269,6 +269,15 @@ module.exports = app => {
                     audit_order: newAuditOrder, audit_type: auditType.key.common,
                     audit_order: newAuditOrder, audit_type: auditType.key.common,
                 };
                 };
                 const result = await transaction.insert(this.tableName, data);
                 const result = await transaction.insert(this.tableName, data);
+                const auditList = await this.ctx.service.tenderPermission.getPartsPermission(this.ctx.tender.id, ['safe_payment']);
+                const addAid = this._.includes(this._.map(auditList, 'uid'), auditor.id);
+                if (!addAid) {
+                    const insert_members = [{
+                        uid: auditor.id,
+                        safe_payment: ['1'],
+                    }];
+                    await this.ctx.service.tenderPermission.saveOnePermission(this.ctx.tender.id, [auditor.id], insert_members, ['safe_payment'], transaction);
+                }
                 await transaction.commit();
                 await transaction.commit();
                 return result.effectRows = 1;
                 return result.effectRows = 1;
             } catch (err) {
             } catch (err) {
@@ -432,7 +441,7 @@ module.exports = app => {
         async start(safeStage) {
         async start(safeStage) {
             const audits = await this.getAllDataByCondition({ where: { stage_id: safeStage.id, audit_times: safeStage.audit_times, audit_order: 1 } });
             const audits = await this.getAllDataByCondition({ where: { stage_id: safeStage.id, audit_times: safeStage.audit_times, audit_order: 1 } });
             if (audits.length === 0) {
             if (audits.length === 0) {
-                if(this.ctx.tender.info.shenpi.safeStage === shenpiConst.sp_status.gdspl) {
+                if(this.ctx.tender.info.shenpi.safe_payment === shenpiConst.sp_status.gdspl) {
                     throw '请联系管理员添加审批人';
                     throw '请联系管理员添加审批人';
                 } else {
                 } else {
                     throw '请先选择审批人,再上报数据';
                     throw '请先选择审批人,再上报数据';