This commit is contained in:
熊成强 2020-11-12 17:52:54 +08:00
parent dbe9d923ed
commit c0fb733386
4 changed files with 209 additions and 165 deletions

View File

@ -81,7 +81,7 @@ export function handleInput (form) {
let value = this[form.split('.')[0]][form.split('.')[1]] let value = this[form.split('.')[0]][form.split('.')[1]]
if (String(value).split('.').length > 2) value = String(parseFloat(value)) if (String(value).split('.').length > 2) value = String(parseFloat(value))
const a = Number(value) > 100 ? 0 : value.replace(/[^.\d]/g, '') const a = Number(value) > 100 ? 0 : value.replace(/[^.\d]/g, '')
this[form.split('.')[0]][form.split('.')[1]] = String(a) this[form.split('.')[0]][form.split('.')[1]] = String(a) || 0
} }
export function messageSuccess (params) { export function messageSuccess (params) {

View File

@ -2,99 +2,68 @@
<div class='table'> <div class='table'>
<div v-if="obj.recortModelDtos.length !== 0" class="table-list commonFont"> <div v-if="obj.recortModelDtos.length !== 0" class="table-list commonFont">
<div class="table-header"> <div class="table-header">
<div class="table-left name">维度</div> <div class="title table-left weidu">维度</div>
<div class="table-header-flex names ">名称</div> <div class="title table-header-flex name">名称</div>
<div class="table-header-flex kaohe">考核标准</div> <div class="title table-header-flex kaohe">考核标准</div>
<div class="table-header-flex jieguo" v-if="tableInfo.result || tableAuth.showResult">结果值</div> <div class="title table-header-flex jieguo" >结果值</div>
<div class="table-header-flex quanzhomng" style="flex:none;">权重({{obj.weight*100}}%)</div> <div class="title table-header-flex quanzhong" >权重({{obj.weight*100}}%)</div>
<div class="table-header-flex" style="flex:none;width:130px;" v-if="tableInfo.score || tableAuth.showScore">上级评分</div> <template v-if="tableAuth.editScore">
<div class="table-header-flex quanzhomng" style="flex:none;" v-if="tableInfo.score || tableAuth.showScore">得分</div> <div class="title table-header-flex pingfen" v-for="k in obj.recortModelDtos[0].detailDtos[0].scoreDtos" >
<div class="table-header-flex" v-if="tableInfo.score || tableAuth.showScore">评分说明</div> <div class="pingfen-title">上级评分 - {{k.approvalName}} ( {{( Math.round((k.weight * 100) * 1000) / 1000 )}}%)</div>
<div class="pingfen-content">
<div class="pingfen-content-ping" >评分</div>
<div class="pingfen-content-defen" >得分</div>
<div class=" pingfen-content-shuoming" >评分说明</div>
</div>
</div>
</template>
</div> </div>
<div class="table-weidu" v-for="(item,index) in ((tableInfo.score || tableAuth.showScore) && tableAuth.editScore?obj.recortModelDtos:obj.recortModelDtos.slice(0,obj.recortModelDtos.length-1))" :key="index">
<div v-for="(item,index) in ((tableInfo.score || tableAuth.showScore)?obj.recortModelDtos:obj.recortModelDtos.slice(0,obj.recortModelDtos.length-1))" :key="index" class="table-content"> <div class="weidu">
<div class="table-content-left table-left name"> {{item.name}}
<div v-for="(i,indexs) in item.name" :key="indexs">
{{i}}
</div>
</div> </div>
<div class="table-content-right"> <div>
<div v-for="(child) in item.detailDtos" :key="child.id" class="table-content-right-item"> <div class="table-content" v-for="i in item.detailDtos">
<div class="names"> <div class="name">
<span> {{child.target || ''}}</span> {{i.target}}
</div> </div>
<div class="kaohe"> <div class="kaohe">
<pre > {{i.keyResult}}
{{child.keyResult || ''}}
</pre>
</div>
<div class='pre jieguo' v-if="tableInfo.result || tableAuth.showResult">
<el-input v-if="tableInfo.result" type="textarea" size="mini" placeholder="请输入内容" v-model="child.checkResult" clearable></el-input>
<pre v-else>{{child.checkResult || '--'}}</pre>
</div> </div>
<div class="quanzhomng" style="flex:none;"> <div class="jieguo">
{{( Math.round((child.checkWeight * 100) * 1000) / 1000 )}}% {{i.checkResult}}
</div> </div>
<div v-if="tableInfo.score || tableAuth.showScore" style="flex:none;width:130px;"> <div class="quanzhong">
<!-- gradeGroupId=== 1 下拉 --> {{( Math.round((i.checkWeight * 100) * 1000) / 1000 )}}%
<el-select v-if="tableInfo.score && obj.gradeGroupId===1" style="width:115px;" size="mini" v-model="child.scoreDtos[child.scoreDtos.length-1].acquireScore">
<el-option
v-for="item in scoreList"
:key="item.id"
:label="item.name"
:value="item.score">
</el-option>
</el-select>
<el-input v-if="tableInfo.score && obj.gradeGroupId===2" style="width:115px;" size="mini" placeholder="请输入评分值" v-model="child.scoreDtos[child.scoreDtos.length-1].acquireScore" clearable></el-input>
<span v-if="!tableInfo.score">{{handleScore(child.scoreDtos[child.scoreDtos.length-1].acquireScore)}}</span>
</div> </div>
<div class="quanzhomng" style="flex:none;" v-if="tableInfo.score || tableAuth.showScore"> <div v-for="dto in i.scoreDtos" class="pingfen table-content-pingfen">
<span>{{child.scoreDtos[child.scoreDtos.length-1].acquireScore || '--'}}</span> <div class="pingfen-content-ping">
</div> {{dto.acquireScore}}
<div class='pre' style="padding:10px;" v-if="tableInfo.score || tableAuth.showScore"> </div>
<el-input v-if="tableInfo.score" style="width:200px;" size="mini" type="textarea" placeholder="请输入内容" v-model="child.scoreComment" clearable></el-input> <div class="pingfen-content-defen">
<span v-else>{{child.scoreComment || '--'}}</span> {{dto.acquireScore}}
</div> </div>
<div class="pingfen-content-shuoming">
</div> {{dto.scoreComment || '--'}}
<div v-if="item.detailDtos.length ===0 && item.name !=='总分'" class="table-content-right-item"> </div>
<div class="names">
</div>
<div class="kaohe">
</div>
<div class='jieguo' v-if="tableInfo.result || tableAuth.showResult">
</div>
<div class="quanzhomng " style="flex:none;">
</div>
<div style="padding:10px;flex:none;width:130px;" v-if="tableInfo.score || tableAuth.showScore">
</div>
<div class="quanzhomng" style="flex:none;" v-if="tableInfo.score || tableAuth.showScore">
</div>
<div style="padding:10px;" v-if="tableInfo.score || tableAuth.showScore">
</div> </div>
</div> </div>
<div v-if="item.name==='总分'" class="table-content-right-item"> <div class="table-content" v-if="item.detailDtos.length===0">
<div class="names"> <div class="name">
--
</div> </div>
<div class="kaohe"> <div class="kaohe">
--
</div> </div>
<div class='jieguo' v-if="tableInfo.result || tableAuth.showResult"> <div class="jieguo">
--
</div> </div>
<div class="quanzhomng " style="flex:none;"> <div class="quanzhong">
</div> --
<div style="padding:10px;flex:none;width:130px;" v-if="tableInfo.score || tableAuth.showScore">
{{score.scoreLevel}}
</div>
<div class="quanzhomng" style="flex:none;" v-if="tableInfo.score || tableAuth.showScore">
{{score.lastScore}}
</div>
<div style="padding:10px;" v-if="tableInfo.score || tableAuth.showScore">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div v-else class='nojixiao'> <div v-else class='nojixiao'>
<img src="./imgs/nojixiao.png" alt=""> <img src="./imgs/nojixiao.png" alt="">
@ -155,9 +124,9 @@ export default {
}, },
computed: { computed: {
score () { score () {
const result = this.obj.recortModelDtos && this.obj.recortModelDtos.reduce((result, i) => { const result = this.obj.recortModelDtos.reduce((result, i) => {
i.detailDtos && i.detailDtos.map(j => { i.detailDtos.map(j => {
j.scoreDtos && j.scoreDtos.map(k => { j.scoreDtos.map(k => {
const str = j.calculate.replace(/{\w+}/g, (i) => { const str = j.calculate.replace(/{\w+}/g, (i) => {
i = i.replace(/{|}/g, '') i = i.replace(/{|}/g, '')
return k[i] return k[i]
@ -184,14 +153,11 @@ export default {
}, },
async handleGetNext () { async handleGetNext () {
this.loadingTi = true this.loadingTi = true
let paramsObj = this.obj let res1 = await apiSaveDetail(Object.assign({}, this.obj, this.score))
if ((this.tableInfo.score || this.tableAuth.showScore)) {
paramsObj = Object.assign({}, paramsObj, this.score)
}
let res1 = await apiSaveDetail(paramsObj)
if (res1.code !== 200) { if (res1.code !== 200) {
this.loadingTi = false
this.$message.error(res1.msg) this.$message.error(res1.msg)
this.loadingTi = false
return
} }
const obj = {status: 1, menuName: this.tableInfo.result ? '提交了结果值' : '提交了评分'} const obj = {status: 1, menuName: this.tableInfo.result ? '提交了结果值' : '提交了评分'}
const params = Object.assign({}, {resultRecordId: this.$route.query.id || ''}, obj) const params = Object.assign({}, {resultRecordId: this.$route.query.id || ''}, obj)
@ -199,6 +165,7 @@ export default {
this.loadingTi = false this.loadingTi = false
if (res.code !== 200) { if (res.code !== 200) {
this.$message.error(res.msg) this.$message.error(res.msg)
return
} }
this.$message({ this.$message({
message: res.msg, message: res.msg,
@ -214,13 +181,9 @@ export default {
if (res.code !== 200) return if (res.code !== 200) return
this.scoreList = res.data this.scoreList = res.data
}, },
async handleSaveDetail (params = this.obj) { async handleSaveDetail (params = Object.assign({}, this.obj, this.score)) {
this.loadingZan = true this.loadingZan = true
let paramsObj = params let res = await apiSaveDetail(params)
if ((this.tableInfo.score || this.tableAuth.showScore)) {
paramsObj = Object.assign({}, paramsObj, this.score)
}
let res = await apiSaveDetail(paramsObj)
this.loadingZan = false this.loadingZan = false
if (res.code !== 200) { if (res.code !== 200) {
this.$message.error(res.msg) this.$message.error(res.msg)
@ -235,27 +198,83 @@ export default {
} }
</script> </script>
<style lang='less' scoped> <style lang='less' scoped>
.names{ .title{
width: 300px !important; background: #f5f5f5;
flex: none !important; border-bottom: 1px solid @borderColor;
} }
.jieguo{ .jieguo{
width: 300px !important; width: 300px ;
flex: none !important; .center();
} }
.name{ .name{
flex: none !important; width: 60px ;
width: 60px !important; .center();
} }
.kaohe{ .kaohe{
width: 300px !important; width: 300px ;
display: block; display: block;
.center();
pre{ pre{
white-space:pre-line; white-space:pre-line;
word-wrap: break-word; word-wrap: break-word;
word-break: break-all; word-break: break-all;
} }
} }
.weidu{
flex: none ;
width: 60px ;
border-right: 1px solid @borderColor;
border-bottom: 1px solid @borderColor;
.center();
}
.quanzhong{
width: 90px ;
.center();
}
.pingfen{
width: 300px;
display: flex;
padding: 0 !important;
border-right: 1px solid @borderColor !important;
flex-direction: column;
&-title{
padding:10px 0 !important;
text-align: center;
border-bottom: 1px solid @borderColor;
}
&-content{
flex: 1;
align-items: center;
display: flex;
align-items: center;
justify-content: space-between;
>div{
border-right: 1px solid @borderColor;
padding:10px 0 !important;
.center();
}
&-ping{
width: 100px;
height: 100%;
}
&-defen{
width: 40px;
height: 100%;
}
&-shuoming{
border-right: none !important;
flex: 1;
}
}
}
.defen{
width: 50px;
}
.shuoming{
width: 200px;
}
.nojixiao{ .nojixiao{
text-align: center; text-align: center;
} }
@ -266,15 +285,20 @@ export default {
border-bottom: 1px solid @borderColor; border-bottom: 1px solid @borderColor;
} }
.table-list{ .table-list{
margin: 0 0 10px 0;
border: 1px solid @borderColor; border: 1px solid @borderColor;
border-bottom: none; border-bottom: none;
overflow: auto;
} }
.table-weidu{
display: flex;
}
.table-header{ .table-header{
display: flex; display: flex;
background: #f5f5f5;
justify-content: space-between; flex-shrink: 0;
border-bottom: 1px solid @borderColor;; // justify-content: space-between;
// border: 1px solid @borderColor; // border: 1px solid @borderColor;
>div{ >div{
padding: 10px; padding: 10px;
@ -284,65 +308,66 @@ export default {
border-right: none; border-right: none;
} }
&-flex{ &-flex{
flex: 1; flex-shrink: 0;
// flex: 1;
// .center(); // .center();
} }
} }
.table-content{ // .table-content{
display: flex; // display: flex;
justify-content: space-between; // justify-content: space-between;
>div{ // >div{
padding: 10px; // padding: 10px;
border-right: 1px solid @borderColor; // border-right: 1px solid @borderColor;
} // }
>div:last-child{ // >div:last-child{
border-right: none; // border-right: none;
padding: 0px; // padding: 0px;
} // }
&-left{ // &-left{
border-bottom: 1px solid @borderColor; // border-bottom: 1px solid @borderColor;
display: flex; // display: flex;
flex-direction: column; // flex-direction: column;
align-items: center; // align-items: center;
justify-content: center; // justify-content: center;
>div{ // >div{
.center(); // .center();
} // }
} // }
&-right{ // &-right{
flex:1; // flex:1;
display: flex; // display: flex;
flex-direction: column; // flex-direction: column;
// justify-content: space-between; // // justify-content: space-between;
// align-items: center; // // align-items: center;
>div{ // >div{
flex: 1; // flex: 1;
border-bottom: 1px solid @borderColor;; // border-bottom: 1px solid @borderColor;;
} // }
>div:last-child{ // >div:last-child{
// border-bottom: none; // // border-bottom: none;
} // }
&-item:hover{ // &-item:hover{
background: #f5f5f5; // background: #f5f5f5;
} // }
&-item{ // &-item{
>div{ // >div{
border-right: 1px solid @borderColor; // border-right: 1px solid @borderColor;
padding: 10px; // padding: 10px;
} // }
>div:last-child{ // >div:last-child{
border-right: none; // border-right: none;
} // }
// flex: 1; // // flex: 1;
display: flex; // display: flex;
>div{ // >div{
flex: 1; // flex: 1;
// .center(); // // .center();
} // }
} // }
} // }
} // }
.table-left{ .table-left{
width: 60px; width: 60px;
text-align: center; text-align: center;
@ -351,6 +376,25 @@ export default {
width: 100px !important; width: 100px !important;
text-align: center; text-align: center;
} }
.table-content{
display: flex;
>div{
flex-shrink: 0;
border-right: 1px solid @borderColor;
border-bottom: 1px solid @borderColor;
padding: 10px 0;
}
&-pingfen{
display: flex;
flex-direction: row;
align-items: center;
>div{
text-align: center;
border-right: 1px solid @borderColor;
.center();
}
}
}
.table{ .table{
position: relative; position: relative;
&-bottoms{ &-bottoms{

View File

@ -45,7 +45,7 @@
<div style="padding:20px 0 0 0 "> <div style="padding:20px 0 0 0 ">
<span>评分权重</span> <span>评分权重</span>
<div style="padding:10px 0 0 20px"> <div style="padding:10px 0 0 20px">
<el-input @input.native="$handleInputInt('itemInfo.weight1')" style="width:200px;" size="small" clearable v-model="itemInfo.weight1"> <el-input @input.native="$handleInputInt('itemInfo.weight1')" style="width:200px;" size="small" v-model="itemInfo.weight1">
<template slot="append">%</template> <template slot="append">%</template>
</el-input> </el-input>
</div> </div>
@ -214,7 +214,7 @@ export default {
isCick: !isC, isCick: !isC,
isShow: false, isShow: false,
label: '权重评分:0%', label: '权重评分:0%',
weight1: 100, weight1: a.length === 0 ? 100 : 0,
roleDtos: JSON.parse(JSON.stringify(this.roleDtos.map(i => { roleDtos: JSON.parse(JSON.stringify(this.roleDtos.map(i => {
if (i.type !== 1) i.checked = true if (i.type !== 1) i.checked = true
return i return i

View File

@ -164,7 +164,7 @@
<el-radio :label="0">不限权重</el-radio> <el-radio :label="0">不限权重</el-radio>
<el-radio :label="1">自定义</el-radio> <el-radio :label="1">自定义</el-radio>
</el-radio-group> </el-radio-group>
<el-input @input.native="$handleInputInt('form.weight')" clearable size="small" style="width:160px;'" v-if="weight!==0" v-model="form.weight"> <el-input @input.native="$handleInputInt('form.weight')" size="small" style="width:160px;'" v-if="weight!==0" v-model="form.weight">
<template slot="append">%</template> <template slot="append">%</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -190,7 +190,7 @@
<el-input size="small" clearable type="textarea" v-model="formIndicators.keyResult"></el-input> <el-input size="small" clearable type="textarea" v-model="formIndicators.keyResult"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="权重" prop="weight"> <el-form-item label="权重" prop="weight">
<el-input size="small" @input.native="$handleInputInt('formIndicators.weight')" clearable v-model="formIndicators.weight"> <el-input size="small" @input.native="$handleInputInt('formIndicators.weight')" v-model="formIndicators.weight">
<template slot="append">%</template> <template slot="append">%</template>
</el-input> </el-input>
</el-form-item> </el-form-item>