|
@@ -1,12 +1,12 @@
|
|
|
<template>
|
|
|
<div class="ruleItem">
|
|
|
<el-dialog title="规则详情" v-model="editEvaluaVisible" width="70vw" :close-on-click-modal="false">
|
|
|
- <div class="indicatorItemAll">
|
|
|
- <div class="indicatorItemBtn">
|
|
|
+ <div class="ruleItemAll">
|
|
|
+ <div class="ruleItemBtn">
|
|
|
<div class="collectSeach">
|
|
|
<div class="exceed">
|
|
|
- <span class="indicatorSpan">指标项:</span>
|
|
|
- <el-input v-model="indicItem" placeholder="请输入指标项名称"></el-input>
|
|
|
+ <span class="indicatorSpan">指标:</span>
|
|
|
+ <el-input v-model="indicItem" placeholder="请输入指标名称"></el-input>
|
|
|
</div>
|
|
|
<el-button type="primary" style="margin-left: 10px;" @click="getSeachData">搜索</el-button>
|
|
|
<el-button style="margin-left: 10px;" @click="resetSeach">重置</el-button>
|
|
@@ -44,11 +44,11 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
- <div class="indicatorItemTableData">
|
|
|
+ <div class="ruleItemTableData">
|
|
|
<el-table :data="ruleDetailData" border style="width: 100%" @select="rowClick" @select-all="rowClick">
|
|
|
<el-table-column type="selection" label="操作" align="center"></el-table-column>
|
|
|
- <el-table-column label="指标项名称" prop="optionName" />
|
|
|
- <el-table-column label="指标项编码" prop="optionCode" />
|
|
|
+ <el-table-column label="指标ID" prop="indicatorId" />
|
|
|
+ <el-table-column label="考评规则id" prop="evaluateRuleId" />
|
|
|
<el-table-column label="创建者" prop="createBy" />
|
|
|
<el-table-column label="创建时间" prop="createTime" />
|
|
|
<el-table-column label="描述">
|
|
@@ -57,29 +57,32 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <el-pagination
|
|
|
+ <!-- <el-pagination
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
|
:current-page="page.currentPage"
|
|
|
:page-size="page.pagesize"
|
|
|
layout="total, prev, pager, next, jumper"
|
|
|
:total="page.total">
|
|
|
- </el-pagination>
|
|
|
+ </el-pagination> -->
|
|
|
</div>
|
|
|
<div class="onlyDialog">
|
|
|
<el-dialog :title="title" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
|
|
|
<div class="periodFrom">
|
|
|
<el-form :model="itemForm" :rules="rules" ref="itemForm" label-width="100px" :validate-on-rule-change="false">
|
|
|
- <el-form-item label="指标项名称" prop="optionName">
|
|
|
- <el-select v-model="itemForm.optionName" placeholder="请选择指标项名称">
|
|
|
+ <el-form-item label="指标名称" prop="indicator">
|
|
|
+ <el-select v-model="itemForm.indicator" placeholder="请选择指标名称">
|
|
|
<el-option
|
|
|
v-for="item in indicItemoptions"
|
|
|
- :key="item.keyValue"
|
|
|
- :label="item.keyName"
|
|
|
- :value="item.keyValue">
|
|
|
+ :key="item.indicatorCode"
|
|
|
+ :label="item.indicatorName"
|
|
|
+ :value="item.indicatorName">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="指标顺序" prop="orderNum">
|
|
|
+ <el-input-number v-model="itemForm.orderNum" :min="1" />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="描述">
|
|
|
<el-input v-model="itemForm.desc" :rows="5" type="textarea" placeholder="请输入描述"></el-input>
|
|
|
</el-form-item>
|
|
@@ -88,7 +91,7 @@
|
|
|
<template #footer>
|
|
|
<span class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="saveindicatorItemMsg('itemForm')">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="saveruleItemMsg('itemForm')">确 定</el-button>
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
@@ -100,7 +103,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {apiGetevaluateRuleinfoList, apiGetIndicatordicsaveList, apiGetIndicatordicdeleteList} from '../../api/api'
|
|
|
+import {apiGetevaluateRuleinfoList, apiGetevaluateRuleInfoSaveList, apiGetevaluateRuleinfodeleteList, apiGetindicatorListAll} from '../../api/api'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -112,11 +115,12 @@ export default {
|
|
|
indicItem: '',
|
|
|
evaluationIndexData:[],
|
|
|
itemForm: {
|
|
|
- optionName: '',
|
|
|
+ indicator: '',
|
|
|
+ orderNum: 1,
|
|
|
desc: ''
|
|
|
},
|
|
|
rules: {
|
|
|
- optionName: [
|
|
|
+ indicator: [
|
|
|
{ required: true, message: '请选择指标名称', trigger: 'change' }
|
|
|
]
|
|
|
},
|
|
@@ -137,33 +141,42 @@ export default {
|
|
|
this.indicItemoptions = []
|
|
|
this.rowevalradio = row
|
|
|
this.getruleDetailData(row)
|
|
|
+ this.getEvaluationData()
|
|
|
},
|
|
|
- // 查询规则数据
|
|
|
+ // 查询规则详情数据
|
|
|
getruleDetailData(row, type) {
|
|
|
let that = this
|
|
|
let params = {
|
|
|
- pageNum: this.page.currentPage,
|
|
|
- pageSize: this.page.pagesize,
|
|
|
- indicatorId: row.id
|
|
|
+ evaluateRuleId: row.id
|
|
|
}
|
|
|
if (type) {
|
|
|
- params.optionName = that.indicItem
|
|
|
+ params.indicatorId = that.indicItem
|
|
|
}
|
|
|
apiGetevaluateRuleinfoList(params).then(datas =>{
|
|
|
- if (datas) {
|
|
|
- that.ruleDetailData = datas
|
|
|
+ if (datas && datas.data) {
|
|
|
+ that.ruleDetailData = datas.data
|
|
|
that.changeDateSelect = []
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 查询指标数据
|
|
|
+ getEvaluationData() {
|
|
|
+ let that = this
|
|
|
+ apiGetindicatorListAll().then(datas =>{
|
|
|
+ if (datas && datas.data) {
|
|
|
+ that.indicItemoptions = datas.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 新增区域信息
|
|
|
handleAdd() {
|
|
|
this.dialogVisible = true
|
|
|
this.isSave = false
|
|
|
- this.title = '新增指标项管理'
|
|
|
+ this.title = '新增规则详情'
|
|
|
this.$nextTick(() =>{
|
|
|
this.itemForm = {
|
|
|
- optionName: '',
|
|
|
+ indicator: '',
|
|
|
+ orderNum: 1,
|
|
|
desc: ''
|
|
|
}
|
|
|
// this.$refs['itemForm'].resetFields()
|
|
@@ -172,14 +185,15 @@ export default {
|
|
|
handleEdit() {
|
|
|
this.dialogVisible = true
|
|
|
this.isSave = true
|
|
|
- this.title = '修改指标项管理'
|
|
|
+ this.title = '修改规则详情'
|
|
|
this.evalradio = this.changeDateSelect[0]
|
|
|
this.itemForm = {
|
|
|
- optionName: this.evalradio.optionCode,
|
|
|
+ indicator: this.evalradio.indicatorId,
|
|
|
+ orderNum: this.evalradio.orderNum,
|
|
|
desc: this.evalradio.des
|
|
|
}
|
|
|
},
|
|
|
- saveindicatorItemMsg(formName) {
|
|
|
+ saveruleItemMsg(formName) {
|
|
|
let that = this
|
|
|
that.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
@@ -191,27 +205,40 @@ export default {
|
|
|
saveAndEditIndicatorData() {
|
|
|
let that = this
|
|
|
let params = {
|
|
|
- indicatorId: that.rowevalradio.id,
|
|
|
- optionCode: that.itemForm.optionName,
|
|
|
+ indicatorId: that.itemForm.indicator,
|
|
|
+ orderNum: that.itemForm.orderNum,
|
|
|
des: that.itemForm.desc
|
|
|
}
|
|
|
if (that.isSave) {
|
|
|
- params.id = this.evalradio.id
|
|
|
+ params.id = that.evalradio.id
|
|
|
+ } else {
|
|
|
+ params.evaluateRuleId = that.rowevalradio.id
|
|
|
}
|
|
|
- apiGetIndicatordicsaveList(params).then(datas =>{
|
|
|
- if (!that.isSave) {
|
|
|
- that.$message({
|
|
|
- message: '指标项新增成功',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- } else {
|
|
|
- that.$message({
|
|
|
- message: '指标项修改成功',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
+ apiGetevaluateRuleInfoSaveList(params).then(datas =>{
|
|
|
+ if (datas) {
|
|
|
+ if (datas.success) {
|
|
|
+ if (!that.isSave) {
|
|
|
+ that.$message({
|
|
|
+ message: '规则详情新增成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.$message({
|
|
|
+ message: '规则详情修改成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ that.dialogVisible = false
|
|
|
+ that.changeDateSelect = []
|
|
|
+ that.getruleDetailData(that.rowevalradio)
|
|
|
+ } else {
|
|
|
+ that.$message({
|
|
|
+ message: datas.message,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
- that.dialogVisible = false
|
|
|
- that.getIndicatorItemData(that.rowevalradio)
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
//删除指标数据
|
|
@@ -226,12 +253,12 @@ export default {
|
|
|
this.changeDateSelect.forEach(it =>{
|
|
|
paramsArr.push(it.id)
|
|
|
})
|
|
|
- await apiGetIndicatordicdeleteList(paramsArr.join(',')).then(datas =>{})
|
|
|
+ await apiGetevaluateRuleinfodeleteList(paramsArr.join(',')).then(datas =>{})
|
|
|
that.$message({
|
|
|
type: 'success',
|
|
|
message: '删除成功!'
|
|
|
});
|
|
|
- that.getIndicatorItemData(that.rowevalradio)
|
|
|
+ that.getruleDetailData(that.rowevalradio)
|
|
|
})
|
|
|
},
|
|
|
rowClick(selection, row) {
|
|
@@ -239,12 +266,12 @@ export default {
|
|
|
},
|
|
|
getSeachData() {
|
|
|
this.page.currentPage = 1
|
|
|
- this.getIndicatorItemData(this.rowevalradio, 'seach')
|
|
|
+ this.getruleDetailData(this.rowevalradio, 'seach')
|
|
|
},
|
|
|
resetSeach() {
|
|
|
this.page.currentPage = 1
|
|
|
this.indicItem = ''
|
|
|
- this.getIndicatorItemData(this.rowevalradio)
|
|
|
+ this.getruleDetailData(this.rowevalradio)
|
|
|
},
|
|
|
handleSizeChange(val){
|
|
|
this.page.pagesize = val
|
|
@@ -263,11 +290,11 @@ export default {
|
|
|
margin-top: 5vh !important;
|
|
|
.el-dialog__body{
|
|
|
padding: 0 20px 30px 20px !important;
|
|
|
- .indicatorItemAll{
|
|
|
+ .ruleItemAll{
|
|
|
.el-select, .el-input{
|
|
|
width: 100%;
|
|
|
}
|
|
|
- .indicatorItemBtn{
|
|
|
+ .ruleItemBtn{
|
|
|
padding: 10px 20px 0 20px;
|
|
|
.collectSeach{
|
|
|
display: flex;
|
|
@@ -317,7 +344,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .indicatorItemTableData{
|
|
|
+ .ruleItemTableData{
|
|
|
padding: 10px 20px;
|
|
|
.el-table{
|
|
|
.el-table__body-wrapper{
|