提交我

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

View File

@ -174,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: [],

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>
@ -137,9 +143,8 @@
</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'
export default {
@ -154,10 +159,12 @@ export default {
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 ''
@ -201,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: {},
@ -229,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') {
@ -285,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
@ -301,8 +345,11 @@ 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, recordType) {
this.$router.push({name: 'recorddetail', query: {id: id, recordType: recordType}}, () => {
this.mainTabsActiveName = this.$route.name
@ -351,5 +398,6 @@ export default {
.btn-box{
margin-bottom: 10px;
}
</style>

View File

@ -51,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>
@ -140,11 +140,10 @@ export default {
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: '业务中台',
@ -176,11 +175,10 @@ export default {
}).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
@ -243,7 +241,7 @@ export default {
})
},
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 ''
@ -253,17 +251,19 @@ export default {
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 {
@ -272,7 +272,7 @@ export default {
}
}
}
if (rowIndex === this.firstRowspan) {
if (rowIndex === this.yeJiCheckNum) {
if (columnIndex === 0) {
return [1, 2]
} 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) {
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) {
@ -305,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]
}
}
}
}
}