优化
This commit is contained in:
parent
7174c821ea
commit
16ee3ecdc1
@ -284,13 +284,13 @@ export default {
|
|||||||
},
|
},
|
||||||
async cb (info) {
|
async cb (info) {
|
||||||
const obj = {status: 8, menuName: '转交了', transferStaffId: info.value}
|
const obj = {status: 8, menuName: '转交了', transferStaffId: info.value}
|
||||||
if (this.info) obj.flowRecordId = this.info.flowRecordId
|
if (this.info) {
|
||||||
if (this.formList.flowRecordId !== 0) obj.flowRecordId = this.formList.flowRecordId
|
obj.flowRecordId = this.info.flowRecordId
|
||||||
|
} else if (this.formList.flowRecordId !== 0) obj.flowRecordId = this.formList.flowRecordId
|
||||||
const params = Object.assign({}, this.form, {resultRecordId: this.$route.query.id || ''}, obj)
|
const params = Object.assign({}, this.form, {resultRecordId: this.$route.query.id || ''}, obj)
|
||||||
let res = await apiSaveapproval(params)
|
let res = await apiSaveapproval(params)
|
||||||
if (res.code !== 200) {
|
if (res.code !== 200) {
|
||||||
this.$message.error(res.msg)
|
this.$message.error(res.msg)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
this.form = {}
|
this.form = {}
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class='table'>
|
<div class='table'>
|
||||||
|
{{scoreListForParams}}
|
||||||
<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="title table-left weidu">维度</div>
|
<div class="title table-left weidu">维度</div>
|
||||||
@ -19,7 +20,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</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 class="table-weidu" v-for="(item,index) in obj.recortModelDtos" :key="index">
|
||||||
|
<!-- ((tableInfo.score || tableAuth.showScore) && tableAuth.editScore?obj.recortModelDtos:obj.recortModelDtos.slice(0,obj.recortModelDtos.length-1)) -->
|
||||||
<div class="weidu">
|
<div class="weidu">
|
||||||
<div v-for="(name,indexname) in item.name" :key="indexname">
|
<div v-for="(name,indexname) in item.name" :key="indexname">
|
||||||
{{name}}
|
{{name}}
|
||||||
@ -71,6 +73,20 @@
|
|||||||
<div class="quanzhong">
|
<div class="quanzhong">
|
||||||
--
|
--
|
||||||
</div>
|
</div>
|
||||||
|
<template >
|
||||||
|
<div v-for="k in scoreListForParams" class="pingfen table-content-pingfen">
|
||||||
|
<div class="pingfen-content-ping">
|
||||||
|
{{k.Level}}
|
||||||
|
</div>
|
||||||
|
<div class="pingfen-content-defen">
|
||||||
|
{{k.Score}}
|
||||||
|
</div>
|
||||||
|
<div class="pingfen-content-shuoming">
|
||||||
|
22
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -133,6 +149,28 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
scoreListForParams () {
|
||||||
|
return this.obj.recortModelDtos[0].detailDtos[0].scoreDtos.map((i, index) => {
|
||||||
|
let result = 0
|
||||||
|
this.obj.recortModelDtos.map(j => {
|
||||||
|
j.detailDtos.map(k => {
|
||||||
|
let str = k.scoreDtos[index].calculate.replace(/{\w+}/g, (l) => {
|
||||||
|
l = l.replace(/{|}/g, '')
|
||||||
|
return k[l]
|
||||||
|
})
|
||||||
|
result += eval(str)
|
||||||
|
console.log('k: ', k)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
const arr = this.scoreList.filter(i => i.minScore <= result && i.maxScore > result)
|
||||||
|
return {
|
||||||
|
Score: result.toFixed(3),
|
||||||
|
Level: arr.length > 0 ? arr[0].name : ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// console.log('this.obj.recortModelDtos: ', this.obj.recortModelDtos[0].detailDtos[0].scoreDtos)
|
||||||
|
// return 10
|
||||||
|
},
|
||||||
score () {
|
score () {
|
||||||
const result = this.obj.recortModelDtos.reduce((result, i) => {
|
const result = this.obj.recortModelDtos.reduce((result, i) => {
|
||||||
i.detailDtos.map(j => {
|
i.detailDtos.map(j => {
|
||||||
@ -252,7 +290,7 @@ export default {
|
|||||||
.center();
|
.center();
|
||||||
}
|
}
|
||||||
.pingfen{
|
.pingfen{
|
||||||
width: 300px;
|
width: 500px;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
border-right: 1px solid @borderColor !important;
|
border-right: 1px solid @borderColor !important;
|
||||||
@ -275,11 +313,11 @@ export default {
|
|||||||
.center();
|
.center();
|
||||||
}
|
}
|
||||||
&-ping{
|
&-ping{
|
||||||
width: 100px;
|
width: 180px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
&-defen{
|
&-defen{
|
||||||
width: 40px;
|
width: 60px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
&-shuoming{
|
&-shuoming{
|
||||||
|
|||||||
@ -275,21 +275,23 @@ export default {
|
|||||||
itemInfo: {
|
itemInfo: {
|
||||||
deep: true,
|
deep: true,
|
||||||
handler (n, o) {
|
handler (n, o) {
|
||||||
console.log('(n: ', (n))
|
if (Object.keys(n).length !== 0) {
|
||||||
const arr = n
|
const arr = n
|
||||||
if (arr.isActive !== 0 && arr.isActive !== -1) {
|
if (arr.isActive !== 0 && arr.isActive !== -1) {
|
||||||
if (arr.optType < 1) arr.optType = 1
|
if (arr.optType < 1) arr.optType = 1
|
||||||
arr.name = this.options.filter(i => i.id === arr.optType)[0].name
|
arr.name = this.options.filter(i => i.id === arr.optType)[0].name
|
||||||
} else if (arr.isActive === 0) {
|
} else if (arr.isActive === 0) {
|
||||||
if (arr.list) {
|
if (arr.list) {
|
||||||
arr.name = this.handleTitle(arr.list)
|
arr.name = this.handleTitle(arr.list)
|
||||||
|
} else {
|
||||||
|
arr.name = '未指定成员'
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
arr.name = '未指定成员'
|
arr.optType = -1
|
||||||
|
arr.name = '被考核人自己'
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
arr.optType = -1
|
|
||||||
arr.name = '被考核人自己'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// n.roleIds = ''
|
// n.roleIds = ''
|
||||||
// n.roleDtos.map(i => {
|
// n.roleDtos.map(i => {
|
||||||
// n.roleIds += ''
|
// n.roleIds += ''
|
||||||
|
|||||||
@ -286,20 +286,23 @@ export default {
|
|||||||
itemInfo: {
|
itemInfo: {
|
||||||
deep: true,
|
deep: true,
|
||||||
handler (n, o) {
|
handler (n, o) {
|
||||||
const arr = n
|
if (Object.keys(n).length !== 0) {
|
||||||
console.log('arr: ', arr)
|
const arr = n
|
||||||
if (arr.isActive !== 0 && arr.isActive !== -1) {
|
console.log('arr: ', arr)
|
||||||
if (arr.optType < 1) arr.optType = 1
|
if (arr.isActive !== 0 && arr.isActive !== -1) {
|
||||||
arr.name = this.options.filter(i => i.id === arr.optType)[0].name
|
if (arr.optType < 1) arr.optType = 1
|
||||||
} else if (arr.isActive === 0) {
|
arr.name = this.options.filter(i => i.id === arr.optType)[0].name
|
||||||
if (arr.list) {
|
} else if (arr.isActive === 0) {
|
||||||
arr.name = this.handleTitle(arr.list)
|
if (arr.list) {
|
||||||
|
arr.name = this.handleTitle(arr.list)
|
||||||
|
} else {
|
||||||
|
arr.name = '未指定成员'
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
arr.name = '未指定成员'
|
arr.name = '被考核人自己'
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
arr.name = '被考核人自己'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.$emit('update:info', this.list)
|
// this.$emit('update:info', this.list)
|
||||||
// n.roleIds = ''
|
// n.roleIds = ''
|
||||||
// n.roleDtos.map(i => {
|
// n.roleDtos.map(i => {
|
||||||
|
|||||||
@ -281,25 +281,28 @@ export default {
|
|||||||
itemInfo: {
|
itemInfo: {
|
||||||
deep: true,
|
deep: true,
|
||||||
handler (n, o) {
|
handler (n, o) {
|
||||||
if (n.isActive !== 0) {
|
if (Object.keys(n).length !== 0) {
|
||||||
if (n.optType === 0) n.optType = 1
|
if (n.isActive !== 0) {
|
||||||
n.name = this.options.filter(i => i.id === n.optType)[0].name
|
if (n.optType === 0) n.optType = 1
|
||||||
} else {
|
n.name = this.options.filter(i => i.id === n.optType)[0].name
|
||||||
n.optType = 0
|
|
||||||
// n.name
|
|
||||||
if (n.list) {
|
|
||||||
n.name = this.handleTitle(n.list)
|
|
||||||
} else {
|
} else {
|
||||||
n.name = '未指定成员'
|
n.optType = 0
|
||||||
|
// n.name
|
||||||
|
if (n.list) {
|
||||||
|
n.name = this.handleTitle(n.list)
|
||||||
|
} else {
|
||||||
|
n.name = '未指定成员'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
n.weight = n.weight1 / 100
|
||||||
|
if (n.weight1 >= 0) {
|
||||||
|
n.label = '权重评分:' + n.weight1 + '%'
|
||||||
|
} else {
|
||||||
|
n.label = ''
|
||||||
|
}
|
||||||
|
this.$forceUpdate()
|
||||||
}
|
}
|
||||||
n.weight = n.weight1 / 100
|
|
||||||
if (n.weight1 >= 0) {
|
|
||||||
n.label = '权重评分:' + n.weight1 + '%'
|
|
||||||
} else {
|
|
||||||
n.label = ''
|
|
||||||
}
|
|
||||||
this.$forceUpdate()
|
|
||||||
// n.roleIds = ''
|
// n.roleIds = ''
|
||||||
// n.roleDtos.map(i => {
|
// n.roleDtos.map(i => {
|
||||||
// n.roleIds += ''
|
// n.roleIds += ''
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user