|
@@ -2,16 +2,23 @@
|
|
|
<div>
|
|
|
<IndexPage ref="indexPageRefs" :dataType="3">
|
|
|
<template #actions="{ row }">
|
|
|
+ <m-button type="primary" 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>
|
|
|
</template>
|
|
|
</IndexPage>
|
|
|
<ApprovalReject ref="approvalRejectRefs" @refresh="onRefresh"></ApprovalReject>
|
|
|
+ <ApprovalDetails ref="approvalDetailsRefs" :option="{ textSure: '通过', colorSure: 'success'}" @sure="onApproval(itemData.workFlowInstanceId)">
|
|
|
+ <template #button-after="{ item }">
|
|
|
+ <m-button type="danger" @click="onApprovalReject(item)">拒绝</m-button>
|
|
|
+ </template>
|
|
|
+ </ApprovalDetails>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import IndexPage from '../components/IndexPage.vue'
|
|
|
+import ApprovalDetails from '../components/ApprovalDetails.vue'
|
|
|
import ApprovalReject from './approvalReject.vue'
|
|
|
|
|
|
import {
|
|
@@ -21,23 +28,36 @@ export default {
|
|
|
name: 'ApprovalPage',
|
|
|
components: {
|
|
|
IndexPage,
|
|
|
- ApprovalReject
|
|
|
+ ApprovalReject,
|
|
|
+ ApprovalDetails
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ itemData: {}
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
onRefresh () {
|
|
|
+ this.$refs.approvalDetailsRefs.close()
|
|
|
this.$refs.indexPageRefs.onInit()
|
|
|
},
|
|
|
- async onApproval (workFlowInstanceId, status) {
|
|
|
- try {
|
|
|
- await setApproval({
|
|
|
- workFlowInstanceId: workFlowInstanceId,
|
|
|
- status: 1
|
|
|
- })
|
|
|
- this.$message.success('审批通过')
|
|
|
- this.$refs.indexPageRefs.onInit()
|
|
|
- } catch (error) {
|
|
|
- this.$message.error(error)
|
|
|
- }
|
|
|
+ onDetails (item) {
|
|
|
+ this.itemData = item
|
|
|
+ this.$refs.approvalDetailsRefs.open(item)
|
|
|
+ },
|
|
|
+ onApproval (workFlowInstanceId, status) {
|
|
|
+ this.$confirm('确定审批通过吗?', '提示').then(async _ => {
|
|
|
+ try {
|
|
|
+ await setApproval({
|
|
|
+ workFlowInstanceId: workFlowInstanceId,
|
|
|
+ status: 1
|
|
|
+ })
|
|
|
+ this.$message.success('审批通过')
|
|
|
+ this.$refs.indexPageRefs.onInit()
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ }
|
|
|
+ }).catch(_ => {})
|
|
|
},
|
|
|
onApprovalReject (item) {
|
|
|
this.$refs.approvalRejectRefs.open(item)
|