|  | @@ -116,6 +116,28 @@
 | 
	
		
			
				|  |  |          >确 定</el-button
 | 
	
		
			
				|  |  |        >
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  | +    <el-dialog
 | 
	
		
			
				|  |  | +      title="班级预览"
 | 
	
		
			
				|  |  | +      :visible.sync="previewVisible"
 | 
	
		
			
				|  |  | +      append-to-body
 | 
	
		
			
				|  |  | +      width="650px"
 | 
	
		
			
				|  |  | +    >
 | 
	
		
			
				|  |  | +      <classrome-preview
 | 
	
		
			
				|  |  | +        :types="form.classs"
 | 
	
		
			
				|  |  | +        :details="previewList"
 | 
	
		
			
				|  |  | +        :courseTypeListByName="courseTypeListByName"
 | 
	
		
			
				|  |  | +        :teacherList="teacherList"
 | 
	
		
			
				|  |  | +        :cooperationList="cooperationList"
 | 
	
		
			
				|  |  | +        :coreTeacher="form.coreTeacher"
 | 
	
		
			
				|  |  | +        :assistant="form.assistant"
 | 
	
		
			
				|  |  | +      />
 | 
	
		
			
				|  |  | +      <div slot="footer" class="dialog-footer" v-if="classType != 5">
 | 
	
		
			
				|  |  | +        <el-button @click="previewVisible = false">取 消</el-button>
 | 
	
		
			
				|  |  | +        <el-button type="primary" @click="submit('confirmGenerate')"
 | 
	
		
			
				|  |  | +          >确 定</el-button
 | 
	
		
			
				|  |  | +        >
 | 
	
		
			
				|  |  | +      </div>
 | 
	
		
			
				|  |  | +    </el-dialog>
 | 
	
		
			
				|  |  |    </div>
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  <script>
 | 
	
	
		
			
				|  | @@ -132,6 +154,7 @@ import { classTimeList } from "@/utils/searchArray";
 | 
	
		
			
				|  |  |  import MusicStore from "@/views/resetTeaming/store";
 | 
	
		
			
				|  |  |  import { queryByOrganIdAndCourseType } from "@/views/resetTeaming/api";
 | 
	
		
			
				|  |  |  import { isEmpty } from "lodash";
 | 
	
		
			
				|  |  | +import classromePreview from './classroom-preview'
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  const classTimeListByType = {};
 | 
	
		
			
				|  |  |  for (const item of classTimeList) {
 | 
	
	
		
			
				|  | @@ -177,6 +200,7 @@ export default {
 | 
	
		
			
				|  |  |    ],
 | 
	
		
			
				|  |  |    components: {
 | 
	
		
			
				|  |  |      courseItem,
 | 
	
		
			
				|  |  | +    'classrome-preview': classromePreview
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    data() {
 | 
	
		
			
				|  |  |      return {
 | 
	
	
		
			
				|  | @@ -193,6 +217,8 @@ export default {
 | 
	
		
			
				|  |  |        classTimeListByType,
 | 
	
		
			
				|  |  |        musicCourseSettings: {},
 | 
	
		
			
				|  |  |        musicSurplus: {},
 | 
	
		
			
				|  |  | +      previewVisible: false,
 | 
	
		
			
				|  |  | +      previewList: [],
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    watch: {
 | 
	
	
		
			
				|  | @@ -318,14 +344,20 @@ export default {
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        this.$set(this.form, "classs", clas);
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    submit() {
 | 
	
		
			
				|  |  | +    submit(type) {
 | 
	
		
			
				|  |  | +      // for (const key in this.musicCourseSettings) {
 | 
	
		
			
				|  |  | +      //   if (Object.hasOwnProperty.call(this.musicCourseSettings, key)) {
 | 
	
		
			
				|  |  | +      //     const item = this.musicCourseSettings[key];
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      //   }
 | 
	
		
			
				|  |  | +      // }
 | 
	
		
			
				|  |  |        this.$refs.form.validate(async (valid) => {
 | 
	
		
			
				|  |  |          if (valid) {
 | 
	
		
			
				|  |  |            const list = [];
 | 
	
		
			
				|  |  |            for (const key in this.form.classs) {
 | 
	
		
			
				|  |  |              if (this.form.classs.hasOwnProperty(key)) {
 | 
	
		
			
				|  |  |                const item = this.form.classs[key];
 | 
	
		
			
				|  |  | -              list.push({
 | 
	
		
			
				|  |  | +              const data = {
 | 
	
		
			
				|  |  |                  type: this.detail ? undefined : this.activeType,
 | 
	
		
			
				|  |  |                  courseType: key,
 | 
	
		
			
				|  |  |                  classGroupName:
 | 
	
	
		
			
				|  | @@ -352,30 +384,33 @@ export default {
 | 
	
		
			
				|  |  |                    endDate:_.endDate,
 | 
	
		
			
				|  |  |                    expectCourseNum:_.expectCourseNum
 | 
	
		
			
				|  |  |                  })),
 | 
	
		
			
				|  |  | -              });
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  | +              if (type && typeof type === 'string') {
 | 
	
		
			
				|  |  | +                data[type] = true
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  | +              list.push(data);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |            try {
 | 
	
		
			
				|  |  |              if (this.detail) {
 | 
	
		
			
				|  |  |                let result = await classGroupUpdate(list);
 | 
	
		
			
				|  |  | -              if (result.code == 206) {
 | 
	
		
			
				|  |  | -                this.$confirm(`当前课程课酬预计为0,是否继续`, "提示", {
 | 
	
		
			
				|  |  | -                  confirmButtonText: "确定",
 | 
	
		
			
				|  |  | -                  cancelButtonText: "取消",
 | 
	
		
			
				|  |  | +              this.previewVisible = false
 | 
	
		
			
				|  |  | +              if (result.code == 207) {
 | 
	
		
			
				|  |  | +                await this.$confirm((result.msg || `当前课程课酬预计为0,是否继续`), "提示", {
 | 
	
		
			
				|  |  |                    type: "warning",
 | 
	
		
			
				|  |  |                  })
 | 
	
		
			
				|  |  | -                  .then(async () => {
 | 
	
		
			
				|  |  | -                    // obj.allowZeroSalary = true;
 | 
	
		
			
				|  |  | -                    list.forEach((item) => {
 | 
	
		
			
				|  |  | -                      item.allowZeroSalary = true;
 | 
	
		
			
				|  |  | -                    });
 | 
	
		
			
				|  |  | -                    await classGroupUpdate(list);
 | 
	
		
			
				|  |  | -                    this.$listeners.submited();
 | 
	
		
			
				|  |  | -                    this.$listeners.close();
 | 
	
		
			
				|  |  | -                  })
 | 
	
		
			
				|  |  | -                  .catch(() => {
 | 
	
		
			
				|  |  | -                    return;
 | 
	
		
			
				|  |  | -                  });
 | 
	
		
			
				|  |  | +                // obj.allowZeroSalary = true;
 | 
	
		
			
				|  |  | +                list.forEach((item) => {
 | 
	
		
			
				|  |  | +                  item.allowZeroSalary = true;
 | 
	
		
			
				|  |  | +                });
 | 
	
		
			
				|  |  | +                await classGroupUpdate(list);
 | 
	
		
			
				|  |  | +                this.$listeners.submited();
 | 
	
		
			
				|  |  | +                this.$listeners.close();
 | 
	
		
			
				|  |  | +                return;
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  | +              if (result.code == 206) {
 | 
	
		
			
				|  |  | +                this.previewVisible = true
 | 
	
		
			
				|  |  | +                this.previewList = result.data
 | 
	
		
			
				|  |  |                  return;
 | 
	
		
			
				|  |  |                }
 | 
	
		
			
				|  |  |                this.$message.success("排课修改成功");
 | 
	
	
		
			
				|  | @@ -422,9 +457,13 @@ export default {
 | 
	
		
			
				|  |  |        this.collapses = val;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      changecoreTeacher(val) {},
 | 
	
		
			
				|  |  | +    updateMusicSurplus() {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      setUserTime(time, type) {
 | 
	
		
			
				|  |  | -      this.$set(this.musicSurplus,type,time)
 | 
	
		
			
				|  |  | -       console.log(this.musicSurplus[type],1)
 | 
	
		
			
				|  |  | +      console.log(time, type)
 | 
	
		
			
				|  |  | +      this.$set(this.musicSurplus, type, (time || 0))
 | 
	
		
			
				|  |  | +      console.log(this.musicSurplus)
 | 
	
		
			
				|  |  |         this.$forceUpdate()
 | 
	
		
			
				|  |  |        // this.$nextTick(res=>{
 | 
	
		
			
				|  |  |        //   this.musicSurplus[type] = time;
 | 
	
	
		
			
				|  | @@ -432,11 +471,12 @@ export default {
 | 
	
		
			
				|  |  |        // })
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -  },watch:{
 | 
	
		
			
				|  |  | -    musicSurplus(){
 | 
	
		
			
				|  |  | -      deep
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | -  }
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  // watch:{
 | 
	
		
			
				|  |  | +  //   musicSurplus(){
 | 
	
		
			
				|  |  | +  //     deep
 | 
	
		
			
				|  |  | +  //   }
 | 
	
		
			
				|  |  | +  // }
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  </script>
 | 
	
		
			
				|  |  |  <style lang="less" scoped>
 |