Browse Source

增加收回按钮

002390 1 year ago
parent
commit
f6a3f7738f

+ 2 - 0
src/api/business/purchase/purchase-order.js

@@ -180,6 +180,8 @@ const downloadFailData = (data) =>{
   });
 }
 
+
+
 export default {
   list,
   details,

+ 10 - 0
src/components/Retrieve/api/index.js

@@ -0,0 +1,10 @@
+import request from "@/utils/request";
+
+// 模OA流程收回
+export const rollback = (data) =>{
+  return request({
+    url: "/oaflow/rollback",
+    method: "POST",
+    data: data,
+  });
+}

+ 93 - 0
src/components/Retrieve/index.vue

@@ -0,0 +1,93 @@
+<template>
+  <el-button 
+    v-if="isShow"
+    :type="type" 
+    :size="size"
+    @click.native="retrieve"
+  >
+    {{ title }}
+  </el-button>
+</template>
+
+<script>
+// import {rollback} from "@/api/business/purchase/purchase-order.js"
+import {rollback} from "./api/index";
+export default {
+  name:'Retrieve',
+  props:{
+    data:{
+      type:[Object],
+      require:true,
+    },
+    type:{
+      type:String,
+      default:'text',
+    },
+    size:{
+      type:String,
+      default:'mini',
+    },
+
+  },
+  computed:{
+    isShow:{
+      get(){
+        if(this.data.status === '1'){
+
+          return true;
+        }
+        return false;
+      },
+      set(){
+
+      }
+    }
+  },
+  data(){
+    return {
+      title:'收 回',
+    }
+  },
+  methods:{
+    retrieve(){
+
+      // if(this.data.status === '1'){
+
+        this.$confirm('是否继续此操作?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(async() => {
+  
+            try {
+              this.$modal.loading("请稍候...");
+              console.log(this.data,'this.data');
+              let {code,msg} = await rollback({...this.data});
+              if(code == 200){
+                this.$emit('success');
+              }
+              
+            } catch (error) {
+              
+            }finally{
+              this.$modal.closeLoading();
+            }
+  
+          }).catch(() => {        
+          });
+      
+      // }else{
+      //   this.$notify.warning({
+      //     title: '警告',
+      //     message: '!',
+      //   });
+      // }
+
+    },
+
+  },
+  created(){},
+  mounted(){},
+
+}
+</script>

+ 22 - 8
src/views/purchase/purchase-order/index.vue

@@ -29,6 +29,7 @@ export default {
     PurchaseReturnDrawer: () => import('./purchaseReturn/index.vue'),
     ElSuperTable: () => import("@/components/super-table/index.vue"),
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
+    Retrieve: () => import("@/components/Retrieve/index.vue"),
     },
   data() {
     const initTabColumns = () => TabColumns;
@@ -318,7 +319,7 @@ export default {
     // 批量提交
     handleBatchSubmit(){
 
-      let inconformity = this.checkedList.filter(row => !((row.status == '0' || row.status == '3') && row.isEnd === 'N'));
+      let inconformity = this.checkedList.filter(row => !((row.status == '0' || row.status == '3' || row.status == '9') && row.isEnd === 'N'));
 
       if(!inconformity.length && this.checkedList.length){
 
@@ -601,27 +602,38 @@ export default {
       }
     },
     judgeIsOption(type,source){
-      // status: 0=自由态,1=审批中,2=已审核,3=已驳回 4=提交中
+      // status: 0=自由态,1=审批中,2=已审核,3=已驳回 4=提交中 9=已回退
       // source: 1=自动协议直采,2=协议直采,3=手工
       // isEnd:整单关闭标识
       switch(type){
         case 'edit':
-          return (source.status == '0' || source.status == '3') && source.isEnd === 'N';
+          return (source.status == '0' || source.status == '3' || source.status == '9') && source.isEnd === 'N';
         case 'revise':
             return source.status == '2' && source.isEnd === 'N';
         case 'del':
-          return (source.status == '0' || source.status == '3') && source.source == '3' && source.isEnd === 'N';
+          return (source.status == '0' || source.status == '3' || source.status == '9') && source.source == '3' && source.isEnd === 'N';
         case 'submit':
-          return (source.status == '0' || source.status == '3') && source.isEnd === 'N';
+          return (source.status == '0' || source.status == '3' || source.status == '9') && source.isEnd === 'N';
         case 'allClose':
           return source.status == 0 && source.isEnd === 'N';
         case 'return':
           return source.source != 3 && source.isEnd === 'N' &&
-                (source.status == 0 || source.status == 3);
+                (source.status == 0 || source.status == 3 || source.status == '9');
         default:
          return false;
       }
-    }
+    },
+    handelRetrieve(row){
+
+      let { status, flowId, code,createBy } = row;
+      return {
+        status,
+        fdId:flowId,
+        fdTemplateId:'1880447a834addc648b3763477a9b09f',
+        billCode:code,
+        billMaker:createBy,
+      }
+    },
   }
 };
 </script>
@@ -674,6 +686,7 @@ export default {
             size="mini" 
             @click="handleDownload" 
           >批量导出</el-button>
+          
         </el-button-group>
         
 
@@ -735,11 +748,12 @@ export default {
                 @click.stop="handleSubmit(scope.row)"
               >提交</el-button>
               <el-button 
-                v-if="scope.row.flowId && scope.row.flowId !== ''" 
+                v-if="scope.row.flowId && scope.row.flowId !== '' && scope.row.status !== '9'" 
                 type="text" 
                 size="mini"
                 @click.stop="jumpFlow(scope.row)"
               >流程跳转</el-button>
+              <!-- <Retrieve :data="handelRetrieve(scope.row)" @success="handleQueryList"></Retrieve> -->
             </template>
         </el-table-column>