|
@@ -160,20 +160,11 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="预计招生数"
|
|
|
prop="expectStudentNum"
|
|
|
- :rules="[{ required: true, message: '请输入预计招生数',trigger: 'blur'},{pattern:/[3-5]/,message:'班级人数必须为3-5人',trigger: 'blur'}]"
|
|
|
- v-if=" newClassForm.type == 'HIGH_ONLINE'">
|
|
|
- <el-input style="width:180px;"
|
|
|
- type="number"
|
|
|
- @mousewheel.native.prevent
|
|
|
- v-model="newClassForm.expectStudentNum"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="预计招生数"
|
|
|
- prop="expectStudentNum"
|
|
|
type="number"
|
|
|
:rules="[{ required: true, message: '请输入预计招生数',trigger: 'blur'}]"
|
|
|
- @mousewheel.native.prevent
|
|
|
- v-else>
|
|
|
+ @mousewheel.native.prevent>
|
|
|
<el-input style="width:180px;"
|
|
|
+ :disabled="newClassForm.type == 'HIGH_ONLINE'"
|
|
|
v-model="newClassForm.expectStudentNum"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="助教老师"
|
|
@@ -897,6 +888,9 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
newClassHight () {
|
|
|
+ if (this.newClassForm.type == 'HIGH_ONLINE' && (this.newClassForm.expectStudentNum > 5 || this.newClassForm.expectStudentNum < 3)) {
|
|
|
+ return this.$message.error('班级人数必须为3-5人')
|
|
|
+ }
|
|
|
this.$refs["newClassForm"].validate(res => {
|
|
|
if (res) {
|
|
|
let obj = {};
|
|
@@ -1669,6 +1663,11 @@ export default {
|
|
|
|
|
|
},
|
|
|
watch: {
|
|
|
+ 'newClassForm.type'() {
|
|
|
+ if (this.newClassForm.type === 'HIGH_ONLINE') {
|
|
|
+ this.$set(this.newClassForm, 'expectStudentNum', 5)
|
|
|
+ }
|
|
|
+ },
|
|
|
newClassVisible (val) {
|
|
|
if (!val) {
|
|
|
this.newClassForm = {
|