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

证书分数配置

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