提交 247f45e7 编写于 作者: chendeli's avatar chendeli

平均分不超过100

上级 5049656e
...@@ -812,11 +812,11 @@ ...@@ -812,11 +812,11 @@
<div class="source-item"> <div class="source-item">
项目中最高&nbsp; 项目中最高&nbsp;
<el-input placeholder="请输入数字" size="mini" v-model="formComponent.passExamCount" style="width:150px"> <el-input placeholder="请输入数字" size="mini" v-model="formComponent.passExamCount" style="width:150px" @input="focusFun($event,'passExamCount')">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
&nbsp;考试成绩的平均分大于等于&nbsp; &nbsp;考试成绩的平均分大于等于&nbsp;
<el-input placeholder="请输入数字" size="mini" v-model="formComponent.passAverageScore" style="width:150px"> <el-input placeholder="请输入数字" size="mini" v-model="formComponent.passAverageScore" style="width:150px" @input="focusFun($event,'passAverageScore')">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
&nbsp;则项目通过 &nbsp;则项目通过
...@@ -840,11 +840,11 @@ ...@@ -840,11 +840,11 @@
<div class="soure-configure"> <div class="soure-configure">
<div class="configure-item mb15"> <div class="configure-item mb15">
<span class="configure-item-l">平均分:</span> <span class="configure-item-l">平均分:</span>
<el-input placeholder="请输入数字" size="mini" v-model="item.rangeMin" style="width:215px"> <el-input placeholder="请输入数字" size="mini" v-model="item.rangeMin" style="width:215px" @input="focusFun($event,'rangeMin',index)">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
&nbsp;~&nbsp; &nbsp;~&nbsp;
<el-input placeholder="请输入数字" size="mini" v-model="item.rangeMax" style="width:215px"> <el-input placeholder="请输入数字" size="mini" v-model="item.rangeMax" style="width:215px" @input="focusFun($event,'rangeMax',index)">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
</div> </div>
...@@ -1303,6 +1303,25 @@ export default { ...@@ -1303,6 +1303,25 @@ export default {
commonUtil.resizeHeight(); commonUtil.resizeHeight();
}, },
methods: { methods: {
focusFun(ev,parm,index){
if(index != undefined){
if(parseInt(ev) < 0 || !this.checkIntFun(ev)){
console.log(typeof index)
this.formExam.exam[index][parm] = ''
}
if(parm == 'rangeMax' && parseInt(ev) > 100){
this.formExam.exam[index][parm] = "100"
}
}else{
if(parseInt(ev) < 0 || !this.checkIntFun(ev)){
this.formComponent[parm] = ''
}
if(parm == 'passAverageScore' && parseInt(ev) > 100){
this.formComponent[parm] = "100"
}
}
},
//表单校验 //表单校验
submitForm(formName) { submitForm(formName) {
let flag = null; let flag = null;
...@@ -3388,7 +3407,7 @@ export default { ...@@ -3388,7 +3407,7 @@ export default {
return vm.dioErrorPop('分数只能是整数') return vm.dioErrorPop('分数只能是整数')
} }
if((vm.formExam.exam[i].rangeMin == '' || vm.formExam.exam[i].rangeMax == '') && vm.formExam.exam[i].rangeMin != 0 && vm.formExam.exam[i].rangeMax != 0){ if((vm.formExam.exam[i].rangeMin === '' || vm.formExam.exam[i].rangeMax === '') ){
console.log(vm.formExam.exam[i].rangeMin,vm.formExam.exam[i].rangeMax) console.log(vm.formExam.exam[i].rangeMin,vm.formExam.exam[i].rangeMax)
return vm.dioErrorPop('分数不能为空') return vm.dioErrorPop('分数不能为空')
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册