This commit is contained in:
wulin 2020-08-21 17:29:35 +08:00
commit ae5fdf5204
6 changed files with 512 additions and 138 deletions

View File

@ -28,3 +28,15 @@ export const recorddetailDelete = params => {
export const weightCheck = params => {
return http({url: '/lz_management/user/lzresultrecord/weightCheck', method: 'post', params})
}
export const commitApproval = params => {
return http({url: '/lz_management/user/lzresultrecord/commitApproval', method: 'get', params})
}
export const getResultComment = params => {
return http({url: '/lz_management/user/lzresultrecord/getResultComment/' + params, method: 'post'})
}
export const recordIdsSubmit = params => {
return http({url: '/lz_management/user/lzresultrecord/recordIdsSubmit', method: 'post', params})
}

View File

@ -0,0 +1,96 @@
<template>
<el-dialog
:title="'' "
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="80px">
<el-form-item label="意见" prop="resultComment">
<div id="resultCommentEditorElem" class="editor"></div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" v-if="auth.approvelCommit === 1" @click="commitRecord(2)">通过</el-button>
<el-button type="primary" v-if="auth.waitCommit===1" @click="commitRecord(3)">侍提交</el-button>
</span>
</el-dialog>
</template>
<script>
import E from 'wangeditor'
import {commitApproval, getResultComment} from '@/api/api_result'
var Base64 = require('js-base64').Base64
export default {
data () {
return {
visible: false,
resultCommentEditor: null,
recordResultId: 0,
auth: [],
resultCommitId: 0,
dataForm: {
resultComment: ''
},
dataRule: {}
}
},
mounted () {
},
computed: {},
methods: {
async init (recordResultId, auth) {
this.recordResultId = recordResultId
this.auth = auth
this.visible = true
this.$nextTick(async () => {
this.$refs['dataForm'].resetFields()
if (this.resultCommentEditor === null) {
this.resultCommentEditor = new E('#resultCommentEditorElem')
this.resultCommentEditor.customConfig.uploadImgServer = '/uploadPicture'
this.resultCommentEditor.customConfig.uploadFileName = 'file'
this.resultCommentEditor.customConfig.uploadImgParams = ''
this.resultCommentEditor.customConfig.debug = true
this.resultCommentEditor.create()
}
const data = await getResultComment(this.recordResultId)
if (data && data.code === 0) {
this.resultCommitId = data.resultComment.id
if (this.keyResultEditor !== null) {
this.resultCommentEditor.txt.html(data.resultComment.comment)
}
}
})
},
alertInfo (msg) {
this.$message({
message: msg,
type: 'success',
duration: 1500,
onClose: () => {
}
})
},
commitRecord (status) {
commitApproval({
'recordResultId': this.recordResultId,
'resultComment': Base64.encode(this.resultCommentEditor.txt.html()),
'status': status,
'resultCommitId': this.resultCommitId
}).then(data => {
if (data && data.code === 0) {
this.$emit('refreshDataList', this.recordResultId)
} else {
this.alertInfo(data.msg)
}
})
},
stringIsNull (str) {
if (typeof str === 'undefined' || str === null || str === '') {
return true
}
return false
}
}
}
</script>

View File

@ -73,6 +73,13 @@
</div>
</template>
</el-table-column>
<el-table-column prop="type" header-align="center" align="center" label="类型">
<template slot-scope="scope">
<div class="conatnt-name">
<span>{{ scope.row.type | getType }}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="lastScore" header-align="center" align="center" label="最后得分"></el-table-column>
<el-table-column prop="allScore" header-align="center" align="center" label="总分"></el-table-column>
<el-table-column prop="remark" header-align="center" align="center" label="备注"></el-table-column>
@ -114,7 +121,7 @@ export default {
var date = new Date(val)
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
return date.getFullYear() + '-' + month + '-' + day
return date.getFullYear() + '-' + month
},
getStatusStr (status) {
if (status === 0) {
@ -127,6 +134,14 @@ export default {
return '审批通过'
}
return ''
},
getType (value) {
if (value === 1) {
return '本月目标'
} else if (value === 2) {
return '结果'
}
return ''
}
},
data () {
@ -159,9 +174,10 @@ export default {
dataListSelections: [],
stateList: [
{value: '0', label: '新建'},
{value: '1', label: '审批'},
{value: '1', label: '审批'},
{value: '2', label: '拒绝'},
{value: '3', label: '审批通过'}
{value: '3', label: '侍提交'},
{value: '4', label: '审批通过'}
],
departmentList1: [],
departmentList2: [],
@ -261,8 +277,8 @@ export default {
this.dataListSelections = val
},
//
addOrUpdateHandle (id, type) {
this.$router.push({name: 'recorddetail', query: {id: id, type: type}}, () => {
addOrUpdateHandle (id, recordType) {
this.$router.push({name: 'recorddetail', query: {id: id, recordType: recordType}}, () => {
this.mainTabsActiveName = this.$route.name
})
},

View File

@ -84,12 +84,18 @@
<el-button @click="getDataList()">查询</el-button>
</el-form-item>
</el-form>
<div>
<el-button type="primary" style="margin-bottom: 10px" @click="submitBt()">批量提交</el-button>
</div>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
:cell-style="cellStyle"
style="width: 100%;" >
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="id" header-align="center" align="center" label="ID"></el-table-column>
<el-table-column prop="departmentName" header-align="center" align="center" label="部门名称"></el-table-column>
@ -118,8 +124,7 @@
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">详情</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id,3)">详情</el-button>
</template>
</el-table-column>
</el-table>
@ -138,11 +143,9 @@
</template>
<script>
import AddOrUpdate from './lzresultrecord-add-or-update'
import {apiGetResultRecordList, departmentQuery} from '@/api/api_result'
import {apiGetResultRecordList, departmentQuery, recordIdsSubmit} from '@/api/api_result'
import {getDataForMonth} from '@/utils'
import {isURL} from '@/utils/validate'
export default {
filters: {
@ -150,19 +153,29 @@ export default {
var date = new Date(val)
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
return date.getFullYear() + '-' + month + '-' + day
return date.getFullYear() + '-' + month
},
getStatusStr (status) {
if (status === 0) {
return '新建'
} else if (status === 1) {
return '审批'
return '审批'
} else if (status === 2) {
return '拒绝'
} else if (status === 3) {
return '侍提交'
} else if (status === 4) {
return '审批通过'
}
return ''
},
getType (value) {
if (value === 1) {
return '本月目标'
} else if (value === 2) {
return '结果'
}
return ''
}
},
data () {
@ -195,15 +208,16 @@ export default {
dataListSelections: [],
stateList: [
{value: '0', label: '新建'},
{value: '1', label: '审批'},
{value: '1', label: '审批'},
{value: '2', label: '拒绝'},
{value: '3', label: '审批通过'}
{value: '3', label: '侍提交'},
{value: '4', label: '审批通过'}
],
departmentList1: [],
departmentList2: [],
departmentList3: [],
addOrUpdateVisible: false
addOrUpdateVisible: false,
recordIdsSelect: []
}
},
computed: {},
@ -223,6 +237,35 @@ export default {
this.dataForm.endDate = dataList[1]
this.onSubmit()
},
handleSelectionChange (val) {
this.multipleSelection = val
this.recordIdsSelect = []
for (let i = 0; i < this.multipleSelection.length; i++) {
this.recordIdsSelect.push(this.multipleSelection[i].goodId)
}
},
alertInfo (msg) {
this.$message({
message: msg,
type: 'success',
duration: 3000,
onClose: () => {
}
})
},
submitBt (msg = '你确定要提交吗?') {
this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
recordIdsSubmit({
'recordIds': this.recordIdsSelect.join(',')
}).then(data => {
this.alertInfo(data.msg)
})
})
},
async changeDepartment (i) {
let departmentId = 0
if (i === '2') {
@ -259,7 +302,8 @@ export default {
'department2': this.dataForm.department2,
'department3': this.dataForm.department3,
'name': this.dataForm.name,
'remark': this.dataForm.remark
'remark': this.dataForm.remark,
'isSelf': 2
}).then(data => {
if (data && data.code === 0) {
this.dataList = data.page.list
@ -278,6 +322,13 @@ export default {
this.dataForm.beginDate = data[0]
this.dataForm.endDate = data[1]
},
cellStyle ({row, column, rowIndex, columnIndex}) {
if (columnIndex === 5 && row.status === 3) {
return 'color:blue!important;'
} else {
return ''
}
},
//
sizeChangeHandle (val) {
this.pageSize = val
@ -294,10 +345,13 @@ export default {
//
selectionChangeHandle (val) {
this.dataListSelections = val
this.recordIdsSelect = []
for (let i = 0; i < this.dataListSelections.length; i++) {
this.recordIdsSelect.push(this.dataListSelections[i].id)
}
},
//
addOrUpdateHandle (id) {
this.$router.push({name: 'recorddetail',query: {id}}, () => {
addOrUpdateHandle (id, recordType) {
this.$router.push({name: 'recorddetail', query: {id: id, recordType: recordType}}, () => {
this.mainTabsActiveName = this.$route.name
})
},
@ -334,3 +388,16 @@ export default {
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.contentEdit {
color: blue;
cursor: pointer;
}
.btn-box{
margin-bottom: 10px;
}
</style>

View File

@ -5,41 +5,46 @@
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm"
label-width="80px">
<el-form-item label="目标/指标" prop="target">
<el-input :disabled="false" v-model="dataForm.target" placeholder="目标/指标"></el-input>
<el-form-item label="目标/指标" v-show="auth.target >= 1" prop="target">
<el-input :disabled="auth.target<2" v-model="dataForm.target" placeholder="目标/指标"></el-input>
</el-form-item>
<el-form-item label="关键结果" prop="keyResult">
<div id="keyResultEditorElem" class="editor"></div>
<el-form-item label="关键结果" v-show="auth.keyResult >= 1 && this.type == 1 " prop="keyResult">
<div id="keyResultEditorElem" class="editor"></div>
</el-form-item>
<el-form-item label="考核权重" prop="checkWeight">
<el-input v-model="dataForm.checkWeight" placeholder="考核权重"></el-input>
<el-form-item v-show="auth.checkWeight>=1" label="考核权重" prop="checkWeight">
<el-input v-model="dataForm.checkWeight" :disabled="auth.checkWeight<2" placeholder="考核权重"></el-input>
</el-form-item>
<el-form-item label="考核结果" prop="checkResult">
<el-form-item label="考核结果" v-show="auth.checkResult >= 1" prop="checkResult">
<div id="checkResultEditorElem" class="editor"></div>
</el-form-item>
<el-form-item label="上级评分">
<el-select v-model="dataForm.superScore" placeholder="请选择" @change="changeSuperScore()" >
<el-form-item label="优先级" v-show="auth.priority >= 1" prop="priority">
<el-input :disabled="auth.priority < 2 " v-model="dataForm.priority" placeholder="优先级别,数字越大,越在排列在表格前面"></el-input>
</el-form-item>
<el-form-item label="上级评分" v-show="auth.superScore >= 1">
<el-select v-model="dataForm.acquireScore" :disabled="auth.superScore < 2" placeholder="请选择">
<el-option
v-for="item in superScore"
v-for="item in superScoreData"
:key="item.score"
:label="item.label"
:value="item.label"
:value="item.score"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="得分" prop="acquireScore">
<template >
<div style="color: red" class="conatnt-name" v-model="dataForm.acquireScore">
<span>{{ this.dataForm.acquireScore }}</span>
<el-form-item label="得分" prop="acquireScore" v-show="auth.acquireScore == 1">
<template>
<div style="color: red" class="conatnt-name">
<span>{{ acquireScore }}</span>
</div>
</template>
</el-form-item>
<el-form-item v-show="true" label="评分说明" prop="scoreComment">
<el-input v-model="dataForm.scoreComment" placeholder="评分说明(直属上级填写)"></el-input>
<el-form-item label="评分说明" v-show="auth.scoreComment >= 1" prop="scoreComment">
<div id="scoreCommentEditorElem" class="editor"></div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
@ -80,25 +85,56 @@ export default {
}
callback()
}
var validPriority = async (rule, value, callback) => {
if (!value) {
callback(new Error('优先级不能为空'))
}
if (!/^(0|[1-9][0-9]*)$/.test(value)) {
callback(new Error('请输入大于或等于0的整数'))
}
callback()
}
return {
visible: false,
keyResultEditor: null,
checkResultEditor: null,
recordResultId: null,
scoreCommentEditor: null,
auth: [],
recordType: 0,
type: 0,
superScore: [{
superScoreData: [{
score: 0,
label: ' '
}, {
score: 4,
label: '4分-卓越'
}, {
score: 3.875,
label: '3.75(+)-优秀'
}, {
score: 3.75,
label: '3.75分-优秀'
label: '3.75分-合格'
}, {
score: 3.667,
label: '3.75(-)-优秀'
}, {
score: 3.583,
label: '3.5(+)-合格'
}, {
score: 3.583,
label: '3.5(+)-合格'
}, {
score: 3.5,
label: '3.5分-合格'
}, {
score: 3.375,
label: '3.5(-)-合格'
}, {
score: 3.25,
label: '3.25分-不合格,待改进'
}],
}
],
dataForm: {
id: 0,
target: '',
@ -107,7 +143,8 @@ export default {
checkResult: '',
superScore: '',
acquireScore: '',
scoreComment: ''
scoreComment: '',
priority: ''
},
dataRule: {
scoreComment: [
@ -115,6 +152,9 @@ export default {
],
checkWeight: [
{validator: validNum, required: true, trigger: 'blur'}
],
priority: [
{validator: validPriority, required: true, trigger: 'blur'}
]
}
}
@ -123,13 +163,18 @@ export default {
},
computed: {
acquireScore () {
const score1 = this.superScoreData.filter(i => this.dataForm.acquireScore === i.score)
return score1.length > 0 ? score1[0].score : 0
}
},
methods: {
async init (id, type, recordResultId) {
async init (id, type, recordResultId, auth, recordType) {
this.type = type
this.recordResultId = recordResultId
this.auth = auth
this.recordType = recordType
this.dataForm.id = id || 0
let data = await weightCheck({
'recordResultId': this.recordResultId,
'type': this.type,
@ -146,6 +191,15 @@ export default {
})
return
}
if (this.keyResultEditor !== null) {
this.keyResultEditor.txt.html('')
}
if (this.checkResultEditor !== null) {
this.checkResultEditor.txt.html('')
}
if (this.scoreCommentEditor !== null) {
this.scoreCommentEditor.txt.html('')
}
this.visible = true
this.$nextTick(async () => {
this.$refs['dataForm'].resetFields()
@ -156,7 +210,9 @@ export default {
this.keyResultEditor.customConfig.uploadImgParams = ''
this.keyResultEditor.customConfig.debug = true
this.keyResultEditor.create()
this.keyResultEditor.$textElem.attr('contenteditable', false)
if (this.auth.keyResult < 2) {
this.keyResultEditor.$textElem.attr('contenteditable', false)
}
}
if (this.checkResultEditor === null) {
this.checkResultEditor = new E('#checkResultEditorElem')
@ -165,57 +221,135 @@ export default {
this.checkResultEditor.customConfig.uploadImgParams = ''
this.checkResultEditor.customConfig.debug = true
this.checkResultEditor.create()
this.keyResultEditor.$textElem.attr('contenteditable', false)
if (this.auth.checkResult < 2) {
this.checkResultEditor.$textElem.attr('contenteditable', false)
}
}
if (this.scoreCommentEditor === null) {
this.scoreCommentEditor = new E('#scoreCommentEditorElem')
this.scoreCommentEditor.customConfig.uploadImgServer = '/uploadPicture'
this.scoreCommentEditor.customConfig.uploadFileName = 'file'
this.scoreCommentEditor.customConfig.uploadImgParams = ''
this.scoreCommentEditor.customConfig.debug = true
this.scoreCommentEditor.create()
if (this.auth.scoreComment < 2) {
this.scoreCommentEditor.$textElem.attr('contenteditable', false)
}
}
if (this.dataForm.id && this.dataForm.id > 0) {
const data = await apiDetailInfo(this.dataForm.id)
if (data && data.code === 0) {
this.dataForm.target = data.detailInfo.target
this.dataForm.keyResult = data.detailInfo.keyResult
this.dataForm.checkWeight = data.detailInfo.checkWeight
this.dataForm.checkResult = data.detailInfo.checkResult
this.dataForm.superScore = data.detailInfo.superScore
this.dataForm.acquireScore = data.detailInfo.acquireScore
this.dataForm.scoreComment = data.detailInfo.scoreComment
this.keyResultEditor.txt.html(this.dataForm.keyResult || '')
this.checkResultEditor.txt.html(this.dataForm.checkResult || '')
this.dataForm = data.detailInfo
if (this.keyResultEditor !== null) {
this.keyResultEditor.txt.html(this.dataForm.keyResult || '')
}
if (this.checkResultEditor !== null) {
this.checkResultEditor.txt.html(this.dataForm.checkResult || '')
}
if (this.scoreCommentEditor !== null) {
this.scoreCommentEditor.txt.html(this.dataForm.scoreComment || '')
}
}
}
})
},
changeSuperScore () {
let value = this.dataForm.superScore
value = value.replace(/[\u4e00-\u9fa5]/g, '')
value = value.replace('-', '')
value = value.replace('', '')
this.dataForm.acquireScore = value
},
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
recorddetailAddOrUpdate({
'id': this.dataForm.id || undefined,
'type': this.type,
'target': this.dataForm.target,
'keyResult': Base64.encode(this.keyResultEditor.txt.html()),
'checkWeight': this.dataForm.checkWeight,
'checkResult': Base64.encode(this.checkResultEditor.txt.html()),
'superScore': this.dataForm.superScore,
'acquireScore': this.dataForm.acquireScore,
'scoreComment': this.dataForm.scoreComment,
'recordId': this.recordResultId
}).then(res => {
if (res && res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
alertInfo (msg) {
this.$message({
message: msg,
type: 'success',
duration: 1500,
onClose: () => {
}
})
},
stringIsNull (str) {
if (typeof str === 'undefined' || str === null || str === '') {
return true
}
return false
},
async dataFormSubmit () {
if (this.auth.target === 2) {
if (this.stringIsNull(this.dataForm.target)) {
this.alertInfo('目标不能为空')
return
}
}
if (this.auth.keyResult === 2 && this.type === 1) {
if (this.stringIsNull(this.keyResultEditor.txt.html())) {
this.alertInfo('关键结果不能为空')
return
}
}
if (this.auth.checkWeight === 2) {
if (this.stringIsNull(this.dataForm.checkWeight)) {
this.alertInfo('权重不能为空')
return
}
let data = await weightCheck({
'recordResultId': this.recordResultId,
'weight': this.dataForm.checkWeight,
'type': this.type,
'id': this.dataForm.id
})
if (data && data.code !== 0) {
this.alertInfo(data.msg)
return
}
}
if (this.auth.checkResult === 2) {
if (this.stringIsNull(this.checkResultEditor.txt.html())) {
this.alertInfo('考核结果不能为空')
return
}
}
if (this.auth.superScore === 2) {
if (this.stringIsNull(this.dataForm.superScore)) {
this.alertInfo('上级评分不能为空')
return
}
}
if (this.auth.scoreComment === 2) {
if (this.dataForm.acquireScore !== 3.5 || this.dataForm.acquireScore !== 3.75) {
if (this.stringIsNull(this.scoreCommentEditor.txt.html())) {
this.alertInfo('评分说明不能为空')
return
}
}
}
if (this.auth.priority === 2) {
if (this.stringIsNull(this.dataForm.priority)) {
this.alertInfo('优先级不能为空')
return
}
}
const score1 = this.superScoreData.filter(i => this.dataForm.acquireScore === i.score)
const superScore1 = score1[0].label
recorddetailAddOrUpdate({
'id': this.dataForm.id || undefined,
'type': this.type,
'target': this.dataForm.target,
'keyResult': Base64.encode(this.keyResultEditor.txt.html()),
'checkWeight': this.dataForm.checkWeight,
'checkResult': Base64.encode(this.checkResultEditor.txt.html()),
'superScore': superScore1,
'acquireScore': this.dataForm.acquireScore,
'scoreComment': Base64.encode(this.scoreCommentEditor.txt.html()),
'recordId': this.recordResultId,
'recordType': this.recordType,
'priority': this.priority
}).then(res => {
if (res && res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList', res.recordId)
}
})
}

View File

@ -26,20 +26,21 @@
<div class="titleBottom">
<div class="bottom" v-show="this.auth.commit == 1" >
<p> <span style="cursor: pointer">提交审批</span></p>
<p><span style="cursor: pointer" @click="commitApprovalYes('你确认要提交审批吗?')">提交审批</span></p>
</div>
<div class="bottom" v-show="this.auth.approvel == 1" >
<p> <span style="cursor: pointer">审批通过</span></p>
<div class="bottom" v-show="this.auth.approvel == 1">
<p><span style="cursor: pointer" @click="commitApprovalAddOrUpdate">审批</span></p>
</div>
<div class="bottom" v-show="this.auth.confirmCommit == 1" >
<p> <span style="cursor: pointer">确认得分</span></p>
<div class="bottom" v-show="this.auth.confirmCommit == 1">
<p><span style="cursor: pointer" @click="commitApprovalYes('你要确认得分吗?')">确认得分</span></p>
</div>
<div class="bottom" v-show="this.auth.reject == 1" >
<p> <span style="cursor: pointer;color: red">驳回</span></p>
<div class="bottom" v-show="this.auth.reject == 1">
<p><span style="cursor: pointer">驳回</span></p>
</div>
</div>
</div>
@ -50,7 +51,7 @@
v-loading.body="loading"
element-loading-text="Loading" border fit highlight-current-row>
<el-table-column label="考核维度" prop="checkRange" align="center" width="80"></el-table-column>
<el-table-column label="目标/指标" prop="target" align="center" width="200">
<el-table-column label="目标/指标" prop="target" align="left" width="200">
<template slot-scope="scope">
<div v-html="scope.row.target" class="rich">
</div>
@ -85,35 +86,33 @@
</div>
</template>
</el-table-column>
<el-table-column label="评分说明(直属上级填写)" width="300" prop="scoreComment"></el-table-column>
<el-table-column width="80" label="操作" align="center" fixed="right">
<el-table-column label="评分说明(直属上级填写)" width="300" prop="scoreComment">
<template slot-scope="scope">
<el-button size="mini" type="primary" style="margin-left:0px;" @click="handleAddOrUpdate(0,scope.row.type )" v-if="scope.row.isAdd===1 && auth.add == 1 ">添加</el-button>
<el-button size="mini" style="margin-left:0px;" @click="handleAddOrUpdate(scope.row.id,scope.row.type)" v-if="scope.row.isEdit > 0 && auth.edit == 1" >编辑</el-button>
<div v-html="scope.row.scoreComment" class="rich">
</div>
</template>
</el-table-column>
<el-table-column width="80" label="操作" v-if="(auth.add === 1 || auth.edit == 1) && hasOperator" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="primary" style="margin-left:0px;" @click="handleAddOrUpdate(0,scope.row.type )" v-if="scope.row.isAdd===1 && auth.add == 1 ">添加</el-button>
<el-button size="mini" style="margin-left:0px;" @click="handleAddOrUpdate(scope.row.id,scope.row.type)" v-if="scope.row.isEdit > 0 && auth.edit == 1">编辑</el-button>
</template>
</el-table-column>
</el-table>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<approval-add-or-update v-if="approvalVisible" ref="approvalAddOrUpdate" @refreshDataList="getDataList"></approval-add-or-update>
</div>
</div>
</template>
<script>
import {getStaffResultDetail} from '@/api/api_result'
import {getStaffResultDetail, commitApproval} from '@/api/api_result'
import AddOrUpdate from './recorddetail-add-or-update'
import ApprovalAddOrUpdate from './approval-add-or-update.vue'
export default {
created () {
this.recordResultId = this.$route.query.id
this.type = this.$route.query.type
},
filters: {
getcheckWeightStr (val) {
@ -138,13 +137,13 @@ export default {
return {
active: 3,
type: 1,
hasOperator: false,
recordResultId: 0,
tableData: [],
firstRowspan: 5,
secondRowspan: 6,
threeRowspan: 8,
fourRowspan: 9,
fiveRowspan: 10,
yeJiCheckNum: 4,
wenHuaJiaZhiGuanNum: 2,
lastResultNum: 2,
commentNum: 1,
checkMonth: '2020-03-21',
staffName: '瞿贻晓',
department1: '业务中台',
@ -152,30 +151,34 @@ export default {
department3: '技术部门',
superStaff: '吴林',
addOrUpdateVisible: false,
approvalVisible: false,
loading: false,
auth: [],
authId: 0
recordType: 0
}
},
components: {
AddOrUpdate
AddOrUpdate,
ApprovalAddOrUpdate
},
activated () {
this.recordResultId = this.$route.query.id
this.recordType = this.$route.query.recordType
this.getDataList()
},
methods: {
getDataList () {
getDataList (id = this.recordResultId) {
this.recordResultId = id
getStaffResultDetail({
'recordResultId': this.recordResultId,
'type': this.type
'recordResultId': id,
'recordType': this.recordType
}).then(data => {
if (data && data.code === 0) {
this.tableData = data.list
this.firstRowspan = data.firstRowspan
this.secondRowspan = data.secondRowspan
this.threeRowspan = data.threeRowspan
this.fourRowspan = data.fourRowspan
this.fiveRowspan = data.fiveRowspan
this.yeJiCheckNum = data.yeJiCheckNum
this.wenHuaJiaZhiGuanNum = data.wenHuaJiaZhiGuanNum
this.lastResultNum = data.lastResultNum
this.commentNum = data.commentNum
this.checkMonth = data.checkMonth
this.staffName = data.staffName
this.department1 = data.department1
@ -183,12 +186,17 @@ export default {
this.department3 = data.department3
this.superStaff = data.superStaff
this.auth = data.auth
this.authId = data.authId
this.recordType = data.recordType
this.recordResultId = data.recordResultId
if (this.tableData.find(item => item.isAdd === 1 || item.isEdit === 1)) {
this.hasOperator = true
}
} else {
this.tableData = []
}
this.dataListLoading = false
this.addOrUpdateVisible = false
this.approvalVisible = false
})
},
// /
@ -196,33 +204,66 @@ export default {
this.addOrUpdateVisible = true
this.$nextTick(() => {
setTimeout(() => {
this.$refs.addOrUpdate.init(id, type, this.recordResultId)
this.$refs.addOrUpdate.init(id, type, this.recordResultId, this.auth, this.recordType)
}, 500)
})
},
commitApprovalAddOrUpdate () {
this.approvalVisible = true
this.$nextTick(() => {
setTimeout(() => {
this.$refs.approvalAddOrUpdate.init(this.recordResultId, this.auth)
}, 500)
})
},
commitApprovalYes (msg = '确定要提交审批吗?') {
this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
commitApproval({
'recordResultId': this.recordResultId,
'status': 2
}).then(data => {
if (data && data.code === 0) {
this.getDataList()
this.$message({
message: data.msg,
type: 'success',
duration: 1500,
onClose: () => {
}
})
}
})
}).catch(() => {
})
},
cellStyle ({row, column, rowIndex, columnIndex}) {
if (rowIndex === this.firstRowspan || rowIndex === this.threeRowspan) {
if (rowIndex === this.yeJiCheckNum || rowIndex === this.yeJiCheckNum + this.wenHuaJiaZhiGuanNum + 1 || rowIndex === this.yeJiCheckNum + this.wenHuaJiaZhiGuanNum + this.lastResultNum + 2) {
return 'background:#FFC400;font-weight:bolder!important;'
} else {
return ''
}
},
objectSpanMethod ({row, column, rowIndex, columnIndex}) {
if (columnIndex === 0) {
if (rowIndex === 0) {
return {
rowspan: this.firstRowspan,
rowspan: this.yeJiCheckNum,
colspan: 1
}
} else if (rowIndex === this.firstRowspan) {
} else if (rowIndex === this.yeJiCheckNum) {
} else if (rowIndex === this.secondRowspan) {
} else if (rowIndex === (this.yeJiCheckNum + 1)) {
return {
rowspan: 2,
colspan: 1
}
} else if (rowIndex >= this.threeRowspan && rowIndex <= this.fiveRowspan) {
} else if (rowIndex >= (this.yeJiCheckNum + 1 + this.wenHuaJiaZhiGuanNum) && rowIndex <= (this.yeJiCheckNum + 1 + this.wenHuaJiaZhiGuanNum + this.lastResultNum)) {
} else if (rowIndex > this.yeJiCheckNum + 1 + this.wenHuaJiaZhiGuanNum + this.lastResultNum) {
} else {
return {
@ -231,7 +272,7 @@ export default {
}
}
}
if (rowIndex === this.firstRowspan) {
if (rowIndex === this.yeJiCheckNum) {
if (columnIndex === 0) {
return [1, 2]
} else if (columnIndex === 1) {
@ -239,22 +280,21 @@ export default {
}
}
if (rowIndex >= this.secondRowspan && rowIndex < this.threeRowspan) {
if (rowIndex >= this.yeJiCheckNum + 1 && rowIndex < this.yeJiCheckNum + 1 + this.wenHuaJiaZhiGuanNum) {
if (columnIndex === 1) {
return [1, 2]
} else if (columnIndex === 2) {
return [0, 0]
}
}
if (rowIndex === this.threeRowspan) {
if (rowIndex === this.yeJiCheckNum + 1 + this.wenHuaJiaZhiGuanNum) {
if (columnIndex === 0) {
return [1, 2]
} else if (columnIndex === 1) {
return [0, 0]
}
}
if (rowIndex >= this.fourRowspan && rowIndex <= this.fiveRowspan) {
if (rowIndex >= (this.yeJiCheckNum + 1 + this.wenHuaJiaZhiGuanNum) && rowIndex <= this.yeJiCheckNum + 1 + this.wenHuaJiaZhiGuanNum + this.lastResultNum) {
if (columnIndex === 0) {
return [1, 2]
} else if (columnIndex === 1) {
@ -265,6 +305,15 @@ export default {
return [0, 0]
}
}
if (rowIndex > this.yeJiCheckNum + 1 + this.wenHuaJiaZhiGuanNum + this.lastResultNum) {
if (columnIndex === 0) {
return [1, 1]
} else if (columnIndex === 1) {
return [1, 7]
} else {
return [0, 0]
}
}
}
}
}
@ -357,7 +406,7 @@ export default {
.bottom{
float: right;
color: blue;
width: 100px;
width: 80px;
height: 30px;
text-align: left;
.des{