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