Commit f3e43d6a by zhangleyuan

feat:处理创建培训计划必须关联课程

parent cf519c45
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zhangleyuan * @Author: zhangleyuan
* @Date: 2021-02-20 16:13:39 * @Date: 2021-02-20 16:13:39
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2021-03-11 19:42:02 * @LastEditTime: 2021-03-12 11:29:48
* @Description: 描述一下 * @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -142,7 +142,17 @@ function AddPlan() { ...@@ -142,7 +142,17 @@ function AddPlan() {
for(let i=0;i<taskList.length;i++){ for(let i=0;i<taskList.length;i++){
if(input.test(taskList[i].taskName)){ if(input.test(taskList[i].taskName)){
message.warning('培训任务名称不能为空'); message.warning('培训任务名称不能为空');
return; return false;
}
if(taskList[i].courseList.length === 0){
Modal.confirm({
title: '保存失败',
content: '每个任务下至少关联一个课程',
okText: '确定',
cancelText: '取消',
icon: <span className="icon iconfont default-confirm-icon">&#xe6f4;</span>,
})
return false;
} }
} }
let scheduleMediaRequests = []; let scheduleMediaRequests = [];
......
...@@ -84,6 +84,10 @@ class UnbundEmployeeModal extends React.Component { ...@@ -84,6 +84,10 @@ class UnbundEmployeeModal extends React.Component {
} }
confirmUnbund = ()=>{ confirmUnbund = ()=>{
const { selectOperatorList } = this.state; const { selectOperatorList } = this.state;
if(selectOperatorList.length ===0){
message.success('请选择员工');
return false;
}
const params = { const params = {
planId:getParameterByName("id"), planId:getParameterByName("id"),
removeUserIds:_.pluck(selectOperatorList, 'storeUserId'), removeUserIds:_.pluck(selectOperatorList, 'storeUserId'),
...@@ -129,7 +133,7 @@ class UnbundEmployeeModal extends React.Component { ...@@ -129,7 +133,7 @@ class UnbundEmployeeModal extends React.Component {
if (selected) { if (selected) {
_list = _.uniq(selectOperatorList.concat(changeRows), false, (item) => item.storeUserId); _list = _.uniq(selectOperatorList.concat(changeRows), false, (item) => item.storeUserId);
} else { } else {
_list = _.reject(selectOperatorList, (item) => _.find(changeRows, (data) => data.id === item.storeUserId)); _list = _.reject(selectOperatorList, (item) => _.find(changeRows, (data) => data.storeUserId === item.storeUserId));
} }
this.setState({selectOperatorList:_list}); this.setState({selectOperatorList:_list});
} }
......
...@@ -26,7 +26,7 @@ class StoreInfo extends React.Component { ...@@ -26,7 +26,7 @@ class StoreInfo extends React.Component {
} }
} }
componentWillMount(){ componentWillMount(){
// this.getStoreDetail() this.getStoreDetail()
} }
getStoreDetail = ()=>{ getStoreDetail = ()=>{
const params= { const params= {
......
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