提交修改
This commit is contained in:
parent
cf8d225ffd
commit
c9c8bc8fc0
87
src/views/modules/result/record/approval-add-or-update.vue
Normal file
87
src/views/modules/result/record/approval-add-or-update.vue
Normal file
@ -0,0 +1,87 @@
|
||||
<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" @click="commitRecord(2)">通过</el-button>
|
||||
<el-button type="primary" @click="commitRecord(3)">侍提交</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import E from 'wangeditor'
|
||||
import {commitApproval} from '@/api/api_result'
|
||||
var Base64 = require('js-base64').Base64
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
resultCommentEditor: null,
|
||||
recordResultId: 0,
|
||||
auth: null,
|
||||
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()
|
||||
}
|
||||
})
|
||||
},
|
||||
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
|
||||
}).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>
|
||||
@ -26,20 +26,21 @@
|
||||
|
||||
<div class="titleBottom">
|
||||
<div class="bottom" v-show="this.auth.commit == 1" >
|
||||
<p> <span style="cursor: pointer" @click="commitApproval">提交审批</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" @click="commitApproval('你确定要审批通过吗?')" >审批通过</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" @click="commitApproval('你要确认得分吗?')" >确认得分</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>
|
||||
@ -91,25 +92,24 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column width="80" label="操作" align="center" fixed="right">
|
||||
<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>
|
||||
<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, commitApproval} from '@/api/api_result'
|
||||
import AddOrUpdate from './recorddetail-add-or-update'
|
||||
import ApprovalAddOrUpdate from './approval-add-or-update.vue'
|
||||
|
||||
export default {
|
||||
created () {
|
||||
@ -137,6 +137,7 @@ export default {
|
||||
return {
|
||||
active: 3,
|
||||
type: 1,
|
||||
hasOperator: false,
|
||||
recordResultId: 0,
|
||||
tableData: [],
|
||||
firstRowspan: 5,
|
||||
@ -151,13 +152,15 @@ export default {
|
||||
department3: '技术部门',
|
||||
superStaff: '吴林',
|
||||
addOrUpdateVisible: false,
|
||||
approvalVisible: false,
|
||||
loading: false,
|
||||
auth: [],
|
||||
recordType: 0
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
AddOrUpdate,
|
||||
ApprovalAddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.recordResultId = this.$route.query.id
|
||||
@ -187,11 +190,15 @@ export default {
|
||||
this.auth = data.auth
|
||||
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
|
||||
})
|
||||
},
|
||||
// 新增 / 编辑
|
||||
@ -203,21 +210,23 @@ export default {
|
||||
}, 500)
|
||||
})
|
||||
},
|
||||
cellStyle ({row, column, rowIndex, columnIndex}) {
|
||||
if (rowIndex === this.firstRowspan || rowIndex === this.threeRowspan) {
|
||||
return 'background:#FFC400;font-weight:bolder!important;'
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
commitApprovalAddOrUpdate () {
|
||||
this.approvalVisible = true
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.$refs.approvalAddOrUpdate.init(this.recordResultId, this.auth)
|
||||
}, 500)
|
||||
})
|
||||
},
|
||||
commitApproval (msg = '确定要提交审批吗?') {
|
||||
commitApprovalYes (msg = '确定要提交审批吗?') {
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
commitApproval({
|
||||
'recordResultId': this.recordResultId
|
||||
'recordResultId': this.recordResultId,
|
||||
'status': 2
|
||||
}).then(data => {
|
||||
if (data && data.code === 0) {
|
||||
this.getDataList()
|
||||
@ -233,6 +242,13 @@ export default {
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
cellStyle ({row, column, rowIndex, columnIndex}) {
|
||||
if (rowIndex === this.firstRowspan || rowIndex === this.threeRowspan) {
|
||||
return 'background:#FFC400;font-weight:bolder!important;'
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
objectSpanMethod ({row, column, rowIndex, columnIndex}) {
|
||||
if (columnIndex === 0) {
|
||||
if (rowIndex === 0) {
|
||||
@ -381,7 +397,7 @@ export default {
|
||||
.bottom{
|
||||
float: right;
|
||||
color: blue;
|
||||
width: 100px;
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
text-align: left;
|
||||
.des{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user