|
@@ -1,4 +1,4 @@
|
|
-import {ADMINISTRATOR, IApiProcessor, ICachedData, IMethodParams, IRequest} from "@core/Defined";
|
|
|
|
|
|
+import {IApiProcessor, ICachedData, IMethodParams, IRequest} from "@core/Defined";
|
|
import {QueryTypes} from "sequelize";
|
|
import {QueryTypes} from "sequelize";
|
|
import {PrjInfo} from "@core-models/PrjInfo";
|
|
import {PrjInfo} from "@core-models/PrjInfo";
|
|
import {Resp} from "@util/Resp";
|
|
import {Resp} from "@util/Resp";
|
|
@@ -37,7 +37,7 @@ function statusGuard(json: IRequest, cached_data: ICachedData): Promise<void> {
|
|
let user = cached_data.user_id;
|
|
let user = cached_data.user_id;
|
|
let data = <IData>json.data;
|
|
let data = <IData>json.data;
|
|
if (!user) return reject(Resp.gen_err(Resp.Forbidden));
|
|
if (!user) return reject(Resp.gen_err(Resp.Forbidden));
|
|
- if (user === ADMINISTRATOR) return resolve();
|
|
|
|
|
|
+ // if (user === ADMINISTRATOR) return resolve();
|
|
let prj_info = await PrjInfo.findOne({where: {id: data.prj_id}, raw: true});
|
|
let prj_info = await PrjInfo.findOne({where: {id: data.prj_id}, raw: true});
|
|
if (!prj_info) return reject(Resp.gen_err(Resp.ResourceNotFound));
|
|
if (!prj_info) return reject(Resp.gen_err(Resp.ResourceNotFound));
|
|
// 检查用户是否是项目负责人,只有项目负责人才可以对任务进行排序
|
|
// 检查用户是否是项目负责人,只有项目负责人才可以对任务进行排序
|
|
@@ -50,8 +50,19 @@ function statusGuard(json: IRequest, cached_data: ICachedData): Promise<void> {
|
|
// if (phase.order_index < 20) return reject(Resp.gen_err(Resp.InvalidFlow, '需要先对项目进行立项,立项后才可制订计划。'));
|
|
// if (phase.order_index < 20) return reject(Resp.gen_err(Resp.InvalidFlow, '需要先对项目进行立项,立项后才可制订计划。'));
|
|
if (phase.order_index >=30 && phase.order_index <= 40 && !data.draft)
|
|
if (phase.order_index >=30 && phase.order_index <= 40 && !data.draft)
|
|
return reject(Resp.gen_err(Resp.InvalidFlow, '项目计划审核中,当前阶段不允许修改。'));
|
|
return reject(Resp.gen_err(Resp.InvalidFlow, '项目计划审核中,当前阶段不允许修改。'));
|
|
- if (phase.order_index >= 60 && phase.order_index <=70 && !data.draft) return reject(Resp.gen_err(Resp.InvalidFlow, '当前项目阶段不允许直接修改计划,应在草稿中修改后重新提交审核。'));
|
|
|
|
- if (phase.order_index >= 80) return reject(Resp.gen_err(Resp.InvalidFlow, '当前项目阶段不允许修改计划。'));
|
|
|
|
|
|
+ // if (phase.order_index >= 60 && phase.order_index <=65 && !data.draft) return reject(Resp.gen_err(Resp.InvalidFlow, '当前项目阶段不允许直接修改计划,应在草稿中修改后重新提交审核。'));
|
|
|
|
+ // if (phase.order_index >= 80) return reject(Resp.gen_err(Resp.InvalidFlow, '当前项目阶段不允许修改计划。'));
|
|
|
|
+ if (phase.order_index >= 60 && phase.order_index <= 65)
|
|
|
|
+ return reject(Resp.gen_err(Resp.InvalidFlow, '当前项目处于计划变更审核过程中,不允许修改计划。'));
|
|
|
|
+ if (phase.order_index === 80) {
|
|
|
|
+ return reject(Resp.gen_err(Resp.InvalidFlow, '项目验收中,不允许修改计划。'));
|
|
|
|
+ }
|
|
|
|
+ if (phase.order_index === 90) {
|
|
|
|
+ return reject(Resp.gen_err(Resp.InvalidFlow, '项目已作废,不允许修改计划。'));
|
|
|
|
+ }
|
|
|
|
+ if (phase.order_index === 100) {
|
|
|
|
+ return reject(Resp.gen_err(Resp.InvalidFlow, '项目已完成,不允许修改计划。'));
|
|
|
|
+ }
|
|
resolve();
|
|
resolve();
|
|
});
|
|
});
|
|
}
|
|
}
|