|
@@ -1,6 +1,12 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-form :model="form" inline ref="form" label-suffix=": " label-width="130px">
|
|
|
+ <el-form
|
|
|
+ :model="form"
|
|
|
+ inline
|
|
|
+ ref="form"
|
|
|
+ label-suffix=": "
|
|
|
+ label-width="130px"
|
|
|
+ >
|
|
|
<el-row v-if="classType == 5">
|
|
|
<el-form-item
|
|
|
label="班级名称"
|
|
@@ -35,10 +41,18 @@
|
|
|
:value="String(item.id)"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
- <!-- <remote-search :commit="'setTeachers'" v-model="form.coreTeacher" /> -->
|
|
|
+ <!-- <remote-search :commit="'setTeachers'" v-model="form.coreTeacher" /> -->
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="助教老师" prop="assistant" v-if="activeType!='HIGH'&&activeType!='HIGH_ONLINE'&&activeType!='MUSIC_NETWORK'">
|
|
|
- <!-- <remote-search :commit="'setTeachers'" v-model="form.assistant" :multiple='true'/> -->
|
|
|
+ <el-form-item
|
|
|
+ label="助教老师"
|
|
|
+ prop="assistant"
|
|
|
+ v-if="
|
|
|
+ activeType != 'HIGH' &&
|
|
|
+ activeType != 'HIGH_ONLINE' &&
|
|
|
+ activeType != 'MUSIC_NETWORK'
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <!-- <remote-search :commit="'setTeachers'" v-model="form.assistant" :multiple='true'/> -->
|
|
|
<el-select
|
|
|
v-model.trim="form.assistant"
|
|
|
placeholder="请选择助教老师"
|
|
@@ -54,16 +68,22 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="!!Object.keys(allClasss).length" style="display: block;" label="排课类型" label-width="88px">
|
|
|
+ <el-form-item
|
|
|
+ v-if="!!Object.keys(allClasss).length"
|
|
|
+ style="display: block"
|
|
|
+ label="排课类型"
|
|
|
+ label-width="88px"
|
|
|
+ >
|
|
|
<el-tag
|
|
|
class="tag"
|
|
|
:effect="form.classs[key] ? 'dark' : 'plain'"
|
|
|
v-for="(item, key) in allClasss"
|
|
|
:key="key"
|
|
|
@click="changeTag(key)"
|
|
|
- >{{courseTypeListByName[key]}}</el-tag>
|
|
|
+ >{{ courseTypeListByName[key] }}</el-tag
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
- <empty v-if="isEmpty" desc="暂无可排课时长"/>
|
|
|
+ <empty v-if="isEmpty" desc="暂无可排课时长" />
|
|
|
<el-collapse v-model="collapses" @change="collapseChange">
|
|
|
<el-collapse-item
|
|
|
v-for="(item, key, index) in form.classs"
|
|
@@ -88,7 +108,9 @@
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer" v-if="classType != 5">
|
|
|
<el-button @click="$listeners.close">取 消</el-button>
|
|
|
- <el-button type="primary" :disabled="isEmpty" @click="submit">确 定</el-button>
|
|
|
+ <el-button type="primary" :disabled="isEmpty" @click="submit"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -147,7 +169,7 @@ export default {
|
|
|
"selectPrices",
|
|
|
"classCouresTimeList",
|
|
|
"teacherList",
|
|
|
- "cooperationList"
|
|
|
+ "cooperationList",
|
|
|
],
|
|
|
components: {
|
|
|
courseItem,
|
|
@@ -246,7 +268,6 @@ export default {
|
|
|
if (this.classType == 5) {
|
|
|
// res = await findClassCourseMinute(this.classIdList);
|
|
|
res.data = this.classCouresTimeList;
|
|
|
-
|
|
|
} else {
|
|
|
try {
|
|
|
res = await getMusicCourseSettingsWithStudents({
|
|
@@ -257,38 +278,37 @@ export default {
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
}
|
|
|
- }
|
|
|
- // console.log(res);
|
|
|
- if (Object.keys(res).length <= 0) return;
|
|
|
- this.musicCourseSettings = res.data;
|
|
|
+ }
|
|
|
+ // console.log(res);
|
|
|
+ if (Object.keys(res).length <= 0) return;
|
|
|
+ this.musicCourseSettings = res.data;
|
|
|
|
|
|
- const classs = {};
|
|
|
- for (const item of this.courseTypeList) {
|
|
|
- const key = item.value;
|
|
|
- if (res.data[key]) {
|
|
|
- classs[key] = {
|
|
|
- courseTotalMinuties: res.data[key],
|
|
|
- cycle: [
|
|
|
- {
|
|
|
- time: this.selectPrices ? this.selectPrices[key] : undefined,
|
|
|
- },
|
|
|
- ],
|
|
|
- };
|
|
|
- }
|
|
|
+ const classs = {};
|
|
|
+ for (const item of this.courseTypeList) {
|
|
|
+ const key = item.value;
|
|
|
+ if (res.data[key]) {
|
|
|
+ classs[key] = {
|
|
|
+ courseTotalMinuties: res.data[key],
|
|
|
+ cycle: [
|
|
|
+ {
|
|
|
+ time: this.selectPrices ? this.selectPrices[key] : undefined,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ };
|
|
|
}
|
|
|
- this.allClasss = {...classs}
|
|
|
- this.$set(this.form, "classs", classs);
|
|
|
- // this.courseTimes = courseTimes
|
|
|
-
|
|
|
+ }
|
|
|
+ this.allClasss = { ...classs };
|
|
|
+ this.$set(this.form, "classs", classs);
|
|
|
+ // this.courseTimes = courseTimes
|
|
|
},
|
|
|
changeTag(key) {
|
|
|
- const clas = {...this.form.classs}
|
|
|
+ const clas = { ...this.form.classs };
|
|
|
if (clas[key]) {
|
|
|
- delete clas[key]
|
|
|
+ delete clas[key];
|
|
|
} else {
|
|
|
- clas[key] = this.allClasss[key]
|
|
|
+ clas[key] = this.allClasss[key];
|
|
|
}
|
|
|
- this.$set(this.form, 'classs', clas)
|
|
|
+ this.$set(this.form, "classs", clas);
|
|
|
},
|
|
|
submit() {
|
|
|
this.$refs.form.validate(async (valid) => {
|
|
@@ -325,7 +345,27 @@ export default {
|
|
|
}
|
|
|
try {
|
|
|
if (this.detail) {
|
|
|
- await classGroupUpdate(list);
|
|
|
+ let result = await classGroupUpdate(list);
|
|
|
+ if (result.code == 206) {
|
|
|
+ this.$confirm(`当前课程课酬预计为0,是否继续`, "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ // obj.allowZeroSalary = true;
|
|
|
+ list.forEach((item) => {
|
|
|
+ item.allowZeroSalary = true;
|
|
|
+ });
|
|
|
+ await classGroupUpdate(list);
|
|
|
+ this.$listeners.submited();
|
|
|
+ this.$listeners.close();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ return;
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.$message.success("排课修改成功");
|
|
|
} else {
|
|
|
if (this.classType == 1) {
|
|
@@ -347,9 +387,10 @@ export default {
|
|
|
obj.classGroupIds = this.classIdList;
|
|
|
obj.studentIds = this.studentSubmitedData.seleched;
|
|
|
obj.classGroupStudents = this.classGroupStudents;
|
|
|
- obj.classCourseMinuteMap = this.selectPrices
|
|
|
+ obj.classCourseMinuteMap = this.selectPrices;
|
|
|
await mergeClassSplitClassAffirm(obj);
|
|
|
- let grend = this.$parent.$parent.$parent.$parent.$parent.$parent.$parent;
|
|
|
+ let grend = this.$parent.$parent.$parent.$parent.$parent.$parent
|
|
|
+ .$parent;
|
|
|
grend.closeStudentReset();
|
|
|
grend.getList();
|
|
|
return;
|
|
@@ -387,7 +428,7 @@ export default {
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
}
|
|
|
-.tag{
|
|
|
+.tag {
|
|
|
margin-right: 5px;
|
|
|
cursor: pointer;
|
|
|
}
|