|
@@ -38,21 +38,16 @@
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item prop="classId" label="考试对象:">
|
|
<el-form-item prop="classId" label="考试对象:">
|
|
- <el-select
|
|
|
|
|
|
+ <clazz-select
|
|
|
|
+ v-if="classList.length"
|
|
v-model="classIds"
|
|
v-model="classIds"
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
multiple
|
|
multiple
|
|
clearable
|
|
clearable
|
|
- style="width: 100%"
|
|
|
|
|
|
+ :datas="classList"
|
|
|
|
+ style="width:100%;"
|
|
@change="classChange"
|
|
@change="classChange"
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="clazz in classList"
|
|
|
|
- :key="clazz.classId"
|
|
|
|
- :value="clazz.classId"
|
|
|
|
- :label="clazz.className"
|
|
|
|
- ></el-option>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ ></clazz-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item prop="studentCount" label="人数:">
|
|
<el-form-item prop="studentCount" label="人数:">
|
|
<el-input-number
|
|
<el-input-number
|
|
@@ -251,7 +246,18 @@ export default {
|
|
paperNumber: this.instance.paperNumber,
|
|
paperNumber: this.instance.paperNumber,
|
|
examTaskPrintId: this.instance.id
|
|
examTaskPrintId: this.instance.id
|
|
});
|
|
});
|
|
- this.classList = data || [];
|
|
|
|
|
|
+ if (!data) {
|
|
|
|
+ this.classList = [];
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.classList = data.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ id: item.classId,
|
|
|
|
+ name: item.className,
|
|
|
|
+ studentCount: item.studentCount
|
|
|
|
+ };
|
|
|
|
+ });
|
|
},
|
|
},
|
|
visibleChange() {
|
|
visibleChange() {
|
|
this.getClazzs();
|
|
this.getClazzs();
|
|
@@ -276,15 +282,13 @@ export default {
|
|
open() {
|
|
open() {
|
|
this.modalIsShow = true;
|
|
this.modalIsShow = true;
|
|
},
|
|
},
|
|
- classChange(vals) {
|
|
|
|
- const classes = this.classList.filter(item =>
|
|
|
|
- vals.includes(item.classId)
|
|
|
|
- );
|
|
|
|
- this.modalForm.className = classes.map(item => item.className).join(",");
|
|
|
|
- this.modalForm.classId = this.classIds.join(",");
|
|
|
|
|
|
+ classChange(classes) {
|
|
|
|
+ this.modalForm.className = classes.map(item => item.name).join();
|
|
|
|
+ this.modalForm.classId = this.classIds.join();
|
|
this.modalForm.studentCount = calcSum(
|
|
this.modalForm.studentCount = calcSum(
|
|
classes.map(item => item.studentCount)
|
|
classes.map(item => item.studentCount)
|
|
);
|
|
);
|
|
|
|
+ this.$refs.modalFormComp.validateField("classId", () => {});
|
|
},
|
|
},
|
|
campusChange(val) {
|
|
campusChange(val) {
|
|
this.modalForm.printHouseId = val.printHouseId;
|
|
this.modalForm.printHouseId = val.printHouseId;
|