This commit is contained in:
熊成强 2020-11-06 17:30:21 +08:00
parent f9cbfba97b
commit 776a97574b

View File

@ -1,234 +0,0 @@
<template>
<div class='table'>
<table
cellspacing="0"
border="1">
<!-- 顶部title -->
<tr>
<th style="width: 90px;">维度</th>
<th>名称</th>
<th>考核标准</th>
<th v-if="tableInfo.result">结果值</th>
<th>权重({{obj.weight*100}}%)</th>
<th v-if="tableInfo.score">上级评分</th>
<th v-if="tableInfo.score">评分说明</th>
</tr>
<!-- 暂无数据时显示 -->
<tr v-if="obj.recortModelDtos.length === 0">
<td :colspan="6">
暂无数据
</td>
</tr>
<!-- template不会被渲染 -->
<template v-for="(item,index) in obj.recortModelDtos" >
<!-- 左侧跨行区域 -->
<tr :key="index+'-only'">
<td :rowspan="item.detailDtos.length+1">
<!-- <div v-for="(i,index) in item.name">
{{i}}
</div> -->
{{item.name}}
</td>
<td v-if="item.detailDtos.length===0"></td>
<td v-if="item.detailDtos.length===0"></td>
<td v-if="item.detailDtos.length===0 && tableInfo.score"></td>
<td v-if="item.detailDtos.length===0 && tableInfo.score"></td>
<td v-if="item.detailDtos.length===0 && tableInfo.result"></td>
<td v-if="item.detailDtos.length===0"></td>
</tr>
<!-- 右侧数据 -->
<tr v-for="(child) in item.detailDtos" :key="child.id">
<td>
<span> {{child.target || ''}}</span>
</td>
<td>
{{child.keyResult || ''}}
</td>
<td v-if="tableInfo.result">
<!-- <span>{{child.checkResult || '--'}}</span> -->
<el-input style="width:120px;" size="mini" placeholder="请输入内容" v-model="child.checkResult" clearable></el-input>
</td>
<td>
{{(child.checkWeight)*100}}%
</td>
<td v-if="tableInfo.score">
<!-- gradeGroupId=== 1 下拉 -->
<el-select style="width:100px;" 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>
<!-- <span>{{child.scoreDtos[child.scoreDtos.length-1].acquireScore || 0}}</span> -->
<!-- <el-input style="width:120px;" size="mini" placeholder="请输入内容" v-model="child.superScore" clearable></el-input> -->
</td>
<td style="padding:10px;" v-if="tableInfo.score">
<!-- <span>{{child.scoreComment || '--'}}</span> -->
<el-input style="width:200px;" size="mini" type="textarea" placeholder="请输入内容" v-model="child.scoreComment" clearable></el-input>
</td>
</tr>
</template>
</table>
<div v-if="tableInfo.result || tableInfo.score" class="table-bottom">
<div class="table-bottom-content">
<el-button size='small' @click="handleCancelResult" plain>取消</el-button>
<el-button size='small' @click="handleSaveDetail()" plain>暂存</el-button>
<el-button size='small' type="primary" >{{tableInfo.result?'提交结果值':'提交评分'}}</el-button>
</div>
</div>
<!-- <div v-else class="table-bottoms">
<div class="table-bottoms-contenct">
<div class="table-bottoms-contenct-left"><i class="el-icon-arrow-left"></i>朱吉达</div>
<div class="table-bottoms-contenct-center commonFont">参与考核7/8</div>
<div class="table-bottoms-contenct-right">熊成强<i class="el-icon-arrow-right"></i></div>
</div>
</div> -->
</div>
</template>
<script>
import { apiSaveDetail, apiGet375 } from '@/api/assessment'
export default {
name: 'columnsTbale',
props: {
obj: {
type: Object,
default: () => {
return {
recortModelDtos: []
}
}
},
tableInfo: {
type: Object,
default: () => {
return {
result: false,
score: false
}
}
}
},
data () {
return {
input: '',
scoreList: []
}
},
mounted () {
console.log('list', this.obj)
this.handleGrt375()
},
methods: {
handleCancelResult () {
this.$emit('update:tableInfo', Object.assign({}, this.tableInfo, {result: false, score: false}))
},
async handleGrt375 () {
let res = await apiGet375()
if (res.code !== 200) return
this.scoreList = res.data
console.log('resssss: ', res)
},
async handleSaveDetail (params = this.obj) {
let res = await apiSaveDetail(params)
if (res.code !== 200) {
this.$message.error(res.msg)
}
this.$message({
message: res.msg,
type: 'success'
})
}
}
}
</script>
<style lang='less' scoped>
.table{
position: relative;
&-bottoms{
width: 100%;
height: 60px;
z-index: 1000000;
bottom: 0;
left: 0;
background:transparent;
position: fixed;
display: flex;
// align-items: center;
justify-content: center;
&-contenct{
height: 40px;
display: flex;
background: #fff;
justify-content: space-between;
border-radius: 40px;
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
&-left{
line-height: 40px;
font-size: 14px;
padding: 0 16px;
i{
margin:0 6px;
font-weight: 800;
}
cursor: pointer;
color: @fontBlue;
}
&-center{
.center();
font-size: 14px;
padding: 0 10px;
}
&-right{
line-height: 40px;
font-size: 14px;
padding: 0 16px;
i{
margin:0 6px;
font-weight: 800;
}
cursor: pointer;
color: @fontBlue;
}
}
}
}
.table-bottom {
height: 60px;
position: fixed;
padding: 0 80px;
width: 100%;
background: #fff;
border-top: 1px solid @borderColor;
bottom: 0;
left: 0;
&-content{
width: 1360px;
margin: 0 auto;
height: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
}
}
table{
margin-top: 15px;
width: 100%;
border:1px solid #e9eaec;
border-collapse:collapse
}
th{
background-color: #f8f8f9;
}
th,td{
padding: 5px;
border: 1px solid #e9eaec;
text-align: center;
vertical-align: top;
line-height: 30px;
}
td{
}
</style>