Forráskód Böngészése

物料变更单流程收回

黄梓星 1 éve
szülő
commit
d817108064
1 módosított fájl, 33 hozzáadás és 1 törlés
  1. 33 1
      src/views/material/changeApply/index.vue

+ 33 - 1
src/views/material/changeApply/index.vue

@@ -59,6 +59,12 @@
           <el-table-column fixed="right" label="操作" width="150" align="center">
             <template slot-scope="scope">
               <el-button type="text" size="small" @click.stop="useSee(scope.row)">查看</el-button>
+              <el-button 
+                v-if="scope.row.status == '1'" 
+                type="text" 
+                size="mini"
+                @click.stop="handleBack(scope.row)"
+              >流程收回</el-button>
               <el-button  
                 v-if="scope.row.oaId && scope.row.oaId !=''" 
                 @click.stop="jumpFlow(scope.row)" 
@@ -79,10 +85,12 @@
 <script>
 import { dicts } from "./dicts";
 import { getChangeList , deleteChangeList,toOA} from '@/api/changeApply/basic';
+// 流程收回通用接口
+import {oaBack} from '@/api/requisition/basic';
 import useColumns from './columns';
 export default {
   name: 'changeApply',
-  dicts:dicts,
+  dicts:[...dicts, 'oa_templete_id'],
   components: {
     AddChangeOrders:() => import('./add/index.vue'),
     SeeChangeOrders:() => import('./see/index.vue'),
@@ -127,6 +135,30 @@ export default {
       }
     },
     
+    //流程收回
+    async handleBack(row){
+      console.log('row', row)
+      console.log('this.dicts.type', this.dict)
+      try {
+        const { msg, code } = await oaBack({
+          fdTemplateId: this.dict.type.oa_templete_id.find(item => {
+            return item.label == "物料变更单"
+          }).value,
+          fdId: row.oaId,
+          billCode: row.code,
+          billMaker: row.createBy
+        });
+        if (code === 200) {
+          this.$emit("success");
+          this.$notify.success(msg);
+        }
+      } catch (err) {
+        console.error(err);
+      } finally {
+        this.useQuery(this.params, this.page);
+      }
+    },
+
     useReset(){
       this.page.pageNum = 1;
       this.page.pageSize = 10;