zhengnaiwen_citu il y a 7 mois
Parent
commit
4742d4fa66

+ 16 - 0
src/api/approval.js

@@ -0,0 +1,16 @@
+import http from '@/utils/request'
+
+// 待办事项 、 发起审核
+export function getApprovalList (data) {
+  return http.post('/work/flow/instance/page', data)
+}
+
+// 审批
+export function setApproval (data) {
+  return http.post('/work/flow/instance/approve', data)
+}
+
+// 进度明细
+export function getApprovalProgress (data) {
+  return http.post('/work/flow/instance/detail', data)
+}

+ 26 - 0
src/views/approval/approvalProgress.vue

@@ -0,0 +1,26 @@
+<template>
+  <m-dialog ref="dialog" title="审批明细">
+    <el-steps :active="2" align-center>
+      <el-step title="步骤1" description="这是一段很长很长很长的描述性文字"></el-step>
+      <el-step title="步骤2" description="这是一段很长很长很长的描述性文字"></el-step>
+      <el-step title="步骤3" description="这是一段很长很长很长的描述性文字"></el-step>
+      <el-step title="步骤4" description="这是一段很长很长很长的描述性文字"></el-step>
+    </el-steps>
+  </m-dialog>
+</template>
+
+<script>
+export default {
+  name: 'approvalProgress',
+  methods: {
+    open (item) {
+      console.log(item)
+      this.$refs.dialog.open()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 118 - 0
src/views/approval/index.vue

@@ -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>

+ 2 - 2
src/views/system/workflow/workflowApproved.vue

@@ -103,9 +103,9 @@ export default {
       this.key = item.workFlowTmplateItems.length + 1
       try {
         const { data: person } = await getOrganizationAtlasAll({ type: 0 })
-        this.options.push(person)
+        this.options.push([person])
         const { data: post } = await getOrganizationAtlasAll({ type: 1 })
-        this.options.push(post)
+        this.options.push([post])
       } catch (error) {
         this.$message.error(error)
       } finally {