|
@@ -50,6 +50,8 @@ module.exports = app => {
|
|
|
if (!tid || !sorder) throw '参数错误';
|
|
|
const stage = await this.ctx.service.stage.getDataByCondition({ tid, order: sorder});
|
|
|
if (!stage) throw '关联标段/期不存在';
|
|
|
+ const exist = await this.ctx.service.stageRela.getDataByCondition({ sid: this.ctx.stage.id, rela_tid: tid});
|
|
|
+ if (exist) throw '已关联该标段,请勿重复关联';
|
|
|
const trid = await this.ctx.service.stageRela.addStageRela(stage);
|
|
|
ctx.redirect(ctx.request.header.referer + '/detail/' + trid);
|
|
|
} catch (err) {
|