Commit 4c69da71 by yuananting

feat:培训任务保存校验跳转定位

parent 90c13b48
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-07-29 13:57:03 * @Date: 2021-07-29 13:57:03
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-08-14 14:17:54 * @LastEditTime: 2021-08-14 14:30:11
* @Description: 任务中心-培训任务-新建页面 * @Description: 任务中心-培训任务-新建页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...@@ -296,27 +296,33 @@ function AddTrainTask() { ...@@ -296,27 +296,33 @@ function AddTrainTask() {
const { percentCompleteLive, percentCompleteVideo, percentCompletePicture } = finishStandard; const { percentCompleteLive, percentCompleteVideo, percentCompletePicture } = finishStandard;
if (!taskName) { if (!taskName) {
activeStep === 'TRAIN_CONTENT' && setActiveStep('BASIC_INFO');
return message.warning('请输入培训任务名称'); return message.warning('请输入培训任务名称');
} }
if (assignList.length === 0) { if (assignList.length === 0) {
activeStep === 'TRAIN_CONTENT' && setActiveStep('BASIC_INFO');
return message.warning('请选择指派对象'); return message.warning('请选择指派对象');
} }
if (stageList.length === 0) { if (stageList.length === 0) {
activeStep === 'BASIC_INFO' && setActiveStep('TRAIN_CONTENT');
return message.warning('请添加阶段'); return message.warning('请添加阶段');
} }
const stageNameEmpty = stageList.filter((item) => !item.stageName); const stageNameEmpty = stageList.filter((item) => !item.stageName);
if (stageNameEmpty.length > 0) { if (stageNameEmpty.length > 0) {
activeStep === 'BASIC_INFO' && setActiveStep('TRAIN_CONTENT');
return message.warning('请输入阶段名称'); return message.warning('请输入阶段名称');
} }
const stageNameArr = stageList.map((item) => item.stageName); const stageNameArr = stageList.map((item) => item.stageName);
const stageNameSet = new Set(stageNameArr); const stageNameSet = new Set(stageNameArr);
if (stageNameSet.size !== stageNameArr.length) { if (stageNameSet.size !== stageNameArr.length) {
activeStep === 'BASIC_INFO' && setActiveStep('TRAIN_CONTENT');
return message.warning('阶段名称不能重复'); return message.warning('阶段名称不能重复');
} }
if (percentCompleteLive === '' || percentCompleteVideo === '' || percentCompletePicture === '') { if (percentCompleteLive === '' || percentCompleteVideo === '' || percentCompletePicture === '') {
activeStep === 'BASIC_INFO' && setActiveStep('TRAIN_CONTENT');
return message.warning('请输入完成标准'); return message.warning('请输入完成标准');
} }
...@@ -327,7 +333,10 @@ function AddTrainTask() { ...@@ -327,7 +333,10 @@ function AddTrainTask() {
(introduceId) => { (introduceId) => {
submitRemote(introduceId, issue); submitRemote(introduceId, issue);
}, },
() => message.warning('上传培训目的失败') () => {
activeStep === 'TRAIN_CONTENT' && setActiveStep('BASIC_INFO');
message.warning('上传培训目的失败');
}
); );
} else { } else {
submitRemote(null, issue); submitRemote(null, issue);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment