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