|
|
@@ -314,6 +314,11 @@ module.exports = app => {
|
|
|
};
|
|
|
insertStage.push(stage);
|
|
|
const safeBills = await this.ctx.service.paymentSafeBills.getAllDataByCondition({ where: { detail_id: detail.id } });
|
|
|
+ const exist = safeBills.length > 0 ? await this.ctx.service.safeStageBills.getDataById(safeBills[0].id) : null;
|
|
|
+ if (exist) {
|
|
|
+ const existTender = await this.ctx.service.tender.getDataById(exist.tender_id);
|
|
|
+ throw '该标段安全生产费数据已迁移' + (existTender ? `至标段【${existTender.name}】下,请勿重复迁移` : '');
|
|
|
+ }
|
|
|
let tp = 0, pre_tp = 0;
|
|
|
for (const sb of safeBills) {
|
|
|
sb.tender_id = tid;
|