|
@@ -981,7 +981,7 @@ module.exports = app => {
|
|
|
await this.ctx.service.stage.checkStage(sid);
|
|
|
const user = await this.ctx.service.projectAccount.getDataById(this.ctx.stage.user_id);
|
|
|
const auditors = this.ctx.stage.auditors;
|
|
|
- return [{
|
|
|
+ const result = [{
|
|
|
aid: user.id,
|
|
|
name: user.name,
|
|
|
company: user.company,
|
|
@@ -989,9 +989,48 @@ module.exports = app => {
|
|
|
mobile: user.mobile,
|
|
|
telephone: user.telephone,
|
|
|
sign_path: user.sign_path,
|
|
|
+ opinion: user.opinion,
|
|
|
end_time: auditors && auditors.length > 0 ? auditors[0].begin_time : null,
|
|
|
sort: 0,
|
|
|
- }, ...this.ctx.stage.auditors];
|
|
|
+ }];
|
|
|
+ for (const a of auditors) {
|
|
|
+ const auditor = await this.ctx.service.stageAudit.getDataByCondition({tid: a.tid, sid: a.sid, order: a.max_order});
|
|
|
+ result.push({
|
|
|
+ aid: a.aid,
|
|
|
+ name: a.name,
|
|
|
+ company: a.company,
|
|
|
+ role: a.role,
|
|
|
+ mobile: a.mobile,
|
|
|
+ telephone: a.telephone,
|
|
|
+ sign_path: a.sign_path,
|
|
|
+ end_time: auditor.end_time,
|
|
|
+ opinion: auditor.opinion,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ async getSignSelect(tid, sid, customSelect) {
|
|
|
+ await this.ctx.service.tender.checkTender(tid);
|
|
|
+ await this.ctx.service.stage.checkStage(sid);
|
|
|
+
|
|
|
+ const signSelect = customSelect.sign_select, result = {};
|
|
|
+ for (const [i, ss] of signSelect.entries()) {
|
|
|
+ const user = await this.ctx.service.projectAccount.getDataById(ss.id);
|
|
|
+ const sign = {
|
|
|
+ id: ss.id, name: user.name, company: user.company, role: user.role,
|
|
|
+ mobile: user.mobile, telephone: user.telephone,
|
|
|
+ };
|
|
|
+ if (ss.id !== this.ctx.stage.user_id) {
|
|
|
+ const audit = this.ctx.stage.auditors.find(x => {return x.aid === ss.id});
|
|
|
+ user.end_time = audit ? audit.end_time : ss.audit_time;
|
|
|
+ } else {
|
|
|
+ user.end_time = this.ctx.stage.auditors[0].end_time;
|
|
|
+ }
|
|
|
+ if (user.end_time) sign.sign_path = user.sign_path;
|
|
|
+ result['sign' + (i+1)] = sign;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|
|
|
|