|
@@ -14,32 +14,18 @@
|
|
|
<el-tag size="small" :type="statusList[row.opType].color">{{ statusList[row.opType].text }}</el-tag>
|
|
|
</template>
|
|
|
<template #actions="{ row }">
|
|
|
- <m-button type="primary" text @click="onDetails(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>
|
|
|
+ <slot name="actions" :row="row"></slot>
|
|
|
</template>
|
|
|
</m-table>
|
|
|
- <ApprovalProgress ref="approvalProgressRefs"></ApprovalProgress>
|
|
|
- <ApprovalReject ref="approvalRejectRefs" @refresh="onInit"></ApprovalReject>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- getApprovalList,
|
|
|
- getApprovalProgress,
|
|
|
- setApproval
|
|
|
+ getApprovalList
|
|
|
} from '@/api/approval'
|
|
|
-import ApprovalProgress from './approvalProgress.vue'
|
|
|
-import ApprovalReject from './approvalReject.vue'
|
|
|
export default {
|
|
|
- name: 'ApprovalPage',
|
|
|
- components: {
|
|
|
- ApprovalProgress,
|
|
|
- ApprovalReject
|
|
|
- },
|
|
|
+ name: 'IndexPage',
|
|
|
data () {
|
|
|
return {
|
|
|
statusList: [
|
|
@@ -103,28 +89,6 @@ export default {
|
|
|
this.loading = false
|
|
|
}
|
|
|
},
|
|
|
- async onDetails ({ workFlowInstanceId }) {
|
|
|
- try {
|
|
|
- const { data } = await getApprovalProgress({ workFlowInstanceId })
|
|
|
- this.$refs.approvalProgressRefs.open(data)
|
|
|
- } catch (error) {
|
|
|
- this.$message.error(error)
|
|
|
- }
|
|
|
- },
|
|
|
- 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()
|