| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <template>
- <div>
- <!-- :closable="false" -->
- <el-alert
- :title="'班级' + (index + 1)"
- type="info"
- @close="deteleClass"
- :closable="index > 0"
- class="alert"
- >
- </el-alert>
- <el-form-item
- label="选择班级"
- style="padding-left: 20px"
- :rules="[{ required: true, message: '请选择班级', trigger: 'change' }]"
- :prop="'classList.' + index + '.classId'"
- >
- <el-select
- v-model="item.classId"
- style="margin-right: 20px"
- clearable
- @change="changeValue"
- >
- <el-option
- :label="item.name"
- :value="item.id"
- v-for="(item, index) in classList"
- :key="index"
- :disabled='item.disabled'
- ></el-option>
- </el-select>
- <el-button
- type="text"
- @click="lookStudentList"
- :disabled="!item.classId"
- class="studentTitle"
- >学员列表>></el-button
- >
- </el-form-item>
- <div class="infomsg">
- <div class="left" v-if="!isNoCourse">
- 剩余课时:
- <div v-for="(val, key) in item.courseList" :key="key">
- <p style="margin-right: 5px">
- {{ key | courseTypeFormat }}:<span>{{ val }}</span
- >节
- </p>
- </div>
- </div>
- <div class="left" v-else>
- <div>暂无剩余课时</div>
- </div>
- <div class="right">
- 已选学员:
- <p>
- <span>{{ item.studentList.length }}</span
- >人
- </p>
- </div>
- </div>
- <el-dialog
- title="学员列表"
- width="700px"
- :visible.sync="studentListModalVisible"
- append-to-body
- destroy-on-close
- >
- <viewStudentList
- :list="studentList"
- :chioseList="item.studentList"
- v-if="studentListModalVisible"
- :showOk="true"
- :isChiose="true"
- @close="closeStudentView"
- />
- </el-dialog>
- </div>
- </template>
- <script>
- import { getClassAllStudent } from "@/api/studentManager";
- import { getClassGroupSubCourseNum } from "@/api/buildTeam";
- import viewStudentList from "./view-student-list";
- import paymentCycle from "@/views/resetTeaming/modals/payment-cycle";
- import extraClass from "../../../resetTeaming/modals/extra-class";
- export default {
- props: ["item", "index", "classList", "form"],
- components: { viewStudentList, paymentCycle, extraClass },
- data() {
- return {
- studentList: [],
- studentListModalVisible: false,
- organizationCourseUnitPriceSettingsByType: [],
- eclass: [],
- isNoCourse: false,
- activeClassList: [],
- };
- },
- mounted() {
- this.activeClassList =this.classList
- },
- methods: {
- async changeValue(val) {
- this.item.studentList = [];
- if (val) {
- try {
- let reset = await getClassGroupSubCourseNum({ classGroupId: val });
- this.setClassCourse(reset.data);
- // 成功之后
- this.$emit("filterClassList", val);
- } catch {}
- } else {
- this.setClassCourse({});
- this.$emit("filterClassList", null);
- }
- },
- deteleClass() {
- this.$emit("deteleClass", this.index);
- },
- lookStudentList() {
- if (!this.item.classId) {
- this.$message.error("请先选择班级,再查询学生列表");
- return;
- }
- // 查学生
- getClassAllStudent({ classGroupId: this.item.classId }).then((res) => {
- if (res.code == 200) {
- this.studentList = res.data.map((item) => {
- return {
- userId: item.userId,
- nickName: item.name,
- gender: item.gender,
- phone: item.parentsPhone,
- subjectNames: item.subjectName,
- };
- });
- this.studentListModalVisible = true;
- }
- });
- },
- closeStudentView(list) {
- this.item.studentList = list;
- this.studentListModalVisible = false;
- },
- setClassCourse(data) {
- console.log(data);
- if (Object.keys(data).length > 0) {
- this.item.courseList = data;
- this.isNoCourse = false;
- } else {
- this.isNoCourse = true;
- }
- },
- priceChange() {},
- syncAllMoney() {},
- },
- };
- </script>
- <style lang="scss" scoped>
- .alert {
- margin-bottom: 10px;
- }
- .infomsg {
- background-color: #f5faf9;
- height: 34px;
- line-height: 34px;
- padding: 0 25px;
- color: #333;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- margin-bottom: 20px;
- div {
- display: flex;
- flex-direction: row;
- p {
- color: #1a1a1a;
- font-weight: bold;
- span {
- color: #3b7f7a;
- }
- }
- }
- }
- .studentTitle {
- width: 120px !important;
- text-align: right;
- display: inline-block;
- // color: #409eff;
- }
- /deep/.dialog-footer {
- display: flex;
- flex-direction: row;
- justify-content: flex-end;
- }
- </style>
|