|
@@ -1,4 +1,4 @@
|
|
|
-<template>
|
|
|
|
|
|
|
+<template>
|
|
|
<section class="panel">
|
|
<section class="panel">
|
|
|
<div class="toolbar"><el-input v-model="query.indicatorName" placeholder="指标名称" clearable/><el-input v-model="query.indicatorCode" placeholder="指标编码" clearable/><el-select v-model="query.indicatorType" placeholder="指标类型" clearable><el-option label="自动采集" :value="1"/><el-option label="人工巡检" :value="2"/></el-select><el-select v-model="query.status" placeholder="状态" clearable><el-option label="启用" :value="1"/><el-option label="停用" :value="0"/></el-select><el-button type="primary" @click="load">查询</el-button><el-button @click="reset">重置</el-button><span class="grow"></span><el-button type="success" plain @click="checkWeight">权重校验</el-button><el-button type="primary" @click="open()">新增指标</el-button></div>
|
|
<div class="toolbar"><el-input v-model="query.indicatorName" placeholder="指标名称" clearable/><el-input v-model="query.indicatorCode" placeholder="指标编码" clearable/><el-select v-model="query.indicatorType" placeholder="指标类型" clearable><el-option label="自动采集" :value="1"/><el-option label="人工巡检" :value="2"/></el-select><el-select v-model="query.status" placeholder="状态" clearable><el-option label="启用" :value="1"/><el-option label="停用" :value="0"/></el-select><el-button type="primary" @click="load">查询</el-button><el-button @click="reset">重置</el-button><span class="grow"></span><el-button type="success" plain @click="checkWeight">权重校验</el-button><el-button type="primary" @click="open()">新增指标</el-button></div>
|
|
|
<el-table :data="rows" border stripe><el-table-column prop="sort" label="排序" width="70"/><el-table-column prop="indicatorCode" label="指标编码" width="140"/><el-table-column prop="indicatorName" label="指标名称" min-width="150"/><el-table-column label="类型" width="100"><template slot-scope="s"><el-tag size="mini" :type="s.row.indicatorType===1?'primary':'warning'">{{typeText(s.row.indicatorType)}}</el-tag></template></el-table-column><el-table-column prop="dataSource" label="数据来源" min-width="150"/><el-table-column prop="maxScore" label="满分" width="80"/><el-table-column prop="passScore" label="及格分" width="80"/><el-table-column prop="weight" label="权重%" width="90"/><el-table-column label="状态" width="90"><template slot-scope="s"><el-switch v-model="s.row.status" :active-value="1" :inactive-value="0" @change="changeStatus(s.row)"/></template></el-table-column><el-table-column label="操作" width="140"><template slot-scope="s"><el-button type="text" @click="open(s.row)">编辑</el-button><el-button type="text" class="danger" @click="remove(s.row)">删除</el-button></template></el-table-column></el-table>
|
|
<el-table :data="rows" border stripe><el-table-column prop="sort" label="排序" width="70"/><el-table-column prop="indicatorCode" label="指标编码" width="140"/><el-table-column prop="indicatorName" label="指标名称" min-width="150"/><el-table-column label="类型" width="100"><template slot-scope="s"><el-tag size="mini" :type="s.row.indicatorType===1?'primary':'warning'">{{typeText(s.row.indicatorType)}}</el-tag></template></el-table-column><el-table-column prop="dataSource" label="数据来源" min-width="150"/><el-table-column prop="maxScore" label="满分" width="80"/><el-table-column prop="passScore" label="及格分" width="80"/><el-table-column prop="weight" label="权重%" width="90"/><el-table-column label="状态" width="90"><template slot-scope="s"><el-switch v-model="s.row.status" :active-value="1" :inactive-value="0" @change="changeStatus(s.row)"/></template></el-table-column><el-table-column label="操作" width="140"><template slot-scope="s"><el-button type="text" @click="open(s.row)">编辑</el-button><el-button type="text" class="danger" @click="remove(s.row)">删除</el-button></template></el-table-column></el-table>
|
|
@@ -14,7 +14,7 @@ export default {
|
|
|
name:'InspectIndicatorIndex',
|
|
name:'InspectIndicatorIndex',
|
|
|
data(){return{query:{},rows:[],dialog:false,form:{},weightSum:0}},
|
|
data(){return{query:{},rows:[],dialog:false,form:{},weightSum:0}},
|
|
|
computed:{ weightValid(){return Math.round(this.weightSum)===100} },
|
|
computed:{ weightValid(){return Math.round(this.weightSum)===100} },
|
|
|
- created(){this.load();this.loadWeight()},
|
|
|
|
|
|
|
+ created(){this.load()},
|
|
|
methods:{
|
|
methods:{
|
|
|
post(u,d){return this.$axios.post(u,querystring.stringify(d||{}))},
|
|
post(u,d){return this.$axios.post(u,querystring.stringify(d||{}))},
|
|
|
list(r){return r.data&&r.data.list||[]},
|
|
list(r){return r.data&&r.data.list||[]},
|
|
@@ -24,7 +24,7 @@ export default {
|
|
|
open(row){this.form=Object.assign({indicatorType:2,maxScore:100,passScore:60,weight:0,sort:0,status:1},row||{});this.dialog=true},
|
|
open(row){this.form=Object.assign({indicatorType:2,maxScore:100,passScore:60,weight:0,sort:0,status:1},row||{});this.dialog=true},
|
|
|
save(){const payload=Object.assign({},this.form);delete payload.createDate;delete payload.updateDate;this.post(this.form.indicatorId?'/inspectManage/indicator/update':'/inspectManage/indicator/save',payload).then(()=>{this.dialog=false;this.load();this.$message.success('保存完成')})},
|
|
save(){const payload=Object.assign({},this.form);delete payload.createDate;delete payload.updateDate;this.post(this.form.indicatorId?'/inspectManage/indicator/update':'/inspectManage/indicator/save',payload).then(()=>{this.dialog=false;this.load();this.$message.success('保存完成')})},
|
|
|
changeStatus(row){this.post('/inspectManage/indicator/changeStatus',{id:row.indicatorId,status:row.status}).then(()=>{this.$message.success('状态已更新');this.loadWeight()})},
|
|
changeStatus(row){this.post('/inspectManage/indicator/changeStatus',{id:row.indicatorId,status:row.status}).then(()=>{this.$message.success('状态已更新');this.loadWeight()})},
|
|
|
- remove(row){this.$confirm('确认删除该指标?','提示').then(()=>this.post('/inspectManage/indicator/delete',{id:row.indicatorId}).then(()=>{this.load();this.$message.success('删除完成')}))},
|
|
|
|
|
|
|
+ remove(row){this.$confirm('确认删除该指标?','提示').then(()=>this.post('/inspectManage/indicator/delete',{id:row.indicatorId}).then(r=>{const rtn=(r.data&&r.data.rtnBean)||{};if(String(rtn.rtnCode)==='0'){this.load();this.$message.success(rtn.rtnMsg||'删除完成')}else{this.$message.error(rtn.rtnMsg||'删除失败')}}))},
|
|
|
checkWeight(){this.post('/inspectManage/indicator/checkWeight').then(r=>this.$message.info('启用指标权重合计:'+(r.data.obj||0)+'%'))},
|
|
checkWeight(){this.post('/inspectManage/indicator/checkWeight').then(r=>this.$message.info('启用指标权重合计:'+(r.data.obj||0)+'%'))},
|
|
|
typeText(v){return v===1?'自动采集':'人工巡检'}
|
|
typeText(v){return v===1?'自动采集':'人工巡检'}
|
|
|
}
|
|
}
|