This commit is contained in:
熊成强 2020-10-29 15:06:59 +08:00
parent c69c2f0731
commit 92a028bc23
3 changed files with 32 additions and 26 deletions

View File

@ -25,6 +25,7 @@
<el-radio-group v-model="itemInfo.isActive">
<el-radio :label="1">主管指定一级</el-radio>
<el-radio :label="0">指定成员</el-radio>
<el-radio :label="-1">被考核人自己</el-radio>
</el-radio-group>
<div v-if="itemInfo.isActive!==0 && itemInfo.isActive!==-1" style="padding:30px 0 0 20px;">
<span>被考评人的</span>
@ -42,7 +43,7 @@
<span style="font-size:14px;padding:0 0 0 10px;">{{itemInfo.name}}</span>
</div>
<getpersonl v-if="itemInfo.isShow" :value.sync='itemInfo.optIds' :isShow.sync='itemInfo.isShow' :showDataList.sync='itemInfo.list'/>
<div style="padding:20px 0 0 0 ">
<div v-if="itemInfo.isActive!==-1" style="padding:20px 0 0 0 ">
<span>当执行人为多人时的处理方式</span>
<div style="padding:10px 0 0 20px">
<el-radio-group v-model="itemInfo.stepType">
@ -132,7 +133,7 @@ export default {
list = list.map(i => {
i.isShow = false
i = Object.assign({}, this.handleOptType(i), i)
i.isActive = i.optType === 0 ? 0 : 1
i.isActive = (i.optType === 0 || i.optType === -1) ? i.optType : 1
i.roleDtos = JSON.parse(JSON.stringify(this.roleDtos)).map(j => {
j.checked = i.roleIds ? i.roleIds.includes(String(j.id)) : false
return j
@ -157,6 +158,7 @@ export default {
return obj
}
if (i.optType === -1) {
obj.name = '被考核人'
return obj
} else {
obj.name = this.options.filter(j => j.id === i.optType)[0].name
@ -231,10 +233,11 @@ export default {
n.map(i => {
i.roleIds = ''
i.roleDtos.map(j => {
if (j.type !== 1 && j.checked) i.roleIds += j.id + ','
console.log('j: ', j)
if (j.type !== 1 && j.checked) i.roleIds += j.roleId + ','
})
i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1)
i.optType = i.isActive === 0 ? 0 : i.optType
i.optType = (i.isActive === 0 || i.isActive === -1) ? i.isActive : i.optType
})
console.log('n: ', n)
this.$emit('update:info', this.list)
@ -248,27 +251,25 @@ export default {
list: {
deep: true,
handler (n, o) {
this.handleIsEmit(n)
this.handleIsEmit(JSON.parse(JSON.stringify(n)))
}
},
itemInfo: {
deep: true,
handler (n, o) {
console.log('nxcq: ', n)
if (n.isActive !== 0) {
if (n.optType === 0 && n.optType !== -1) {
n.name = this.options.filter(i => i.id === n.optType)[0].name
n.optType = 1
}
if (n.optType === -1) {
n.name = '考核人员自己'
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 {
if (n.list) {
n.name = this.handleTitle(n.list)
} else {
n.name = '未指定成员'
}
arr.name = '被考核人自己'
}
// n.roleIds = ''
// n.roleDtos.map(i => {

View File

@ -25,6 +25,7 @@
<el-radio-group v-model="itemInfo.isActive">
<el-radio :label="1">主管指定一级</el-radio>
<el-radio :label="0">指定成员</el-radio>
<el-radio :label="-1">被考核人自己</el-radio>
</el-radio-group>
<div v-if="itemInfo.isActive!==0 && itemInfo.isActive!==-1" style="padding:30px 0 0 20px;">
<span>被考评人的</span>
@ -42,7 +43,7 @@
<span style="font-size:14px;padding:0 0 0 10px;">{{itemInfo.name}}</span>
</div>
<getpersonl v-if="itemInfo.isShow" :value.sync='itemInfo.optIds' :isShow.sync='itemInfo.isShow' :showDataList.sync='itemInfo.list'/>
<div style="padding:20px 0 0 0 ">
<div v-if="itemInfo.isActive !== -1" style="padding:20px 0 0 0 ">
<span>当执行人为多人时的处理方式</span>
<div style="padding:10px 0 0 20px">
<el-radio-group v-model="itemInfo.stepType">
@ -137,7 +138,8 @@ export default {
list = list.map(i => {
i.isShow = false
i = Object.assign({}, this.handleOptType(i), i)
i.isActive = i.optType === 0 ? 0 : 1
console.log('i: ', i)
i.isActive = (i.optType === 0 || i.optType === -1) ? i.optType : 1
i.roleDtos = JSON.parse(JSON.stringify(this.roleDtos)).map(j => {
j.checked = i.roleIds ? i.roleIds.includes(String(j.id)) : false
return j
@ -162,6 +164,7 @@ export default {
return obj
}
if (i.optType === -1) {
obj.name = '被考核人'
return obj
} else {
obj.name = this.options.filter(j => j.id === i.optType)[0].name
@ -239,10 +242,10 @@ export default {
arr = arr.map(i => {
i.roleIds = ''
i.roleDtos.map(j => {
if (j.type !== 1 && j.checked) i.roleIds += j.id + ','
if (j.type !== 1 && j.checked) i.roleIds += j.roleId + ','
})
i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1)
i.optType = i.isActive === 0 ? 0 : i.optType
i.optType = (i.isActive === 0 || i.isActive === -1) ? i.isActive : i.optType
return i
})
console.log('arr: ', arr)
@ -266,15 +269,17 @@ export default {
handler (n, o) {
const arr = n
console.log('arr: ', arr)
if (arr.isActive !== 0) {
if (arr.optType === 0) arr.optType = 1
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 {
} else if (arr.isActive === 0) {
if (arr.list) {
arr.name = this.handleTitle(arr.list)
} else {
arr.name = '未指定成员'
}
} else {
arr.name = '被考核人自己'
}
// this.$emit('update:info', this.list)
// n.roleIds = ''

View File

@ -239,7 +239,7 @@ export default {
n.map(i => {
i.roleIds = ''
i.roleDtos.map(j => {
if (j.type !== 1 && j.checked) i.roleIds += j.id + ','
if (j.type !== 1 && j.checked) i.roleIds += j.roleId + ','
})
i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1)
})