|
@@ -15,23 +15,30 @@
|
|
|
</template>
|
|
|
<template #actions="{ row }">
|
|
|
<m-button type="primary" text @click="onDetails(row)">审批进度</m-button>
|
|
|
- <m-button v-if="row.opType === 1" type="primary" text @click="onApproval(row)">审批</m-button>
|
|
|
+ <template v-if="row.opType === 1">
|
|
|
+ <m-button type="primary" class="mr-2" text @click="onApproval(row.workFlowInstanceId)">通过审核</m-button>
|
|
|
+ <m-button type="danger" text @click="onApprovalReject(row)">拒绝通过</m-button>
|
|
|
+ </template>
|
|
|
</template>
|
|
|
</m-table>
|
|
|
<ApprovalProgress ref="approvalProgressRefs"></ApprovalProgress>
|
|
|
+ <ApprovalReject ref="approvalRejectRefs" @refresh="onInit"></ApprovalReject>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
getApprovalList,
|
|
|
- getApprovalProgress
|
|
|
+ getApprovalProgress,
|
|
|
+ setApproval
|
|
|
} from '@/api/approval'
|
|
|
import ApprovalProgress from './approvalProgress.vue'
|
|
|
+import ApprovalReject from './approvalReject.vue'
|
|
|
export default {
|
|
|
name: 'ApprovalPage',
|
|
|
components: {
|
|
|
- ApprovalProgress
|
|
|
+ ApprovalProgress,
|
|
|
+ ApprovalReject
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -88,7 +95,7 @@ export default {
|
|
|
...this.searchValues
|
|
|
}
|
|
|
})
|
|
|
- this.items = data.records || []
|
|
|
+ this.items = data.records
|
|
|
this.total = data.total || 0
|
|
|
} catch (error) {
|
|
|
this.$message.error(error)
|
|
@@ -104,7 +111,20 @@ export default {
|
|
|
this.$message.error(error)
|
|
|
}
|
|
|
},
|
|
|
- onApproval () {},
|
|
|
+ onApprovalReject (item) {
|
|
|
+ this.$refs.approvalRejectRefs.open(item)
|
|
|
+ },
|
|
|
+ async onApproval (workFlowInstanceId, status) {
|
|
|
+ try {
|
|
|
+ await setApproval({
|
|
|
+ workFlowInstanceId: workFlowInstanceId,
|
|
|
+ status: 1
|
|
|
+ })
|
|
|
+ this.$message.success(status ? '审批通过' : '拒绝成功')
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ }
|
|
|
+ },
|
|
|
onSearch () {
|
|
|
this.pageInfo.current = 1
|
|
|
this.onInit()
|