Преглед изворни кода

物料申请单批量提交

002390 пре 1 година
родитељ
комит
7da5f4bc84

+ 9 - 0
src/api/requisition/basic.js

@@ -35,6 +35,15 @@ export function editReq(data) {
   })
 }
 
+// 物料申请单-修改提交
+export function betchSubmit(data) {
+  return request({
+    url: `/system/apply/material/submit/${data}`,
+    method: 'post',
+    // data: data
+  })
+}
+
 // 物料申请单-删除
 export function delReq(id) {
   return request({

+ 2 - 2
src/views/material/requisition/add.vue

@@ -18,7 +18,7 @@
     </el-row>
     <el-tabs type="border-card" v-model="tabValue" @tab-click="handleClick">
       <el-tab-pane label="基本信息" name="first">
-        <div style="width: 100%;height: 680px;overflow-y: auto; overflow-x: hidden;">
+        <div style="width: 100%;height: 580px;overflow-y: auto; overflow-x: hidden;">
           <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="170px">
             <el-row :gutter="20">
               <el-col :span="8">
@@ -1658,7 +1658,7 @@
 
 <style lang="scss" scoped>
   .requisition_add {
-    height: calc(100vh - 84px);
+    // height: calc(100vh - 84px);
     padding: 12px;
     box-sizing: border-box;
     overflow-y: auto;

+ 40 - 7
src/views/material/requisition/index.vue

@@ -4,7 +4,7 @@
      
       <el-card>
 
-        <el-super-search
+      <el-super-search
         v-model="params"
         :size="size"
         :dict="dict"
@@ -29,7 +29,7 @@
           <el-button :size="size" @click="handleImport">批量导入</el-button>
         </el-col>
         <el-col :span="1.5">
-          <!-- <el-button :size="size" @click="handleBatchSubmit">批量提交</el-button> -->
+          <el-button :size="size" @click="handleBatchSubmit">批量提交</el-button>
         </el-col>
         <!-- 导入弹窗 -->
         <el-dialog 
@@ -116,7 +116,7 @@
 
 <script>
   import addReq from './add.vue';
-  import {getReqList, delReq, importData, fileImport} from '@/api/requisition/basic';
+  import {getReqList, delReq, importData, fileImport,betchSubmit} from '@/api/requisition/basic';
   import {saveAs} from "file-saver";
   import { blobValidate } from "@/utils/ruoyi";
   import { SearchColumns, TableColumns } from './columns';
@@ -180,12 +180,45 @@
     },
     methods: {
       // 批量提交
-      handleBatchSubmit(){
-        let filterList = this.checkedList.filter(item => (item.status ==='0' ||item.status ==='3') )
+     async handleBatchSubmit(){
+        let filterList = this.checkedList.filter(item => !(item.status == '0' || item.status == '3') )
         
-        console.log(filterList,'filterList');
-        if(filterList.length){  
+        if(!filterList.length &&  this.checkedList.length){  
 
+          try {
+
+            this.failLoad = true;
+            
+            let ids = this.checkedList.map( item => Number(item.id));
+            
+            let {code,msg} = await betchSubmit(ids);
+
+            if(code == 200){
+              this.reset();
+            }
+
+            this.$notify({
+              title: code == 200 ? msg : 'error',
+              type: code == 200 ? 'success' :'error',
+              message: code == 200 ?'' :msg,
+            });
+
+            // if(code == 200){
+            //   this.$notify.success({
+            //     title: msg,
+            //   });
+            // }else{
+            //   this.$notify.error({
+            //     title: '错误',
+            //     message: msg,
+            //   });
+            // }
+
+          } catch (error) {
+            
+          }finally{
+            this.failLoad = false;
+          }
 
         }else{
           this.$notify.warning({