|
@@ -1,12 +1,6 @@
|
|
|
<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="班级名称"
|
|
@@ -82,15 +76,15 @@
|
|
|
:surplustime="surplustime[key]"
|
|
|
:type="key"
|
|
|
:form="item"
|
|
|
+ :prices="prices"
|
|
|
+ :selectPrice="selectPrices ? selectPrices[key] : ''"
|
|
|
/>
|
|
|
</el-collapse-item>
|
|
|
</el-collapse>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer" v-if="classType != 5">
|
|
|
<el-button @click="$listeners.close">取 消</el-button>
|
|
|
- <el-button type="primary" v-if="!isEmpty" @click="submit"
|
|
|
- >确 定</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" v-if="!isEmpty" @click="submit">确 定</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -105,6 +99,8 @@ import {
|
|
|
} from "@/api/buildTeam";
|
|
|
import courseItem from "./classroom-setting-item";
|
|
|
import { classTimeList } from "@/utils/searchArray";
|
|
|
+import MusicStore from "@/views/resetTeaming/store";
|
|
|
+import { queryByOrganIdAndCourseType } from "@/views/resetTeaming/api";
|
|
|
import { isEmpty } from "lodash";
|
|
|
|
|
|
const classTimeListByType = {};
|
|
@@ -137,7 +133,7 @@ export default {
|
|
|
props: [
|
|
|
"teacherList",
|
|
|
"activeType",
|
|
|
- "courseTypeList",
|
|
|
+ "courseTypeList",
|
|
|
"cooperationList",
|
|
|
"musicGroupId",
|
|
|
"detail",
|
|
@@ -145,7 +141,8 @@ export default {
|
|
|
"classType",
|
|
|
"musicGroupPaymentCalenderDtos",
|
|
|
"classIdList",
|
|
|
- "classGroupStudents"
|
|
|
+ "classGroupStudents",
|
|
|
+ "selectPrices",
|
|
|
],
|
|
|
components: {
|
|
|
courseItem,
|
|
@@ -157,6 +154,7 @@ export default {
|
|
|
assistant: "",
|
|
|
classs: {},
|
|
|
},
|
|
|
+ prices: {},
|
|
|
collapses: [0],
|
|
|
courseTimes: {},
|
|
|
courseTypeListByName: {},
|
|
@@ -164,7 +162,6 @@ export default {
|
|
|
musicCourseSettings: {},
|
|
|
};
|
|
|
},
|
|
|
-
|
|
|
watch: {
|
|
|
courseTypeList() {
|
|
|
this.setCourseTypeListByName();
|
|
@@ -190,16 +187,22 @@ export default {
|
|
|
isEmpty() {
|
|
|
return isEmpty(this.form.classs);
|
|
|
},
|
|
|
+ musicGroup() {
|
|
|
+ return MusicStore.state.musicGroup;
|
|
|
+ },
|
|
|
},
|
|
|
async mounted() {
|
|
|
+ try {
|
|
|
+ await MusicStore.dispatch("getBaseInfo", {
|
|
|
+ data: { musicGroupId: this.musicGroupId },
|
|
|
+ });
|
|
|
+ const res = await queryByOrganIdAndCourseType({
|
|
|
+ organId: this.musicGroup.organId,
|
|
|
+ });
|
|
|
+ this.prices = res.data;
|
|
|
+ } catch (error) {}
|
|
|
this.setCourseTypeListByName();
|
|
|
this.formatClasss();
|
|
|
- // console.log("activeType", this.activeType);
|
|
|
- // console.log("courseTypeList", this.courseTypeList);
|
|
|
- // console.log("detail", this.detail);
|
|
|
- // console.log("studentSubmitedData", this.studentSubmitedData);
|
|
|
- // console.log("classType", this.classType);
|
|
|
- // console.log("cooperationList", this.cooperationList);
|
|
|
},
|
|
|
methods: {
|
|
|
setCourseTypeListByName() {
|
|
@@ -210,6 +213,7 @@ export default {
|
|
|
this.courseTypeListByName = courseTypeListByName;
|
|
|
},
|
|
|
async formatClasss() {
|
|
|
+
|
|
|
if (this.detail) {
|
|
|
let coreid = "";
|
|
|
const assistant = [];
|
|
@@ -233,23 +237,27 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- try {
|
|
|
- let res;
|
|
|
- if (this.classType == 5) {
|
|
|
- res = await findClassCourseMinute(this.classIdList);
|
|
|
- } else {
|
|
|
+ let res = {};
|
|
|
+ if (this.classType == 5) {
|
|
|
+ // res = await findClassCourseMinute(this.classIdList);
|
|
|
+ res.data = this.selectPrices;
|
|
|
+
|
|
|
+ } else {
|
|
|
+ try {
|
|
|
res = await getMusicCourseSettingsWithStudents({
|
|
|
musicGroupId: this.musicGroupId,
|
|
|
studentIds,
|
|
|
classGroupId,
|
|
|
});
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
}
|
|
|
-
|
|
|
- if (!res) return;
|
|
|
+ }
|
|
|
+ console.log(res);
|
|
|
+ if (Object.keys(res).length <= 0) return;
|
|
|
this.musicCourseSettings = res.data;
|
|
|
|
|
|
const classs = {};
|
|
|
- console.log(this.courseTypeList)
|
|
|
for (const item of this.courseTypeList) {
|
|
|
const key = item.value;
|
|
|
if (res.data[key]) {
|
|
@@ -257,18 +265,15 @@ export default {
|
|
|
courseTotalMinuties: res.data[key],
|
|
|
cycle: [
|
|
|
{
|
|
|
- time: classTimeListByType[key],
|
|
|
+ time: this.selectPrices ? this.selectPrices[key] : undefined,
|
|
|
},
|
|
|
],
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
- console.log(classs)
|
|
|
this.$set(this.form, "classs", classs);
|
|
|
// this.courseTimes = courseTimes
|
|
|
- } catch (error) {
|
|
|
- console.log(error);
|
|
|
- }
|
|
|
+
|
|
|
},
|
|
|
submit() {
|
|
|
this.$refs.form.validate(async (valid) => {
|
|
@@ -326,11 +331,10 @@ export default {
|
|
|
obj.classGroup4MixDtos = list;
|
|
|
obj.classGroupIds = this.classIdList;
|
|
|
obj.studentIds = this.studentSubmitedData.seleched;
|
|
|
- obj.classGroupStudents = this.classGroupStudents
|
|
|
- // console.log(obj);
|
|
|
+ obj.classGroupStudents = this.classGroupStudents;
|
|
|
+ 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;
|