|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
- <div>
|
|
|
|
- <IndexPage ref="indexPageRefs" :dataType="3">
|
|
|
|
|
|
+ <div v-loading="loading">
|
|
|
|
+ <IndexPage ref="indexPageRefs" :dataType="dataType">
|
|
<template #actions="{ row }">
|
|
<template #actions="{ row }">
|
|
<m-button type="danger" text @click="onDetails(row)">审批</m-button>
|
|
<m-button type="danger" text @click="onDetails(row)">审批</m-button>
|
|
<!-- <m-button type="primary" text @click="onApproval(row.workFlowInstanceId)">通过审核</m-button>
|
|
<!-- <m-button type="primary" text @click="onApproval(row.workFlowInstanceId)">通过审核</m-button>
|
|
@@ -8,7 +8,12 @@
|
|
</template>
|
|
</template>
|
|
</IndexPage>
|
|
</IndexPage>
|
|
<ApprovalReject ref="approvalRejectRefs" @refresh="onRefresh"></ApprovalReject>
|
|
<ApprovalReject ref="approvalRejectRefs" @refresh="onRefresh"></ApprovalReject>
|
|
- <ApprovalDetails ref="approvalDetailsRefs" :option="{ textSure: '通过', colorSure: 'success'}" @sure="onApproval(itemData.workFlowInstanceId)">
|
|
|
|
|
|
+ <ApprovalDetails
|
|
|
|
+ ref="approvalDetailsRefs"
|
|
|
|
+ :option="{ textSure: '通过', colorSure: 'success'}"
|
|
|
|
+ @sure="onApproval(itemData.workFlowInstanceId)"
|
|
|
|
+ @close="onClose"
|
|
|
|
+ >
|
|
<template #button-after="{ item }">
|
|
<template #button-after="{ item }">
|
|
<m-button type="danger" @click="onApprovalReject(item)">拒绝</m-button>
|
|
<m-button type="danger" @click="onApprovalReject(item)">拒绝</m-button>
|
|
</template>
|
|
</template>
|
|
@@ -22,7 +27,8 @@ import ApprovalDetails from '../components/ApprovalDetails.vue'
|
|
import ApprovalReject from './approvalReject.vue'
|
|
import ApprovalReject from './approvalReject.vue'
|
|
|
|
|
|
import {
|
|
import {
|
|
- setApproval
|
|
|
|
|
|
+ setApproval,
|
|
|
|
+ getApprovalList
|
|
} from '@/api/approval'
|
|
} from '@/api/approval'
|
|
export default {
|
|
export default {
|
|
name: 'ApprovalPage',
|
|
name: 'ApprovalPage',
|
|
@@ -33,10 +39,41 @@ export default {
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
|
|
+ loading: false,
|
|
|
|
+ dataType: 3,
|
|
itemData: {}
|
|
itemData: {}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ created () {
|
|
|
|
+ if (this.$route.query.id) {
|
|
|
|
+ // 获取数据明细
|
|
|
|
+ this.onGetDetails(this.$route.query.id)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ onClose () {
|
|
|
|
+ this.$router.push(this.$route.path)
|
|
|
|
+ },
|
|
|
|
+ async onGetDetails (workFlowInstanceId) {
|
|
|
|
+ this.loading = true
|
|
|
|
+ try {
|
|
|
|
+ const { data } = await getApprovalList({
|
|
|
|
+ dataType: this.dataType,
|
|
|
|
+ entity: {
|
|
|
|
+ workFlowInstanceId
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ if (!data.records.length) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 唤起审批详情
|
|
|
|
+ this.onDetails(data.records[0])
|
|
|
|
+ } catch (error) {
|
|
|
|
+ this.$message.error(error)
|
|
|
|
+ } finally {
|
|
|
|
+ this.loading = false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
onRefresh () {
|
|
onRefresh () {
|
|
this.$refs.approvalDetailsRefs.close()
|
|
this.$refs.approvalDetailsRefs.close()
|
|
this.$refs.indexPageRefs.onInit()
|
|
this.$refs.indexPageRefs.onInit()
|