|
|
@@ -0,0 +1,118 @@
|
|
|
+<template>
|
|
|
+ <div class="pa-3 white">
|
|
|
+ <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
|
|
|
+ <m-table
|
|
|
+ v-loading="loading"
|
|
|
+ :items="items"
|
|
|
+ :headers="headers"
|
|
|
+ :page-size="pageInfo.size"
|
|
|
+ :page-current="pageInfo.current"
|
|
|
+ :total="total"
|
|
|
+ @page-change="onPageChange"
|
|
|
+ >
|
|
|
+ <template #status="{ row }">
|
|
|
+ <el-tag size="small" :type="statusList[row.status].color">{{ statusList[row.status].text }}</el-tag>
|
|
|
+ </template>
|
|
|
+ <template #actions="{ row }">
|
|
|
+ <m-button type="primary" text @click="onDetails(row)">审批进度</m-button>
|
|
|
+ <!-- <m-button type="danger" text @click="onDelete(row)">删除</m-button> -->
|
|
|
+ </template>
|
|
|
+ </m-table>
|
|
|
+ <ApprovalProgress ref="approvalProgressRefs"></ApprovalProgress>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {
|
|
|
+ getApprovalList,
|
|
|
+ getApprovalProgress
|
|
|
+} from '@/api/approval'
|
|
|
+import ApprovalProgress from './approvalProgress.vue'
|
|
|
+export default {
|
|
|
+ name: 'ApprovalPage',
|
|
|
+ components: {
|
|
|
+ ApprovalProgress
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ statusList: [
|
|
|
+ { text: '开始 ', color: 'default' },
|
|
|
+ { text: '审批通过 ', color: 'success' },
|
|
|
+ { text: '审批拒绝 ', color: 'danger' },
|
|
|
+ { text: '异常结束 ', color: 'warning' }
|
|
|
+ ],
|
|
|
+ searchItems: [
|
|
|
+ {
|
|
|
+ label: '名称',
|
|
|
+ prop: 'name',
|
|
|
+ type: 'input',
|
|
|
+ options: {
|
|
|
+ placeholder: '请输入名称'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ searchValues: {
|
|
|
+ name: null
|
|
|
+ },
|
|
|
+ headers: [
|
|
|
+ { label: '名称', prop: 'title' },
|
|
|
+ { label: '发起人', prop: 'createUserName' },
|
|
|
+ { label: '状态', prop: 'status', align: 'center' },
|
|
|
+ { label: '版本号', prop: 'version' },
|
|
|
+ { label: '操作', prop: 'actions', fixed: 'right', width: 300 }
|
|
|
+ ],
|
|
|
+ items: [],
|
|
|
+ total: 0,
|
|
|
+ pageInfo: {
|
|
|
+ current: 1,
|
|
|
+ size: 10
|
|
|
+ },
|
|
|
+ loading: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.onInit()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async onInit () {
|
|
|
+ this.loading = true
|
|
|
+ try {
|
|
|
+ const { data } = await getApprovalList({
|
|
|
+ page: {
|
|
|
+ ...this.pageInfo
|
|
|
+ },
|
|
|
+ entity: {
|
|
|
+ ...this.searchValues
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.items = data.records || []
|
|
|
+ this.total = data.total || 0
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ } finally {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async onDetails ({ workFlowInstanceId }) {
|
|
|
+ try {
|
|
|
+ const { data } = await getApprovalProgress({ workFlowInstanceId })
|
|
|
+ this.$refs.approvalProgressRefs.open(data)
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onSearch () {
|
|
|
+ this.pageInfo.current = 1
|
|
|
+ this.onInit()
|
|
|
+ },
|
|
|
+ onPageChange (index) {
|
|
|
+ this.pageInfo.current = index
|
|
|
+ this.onInit()
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ /* 自定义样式 */
|
|
|
+</style>
|