提交我

This commit is contained in:
quyixiao 2020-08-21 17:24:55 +08:00
parent c9c8bc8fc0
commit f0dfe2d916
5 changed files with 113 additions and 38 deletions

View File

@ -32,3 +32,11 @@ export const weightCheck = params => {
export const commitApproval = params => { export const commitApproval = params => {
return http({url: '/lz_management/user/lzresultrecord/commitApproval', method: 'get', 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

@ -9,15 +9,16 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="commitRecord(2)">通过</el-button> <el-button type="primary" v-if="auth.approvelCommit === 1" @click="commitRecord(2)">通过</el-button>
<el-button type="primary" @click="commitRecord(3)">侍提交</el-button> <el-button type="primary" v-if="auth.waitCommit===1" @click="commitRecord(3)">侍提交</el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import E from 'wangeditor' import E from 'wangeditor'
import {commitApproval} from '@/api/api_result' import {commitApproval, getResultComment} from '@/api/api_result'
var Base64 = require('js-base64').Base64 var Base64 = require('js-base64').Base64
export default { export default {
data () { data () {
@ -25,12 +26,12 @@ export default {
visible: false, visible: false,
resultCommentEditor: null, resultCommentEditor: null,
recordResultId: 0, recordResultId: 0,
auth: null, auth: [],
resultCommitId: 0,
dataForm: { dataForm: {
resultComment: '' resultComment: ''
}, },
dataRule: { dataRule: {}
}
} }
}, },
mounted () { mounted () {
@ -52,6 +53,13 @@ export default {
this.resultCommentEditor.customConfig.debug = true this.resultCommentEditor.customConfig.debug = true
this.resultCommentEditor.create() 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) { alertInfo (msg) {
@ -67,7 +75,8 @@ export default {
commitApproval({ commitApproval({
'recordResultId': this.recordResultId, 'recordResultId': this.recordResultId,
'resultComment': Base64.encode(this.resultCommentEditor.txt.html()), 'resultComment': Base64.encode(this.resultCommentEditor.txt.html()),
'status': status 'status': status,
'resultCommitId': this.resultCommitId
}).then(data => { }).then(data => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$emit('refreshDataList', this.recordResultId) this.$emit('refreshDataList', this.recordResultId)

View File

@ -174,9 +174,10 @@ export default {
dataListSelections: [], dataListSelections: [],
stateList: [ stateList: [
{value: '0', label: '新建'}, {value: '0', label: '新建'},
{value: '1', label: '审批'}, {value: '1', label: '审批'},
{value: '2', label: '拒绝'}, {value: '2', label: '拒绝'},
{value: '3', label: '审批通过'} {value: '3', label: '侍提交'},
{value: '4', label: '审批通过'}
], ],
departmentList1: [], departmentList1: [],
departmentList2: [], departmentList2: [],

View File

@ -84,12 +84,18 @@
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div>
<el-button type="primary" style="margin-bottom: 10px" @click="submitBt()">批量提交</el-button>
</div>
<el-table <el-table
:data="dataList" :data="dataList"
border border
v-loading="dataListLoading" v-loading="dataListLoading"
@selection-change="selectionChangeHandle" @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 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="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> <el-table-column prop="departmentName" header-align="center" align="center" label="部门名称"></el-table-column>
@ -137,9 +143,8 @@
</template> </template>
<script> <script>
import AddOrUpdate from './lzresultrecord-add-or-update' 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 {getDataForMonth} from '@/utils'
export default { export default {
@ -154,10 +159,12 @@ export default {
if (status === 0) { if (status === 0) {
return '新建' return '新建'
} else if (status === 1) { } else if (status === 1) {
return '审批' return '审批'
} else if (status === 2) { } else if (status === 2) {
return '拒绝' return '拒绝'
} else if (status === 3) { } else if (status === 3) {
return '侍提交'
} else if (status === 4) {
return '审批通过' return '审批通过'
} }
return '' return ''
@ -201,15 +208,16 @@ export default {
dataListSelections: [], dataListSelections: [],
stateList: [ stateList: [
{value: '0', label: '新建'}, {value: '0', label: '新建'},
{value: '1', label: '审批'}, {value: '1', label: '审批'},
{value: '2', label: '拒绝'}, {value: '2', label: '拒绝'},
{value: '3', label: '审批通过'} {value: '3', label: '侍提交'},
{value: '4', label: '审批通过'}
], ],
departmentList1: [], departmentList1: [],
departmentList2: [], departmentList2: [],
departmentList3: [], departmentList3: [],
addOrUpdateVisible: false addOrUpdateVisible: false,
recordIdsSelect: []
} }
}, },
computed: {}, computed: {},
@ -229,6 +237,35 @@ export default {
this.dataForm.endDate = dataList[1] this.dataForm.endDate = dataList[1]
this.onSubmit() 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) { async changeDepartment (i) {
let departmentId = 0 let departmentId = 0
if (i === '2') { if (i === '2') {
@ -285,6 +322,13 @@ export default {
this.dataForm.beginDate = data[0] this.dataForm.beginDate = data[0]
this.dataForm.endDate = data[1] this.dataForm.endDate = data[1]
}, },
cellStyle ({row, column, rowIndex, columnIndex}) {
if (columnIndex === 5 && row.status === 3) {
return 'color:blue!important;'
} else {
return ''
}
},
// //
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
@ -301,8 +345,11 @@ export default {
// //
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
this.recordIdsSelect = []
for (let i = 0; i < this.dataListSelections.length; i++) {
this.recordIdsSelect.push(this.dataListSelections[i].id)
}
}, },
//
addOrUpdateHandle (id, recordType) { addOrUpdateHandle (id, recordType) {
this.$router.push({name: 'recorddetail', query: {id: id, recordType: recordType}}, () => { this.$router.push({name: 'recorddetail', query: {id: id, recordType: recordType}}, () => {
this.mainTabsActiveName = this.$route.name this.mainTabsActiveName = this.$route.name
@ -351,5 +398,6 @@ export default {
.btn-box{ .btn-box{
margin-bottom: 10px; margin-bottom: 10px;
} }
</style> </style>

View File

@ -51,7 +51,7 @@
v-loading.body="loading" v-loading.body="loading"
element-loading-text="Loading" border fit highlight-current-row> 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="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"> <template slot-scope="scope">
<div v-html="scope.row.target" class="rich"> <div v-html="scope.row.target" class="rich">
</div> </div>
@ -140,11 +140,10 @@ export default {
hasOperator: false, hasOperator: false,
recordResultId: 0, recordResultId: 0,
tableData: [], tableData: [],
firstRowspan: 5, yeJiCheckNum: 4,
secondRowspan: 6, wenHuaJiaZhiGuanNum: 2,
threeRowspan: 8, lastResultNum: 2,
fourRowspan: 9, commentNum: 1,
fiveRowspan: 10,
checkMonth: '2020-03-21', checkMonth: '2020-03-21',
staffName: '瞿贻晓', staffName: '瞿贻晓',
department1: '业务中台', department1: '业务中台',
@ -176,11 +175,10 @@ export default {
}).then(data => { }).then(data => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.tableData = data.list this.tableData = data.list
this.firstRowspan = data.firstRowspan this.yeJiCheckNum = data.yeJiCheckNum
this.secondRowspan = data.secondRowspan this.wenHuaJiaZhiGuanNum = data.wenHuaJiaZhiGuanNum
this.threeRowspan = data.threeRowspan this.lastResultNum = data.lastResultNum
this.fourRowspan = data.fourRowspan this.commentNum = data.commentNum
this.fiveRowspan = data.fiveRowspan
this.checkMonth = data.checkMonth this.checkMonth = data.checkMonth
this.staffName = data.staffName this.staffName = data.staffName
this.department1 = data.department1 this.department1 = data.department1
@ -243,7 +241,7 @@ export default {
}) })
}, },
cellStyle ({row, column, rowIndex, columnIndex}) { 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;' return 'background:#FFC400;font-weight:bolder!important;'
} else { } else {
return '' return ''
@ -253,17 +251,19 @@ export default {
if (columnIndex === 0) { if (columnIndex === 0) {
if (rowIndex === 0) { if (rowIndex === 0) {
return { return {
rowspan: this.firstRowspan, rowspan: this.yeJiCheckNum,
colspan: 1 colspan: 1
} }
} else if (rowIndex === this.firstRowspan) { } else if (rowIndex === this.yeJiCheckNum) {
} else if (rowIndex === this.secondRowspan) { } else if (rowIndex === (this.yeJiCheckNum + 1)) {
return { return {
rowspan: 2, rowspan: 2,
colspan: 1 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 { } else {
return { return {
@ -272,7 +272,7 @@ export default {
} }
} }
} }
if (rowIndex === this.firstRowspan) { if (rowIndex === this.yeJiCheckNum) {
if (columnIndex === 0) { if (columnIndex === 0) {
return [1, 2] return [1, 2]
} else if (columnIndex === 1) { } else if (columnIndex === 1) {
@ -280,21 +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) { if (columnIndex === 1) {
return [1, 2] return [1, 2]
} else if (columnIndex === 2) { } else if (columnIndex === 2) {
return [0, 0] return [0, 0]
} }
} }
if (rowIndex === this.threeRowspan) { if (rowIndex === this.yeJiCheckNum + 1 + this.wenHuaJiaZhiGuanNum) {
if (columnIndex === 0) { if (columnIndex === 0) {
return [1, 2] return [1, 2]
} else if (columnIndex === 1) { } else if (columnIndex === 1) {
return [0, 0] 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) { if (columnIndex === 0) {
return [1, 2] return [1, 2]
} else if (columnIndex === 1) { } else if (columnIndex === 1) {
@ -305,6 +305,15 @@ export default {
return [0, 0] 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]
}
}
} }
} }
} }