natasha 1 ano atrás
pai
commit
996bde0ea3

+ 5 - 2
src/views/content_manage/course_manage/CreateLive.vue

@@ -10,7 +10,7 @@
                     <h3>{{id?'编辑直播课程':'创建直播课程'}}</h3>
                     <div class="btn-box" v-if="id||!id&&stepIndex!==1">
                         <el-button size="small" @click="handleStep('-')" :disabled="stepIndex===0">上一步</el-button>
-                        <el-button type="primary" size="small" @click="handleStep('+')" :disabled="stepIndex===1">下一步</el-button>
+                        <el-button type="primary" size="small" @click="handleStep('+')" :disabled="stepIndex===1" :loading="loading">下一步</el-button>
                     </div>
                 </div>
                 <el-steps :active="stepIndex" align-center>
@@ -125,7 +125,7 @@ export default {
             if (price!==undefined&&currentPrice!==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();
@@ -205,6 +205,7 @@ export default {
         teacherList:['李老师','赵老师'],
         orgList:[],
         coverFlag: false,
+        loading: false
     }
   },
   //计算属性 类似于data概念
@@ -297,6 +298,7 @@ export default {
       });
     },
     handleAddCourse(){
+        this.loading = true
         let MethodName = "/CourseServer/Manager/ZBCourseManager/AddZBCourse";
         let form = this.organizeForm
         let data = {
@@ -315,6 +317,7 @@ export default {
         }
         getLogin(MethodName, data)
         .then((res) => {
+            this.loading = false
             if(res.status===1){
                this.recordedId = res.id
                this.stepIndex++

+ 9 - 4
src/views/content_manage/course_manage/CreateRecorded.vue

@@ -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&&currentPrice!==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++

+ 20 - 3
src/views/content_manage/newspaper_manage/CreateArticle.vue

@@ -3,10 +3,11 @@
     <Header/>
     <breadcrumb :breadcrumbList="breadcrumbList" class="breadcrumb-box"></breadcrumb>
     <div class="manage-root-contain" :style="{height:tableHeight+'px'}">
-        
+        <el-form :model="articleForm" :rules="articleRules" ref="articleForm" label-width="100px" class="registerForm">
+        </el-form>
         <div class="save-btn">
-            <el-button type="primary" size="small" :loading="loading">保存</el-button>
-            <el-button size="small">取消</el-button>
+            <el-button type="primary" size="small" @click="handleSaveArticle('articleForm')" :loading="loading">保存</el-button>
+            <el-button size="small" @click="onCancel('articleForm')">取消</el-button>
         </div>
         <el-button type="primary" size="small" class="preview-btn">预览</el-button>
     </div>
@@ -67,6 +68,9 @@ export default {
             pictureList: [], // 图片
             teacher: '', // 讲解教师
             explanContent: [], // 讲解内容
+        },
+        articleRules:{
+
         }
     }
   },
@@ -87,6 +91,19 @@ export default {
         this.tableHeight = window.innerHeight - tableH;
       }
     },
+    // 取消 恢复到修改前状态
+    onCancel(formName){
+        this.$refs[formName].resetFields();
+    },
+    handleSaveArticle(formName){
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            
+          } else {
+            return false;
+          }
+        });
+    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {

+ 4 - 1
src/views/content_manage/newspaper_manage/CreateNewspaper.vue

@@ -10,7 +10,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>
@@ -484,6 +484,7 @@ export default {
             ]
         },
         drag: false,
+        loading: false
     }
   },
   //计算属性 类似于data概念
@@ -624,6 +625,7 @@ export default {
         this.newspaperForm.chn_data_str = JSON.parse(this.newspaperForm.chn_data).join('\n')
     },
     handleAddIssue(){
+        this.loading = true
         let MethodName = "/PaperServer/Manager/IssueManager/AddIssue";
         let form = this.newspaperForm
         let data = {
@@ -652,6 +654,7 @@ export default {
         }
         getLogin(MethodName, data)
         .then((res) => {
+            this.loading = false
             if(res.status===1){
                window.localStorage.removeItem('newsForm')
                window.localStorage.removeItem('newsStep')

+ 1 - 1
src/views/organize_manage/CreateOrganize.vue

@@ -10,7 +10,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" v-loading="loading">下一步</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>

+ 3 - 1
src/views/people_manage/CreatePerson.vue

@@ -10,7 +10,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>
@@ -409,6 +409,7 @@ export default {
       });
     },
     handleAdd(){
+        this.loading = true
         let MethodName = "/OrgServer/Manager/SysUserManager/AddSysUser";
         let form = this.registerForm
         let finance_popedom_data_scope = {}
@@ -449,6 +450,7 @@ export default {
         }
         getLogin(MethodName, data)
         .then((res) => {
+            this.loading = false
             if(res.status===1){
                this.stepIndex++
             }