zhengnaiwen_citu 5 månader sedan
förälder
incheckning
75aac1f20a

+ 4 - 19
src/views/workOrder/approval/index.vue

@@ -1,54 +1,39 @@
 <template>
   <div>
-    <IndexPage ref="indexPageRefs">
+    <IndexPage ref="indexPageRefs" :dataType="3">
       <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>
+        <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>
     </IndexPage>
-    <ApprovalProgress ref="approvalProgressRefs"></ApprovalProgress>
     <ApprovalReject ref="approvalRejectRefs" @refresh="onRefresh"></ApprovalReject>
   </div>
 </template>
 
 <script>
 import IndexPage from '../components/IndexPage.vue'
-import ApprovalProgress from './approvalProgress.vue'
 import ApprovalReject from './approvalReject.vue'
 
 import {
-  getApprovalProgress,
   setApproval
 } from '@/api/approval'
 export default {
   name: 'ApprovalPage',
   components: {
     IndexPage,
-    ApprovalProgress,
     ApprovalReject
   },
   methods: {
     onRefresh () {
       this.$refs.indexPageRefs.onInit()
     },
-    async onDetails ({ workFlowInstanceId }) {
-      try {
-        const { data } = await getApprovalProgress({ workFlowInstanceId })
-        this.$refs.approvalProgressRefs.open(data)
-      } catch (error) {
-        this.$message.error(error)
-      }
-    },
     async onApproval (workFlowInstanceId, status) {
       try {
         await setApproval({
           workFlowInstanceId: workFlowInstanceId,
           status: 1
         })
-        this.$message.success(status ? '审批通过' : '拒绝成功')
+        this.$message.success('审批通过')
       } catch (error) {
         this.$message.error(error)
       }

+ 17 - 0
src/views/workOrder/approvalAlready/index.vue

@@ -0,0 +1,17 @@
+<template>
+  <IndexPage ref="indexPageRefs" :dataType="2"></IndexPage>
+</template>
+
+<script>
+import IndexPage from '../components/IndexPage.vue'
+export default {
+  name: 'approvalAlready',
+  components: {
+    IndexPage
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 33 - 11
src/views/workOrder/components/IndexPage.vue

@@ -10,33 +10,46 @@
       :total="total"
       @page-change="onPageChange"
     >
-      <template #opType="{ row }">
+      <!-- <template #opType="{ row }">
         <el-tag size="small" :type="statusList[row.opType].color">{{ statusList[row.opType].text }}</el-tag>
-      </template>
+      </template> -->
       <template #actions="{ row }">
+        <m-button type="primary" text @click="onDetails(row)">审批进度</m-button>
         <slot name="actions" :row="row"></slot>
       </template>
     </m-table>
+    <ApprovalProgress ref="approvalProgressRefs"></ApprovalProgress>
   </div>
 </template>
 
 <script>
 import {
-  getApprovalList
+  getApprovalList,
+  getApprovalProgress
 } from '@/api/approval'
+import ApprovalProgress from './approvalProgress.vue'
 export default {
   name: 'IndexPage',
+  components: {
+    ApprovalProgress
+  },
+  props: {
+    dataType: {
+      type: Number,
+      default: 0
+    }
+  },
   data () {
     return {
-      statusList: [
-        { text: '我发起的 ', color: 'default' },
-        { text: '待我审批 ', color: 'warning' },
-        { text: '我已审批 ', color: 'success' }
-      ],
+      // statusList: [
+      //   { text: '我发起的 ', color: 'default' },
+      //   { text: '待我审批 ', color: 'warning' },
+      //   { text: '我已审批 ', color: 'success' }
+      // ],
       searchItems: [
         {
           label: '名称',
-          prop: 'name',
+          prop: 'title',
           type: 'input',
           options: {
             placeholder: '请输入名称'
@@ -44,12 +57,12 @@ export default {
         }
       ],
       searchValues: {
-        name: null
+        title: null
       },
       headers: [
         { label: '名称', prop: 'title' },
         { label: '发起人', prop: 'createUserName' },
-        { label: '状态', prop: 'opType', align: 'center' },
+        // { label: '状态', prop: 'opType', align: 'center' },
         { label: '发起时间', prop: 'createDate' },
         { label: '版本号', prop: 'version' },
         { label: '操作', prop: 'actions', fixed: 'right', width: 300 }
@@ -71,6 +84,7 @@ export default {
       this.loading = true
       try {
         const { data } = await getApprovalList({
+          dataType: this.dataType,
           page: {
             ...this.pageInfo,
             orders: [
@@ -89,6 +103,14 @@ 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)
+      }
+    },
     onSearch () {
       this.pageInfo.current = 1
       this.onInit()

+ 0 - 0
src/views/workOrder/approval/approvalProgress.vue → src/views/workOrder/components/approvalProgress.vue


+ 6 - 4
src/views/workOrder/myOrder/index.vue

@@ -1,12 +1,14 @@
 <template>
-  <div>
-
-  </div>
+  <IndexPage ref="indexPageRefs" :dataType="1"></IndexPage>
 </template>
 
 <script>
+import IndexPage from '../components/IndexPage.vue'
 export default {
-  name: 'myOrder'
+  name: 'myOrder',
+  components: {
+    IndexPage
+  }
 }
 </script>