|
@@ -43,7 +43,7 @@
|
|
|
<div class="approve-tool">
|
|
|
<div class="tool-btn">
|
|
|
<!-- 根据审批的状态决定显示 -->
|
|
|
- <el-button type="danger" v-if="formType==='approve'&&approveInfo.isCurrentApprover" @click="handleRejectApprove">驳回</el-button>
|
|
|
+ <el-button type="danger" v-if="formType==='approve'&&approveInfo.isCurrentApprover" @click="changeApprove('reject')">驳回</el-button>
|
|
|
<el-button type="primary" v-if="formType==='approve'&&approveInfo.isCurrentApprover" @click="changeApprove('pass')">通过</el-button>
|
|
|
<el-button type="primary" v-if="formType==='myself'&&approveInfo.state!==4" @click="changeApprove('return')">撤销</el-button>
|
|
|
<el-button type="primary" plain @click="$router.replace('/approveList')">返回</el-button>
|
|
@@ -201,9 +201,12 @@ export default {
|
|
|
//检查最后一个节点是否有人审批
|
|
|
let hasApprove = true
|
|
|
Nodes[currentIndex].approveList.forEach(u=>{
|
|
|
- if(!u.approveStatus){
|
|
|
+ if(!u.approveStatus||u.approveStatus==='待审批'){
|
|
|
hasApprove = false
|
|
|
}
|
|
|
+ if(u.approveStatus==='已驳回'){
|
|
|
+ Nodes[currentIndex].nodeStatus = 'reject'
|
|
|
+ }
|
|
|
})
|
|
|
//若没有,则把这个节点删除
|
|
|
!hasApprove&&(Nodes.pop())
|
|
@@ -219,14 +222,27 @@ export default {
|
|
|
}
|
|
|
this.TimeLineData = [startNode,...Nodes]
|
|
|
},
|
|
|
- changeApprove(type){
|
|
|
+ async changeApprove(type){
|
|
|
const {approveId} = this.$route.query
|
|
|
if(!approveId) return
|
|
|
- },
|
|
|
- handleRejectApprove(){
|
|
|
- console.log('a?')
|
|
|
- //打开驳回理由弹窗
|
|
|
- this.isDetailDialogShow = true
|
|
|
+ if(type==='reject'){
|
|
|
+ this.isDetailDialogShow = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let res = null
|
|
|
+ if(type==='return'){
|
|
|
+ res = await approveInterence.cancelApprove({
|
|
|
+ ReportApproveId:Number(approveId)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(type==='pass'){
|
|
|
+ res = await approveInterence.passApprove({
|
|
|
+ ReportApproveId:Number(approveId)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ this.$message.success(`${type==='return'?'撤销':'通过'}成功`)
|
|
|
+ type!=='reject'&&(this.$router.replace("/approveList"))
|
|
|
},
|
|
|
rejectApprove(reason){
|
|
|
this.isDetailDialogShow = false
|