|
@@ -2,20 +2,29 @@
|
|
|
<div v-loading="loading">
|
|
|
<IndexPage ref="indexPageRefs" :dataType="dataType">
|
|
|
<template #actions="{ row }">
|
|
|
- <m-button type="danger" text @click="onDetails(row)">审批</m-button>
|
|
|
- <!-- <m-button type="primary" text @click="onApproval(row.workFlowInstanceId)">通过审核</m-button>
|
|
|
- <m-button type="danger" text @click="onApprovalReject(row)">拒绝通过</m-button> -->
|
|
|
+ <m-button type="danger" text @click="onDetails(row)">审核</m-button>
|
|
|
</template>
|
|
|
</IndexPage>
|
|
|
- <ApprovalReject ref="approvalRejectRefs" @refresh="onRefresh"></ApprovalReject>
|
|
|
- <ApprovalDetails
|
|
|
- ref="approvalDetailsRefs"
|
|
|
- :option="{ textSure: '通过', colorSure: 'success'}"
|
|
|
- @sure="onApproval(itemData.workFlowInstanceId)"
|
|
|
- @close="onClose"
|
|
|
- >
|
|
|
- <template #button-after="{ item }">
|
|
|
- <m-button type="danger" @click="onApprovalReject(item)">拒绝</m-button>
|
|
|
+ <ApprovalDetails ref="approvalDetailsRefs" @close="onClose">
|
|
|
+ <template #approval-btn>
|
|
|
+ <div>
|
|
|
+ <m-button type="success" size="small" icon="el-icon-check" class="mr-3" @click="onApproval">通过</m-button>
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ v-model="visible"
|
|
|
+ width="300"
|
|
|
+ trigger="click"
|
|
|
+ >
|
|
|
+ <el-input v-model="msg" type="textarea" :rows="3" placeholder="请输入拒绝原因"></el-input>
|
|
|
+ <div class="pt-3 text-right">
|
|
|
+ <m-button size="mini" @click="visible = false">取消</m-button>
|
|
|
+ <m-button size="mini" type="orange" @click="onApprovalReject">提交</m-button>
|
|
|
+ </div>
|
|
|
+ <template #reference>
|
|
|
+ <m-button type="danger" size="small" icon="el-icon-close">拒绝</m-button>
|
|
|
+ </template>
|
|
|
+ </el-popover>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</ApprovalDetails>
|
|
|
</div>
|
|
@@ -24,7 +33,6 @@
|
|
|
<script>
|
|
|
import IndexPage from '../components/IndexPage.vue'
|
|
|
import ApprovalDetails from '../components/ApprovalDetails.vue'
|
|
|
-import ApprovalReject from './approvalReject.vue'
|
|
|
|
|
|
import {
|
|
|
setApproval,
|
|
@@ -34,11 +42,12 @@ export default {
|
|
|
name: 'ApprovalPage',
|
|
|
components: {
|
|
|
IndexPage,
|
|
|
- ApprovalReject,
|
|
|
ApprovalDetails
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ msg: null,
|
|
|
+ visible: false,
|
|
|
loading: false,
|
|
|
dataType: 3,
|
|
|
itemData: {}
|
|
@@ -66,7 +75,7 @@ export default {
|
|
|
if (!data.records.length) {
|
|
|
return
|
|
|
}
|
|
|
- // 唤起审批详情
|
|
|
+ // 唤起审核详情
|
|
|
this.onDetails(data.records[0])
|
|
|
} catch (error) {
|
|
|
this.$message.error(error)
|
|
@@ -80,24 +89,39 @@ export default {
|
|
|
},
|
|
|
onDetails (item) {
|
|
|
this.itemData = item
|
|
|
+ this.msg = null
|
|
|
this.$refs.approvalDetailsRefs.open(item)
|
|
|
},
|
|
|
- onApproval (workFlowInstanceId, status) {
|
|
|
- this.$confirm('确定审批通过吗?', '提示').then(async _ => {
|
|
|
+ onApproval () {
|
|
|
+ this.$confirm('确定审核通过吗?', '提示').then(async _ => {
|
|
|
try {
|
|
|
await setApproval({
|
|
|
- workFlowInstanceId: workFlowInstanceId,
|
|
|
+ workFlowInstanceId: this.itemData.workFlowInstanceId,
|
|
|
status: 1
|
|
|
})
|
|
|
- this.$message.success('审批通过')
|
|
|
+ this.$message.success('审核通过')
|
|
|
this.$refs.indexPageRefs.onInit()
|
|
|
} catch (error) {
|
|
|
this.$message.error(error)
|
|
|
}
|
|
|
}).catch(_ => {})
|
|
|
},
|
|
|
- onApprovalReject (item) {
|
|
|
- this.$refs.approvalRejectRefs.open(item)
|
|
|
+ async onApprovalReject () {
|
|
|
+ if (!this.msg) {
|
|
|
+ this.$message.error('请输入拒绝原因')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ await setApproval({
|
|
|
+ workFlowInstanceId: this.itemData.workFlowInstanceId,
|
|
|
+ status: 2,
|
|
|
+ msg: this.msg
|
|
|
+ })
|
|
|
+ this.$message.success('拒绝成功')
|
|
|
+ this.onRefresh()
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|