Commit f65b4310 by tangjiale

修复Bug

parent bf854654
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 09:28:37
* @LastEditors: tangjiale
* @LastEditTime: 2022-07-05 11:04:48
* @LastEditTime: 2022-07-05 11:15:52
-->
<template>
<div class="add-course-bg">
......@@ -204,49 +204,51 @@ export default {
},
onSubmit(data,form){
let that = this
this.$refs.courseFrom.validate((valid) => {
if(!that.checkList.length){
that.$message.error('请选择校区')
return
}
if(!that.param.pxEmployeeList.length){
that.$message.error('请选择校区人员')
return
}
if(!(that.param.pxEmployeeList.filter(v => v.empPosition == 'coach')).length){
that.$message.error('请添加教练')
return
}
if(!(that.param.pxEmployeeList.filter(v => v.empPosition == 'manger')).length){
that.$message.error('请添加班主任')
return
}
if(!that.param.poster){
that.$message.error('请上传课程图片')
return
}
if(!that.param.detail){
that.$message.error('请输入课程详情')
return
}
let param = {
...that.param,
status:that.param.status == 1 ? 1 : form, //0未发布 1已发布
schIds:that.checkList.join(','),
}
if(param.cost <= 0){
that.$message.error('课程价格不能小于等于0')
return
}
//单位:分
param.cost = param.cost * 100
param.courseDefNum = param.courseDefNum || 0
this.$refs.courseFrom.validate((valid) => {
if (valid) {
if(!that.checkList.length){
that.$message.error('请选择校区')
return
}
if(!that.param.pxEmployeeList.length){
that.$message.error('请选择校区人员')
return
}
if(!(that.param.pxEmployeeList.filter(v => v.empPosition == 'coach')).length){
that.$message.error('请添加教练')
return
}
if(!(that.param.pxEmployeeList.filter(v => v.empPosition == 'manger')).length){
that.$message.error('请添加班主任')
return
}
if(!that.param.poster){
that.$message.error('请上传课程图片')
return
}
if(!that.param.detail){
that.$message.error('请输入课程详情')
return
}
let param = {
...that.param,
status:that.param.status == 1 ? 1 : form, //0未发布 1已发布
schIds:that.checkList.join(','),
}
if(param.cost <= 0){
that.$message.error('课程价格不能小于等于0')
return
}
//单位:分
param.cost = param.cost * 100
param.courseDefNum = param.courseDefNum || 0
let funName = param.id ? 'emitCourse' : 'addCourse'
this.$service.course[funName](param).then(res =>{
that.$notifySuccess()
that.$emit('update')
})
let funName = param.id ? 'emitCourse' : 'addCourse'
this.$service.course[funName](param).then(res =>{
that.$notifySuccess()
that.$emit('update')
})
}
})
},
......
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