Browse Source

旋爷优化

1
mo 3 years ago
parent
commit
1f23d98564

+ 8 - 1
src/views/teamDetail/api.js

@@ -40,5 +40,12 @@ export const getMusicGroupCourseScheduleStatistics = data => request2({
 })
 
 
-// 课表详情- 统计
+// 班级调整
+export const resetClassName = data => request2({
+  url: '/api-web/classGroup/update',
+  params:data,
+  data,
+  method: 'post'
+})
+
 

+ 60 - 0
src/views/teamDetail/components/modals/class-resetclass-name.vue

@@ -0,0 +1,60 @@
+<template>
+  <div>
+    <el-form
+      :model="form"
+      ref="form"
+      label-position="right"
+      label-width="80px;"
+      :inline="true"
+    >
+     <el-form-item
+            label="班级名称"
+            prop="name"
+            :rules="[
+              { required: true, message: '请输入班级名称', trigger: 'blur' },
+            ]"
+          >
+            <el-input
+              v-model="form.name"
+              style="width: 100%"
+              placeholder="请输入班级名称"
+            />
+          </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer" style="text-align: right;">
+      <el-button @click="$emit('close')">取 消</el-button>
+      <el-button type="primary" @click="subResetName">确 定</el-button>
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  props: [ 'detail'],
+  data() {
+    return {
+      form: {
+        name: '',
+         id:''
+      }
+    }
+  },
+  computed: {
+
+  },
+  mounted() {
+    this.form.name = this.detail.name
+      this.form.id= this.detail.id
+  },
+  methods: {
+    subResetName () {
+      this.$refs.form.validate(some => {
+        if (some) {
+          this.$emit('submited', {...this.form});
+        } else {
+          return;
+        }
+      });
+    }
+  }
+};
+</script>

+ 47 - 8
src/views/teamDetail/components/resetClass.vue

@@ -194,6 +194,15 @@
                   @click="signPostpone(scope.row)"
                   >顺延课程</el-button
                 >
+                <el-button
+                  type="text"
+                  v-if="
+                    team_status == 'PROGRESS' &&
+                    permission('classGroup/update')
+                  "
+                  @click="resetClassName(scope.row)"
+                  >班级名称调整</el-button
+                >
               </div>
             </template>
           </el-table-column>
@@ -263,7 +272,6 @@
       title="老师调整"
       width="750px"
       :visible.sync="teacherVisible"
-
       v-if="teacherVisible"
     >
       <changeTeacher
@@ -277,6 +285,20 @@
         @close="teacherVisible = false"
       />
     </el-dialog>
+    <!-- 修改班级名称 -->
+    <el-dialog
+      title="班级名称调整"
+      width="400px"
+      :visible.sync="classNameVisible"
+      v-if="classNameVisible"
+    >
+      <changeClassName
+        :classGroupId="activeClass"
+        :detail="classDetail"
+        @submited="submitedResetClassName"
+        @close="classNameVisible = false"
+      />
+    </el-dialog>
     <!-- 学员选择 -->
     <el-dialog
       :title="isOnlyChangeUser ? '学员调整' : '新建班级'"
@@ -738,11 +760,12 @@ import selectStudent from "./modals/select-student";
 import changeTeacher from "./modals/change-teacher";
 import classroomSetting from "./modals/classroom-setting";
 import studentResetView from "./modals/student-reset-view";
+import changeClassName from "./modals/class-resetclass-name.vue";
 import qs from "qs";
 import { permission } from "@/utils/directivePage";
 import { getCourseType } from "@/utils/utils";
 import { getSysTenantConfig } from "@/views/courseRulersManager/api";
-
+import {resetClassName} from '../api'
 const formatClassGroupTeacherMapperList = (core, ass) => {
   const list = [];
   if (core) {
@@ -765,6 +788,7 @@ export default {
     classroomSetting,
     studentResetView,
     changeTeacher,
+    changeClassName,
   },
   data() {
     return {
@@ -917,13 +941,14 @@ export default {
       activeList: [],
       courseViewType: "",
       tenantId: null,
-      isFirst:false
-
+      isFirst: false,
+      classDetail: null,
+      classNameVisible: false,
     };
   },
   created() {
     this.init();
-    this.getInstitutionRules()
+    this.getInstitutionRules();
   },
   // activated() {
   //   this.init();
@@ -937,9 +962,9 @@ export default {
     async getInstitutionRules() {
       try {
         const res = await getSysTenantConfig({ group: "OFFLINE" });
-        this.isFirst = Boolean(res.data[0].createOn)
-        if(!this.isFirst){
-           this.$bus.$emit("showguide", ['offline']);
+        this.isFirst = Boolean(res.data[0].createOn);
+        if (!this.isFirst) {
+          this.$bus.$emit("showguide", ["offline"]);
         }
       } catch (e) {
         console.log(e);
@@ -1793,6 +1818,20 @@ export default {
         console.log(e);
       }
     },
+    resetClassName(row) {
+      this.classDetail = row;
+      this.classNameVisible = true;
+    },
+    async submitedResetClassName(data) {
+      const obj = {...data};
+      resetClassName(obj).then((res) => {
+        if (res.code == 200) {
+          this.$message.success("修改成功");
+          this.classNameVisible = false;
+          this.getList();
+        }
+      });
+    },
   },
 
   watch: {