|
@@ -68,7 +68,7 @@ module.exports = app => {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- async doCheckStage(stage, formDataCollect = false) {
|
|
|
+ async doCheckStage(stage, force = false) {
|
|
|
const status = auditConst.status;
|
|
|
stage.auditors = await this.ctx.service.stageAudit.getAuditors(stage.id, stage.times);
|
|
|
stage.curAuditor = await this.ctx.service.stageAudit.getCurAuditor(stage.id, stage.times);
|
|
@@ -76,6 +76,7 @@ module.exports = app => {
|
|
|
const accountId = this.ctx.session.sessionUser.accountId,
|
|
|
auditorIds = this._.map(stage.auditors, 'aid'),
|
|
|
shareIds = [];
|
|
|
+ const isTenderTourist = await this.service.tenderTourist.getDataByCondition({ tid: stage.tid, user_id: accountId });
|
|
|
const permission = this.ctx.session.sessionUser.permission;
|
|
|
if (accountId === stage.user_id) { // 原报
|
|
|
if (stage.curAuditor) {
|
|
@@ -91,7 +92,7 @@ module.exports = app => {
|
|
|
} else {
|
|
|
stage.curOrder = stage.curAuditor.aid === accountId ? stage.curAuditor.order : stage.curAuditor.order - 1;
|
|
|
}
|
|
|
- } else if ((this.ctx.tender && this.ctx.tender.isTourist) || formDataCollect) { // 游客
|
|
|
+ } else if (!!isTenderTourist || force) { // 游客
|
|
|
stage.readOnly = true;
|
|
|
stage.curTimes = stage.times;
|
|
|
if (stage.status === status.uncheck || stage.status === status.checkNo) {
|
|
@@ -218,10 +219,10 @@ module.exports = app => {
|
|
|
return await this.db.query(sql, sqlParam);
|
|
|
}
|
|
|
|
|
|
- async checkStageGatherData(stage, formDataCollect = false) {
|
|
|
+ async checkStageGatherData(stage, force = false) {
|
|
|
// 最新一期计量(未审批完成),当前操作人的期详细数据,应实时计算
|
|
|
if (stage.status !== auditConst.status.checked) {
|
|
|
- await this.doCheckStage(stage, formDataCollect);
|
|
|
+ await this.doCheckStage(stage, force);
|
|
|
if (!stage.readOnly && stage.check_calc) {
|
|
|
const tpData = await this.ctx.service.stageBills.getSumTotalPrice(stage);
|
|
|
stage.contract_tp = tpData.contract_tp;
|