|
@@ -7,20 +7,20 @@
|
|
<p class="page-top-title-submit-p" v-hasPermiRouter="['exam:violationSite:add']" @click="submitForm">提交</p>
|
|
<p class="page-top-title-submit-p" v-hasPermiRouter="['exam:violationSite:add']" @click="submitForm">提交</p>
|
|
</div>
|
|
</div>
|
|
<el-form class="form-content scrollbar-box" ref="form" :model="form" label-width="100px" :rules="rules">
|
|
<el-form class="form-content scrollbar-box" ref="form" :model="form" label-width="100px" :rules="rules">
|
|
- <el-form-item label="负面清单次数设置:" prop="violationNumber" label-width="240px">
|
|
|
|
- <el-input
|
|
|
|
- v-model="form.violationNumber"
|
|
|
|
- placeholder="请输入负面清单次数"
|
|
|
|
- maxLength="5"
|
|
|
|
- clearable
|
|
|
|
- size="small">
|
|
|
|
- <template slot="append">次</template>
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <!--<el-form-item label="负面清单次数设置:" prop="violationNumber" label-width="240px">-->
|
|
|
|
+ <!--<el-input-->
|
|
|
|
+ <!--v-model="form.violationNumber"-->
|
|
|
|
+ <!--placeholder="请输入负面清单次数"-->
|
|
|
|
+ <!--maxLength="5"-->
|
|
|
|
+ <!--clearable-->
|
|
|
|
+ <!--size="small">-->
|
|
|
|
+ <!--<template slot="append">次</template>-->
|
|
|
|
+ <!--</el-input>-->
|
|
|
|
+ <!--</el-form-item>-->
|
|
<el-form-item label="违规项设置:" label-width="240px">
|
|
<el-form-item label="违规项设置:" label-width="240px">
|
|
<div style="display: flex">
|
|
<div style="display: flex">
|
|
<el-input
|
|
<el-input
|
|
- v-model="violationName"
|
|
|
|
|
|
+ v-model="configName"
|
|
placeholder="请输入违规项名称"
|
|
placeholder="请输入违规项名称"
|
|
clearable
|
|
clearable
|
|
maxLength="14"
|
|
maxLength="14"
|
|
@@ -33,17 +33,18 @@
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<div v-for="(item,index) in form.violationMeth">
|
|
<div v-for="(item,index) in form.violationMeth">
|
|
- <el-form-item :label="item.violationName+':'" :rules="rules.violationVal" :prop="'violationMeth.'+ index +'.violationVal'" label-width="240px">
|
|
|
|
|
|
+ <el-form-item :label="item.configName+':'" :rules="rules.configValue" :prop="'violationMeth.'+ index +'.configValue'" label-width="240px">
|
|
<div class="violationMeth-for-box">
|
|
<div class="violationMeth-for-box">
|
|
<el-input
|
|
<el-input
|
|
- v-model="item.violationVal"
|
|
|
|
|
|
+ v-model="item.configValue"
|
|
placeholder="请输入扣分值"
|
|
placeholder="请输入扣分值"
|
|
clearable
|
|
clearable
|
|
maxLength="5"
|
|
maxLength="5"
|
|
size="small">
|
|
size="small">
|
|
- <template slot="append">分</template>
|
|
|
|
|
|
+ <template slot="append" v-if="item.configName == '负面清单次数设置'">次</template>
|
|
|
|
+ <template slot="append" v-else>分</template>
|
|
</el-input>
|
|
</el-input>
|
|
- <i class="el-icon-circle-close" @click="delViolationMeth(index)"></i>
|
|
|
|
|
|
+ <i class="el-icon-circle-close" v-if="item.configName != '负面清单次数设置'" @click="delViolationMeth(index)"></i>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
@@ -53,6 +54,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { examViolationSiteList, examViolationSiteAdd } from "@/api/creditViolation/index";
|
|
import { examViolationSiteList, examViolationSiteAdd } from "@/api/creditViolation/index";
|
|
|
|
+import { creditItemListAllCredit,creditItemEditCredit } from "@/api/creditViolation/newIndex";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "Site",
|
|
name: "Site",
|
|
@@ -60,20 +62,20 @@ export default {
|
|
return {
|
|
return {
|
|
//数据
|
|
//数据
|
|
violationTypeList:[
|
|
violationTypeList:[
|
|
- {violationVal:"警告"},{violationVal:"约谈"},{violationVal:"考试"},{violationVal:"学习"},{violationVal:"做题"}
|
|
|
|
|
|
+ {configValue:"警告"},{configValue:"约谈"},{configValue:"考试"},{configValue:"学习"},{configValue:"做题"}
|
|
],
|
|
],
|
|
form:{
|
|
form:{
|
|
violationType:[],
|
|
violationType:[],
|
|
violationNumber:"",
|
|
violationNumber:"",
|
|
violationMeth:[
|
|
violationMeth:[
|
|
{
|
|
{
|
|
- violationName:"",
|
|
|
|
- violationVal:"",
|
|
|
|
|
|
+ configName:"",
|
|
|
|
+ configValue:"",
|
|
}
|
|
}
|
|
],
|
|
],
|
|
},
|
|
},
|
|
- violationVal:"",
|
|
|
|
- violationName:"",
|
|
|
|
|
|
+ configValue:"",
|
|
|
|
+ configName:"",
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
violationNumber: [
|
|
violationNumber: [
|
|
@@ -81,9 +83,9 @@ export default {
|
|
{ required: true, message: "请输入负面清单次数", validator: this.spaceJudgment, trigger: "blur" },
|
|
{ required: true, message: "请输入负面清单次数", validator: this.spaceJudgment, trigger: "blur" },
|
|
{ required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
|
|
{ required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
|
|
],
|
|
],
|
|
- violationVal: [
|
|
|
|
- { required: true, message: "请输入扣分值", trigger: "blur" },
|
|
|
|
- { required: true, message: "请输入扣分值", validator: this.spaceJudgment, trigger: "blur" },
|
|
|
|
|
|
+ configValue: [
|
|
|
|
+ { required: true, message: "请输入", trigger: "blur" },
|
|
|
|
+ { required: true, message: "请输入", validator: this.spaceJudgment, trigger: "blur" },
|
|
{ required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
|
|
{ required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
|
|
],
|
|
],
|
|
}
|
|
}
|
|
@@ -96,22 +98,22 @@ export default {
|
|
//添加违规项
|
|
//添加违规项
|
|
addViolationMeth(){
|
|
addViolationMeth(){
|
|
let self = this;
|
|
let self = this;
|
|
- if(!this.violationName){
|
|
|
|
|
|
+ if(!this.configName){
|
|
this.msgError("请先输入违规项名称");
|
|
this.msgError("请先输入违规项名称");
|
|
return
|
|
return
|
|
}
|
|
}
|
|
for(let i=0;i<self.form.violationMeth.length;i++){
|
|
for(let i=0;i<self.form.violationMeth.length;i++){
|
|
- if(self.violationName == self.form.violationMeth[i].violationName){
|
|
|
|
|
|
+ if(self.configName == self.form.violationMeth[i].configName){
|
|
self.msgError("已存在相同名称的违规项");
|
|
self.msgError("已存在相同名称的违规项");
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
let obj = {
|
|
let obj = {
|
|
- violationName:this.violationName,
|
|
|
|
- violationVal:"",
|
|
|
|
|
|
+ configName:this.configName,
|
|
|
|
+ configValue:"",
|
|
};
|
|
};
|
|
this.form.violationMeth.push(obj);
|
|
this.form.violationMeth.push(obj);
|
|
- this.violationName = "";
|
|
|
|
|
|
+ this.configName = "";
|
|
},
|
|
},
|
|
//删除违规项
|
|
//删除违规项
|
|
delViolationMeth(index){
|
|
delViolationMeth(index){
|
|
@@ -119,31 +121,24 @@ export default {
|
|
},
|
|
},
|
|
/** 查询数据 */
|
|
/** 查询数据 */
|
|
getList() {
|
|
getList() {
|
|
- examViolationSiteList({}).then( response => {
|
|
|
|
- this.$set(this,'form',response.data)
|
|
|
|
|
|
+ creditItemListAllCredit({}).then( response => {
|
|
|
|
+ this.$set(this.form,'violationMeth',response.data)
|
|
});
|
|
});
|
|
},
|
|
},
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
submitForm() {
|
|
|
|
+ let self = this;
|
|
this.$refs["form"].validate(valid => {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- let obj = {
|
|
|
|
- violationMeth: [
|
|
|
|
- {
|
|
|
|
- violationVal: this.form.violationNumber,
|
|
|
|
- violationName: "负面清单次数",
|
|
|
|
- violationType: 0,
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
- this.form.violationMeth.forEach((item)=>{
|
|
|
|
- obj.violationMeth.push({
|
|
|
|
- violationVal:item.violationVal,
|
|
|
|
- violationName:item.violationName,
|
|
|
|
- violationType:1,
|
|
|
|
|
|
+ let list = [];
|
|
|
|
+ for (let i=0;i<self.form.violationMeth.length;i++){
|
|
|
|
+ list.push({
|
|
|
|
+ sort:i,
|
|
|
|
+ configName:self.form.violationMeth[i].configName,
|
|
|
|
+ configValue:self.form.violationMeth[i].configValue,
|
|
})
|
|
})
|
|
- })
|
|
|
|
- examViolationSiteAdd(obj).then( response => {
|
|
|
|
|
|
+ }
|
|
|
|
+ creditItemEditCredit(list).then( response => {
|
|
this.getList();
|
|
this.getList();
|
|
this.msgSuccess("保存成功")
|
|
this.msgSuccess("保存成功")
|
|
});
|
|
});
|