作者 xudada

批量删除,批量申请功能

@@ -12,4 +12,6 @@ export const selectCustomcode=params=>{return http.get(`${baseUrl}/selectCustomc @@ -12,4 +12,6 @@ export const selectCustomcode=params=>{return http.get(`${baseUrl}/selectCustomc
12 12
13 export const sendCreateMt1201=params=>{return http.post(`${baseUrl}/sendCreateMt1201`, params);}; 13 export const sendCreateMt1201=params=>{return http.post(`${baseUrl}/sendCreateMt1201`, params);};
14 export const sendEditeMt1201=params=>{return http.post(`${baseUrl}/sendEditeMt1201`, params);}; 14 export const sendEditeMt1201=params=>{return http.post(`${baseUrl}/sendEditeMt1201`, params);};
15 -export const sendRemoveMt1201=params=>{return http.post(`${baseUrl}/sendRemoveMt1201`, params);};  
  15 +export const sendRemoveMt1201=params=>{return http.post(`${baseUrl}/sendRemoveMt1201`, params);};
  16 +export const sendBatchDelMt1201=params=>{return http.post(`${baseUrl}/sendBatchDelMt1201`, params);};
  17 +export const sendBatchApllyMt1201=params=>{return http.post(`${baseUrl}/sendBatchApllyMt1201`, params);};
@@ -11,4 +11,8 @@ export const sendCreateMt520x=params=>{return http.post(`${baseUrl}/sendCreateMt @@ -11,4 +11,8 @@ export const sendCreateMt520x=params=>{return http.post(`${baseUrl}/sendCreateMt
11 export const sendRemoveMt520x=params=>{return http.post(`${baseUrl}/sendRemoveMt520x`, params);}; 11 export const sendRemoveMt520x=params=>{return http.post(`${baseUrl}/sendRemoveMt520x`, params);};
12 export const selectCustomcode=params=>{return http.get(`${baseUrl2}/selectCustomcode`, params);}; 12 export const selectCustomcode=params=>{return http.get(`${baseUrl2}/selectCustomcode`, params);};
13 13
  14 +export const sendbatchRemoveMt5201=params=>{return http.post(`${baseUrl}/sendbatchRemoveMt5201`, params);};
  15 +export const sendbatchCreateMt5201=params=>{return http.post(`${baseUrl}/sendbatchCreateMt5201`, params);};
  16 +
  17 +
14 18
@@ -135,7 +135,7 @@ @@ -135,7 +135,7 @@
135 this.tableData=response.list; 135 this.tableData=response.list;
136 this.tableloading=false; 136 this.tableloading=false;
137 this.total=response.total; 137 this.total=response.total;
138 - this.listLoading = false; 138 + this.listLoading = false;
139 }); 139 });
140 }, 140 },
141 /*原始舱单跳转*/ 141 /*原始舱单跳转*/
@@ -588,7 +588,12 @@ @@ -588,7 +588,12 @@
588 </el-col> 588 </el-col>
589 <el-col :span="2.5" class="pub"> 589 <el-col :span="2.5" class="pub">
590 <div class="grid-content"> 590 <div class="grid-content">
591 - <el-button type="primary" size="mini">批量发送删除报</el-button> 591 + <el-button type="primary" size="mini" :disabled="batich" @click="batchdel()">批量发送删除报</el-button>
  592 + </div>
  593 + </el-col>
  594 + <el-col :span="2.5" class="pub">
  595 + <div class="grid-content">
  596 + <el-button type="primary" size="mini" :disabled="batich" @click="batchaplly()">批量申请</el-button>
592 </div> 597 </div>
593 </el-col> 598 </el-col>
594 <el-col :span="2" class="pub"> 599 <el-col :span="2" class="pub">
@@ -717,7 +722,7 @@ @@ -717,7 +722,7 @@
717 </style> 722 </style>
718 723
719 <script> 724 <script>
720 - import { getMt1201List,addMt1201,ediMt1201,getFenList,getCountryCode,selectCustomcode,sendCreateMt1201,sendEditeMt1201,sendRemoveMt1201 } from '../../api/mt1201' 725 + import { getMt1201List,addMt1201,ediMt1201,getFenList,getCountryCode,selectCustomcode,sendCreateMt1201,sendEditeMt1201,sendRemoveMt1201,sendBatchDelMt1201,sendBatchApllyMt1201 } from '../../api/mt1201'
721 import{addResponse,selectResponseList} from "../../api/InResponse"; 726 import{addResponse,selectResponseList} from "../../api/InResponse";
722 import FileSaver from "file-saver"; 727 import FileSaver from "file-saver";
723 import XLSX from "xlsx"; 728 import XLSX from "xlsx";
@@ -890,7 +895,10 @@ @@ -890,7 +895,10 @@
890 dialogTableVisible:false, 895 dialogTableVisible:false,
891 gridData:[], 896 gridData:[],
892 tableloading:true, 897 tableloading:true,
893 - htmlTitle:'' 898 + htmlTitle:'',
  899 + batich:true,
  900 + batichboolean:false,
  901 + uuids:[],
894 } 902 }
895 }, 903 },
896 methods: { 904 methods: {
@@ -982,10 +990,44 @@ @@ -982,10 +990,44 @@
982 return false; 990 return false;
983 } 991 }
984 }, 992 },
985 - /*多选框功能*/ 993 + /*多选框功能批量选择*/
986 handleSelectionChange(val) { 994 handleSelectionChange(val) {
987 this.multipleSelection = val; 995 this.multipleSelection = val;
988 - console.log(val) 996 + if(this.multipleSelection!=null && this.multipleSelection!=""){
  997 + this.batich=false;
  998 + }else{
  999 + this.batich=true;
  1000 + }
  1001 +
  1002 + },
  1003 + //批量删除
  1004 + batchdel(){
  1005 + let ids=[];
  1006 + this.multipleSelection.forEach(function (item) {
  1007 + ids.push(item.uuid);
  1008 + })
  1009 + this.uuids=ids;
  1010 + this.udStatus='delete';
  1011 + this.dialogFormVisible=true;
  1012 + this.batichboolean=true;
  1013 + },
  1014 + //批量申请
  1015 + batchaplly(){
  1016 + let ids=[];
  1017 + this.multipleSelection.forEach(function (item) {
  1018 + ids.push(item.uuid);
  1019 + })
  1020 + sendBatchApllyMt1201(ids).then(res=>{
  1021 + let response=res.data;
  1022 + this.code=response.code;
  1023 + if(this.code=='200'){
  1024 + this.centerDialogVisible=true;
  1025 + this.msg=response.msg;
  1026 + }else{
  1027 + this.centerDialogVisible=true;
  1028 + this.msg=response.msg;
  1029 + }
  1030 + });
989 }, 1031 },
990 /*编辑主单信息*/ 1032 /*编辑主单信息*/
991 handleEdit(index, row){ 1033 handleEdit(index, row){
@@ -1055,40 +1097,56 @@ @@ -1055,40 +1097,56 @@
1055 row.flightno=row.flightno.substring(2); 1097 row.flightno=row.flightno.substring(2);
1056 } 1098 }
1057 this.temprows= row; 1099 this.temprows= row;
  1100 + this.batichboolean=false;
1058 }, 1101 },
1059 //提交发送舱单删除报表单 1102 //提交发送舱单删除报表单
1060 deleteUdForm(formName){ 1103 deleteUdForm(formName){
1061 this.$refs[formName].validate((valid) => { 1104 this.$refs[formName].validate((valid) => {
1062 if (valid) { 1105 if (valid) {
1063 - const map = {'flightNo':this.temprows.flightno,  
1064 - 'flightDate':this.temprows.flightdate,  
1065 - 'awba':this.temprows.awba,  
1066 - 'content':'',  
1067 - 'customCode':this.temprows.customcode,  
1068 - 'awbh':this.temprows.awbh,  
1069 - 'reason' :this.Udform.operreason,  
1070 - 'contactName':this.Udform.operperson,  
1071 - 'contactTel':this.Udform.opertel,  
1072 - 'carrier':this.Udform.carrier,  
1073 - 'username':loginUserInfo.username}  
1074 - sendRemoveMt1201(map).then(res=>{  
1075 - let response=res.data;  
1076 - //console.log(res);  
1077 - this.code=response.code;  
1078 - if(this.code=='200'){  
1079 - this.temprows.status='24';  
1080 - this.temprows.customText='舱单删除报发送成功';  
1081 - this.dialogFormVisible=false;  
1082 - this.outerVisible = false;  
1083 - this.centerDialogVisible=true;  
1084 - this.msg=response.msg;  
1085 - }else{  
1086 - this.dialogFormVisible=false;  
1087 - this.outerVisible = false;  
1088 - this.centerDialogVisible=true;  
1089 - this.msg=response.msg;  
1090 - }  
1091 - }); 1106 + if(this.batichboolean){
  1107 + let arr={ids:this.uuids,reason:this.Udform.operreason,contactName:loginUserInfo.username,contactTel:this.Udform.opertel,content:''}
  1108 + sendBatchDelMt1201(arr).then(res=>{
  1109 + let response=res.data;
  1110 + this.code=response.code;
  1111 + if(this.code=='200'){
  1112 + this.centerDialogVisible=true;
  1113 + this.msg=response.msg;
  1114 + }else{
  1115 + this.centerDialogVisible=true;
  1116 + this.msg=response.msg;
  1117 + }
  1118 + });
  1119 + }else{
  1120 + const map = {'flightNo':this.temprows.flightno,
  1121 + 'flightDate':this.temprows.flightdate,
  1122 + 'awba':this.temprows.awba,
  1123 + 'content':'',
  1124 + 'customCode':this.temprows.customcode,
  1125 + 'awbh':this.temprows.awbh,
  1126 + 'reason' :this.Udform.operreason,
  1127 + 'contactName':this.Udform.operperson,
  1128 + 'contactTel':this.Udform.opertel,
  1129 + 'carrier':this.Udform.carrier,
  1130 + 'username':loginUserInfo.username}
  1131 + sendRemoveMt1201(map).then(res=>{
  1132 + let response=res.data;
  1133 + //console.log(res);
  1134 + this.code=response.code;
  1135 + if(this.code=='200'){
  1136 + this.temprows.status='24';
  1137 + this.temprows.customText='舱单删除报发送成功';
  1138 + this.dialogFormVisible=false;
  1139 + this.outerVisible = false;
  1140 + this.centerDialogVisible=true;
  1141 + this.msg=response.msg;
  1142 + }else{
  1143 + this.dialogFormVisible=false;
  1144 + this.outerVisible = false;
  1145 + this.centerDialogVisible=true;
  1146 + this.msg=response.msg;
  1147 + }
  1148 + });
  1149 + }
1092 } else { 1150 } else {
1093 console.log('error submit!!'); 1151 console.log('error submit!!');
1094 return false; 1152 return false;
@@ -1320,6 +1378,7 @@ @@ -1320,6 +1378,7 @@
1320 this.$router.push({name:'分拨运抵',params:{carrier:row.carrier,flightno:row.flightno,awba:row.awba,flightdate:row.flightdate, 1378 this.$router.push({name:'分拨运抵',params:{carrier:row.carrier,flightno:row.flightno,awba:row.awba,flightdate:row.flightdate,
1321 turnpiece:row.awbinfo.pcs,turnweight:row.awbinfo.weight,customcode:row.customcode,goodsname:row.goodsname}}); 1379 turnpiece:row.awbinfo.pcs,turnweight:row.awbinfo.weight,customcode:row.customcode,goodsname:row.goodsname}});
1322 }, 1380 },
  1381 +
1323 //返回上一层 1382 //返回上一层
1324 back(){ 1383 back(){
1325 this.$router.go(-1); 1384 this.$router.go(-1);
@@ -1332,4 +1391,4 @@ @@ -1332,4 +1391,4 @@
1332 this.getList(); 1391 this.getList();
1333 } 1392 }
1334 } 1393 }
1335 -</script>  
  1394 +</script>
@@ -349,7 +349,8 @@ @@ -349,7 +349,8 @@
349 <!--底部按钮及理货信息--> 349 <!--底部按钮及理货信息-->
350 <el-row> 350 <el-row>
351 <el-col :span="2.5"><div class="grid-content"><el-button type="primary" v-on:click="addTally" size="mini">新增进港理货</el-button></div></el-col> 351 <el-col :span="2.5"><div class="grid-content"><el-button type="primary" v-on:click="addTally" size="mini">新增进港理货</el-button></div></el-col>
352 - <el-col :span="2.5"><div class="grid-content"><el-button type="primary" size="mini">批量发送删除报</el-button></div></el-col> 352 + <el-col :span="2.5"><div class="grid-content"><el-button type="primary" size="mini" :disabled="batich" @click="batchdel()">批量发送删除报</el-button></div></el-col>
  353 + <el-col :span="2.5"><div class="grid-content"><el-button type="primary" size="mini" :disabled="batich" @click="batchaplly()">批量申请</el-button></div></el-col>
353 <el-col :span="2"><div class="grid-content"><el-button type="primary" @click="back" size="mini">返回</el-button></div></el-col> 354 <el-col :span="2"><div class="grid-content"><el-button type="primary" @click="back" size="mini">返回</el-button></div></el-col>
354 <el-col :span="2.5"><div class="grid-content"><span>主单数:{{sumNmmsCount}}</span></div></el-col> 355 <el-col :span="2.5"><div class="grid-content"><span>主单数:{{sumNmmsCount}}</span></div></el-col>
355 <el-col :span="3.5"><div class="grid-content"><span>理货总件数:{{sumNmmsPrice}}</span></div></el-col> 356 <el-col :span="3.5"><div class="grid-content"><span>理货总件数:{{sumNmmsPrice}}</span></div></el-col>
@@ -440,8 +441,9 @@ @@ -440,8 +441,9 @@
440 441
441 <script> 442 <script>
442 import{addResponse,selectResponseList} from "../../api/InResponse"; 443 import{addResponse,selectResponseList} from "../../api/InResponse";
443 - import { getMt5201List,addMt5201,ediMt5201,delMt5201,sendCreateMt520x,sendRemoveMt520x,selectCustomcode} from '../../api/mt5201' 444 + import { getMt5201List,addMt5201,ediMt5201,delMt5201,sendCreateMt520x,sendRemoveMt520x,selectCustomcode,sendbatchRemoveMt5201,sendbatchCreateMt5201} from '../../api/mt5201'
444 import loginUserInfo from '@/api/base' 445 import loginUserInfo from '@/api/base'
  446 + import {sendBatchApllyMt1201, sendBatchDelMt1201} from "../../api/mt1201";
445 export default { 447 export default {
446 data() { 448 data() {
447 return { 449 return {
@@ -536,7 +538,10 @@ @@ -536,7 +538,10 @@
536 loading:false, 538 loading:false,
537 dialogTableVisible:false, 539 dialogTableVisible:false,
538 gridData:[], 540 gridData:[],
539 - tableLoading:false 541 + tableLoading:false,
  542 + batich:true,
  543 + batichboolean:false,
  544 + uuids:[],
540 } 545 }
541 }, 546 },
542 methods: { 547 methods: {
@@ -657,41 +662,58 @@ @@ -657,41 +662,58 @@
657 row.awbh=""; 662 row.awbh="";
658 } 663 }
659 this.rows=row; 664 this.rows=row;
  665 + this.batichboolean=false;
660 }, 666 },
661 //发送理化删除报提交表单 667 //发送理化删除报提交表单
662 deleteUdForm(formName){ 668 deleteUdForm(formName){
663 this.$refs[formName].validate((valid) => { 669 this.$refs[formName].validate((valid) => {
664 if (valid) { 670 if (valid) {
665 - const map = {'flightNo':this.rows.flightno,  
666 - 'flightDate':this.rows.flightdate,  
667 - 'awba':this.rows.awba,  
668 - 'content':'',  
669 - 'customCode':this.rows.customcode,  
670 - 'awbh':this.rows.awbh,  
671 - 'reason' :this.Udform.operreason,  
672 - 'contactName':this.Udform.operperson,  
673 - 'contactTel':this.Udform.opertel,  
674 - 'rcfdep':this.rows.rcfdep,  
675 - 'carrier':this.rows.carrier,  
676 - 'username':loginUserInfo.username}  
677 - sendRemoveMt520x(map).then(res=>{  
678 - let response=res.data;  
679 - //console.log(res);  
680 - this.code=response.code;  
681 - if(this.code=='200'){  
682 - this.rows.status='24';  
683 - this.rows.ext5='理货删除报发送成功';  
684 - this.dialogFormVisible=false;  
685 - this.outerVisible = false;  
686 - this.centerDialogVisible=true;  
687 - this.msg=response.msg;  
688 - }else{  
689 - this.dialogFormVisible=false;  
690 - this.outerVisible = false;  
691 - this.centerDialogVisible=true;  
692 - this.msg=response.msg;  
693 - }  
694 - }); 671 + if(this.batichboolean){
  672 + let arr={ids:this.uuids,reason:this.Udform.operreason,contactName:loginUserInfo.username,contactTel:this.Udform.opertel,content:''}
  673 + sendbatchRemoveMt5201(arr).then(res=>{
  674 + let response=res.data;
  675 + this.code=response.code;
  676 + if(this.code=='200'){
  677 + this.centerDialogVisible=true;
  678 + this.msg=response.msg;
  679 + }else{
  680 + this.centerDialogVisible=true;
  681 + this.msg=response.msg;
  682 + }
  683 + });
  684 + }else{
  685 + const map = {'flightNo':this.rows.flightno,
  686 + 'flightDate':this.rows.flightdate,
  687 + 'awba':this.rows.awba,
  688 + 'content':'',
  689 + 'customCode':this.rows.customcode,
  690 + 'awbh':this.rows.awbh,
  691 + 'reason' :this.Udform.operreason,
  692 + 'contactName':this.Udform.operperson,
  693 + 'contactTel':this.Udform.opertel,
  694 + 'rcfdep':this.rows.rcfdep,
  695 + 'carrier':this.rows.carrier,
  696 + 'username':loginUserInfo.username}
  697 + sendRemoveMt520x(map).then(res=>{
  698 + let response=res.data;
  699 + //console.log(res);
  700 + this.code=response.code;
  701 + if(this.code=='200'){
  702 + this.rows.status='24';
  703 + this.rows.ext5='理货删除报发送成功';
  704 + this.dialogFormVisible=false;
  705 + this.outerVisible = false;
  706 + this.centerDialogVisible=true;
  707 + this.msg=response.msg;
  708 + }else{
  709 + this.dialogFormVisible=false;
  710 + this.outerVisible = false;
  711 + this.centerDialogVisible=true;
  712 + this.msg=response.msg;
  713 + }
  714 + });
  715 + }
  716 +
695 } else { 717 } else {
696 console.log('error submit!!'); 718 console.log('error submit!!');
697 return false; 719 return false;
@@ -702,6 +724,40 @@ @@ -702,6 +724,40 @@
702 //批量选中事件 724 //批量选中事件
703 handleSelectionChange(val) { 725 handleSelectionChange(val) {
704 this.multipleSelection = val; 726 this.multipleSelection = val;
  727 + if(this.multipleSelection!=null && this.multipleSelection!=""){
  728 + this.batich=false;
  729 + }else{
  730 + this.batich=true;
  731 + }
  732 + },
  733 + //批量申请
  734 + batchaplly(){
  735 + let ids=[];
  736 + this.multipleSelection.forEach(function (item) {
  737 + ids.push(item.uuid);
  738 + })
  739 + sendbatchCreateMt5201(ids).then(res=>{
  740 + let response=res.data;
  741 + this.code=response.code;
  742 + if(this.code=='200'){
  743 + this.centerDialogVisible=true;
  744 + this.msg=response.msg;
  745 + }else{
  746 + this.centerDialogVisible=true;
  747 + this.msg=response.msg;
  748 + }
  749 + });
  750 + },
  751 + //批量删除
  752 + batchdel(){
  753 + let ids=[];
  754 + this.multipleSelection.forEach(function (item) {
  755 + ids.push(item.uuid);
  756 + })
  757 + this.uuids=ids;
  758 + this.udStatus='delete';
  759 + this.dialogFormVisible=true;
  760 + this.batichboolean=true;
705 }, 761 },
706 //编辑主单 762 //编辑主单
707 handleMain(index,row){ 763 handleMain(index,row){
@@ -833,4 +889,4 @@ @@ -833,4 +889,4 @@
833 this.getMt5201List(); 889 this.getMt5201List();
834 } 890 }
835 } 891 }
836 -</script>  
  892 +</script>