|
@@ -11,7 +11,7 @@
|
|
|
<h3>{{id?'编辑课程':'创建课程'}}</h3>
|
|
|
<div class="btn-box" v-if="id||!id&&stepIndex!==2">
|
|
|
<el-button size="small" @click="handleStep('-')" :disabled="stepIndex===0">上一步</el-button>
|
|
|
- <el-button type="primary" size="small" @click="handleStep('+')" :disabled="stepIndex===2">下一步</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="handleStep('+')" :disabled="stepIndex===2" :loading="loading">下一步</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-steps :active="stepIndex" align-center>
|
|
@@ -179,7 +179,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button size="small" @click="onCancel('createCourseForm')">取消</el-button>
|
|
|
- <el-button type="primary" size="small" @click="handleSaveCourse('createCourseForm')"><svg-icon icon-class="save-line"></svg-icon> 保存</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="handleSaveCourse('createCourseForm')" :loading="courseLoaing"><svg-icon icon-class="save-line"></svg-icon> 保存</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -263,7 +263,7 @@ export default {
|
|
|
if (price!==undefined&¤tPrice!==undefined) {
|
|
|
if(price===0&&rule.fullField==='price'){
|
|
|
callback(new Error('原价需大于0'));
|
|
|
- }else if(currentPrice>=price){
|
|
|
+ }else if(currentPrice>=price&&this.organizeForm.has_discount){
|
|
|
callback(new Error('优惠价格必须低于原价'));
|
|
|
}else{
|
|
|
callback();
|
|
@@ -398,6 +398,7 @@ export default {
|
|
|
playbackRate: 1,
|
|
|
volume: 100
|
|
|
},
|
|
|
+ courseLoaing: false
|
|
|
}
|
|
|
},
|
|
|
//计算属性 类似于data概念
|
|
@@ -546,6 +547,7 @@ export default {
|
|
|
handleSaveCourse(formName){
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
+ this.courseLoaing = true
|
|
|
let MethodName = "/CourseServer/Manager/LBCourseManager/AddCSItemToLBCourse";
|
|
|
let form = this.createCourseForm
|
|
|
let resource_file_id_list = []
|
|
@@ -572,6 +574,7 @@ export default {
|
|
|
}
|
|
|
getLogin(MethodName, data)
|
|
|
.then((res) => {
|
|
|
+ this.courseLoaing = false
|
|
|
if(res.status===1){
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
@@ -584,7 +587,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- this.loading = false
|
|
|
+ this.courseLoaing = false
|
|
|
});
|
|
|
} else {
|
|
|
return false;
|
|
@@ -652,6 +655,7 @@ export default {
|
|
|
},
|
|
|
// 创建录播课
|
|
|
handleAddCourse(){
|
|
|
+ this.loading = true
|
|
|
let MethodName = "/CourseServer/Manager/LBCourseManager/AddLBCourse";
|
|
|
let form = this.organizeForm
|
|
|
let data = {
|
|
@@ -673,6 +677,7 @@ export default {
|
|
|
}
|
|
|
getLogin(MethodName, data)
|
|
|
.then((res) => {
|
|
|
+ this.loading = false
|
|
|
if(res.status===1){
|
|
|
this.recordedId = res.id
|
|
|
this.stepIndex++
|