|
@@ -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 '请先选择审批人,再上报数据';
|