|
@@ -140,7 +140,7 @@ module.exports = app => {
|
|
|
stage.isCheckFirst = stage.order > 1 ? (stage.preCheckedStage ? stage.preCheckedStage.order === stage.order - 1 : false) : true;
|
|
|
} else {
|
|
|
stage.preCheckedStage = undefined;
|
|
|
- stage.isCheckFirst = false;
|
|
|
+ stage.isCheckFirst = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -393,7 +393,6 @@ module.exports = app => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
async _checkStageValid(stage) {
|
|
|
if (stage.status === auditConst.stage.status.uncheck && !this.ctx.tender.isTourist) {
|
|
|
const assist = await this.ctx.service.auditAss.getAllDataByCondition({ where: { tid: stage.tid, user_id: stage.user_id } });
|
|
@@ -511,6 +510,7 @@ module.exports = app => {
|
|
|
const result = await transaction.insert(this.tableName, newStage);
|
|
|
if (result.affectedRows === 1) {
|
|
|
newStage.id = result.insertId;
|
|
|
+ newStage.preCheckedStage = preCheckedStage;
|
|
|
} else {
|
|
|
throw '新增期数据失败';
|
|
|
}
|
|
@@ -542,8 +542,8 @@ module.exports = app => {
|
|
|
if (preStage && preCheckedStage && preStage.order === preCheckedStage.order) {
|
|
|
const priceCalc = new RevisePrice(this.ctx);
|
|
|
pcTp = await priceCalc.newStagePriceChange(newStage, preStage, transaction);
|
|
|
+ await this.ctx.service.tenderCache.updateStageCache4Add(transaction, newStage, pcTp);
|
|
|
}
|
|
|
- await this.ctx.service.tenderCache.updateStageCache4Add(transaction, newStage, pcTp);
|
|
|
// 新增期拷贝报表相关配置/签名角色 等
|
|
|
if (preStage) {
|
|
|
const rptResult = await this.ctx.service.rptCustomDefine.addInitialStageData(newStage, preStage, transaction);
|
|
@@ -690,9 +690,10 @@ module.exports = app => {
|
|
|
* @return {Promise<void>}
|
|
|
*/
|
|
|
async deleteStage(id) {
|
|
|
+ const stageInfo = await this.getDataById(id);
|
|
|
+ await this.loadPreCheckedStage(stageInfo);
|
|
|
const transaction = await this.db.beginTransaction();
|
|
|
try {
|
|
|
- const stageInfo = await this.getDataById(id);
|
|
|
// 通知发送 - 第三方更新
|
|
|
// if (this.ctx.session.sessionProject.custom && syncApiConst.notice_type.indexOf(this.ctx.session.sessionProject.customType) !== -1) {
|
|
|
// const base_data = {
|
|
@@ -707,7 +708,7 @@ module.exports = app => {
|
|
|
// await this.ctx.helper.syncNoticeSend(this.ctx.session.sessionProject.customType, JSON.stringify(base_data));
|
|
|
// }
|
|
|
await transaction.delete(this.tableName, { id });
|
|
|
- await this.ctx.service.tenderCache.updateStageCache4Del(transaction, stageInfo);
|
|
|
+ if (stageInfo.isCheckFirst) await this.ctx.service.tenderCache.updateStageCache4Del(transaction, stageInfo);
|
|
|
await transaction.delete(this.ctx.service.pos.tableName, { add_stage: id });
|
|
|
await transaction.delete(this.ctx.service.stageAudit.tableName, { sid: id });
|
|
|
await transaction.delete(this.ctx.service.stageBills.tableName, { sid: id });
|