|
@@ -339,6 +339,15 @@ module.exports = app => {
|
|
|
}
|
|
|
return [validStages, preStage, endStage];
|
|
|
}
|
|
|
+ async _getMonthStages(tender, month) {
|
|
|
+ const stages = await this._getValidStages(tender.id, 'asc'), validStages = [];
|
|
|
+ for (const stage of stages) {
|
|
|
+ if (stage.s_time === month) validStages.push(stage);
|
|
|
+ }
|
|
|
+ const preStage = stages.length > 0 ? stages.find(x => { return x.order === stages[0].order - 1; }) : null;
|
|
|
+ const endStage = stages.length > 0 ? stages.find(x => { return x.order === stages[stages.length - 1].order + 1; }) : null;
|
|
|
+ return [validStages, preStage, endStage];
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 台账数据
|
|
@@ -478,6 +487,10 @@ module.exports = app => {
|
|
|
const [stages, preStage, endStage] = await this._getCheckedZoneStages(tender, zone);
|
|
|
await this._gatherStagesData(completeData, tender, stages, preStage);
|
|
|
}
|
|
|
+ async _gatherMonthsData(tender, completeData, month) {
|
|
|
+ const [stages, preStage, endStage] = await this._getMonthStages(tender, month);
|
|
|
+ await this._gatherStagesData(completeData, tender, stages, preStage);
|
|
|
+ }
|
|
|
|
|
|
async _gatherStageData(completeData, tender, stage, hasPre) {
|
|
|
const helper = this.ctx.helper;
|
|
@@ -664,6 +677,9 @@ module.exports = app => {
|
|
|
case 'month':
|
|
|
await this._gatherMonthData(tender, completeData, gsCustom.month, gsSetting.hasPre);
|
|
|
break;
|
|
|
+ case 'months':
|
|
|
+ await this._gatherMonthsData(tender, completeData, gsCustom.months);
|
|
|
+ break;
|
|
|
case 'zone':
|
|
|
await this._gatherZoneData(tender, completeData, gsCustom.zone);
|
|
|
break;
|