提交 29238f88 编写于 作者: zhentian.jia's avatar zhentian.jia

证书分数配置

上级 a9539533
......@@ -9,7 +9,8 @@ export const envConfig = {
// baseUrl: 'https://test1-sc.yunqueyi.com/',
//baseUrl: 'https://uat-sc.yunqueyi.com/',
baseUrl: 'https://dev-sc.yunqueyi.com/',
baseUrl: 'http://10.177.15.150:11905/',
// baseUrl: 'https://dev-sc.yunqueyi.com/',
qiniuFileUrl: "https://dev-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com",
......
......@@ -613,25 +613,26 @@
>
<el-form-item label="项目成绩评定条件">
<el-select
v-model="formExam.condition"
v-model="formExam.certificateType"
placeholder="请选择"
style="width: 350px"
>
<el-option
v-for="item in conditionList"
v-for="item in certificateTypeList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<div v-show="formExam.condition == 1" v-for="(item , index) in formExam.exam" :key="index">
<div v-show="formExam.certificateType == 2" v-for="(item , index) in formExam.exam" :key="index">
<el-form-item label="发放证书">
<el-col :span="6">
<el-select
v-model="index.certificate"
v-model="item.certificateId"
placeholder="请选择证书"
style=""
@change="updateCertificate(index)"
>
<el-option
v-for="item in optionsCertificate"
......@@ -648,21 +649,19 @@
</el-form-item>
<el-form-item label="项目中最高">
<el-col :span="3">
<el-input v-model="item.num"></el-input>
<el-input v-model="item.examCount"></el-input>
</el-col>
<el-col class="line" :span="3.5" > &nbsp 门考试平均分:</el-col>
<el-col :span="3">
<el-input v-model="item.minGrade" @change="updateMin(index)"></el-input>
<!-- <el-input-number v-model="item.minGrade" :min="0" :max="100" @change="updateMin(index)"></el-input-number> -->
<el-input v-model="item.rangeMin" @change="updateMin(index)"></el-input>
</el-col>
<el-col class="line" :span="1.5"> &nbsp 分~ &nbsp</el-col>
<el-col :span="3">
<el-input v-model="item.maxGrade" @change="updateMax(index)"></el-input>
<!-- <el-input-number v-model="item.maxGrade" :min="0" :max="100" @change="updateMax(index)"></el-input-number> -->
<el-input v-model="item.rangeMax" @change="updateMax(index)"></el-input>
</el-col>
</el-form-item>
</div>
<el-form-item v-show="formExam.condition == 2" label="发放证书">
<el-form-item v-show="formExam.certificateType == 1" label="发放证书">
<el-select
v-model="formExam.certificate"
placeholder="请选择证书"
......@@ -878,22 +877,23 @@ export default {
showStorage: false,
//考试数据
formExam: {
condition: '',
certificateType: 1,
exam: [{
num: 8,
minGrade: 0,
maxGrade: 0,
certificate: '',
examCount: 1,
rangeMin: 100,
rangeMax: 100,
certificateId: '',
certificateName: '',
}]
},
conditionList: [
certificateTypeList: [
{
label: '根据平均分发证书',
value: 1,
value: 2,
},
{
label: '所有组件通过即发放',
value: 2,
value: 1,
}
],
//校验工具 数据
......@@ -1069,6 +1069,9 @@ export default {
this.formComponent.certificate =
editData.certificateData[0].relevanceId;
}
//初始化考试平均分配置数据
this.formExam.certificateType = editData.projectData.certificateType;
this.formExam.exam = editData.certificateRule;
},
//编辑管理
editManager(data) {
......@@ -1242,11 +1245,26 @@ export default {
componentDraft(type) {
let param = {
componentIds: this.formComponent.component,
certificateId: this.formComponent.certificate,
// certificateId: this.formComponent.certificate,
certificateId: [],
projectId: this.projectId,
type: type,
status: this.projectStatus
status: this.projectStatus,
certificateType: this.formExam.certificateType,
getCertificateRule: [],
};
let ruleData = vm.formExam.exam;
for(let o=0;o<ruleData.length;o++) {
param.certificateId[o] = ruleData[o].certificateId,
param.getCertificateRule[o] = {
certificateId: ruleData[o].certificateId,
certificateName: ruleData[o].certificateName,
examCount: ruleData[o].examCount,
portalProjectId: this.projectId,
rangeMax: ruleData[o].rangeMax,
rangeMin: ruleData[o].rangeMin,
}
}
vm.POST("portal/portalInfo/componentDraft", param).then(res => {
console.log(res);
vm.$message({
......@@ -1369,11 +1387,6 @@ export default {
} else if (this.active == 2) {
//暂存步骤3
this.componentDraft(1);
// let formName = "formComponent";
// let completeState = this.submitForm(formName);
// if (completeState === true) {
// this.componentDraft(1);
// }
}
},
//点击完成
......@@ -1386,7 +1399,8 @@ export default {
}
let formName = "formComponent";
let completeState = this.submitForm(formName);
if (completeState === true) {
let certificateState = this.checkCertificate();
if (completeState === true && certificateState === true) {
this.componentDraft(2);
}
},
......@@ -3042,9 +3056,9 @@ export default {
},
addCertificate() {
let obj = {
num: 10,
minGrade: 0,
maxGrade: 0,
num: 1,
rangeMin: 100,
rangeMax: 100,
certificate: '',
};
vm.formExam.exam.push(obj);
......@@ -3054,19 +3068,19 @@ export default {
vm.formExam.exam.splice(index,1);
},
baseCheck(index) {
vm.formExam.exam[index].minGrade = parseInt(vm.formExam.exam[index].minGrade);
vm.formExam.exam[index].maxGrade = parseInt(vm.formExam.exam[index].maxGrade);
if(vm.formExam.exam[index].minGrade > 100) {
vm.formExam.exam[index].minGrade = 100;
vm.formExam.exam[index].rangeMin = parseInt(vm.formExam.exam[index].rangeMin);
vm.formExam.exam[index].rangeMax = parseInt(vm.formExam.exam[index].rangeMax);
if(vm.formExam.exam[index].rangeMin > 100) {
vm.formExam.exam[index].rangeMin = 100;
}
if(vm.formExam.exam[index].maxGrade > 100) {
vm.formExam.exam[index].maxGrade = 100;
if(vm.formExam.exam[index].rangeMax > 100) {
vm.formExam.exam[index].rangeMax = 100;
}
if(vm.formExam.exam[index].minGrade < 0) {
vm.formExam.exam[index].minGrade = 0;
if(vm.formExam.exam[index].rangeMin < 0) {
vm.formExam.exam[index].rangeMin = 0;
}
if(vm.formExam.exam[index].maxGrade < 0) {
vm.formExam.exam[index].maxGrade = 0;
if(vm.formExam.exam[index].rangeMax < 0) {
vm.formExam.exam[index].rangeMax = 0;
}
},
//区间不能有交集
......@@ -3076,40 +3090,53 @@ export default {
if(index === i) {
break;
}
if(vm.formExam.exam[index].maxGrade >= examList[i].minGrade &&
vm.formExam.exam[index].maxGrade <= examList[i].maxGrade) {
if(vm.formExam.exam[index].rangeMax >= examList[i].rangeMin &&
vm.formExam.exam[index].rangeMax <= examList[i].rangeMax) {
if(type == 'max') {
vm.formExam.exam[index].maxGrade = vm.formExam.exam[index].minGrade;
vm.formExam.exam[index].rangeMax = vm.formExam.exam[index].rangeMin;
} else if(type == 'min') {
vm.formExam.exam[index].minGrade = vm.formExam.exam[index].maxGrade;
vm.formExam.exam[index].rangeMin = vm.formExam.exam[index].rangeMax;
}
}
}
},
updateMin(index) {
vm.baseCheck(index);
if(!Number.isInteger(vm.formExam.exam[index].minGrade)){
vm.formExam.exam[index].minGrade = vm.formExam.exam[index].maxGrade;
if(!Number.isInteger(vm.formExam.exam[index].rangeMin)){
vm.formExam.exam[index].rangeMin = vm.formExam.exam[index].rangeMax;
return;
}
if(vm.formExam.exam[index].minGrade > vm.formExam.exam[index].maxGrade) {
vm.formExam.exam[index].minGrade = vm.formExam.exam[index].maxGrade;
if(vm.formExam.exam[index].rangeMin > vm.formExam.exam[index].rangeMax) {
vm.formExam.exam[index].rangeMin = vm.formExam.exam[index].rangeMax;
}
},
updateMax(index) {
vm.baseCheck(index);
if(!Number.isInteger(vm.formExam.exam[index].maxGrade)){
console.log('只能整数');
vm.formExam.exam[index].maxGrade = vm.formExam.exam[index].minGrade;
if(!Number.isInteger(vm.formExam.exam[index].rangeMax)){
// console.log('只能整数');
vm.formExam.exam[index].rangeMax = vm.formExam.exam[index].rangeMin;
return;
}
// console.log('index',index,'min',min,'max',max);
if(vm.formExam.exam[index].minGrade > vm.formExam.exam[index].maxGrade) {
vm.formExam.exam[index].maxGrade = vm.formExam.exam[index].minGrade;
console.log('max值',vm.formExam.exam[index].maxGrade);
if(vm.formExam.exam[index].rangeMin > vm.formExam.exam[index].rangeMax) {
vm.formExam.exam[index].rangeMax = vm.formExam.exam[index].rangeMin;
// console.log('max值',vm.formExam.exam[index].rangeMax);
}
vm.withoutUnion(index,'max')
},
updateCertificate(index) {
// console.log('optionsCertificate',vm.optionsCertificate,'index',index,'item',vm.formExam.exam[index])
for(let i=0;i<vm.optionsCertificate.length;i++) {
if(vm.optionsCertificate[i].value == vm.formExam.exam[index].certificateId) {
vm.formExam.exam[index].certificateName = vm.optionsCertificate[i].label;
break;
}
}
console.log('item',vm.formExam.exam[index])
},
checkCertificate () {
return true;
}
}
};
</script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册