Explorar el Código

03/05 20:122

111
261568008@qq.com hace 5 años
padre
commit
7fbb5be079

+ 28 - 1
src/api/buildTeam.js

@@ -967,4 +967,31 @@ export function cleanAttendance(data) {
     method: 'post',
     data: qs.stringify(data)
   })
-}
+}
+
+// 批量加网管课  
+export function batchAddCourses(data) {
+  return request({
+    url: api + '/courseSchedule/batchAddCourses',
+    method: 'post',
+    data
+  })
+}
+
+// 关闭网管课 课程组
+export function cancelGroup(data) {
+  return request({
+    url: api + '/practiceGroupManage/cancelGroup',
+    method: 'post',
+    data:qs.stringify(data)
+  })
+}
+
+// 获取网管课可预约声部 getPracticeApplySubjects
+export function getPracticeApplySubjects(data) {
+  return request({
+    url: api + '/practiceGroupManage/getPracticeApplySubjects',
+    method: 'get',
+    params: data
+  })
+}

+ 11 - 0
src/utils/vueFilter.js

@@ -388,4 +388,15 @@ Vue.filter('payStatus', value => {
     CLOSE:'交易关闭'
   }
   return template[value]
+})
+
+// 课程组状态 FINISH
+Vue.filter('courseGroup', value => {
+  let template = {
+    NORMAL: "正常",
+    LOCK: "锁定",
+    FINISH:'结束',
+    CANCEL:'取消',
+  }
+  return template[value]
 })

+ 145 - 69
src/views/accompanyManager/accompanyList.vue

@@ -3,14 +3,18 @@
     <h2>
       <div class="squrt"></div>网管课列表
     </h2>
-  
+
     <div class="m-core">
       <el-form :inline="true" class="searchForm" v-model.trim="searchForm">
         <!-- 状态 指导老师 活动方案-->
         <el-form-item>
-          <el-input v-model.trim="searchForm.search" @keyup.enter.native="search" placeholder="课程组名称"></el-input>
+          <el-input
+            v-model.trim="searchForm.search"
+            @keyup.enter.native="search"
+            placeholder="课程组名称"
+          ></el-input>
         </el-form-item>
-           <el-form-item>
+        <el-form-item>
           <el-select
             class="multiple"
             v-model.trim="searchForm.organIdList"
@@ -42,7 +46,7 @@
               :value="item.value"
             ></el-option>
           </el-select>
-        </el-form-item> -->
+        </el-form-item>-->
 
         <el-form-item>
           <el-select v-model.trim="searchForm.teacherId" clearable filterable placeholder="指导老师">
@@ -59,7 +63,7 @@
           <el-button @click="onReSet" type="primary">重置</el-button>
         </el-form-item>
       </el-form>
-         <!-- tab -->
+      <!-- tab -->
       <div class="tableWrap">
         <el-table
           style="width: 100%"
@@ -68,13 +72,13 @@
         >
           <el-table-column align="center" prop="id" label="课程组编号"></el-table-column>
           <el-table-column align="center" prop="name" label="课程组名称"></el-table-column>
-           <el-table-column align="center" prop="organName" label="所属分部"></el-table-column>
+          <el-table-column align="center" prop="organName" label="所属分部"></el-table-column>
           <!-- organName -->
           <!-- <el-table-column align="center" prop="status" label="课程状态">
             <template slot-scope="scope">
               <div>{{ scope.row.status | formatterStatus}}</div>
             </template>
-          </el-table-column> -->
+          </el-table-column>-->
           <el-table-column align="center" prop="teacherName" label="指导老师"></el-table-column>
           <el-table-column align="center" prop="studentNum" label="班级人数"></el-table-column>
           <!-- <el-table-column align="center" label="课程单价">
@@ -84,7 +88,7 @@
                 <p>线下:{{scope.row.offlineClassesUnitPrice}}</p>
               </div>
             </template>
-          </el-table-column> -->
+          </el-table-column>-->
           <el-table-column align="center" label="当前课次">
             <template slot-scope="scope">
               <div>
@@ -106,17 +110,22 @@
               </div>
             </template>
           </el-table-column>
+              <el-table-column align="center" prop="groupStatus" label="课程组状态">
+            <template slot-scope="scope">
+              <div>
+                <p>{{scope.row.groupStatus | courseGroup}}</p>
+              </div>
+            </template>
+          </el-table-column>
 
           <el-table-column align="center" width="150px" fixed="right" label="操作">
-               <template slot-scope="scope">
-            <div>
-              <!-- v-permission="'courseSchedule/classStartDateAdjust'"  v-if="!scope.row.isSettlement" -->
-              <el-button
-                type="text"
-                @click="lookCrouse(scope.row)"
-              >查看</el-button>
-            </div>
-          </template>
+            <template slot-scope="scope">
+              <div>
+                <!-- v-permission="'courseSchedule/classStartDateAdjust'"  v-if="!scope.row.isSettlement" -->
+                <el-button type="text" @click="lookCrouse(scope.row)">查看</el-button>
+                <el-button type="text" v-if="scope.row.groupStatus == 'NORMAL'" @click="closeCrouse(scope.row)" v-permission="'practiceGroupManage/cancelGroup'">关闭</el-button>
+              </div>
+            </template>
           </el-table-column>
         </el-table>
         <pagination
@@ -128,35 +137,72 @@
         />
       </div>
     </div>
+    <el-dialog
+      title="关闭课程组"
+      width="400px"
+      :before-close="courseVisibleClose"
+      :visible.sync="closeVisible"
+    >
+      <el-form
+        :model="closeForm"
+        ref="closeForm"
+        label-position="right"
+        label-width="80px;"
+        :inline="true"
+      >
+        <el-form-item label="是否退费" prop="isBasck">
+          <el-radio v-model="closeForm.isBack" :label="true">是</el-radio>
+          <el-radio v-model="closeForm.isBack" :label="false">否</el-radio>
+        </el-form-item>
+        <el-form-item label="退费金额" v-if="closeForm.isBack" prop="money">
+          <el-input type="number"  @mousewheel.native.prevent v-model.trim="closeForm.money"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="closeVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submieCloseCrouse">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 <script>
 import pagination from "@/components/Pagination/index";
-import { getTeacher, getEmployeeOrgan,practiceGroupManage } from "@/api/buildTeam";
+import {
+  getTeacher,
+  getEmployeeOrgan,
+  practiceGroupManage,
+  cancelGroup
+} from "@/api/buildTeam";
 export default {
-  components:{pagination},
+  components: { pagination },
   data() {
     return {
-        searchForm:{
-            search:null,
-            status:null,
-            teacherId:null,
-            organIdList:null
-        },
-        organList:[],
-        statusList:[],
-        teacherList:[],
-        tableData:[],
-        rules: {
+      searchForm: {
+        search: null,
+        status: null,
+        teacherId: null,
+        organIdList: null
+      },
+      closeForm: {
+        isBack:false,
+        money:null
+      },
+      closeVisible: false,
+      activeRow: null,
+      organList: [],
+      statusList: [],
+      teacherList: [],
+      tableData: [],
+      rules: {
         // 分页规则
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
         page_size: [10, 20, 40, 50] // 选择限制显示条数
-      },
-    }
+      }
+    };
   },
-    created() {
+  created() {
     if (this.$route.query.searchForm) {
       this.$route.query.searchForm instanceof Object
         ? (this.searchForm = this.$route.query.searchForm)
@@ -172,56 +218,86 @@ export default {
   mounted() {},
   activated() {
     this.init();
-  },methods:{
-    init(){
-         getEmployeeOrgan().then(res => {
+  },
+  methods: {
+    init() {
+      getEmployeeOrgan().then(res => {
         if (res.code == 200) {
           this.organList = res.data;
         }
       });
-       //   <!-- 状态 指导老师 活动方案-->
+      //   <!-- 状态 指导老师 活动方案-->
       getTeacher().then(res => {
         if (res.code == 200) {
           this.teacherList = res.data;
         }
       });
-      this.getList()
+      this.getList();
     },
-      search(){
-        this.rules.page = 1;
-        this.getList();
-      },
-      onReSet(){
-         this.searchForm = {
-            search:null,
-            status:null,
-            teacherId:null,
-            organIdList:null
-        }
-       this.search();
-      },
-      getList(){
-        let obj = {
-          search:this.searchForm.search || null,
-          teacherId:this.searchForm.teacherId || null,
-          organId:this.searchForm.organIdList || null,
-          page:this.rules.page,
-          rows:this.rules.limit
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.searchForm = {
+        search: null,
+        status: null,
+        teacherId: null,
+        organIdList: null
+      };
+      this.search();
+    },
+    getList() {
+      let obj = {
+        search: this.searchForm.search || null,
+        teacherId: this.searchForm.teacherId || null,
+        organId: this.searchForm.organIdList || null,
+        page: this.rules.page,
+        rows: this.rules.limit
+      };
+      practiceGroupManage(obj).then(res => {
+        if (res.code == 200) {
+          this.tableData = res.data.rows;
+          this.rules.total = res.data.total;
         }
-        practiceGroupManage(obj).then(res=>{
-          if(res.code == 200){
-            
-            this.tableData = res.data.rows;
-            this.rules.total = res.data.total
-          }
-        })
-      },
-      lookCrouse(row){
-         let rules = JSON.stringify(this.rules);
+      });
+    },
+    lookCrouse(row) {
+      let rules = JSON.stringify(this.rules);
       let searchForm = JSON.stringify(this.searchForm);
-        this.$router.push({path:'/business/accompanys',query:{id:row.id, rules, searchForm}})
+      this.$router.push({
+        path: "/business/accompanys",
+        query: { id: row.id, rules, searchForm }
+      });
+    },
+    closeCrouse(row) {
+      this.activeRow = row;
+      this.closeVisible = true;
+    },
+    courseVisibleClose() {
+      // 关闭弹窗前
+      this.activeRow = null;
+      this.$refs.closeForm.resetFields()
+      this.closeVisible = false;
+    },
+    submieCloseCrouse() {
+      // 提交关闭课程组
+      if(this.closeForm.isBack){
+        if(!this.closeForm.money){
+          this.$message.error('请输入退费金额')
+          return
+        }
       }
+      // 请求数据
+      cancelGroup({groupId:this.activeRow.id,groupType:'PRACTICE',refundAmount:this.closeForm.money}).then(res=>{
+        if(res.code == 200){
+            this.$message.success('关闭成功')
+           this.getList()
+           this.closeVisible = false;
+        }
+      })
       
+    }
   }
 };
 </script>

+ 77 - 40
src/views/accompanyManager/accompanys.vue

@@ -9,10 +9,10 @@
         class="newBand"
         @click="resetTeachers"
         v-permission="'courseSchedule/practiceGroupTeacherAdjust'"
-      >修改老师</div>
+      >课程组调整</div>
       <!-- // accompanys/addCourse -->
-      <!-- <div v-permission="'accompanys/addCourse'" class="newBand" @click="addCourse">网管课加课</div>
-      <div class="newBand" v-permission="'accompanys/vipCourseAdjust'" @click="adjustment">批量调整</div> -->
+      <div v-permission="{ child:'courseSchedule/batchAddCourses',parent:'/accompanys'}" class="newBand" @click="addCourse">网管课加课</div>
+      <div class="newBand" v-permission="'accompanys/vipCourseAdjust'" @click="adjustment">批量调整</div>
     </div>
 
     <div class="tableWrap">
@@ -70,24 +70,24 @@
                 v-if="!scope.row.isSettlement"
                 @click="resetClass(scope.row)"
               >调整</el-button>
-              <!-- <el-button
+              <el-button
                 type="text"
                 v-permission="'accompanys/remove'"
                 v-if="!scope.row.isSettlement && scope.row.status == 'NOT_START'"
                 @click="removeClass(scope.row)"
-              >删除</el-button> -->
+              >删除</el-button>
               <el-button
                 v-permission="'courseSchedule/practiceCourseTeacherAdjust'"
                 type="text"
                 v-if="scope.row.status == 'NOT_START'"
                 @click="resetTeacher(scope.row)"
               >更换老师</el-button>
-              <!-- <el-button
+              <el-button
                 type="text"
                 v-permission="'accompanys/cleanAttendance'"
                 v-if="!scope.row.isSettlement"
                 @click="clearAttend(scope.row)"
-              >清除考勤</el-button> -->
+              >清除考勤</el-button>
             </div>
           </template>
         </el-table-column>
@@ -167,7 +167,7 @@
     </el-dialog>
 
     <el-dialog
-      title="老师调整"
+      title="课程组调整"
       width="400px"
       :before-close="teacherClose"
       :visible.sync="teacherVisible"
@@ -180,7 +180,20 @@
         label-width="80px;"
         :inline="true"
       >
-        <el-form-item label="老师姓名">
+        <el-form-item label="课程班名称">
+          <el-input v-model.trim="teacherForm.name" disabled></el-input>
+        </el-form-item>
+        <el-form-item label="课程组声部">
+          <el-select v-model.trim="teacherForm.subject" @change="changeSound" filterable clearable>
+            <el-option
+              v-for="(item,index) in subjectList"
+              :key="index"
+              :value="item.id"
+              :label="item.name"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="课程组老师">
           <el-select v-model.trim="teacherForm.teacher" filterable clearable>
             <el-option
               v-for="(item,index) in teacherList"
@@ -190,6 +203,9 @@
             ></el-option>
           </el-select>
         </el-form-item>
+        <el-form-item>
+          <p style="color:#FF5353">*更改课程组老师,将更换全部未开始课程的老师</p>
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="teacherVisible = false">取 消</el-button>
@@ -212,9 +228,9 @@
           <el-input type="number" @mousewheel.native.prevent v-model.trim="adjustmentForm.addCount"></el-input>
         </el-form-item>
         <br />
-        <el-form-item label="单课费用" prop="fee" v-if="isaddCourse">
+        <!-- <el-form-item label="单课费用" prop="fee" v-if="isaddCourse">
           <el-input v-model.trim="adjustmentForm.fee"></el-input>
-        </el-form-item>
+        </el-form-item>-->
         <el-form-item label="排课起始时间" prop="courseTime">
           <el-date-picker
             v-model.trim="adjustmentForm.courseTime"
@@ -286,7 +302,9 @@ import {
   practiceGroupManage,
   practiceGroupTeacherAdjust,
   practiceCourseTeacherAdjust,
-  cleanAttendance
+  cleanAttendance,
+  batchAddCourses,
+  getPracticeApplySubjects
 } from "@/api/buildTeam";
 import {
   vipCourseAdjust,
@@ -321,6 +339,7 @@ export default {
       teacherList: [],
       courseData: [],
       practiceId: null,
+      subjectList: [],
       maskForm: {
         date: "",
         startTime: "",
@@ -343,10 +362,13 @@ export default {
         ]
       },
       teacherRules: {
-        teacher: [{ required: true, message: "请选择老师", trigger: "blur" }]
+        teacher: [{ required: true, message: "请选择老师", trigger: "blur" }],
+        subject: [{ required: true, message: "请选择声部", trigger: "blur" }]
       },
       teacherForm: {
-        teacher: null
+        teacher: null,
+        name: null,
+        subject: null
       },
       courseOption: null,
       coursesExpireDate: null,
@@ -404,6 +426,12 @@ export default {
           this.teacherList = res.data;
         }
       });
+      // 获取默认声部信息
+      getPracticeApplySubjects().then(res => {
+        if (res.code == 200) {
+          this.subjectList = res.data;
+        }
+      });
       // 获取课程组信息
       this.courseOption = this.coursesDate();
       this.getCourseGroup();
@@ -496,6 +524,8 @@ export default {
       // 课程组
       this.isMultiple = true;
       this.teacherForm.teacher = this.courseData[0].userId;
+      this.teacherForm.name = this.courseData[0].name;
+      this.teacherForm.subject = this.courseData[0].subjectId;
       this.teacherVisible = true;
     },
     subresetTeacher() {
@@ -503,12 +533,7 @@ export default {
         if (some) {
           if (this.isMultiple) {
             // 修改课程组老师
-            this.$confirm("此操作将修改所有未上课程的老师, 是否继续?", "提示", {
-              confirmButtonText: "确定",
-              cancelButtonText: "取消",
-              type: "warning"
-            })
-              .then(() => {
+    
                 practiceGroupTeacherAdjust({
                   practiceGroupId: this.practiceId,
                   teacherId: this.teacherForm.teacher
@@ -520,15 +545,12 @@ export default {
                     this.teacherVisible = false;
                   }
                 });
-              })
-              .catch(() => {
-                return;
-              });
           } else {
             // 修改单节课老师
             practiceCourseTeacherAdjust({
               courseScheduleId: this.activeRow.id,
-              teacherId: this.teacherForm.teacher
+              teacherId: this.teacherForm.teacher,
+              subjectId:this.teacherForm.subjectId
             }).then(res => {
               if (res.code == 200) {
                 this.$message.success("修改成功");
@@ -575,6 +597,17 @@ export default {
         this.adjustmentVisible = true;
       }
     },
+    changeSound(val){
+      if(val){
+           this.subjectList.forEach(item=>{
+        if(item.id == val){
+          let strArr = this.teacherForm.name.split('•')
+          this.teacherForm.name = item.name+'•'+strArr[1]
+        }
+      })
+      }
+   
+    },
     addWeek() {
       // 添加循环周期
       this.weekList.push({
@@ -606,8 +639,10 @@ export default {
           let idArr = this.activeList.map(item => {
             return item.id;
           });
-          let courseScheduleIds = idArr.join(",");
-          obj.courseScheduleIds = courseScheduleIds;
+          // courseScheduleIdList
+          let courseScheduleIdList = idArr.join(",");
+          obj.courseScheduleIdList = courseScheduleIdList;
+          obj.courseScheduleIds = courseScheduleIdList
           obj.courseTimes = this.weekList;
           obj.holiday = this.adjustmentForm.checked;
           obj.teachMode = this.adjustmentForm.courseType || null;
@@ -663,20 +698,22 @@ export default {
           }
           // 开始
           let obj = {};
-          obj.courseCreateStartTime = this.adjustmentForm.courseTime;
-          let idArr = this.activeList.map(item => {
-            return item.id;
-          });
-          let courseScheduleIds = idArr.join(",");
-          obj.courseScheduleIds = courseScheduleIds;
-          obj.courseTimes = this.weekList;
-          obj.holiday = this.adjustmentForm.checked;
-          obj.vipGroupId = this.practiceId;
-          obj.courseCount = this.adjustmentForm.addCount;
+          obj.startDate = this.adjustmentForm.courseTime;
+          // let idArr = this.activeList.map(item => {
+          //   return item.id;
+          // });
+          // let courseScheduleIds = idArr.join(",");
+          // obj.courseScheduleIds = courseScheduleIds;
+          obj.coursesTimes = this.adjustmentForm.addCount;
+          obj.teachingArrangementList = this.weekList;
+
+          obj.isJumpHoliday = this.adjustmentForm.checked;
+          obj.musicGroupId = this.practiceId;
           obj.teachMode = this.adjustmentForm.courseType;
-          obj.singleClassPrice = this.adjustmentForm.fee;
-          obj.groupType = "PRACTICE";
-          batchAppendVipGroupCourses(obj).then(res => {
+          obj.type = "PRACTICE";
+          // console.log(obj)
+          // return
+          batchAddCourses(obj).then(res => {
             if (res.code == 200) {
               this.$message.success("恭喜您添加成功");
               this.adjustmentVisible = false;

+ 3 - 3
src/views/vipClass/vipReset.vue

@@ -68,20 +68,20 @@
             <div>
               <el-button
                 type="text"
-                v-permission="'courseSchedule/classStartDateAdjust'"
+                  v-permission="{parent:'/vipReset',child:'courseSchedule/classStartDateAdjust'}"
                 v-if="!scope.row.isSettlement"
                 @click="resetClass(scope.row)"
               >调整</el-button>
               <el-button
                 type="text"
-                v-permission="'courseSchedule/bathDelete'"
+                v-permission="{parent:'/vipReset',child:'courseSchedule/batchDelete'}"
                  v-if="!scope.row.isSettlement"
                 @click="removeClass(scope.row)"
               >删除</el-button>
               <!--   -->
                   <el-button
                 type="text"
-                 v-permission="'vip/cleanAttendance'"
+                 v-permission="{parent:'/vipReset',child:'vip/cleanAttendance'}"
                 v-if="!scope.row.isSettlement"
                @click="clearAttend(scope.row)"
               >清除考勤</el-button>