Browse Source

预发货日期修改

jbb 2 years ago
parent
commit
f555ec7793

+ 20 - 16
src/views/shipment-details/referOrderDataModal.vue

@@ -605,24 +605,28 @@ export default {
         this.$message.error('请选择查询类型!');
       }else if(this.queryParam.account === '' || !this.queryParam.hasOwnProperty('account')){
         this.$message.error('请选择账套号!');
-      }else if(this.range.length == 1 || this.range.length == 0){
-        this.$message.error('请选择预发货时间区间!');
       }else{
-         var separator = "-"; //日期分隔符  
-         var startDates = this.queryParam.preDeliveryDateS.split(separator);  
-         var endDates = this.queryParam.preDeliveryDateE.split(separator);  
-         var startDate = new Date(startDates[0], startDates[1]-1, startDates[2]);  
-         var endDate = new Date(endDates[0], endDates[1]-1, endDates[2]);  
-        var timeInterval= parseInt(Math.abs(endDate - startDate ) / 1000 / 60 / 60 /24) + 1;
-        if(timeInterval > 31 ){
-           this.$message.error('预发货时间区间超过31天,请重新选择!');
-           this.range = []
-           this.queryParam.preDeliveryDateS = ''
-           this.queryParam.preDeliveryDateE = ''
-        }else{
-          this.queryParam.pageNo = '';
+         if(this.range.length == 2){
+           var separator = "-"; //日期分隔符  
+           var startDates = this.queryParam.preDeliveryDateS.split(separator);  
+           var endDates = this.queryParam.preDeliveryDateE.split(separator);  
+           var startDate = new Date(startDates[0], startDates[1]-1, startDates[2]);  
+           var endDate = new Date(endDates[0], endDates[1]-1, endDates[2]);  
+           var timeInterval= parseInt(Math.abs(endDate - startDate ) / 1000 / 60 / 60 /24) + 1;
+           if(timeInterval > 31 ){
+             this.$message.error('预发货时间区间超过31天,请重新选择!');
+             this.range = []
+             this.queryParam.preDeliveryDateS = ''
+             this.queryParam.preDeliveryDateE = ''
+           }else{
+             this.queryParam.pageNo = '';
+             this.getOrderList();
+           }
+         }else {
+           this.queryParam.pageNo = ''
            this.getOrderList();
-        }
+         }
+         
       }
     },
 

+ 16 - 15
src/views/shipment-details/shipmentList.vue

@@ -876,22 +876,23 @@ export default {
     searchQuery() {
       if(this.queryParam.flourOrGarment === '' || !this.queryParam.hasOwnProperty('flourOrGarment')){
        this.$message.error('请选择查询类型!');
-      }else if(this.preDeliveryDate.length !==2){
-       this.$message.error('请选择预发货时间区间!');
       }else{
-        var separator = "-"; //日期分隔符  
-         var startDates = this.queryParam.preDeliveryDateB.split(separator);  
-         var endDates = this.queryParam.preDeliveryDateE.split(separator);  
-         var startDate = new Date(startDates[0], startDates[1]-1, startDates[2]);  
-         var endDate = new Date(endDates[0], endDates[1]-1, endDates[2]);  
-        var timeInterval= parseInt(Math.abs(endDate - startDate ) / 1000 / 60 / 60 /24) + 1;
-        if(timeInterval > 31){
-          this.$message.error('预发货时间区间超过31天,请重新选择!');
-        }else {
-          // this.queryParam.pageNo = ''
-          // this.queryParam.pageSize = 20
-          this.getShipmentList() 
-        }       
+         if(this.preDeliveryDate.length ==2){
+            var separator = "-"; //日期分隔符  
+            var startDates = this.queryParam.preDeliveryDateB.split(separator);  
+            var endDates = this.queryParam.preDeliveryDateE.split(separator);  
+            var startDate = new Date(startDates[0], startDates[1]-1, startDates[2]);  
+            var endDate = new Date(endDates[0], endDates[1]-1, endDates[2]);  
+            var timeInterval= parseInt(Math.abs(endDate - startDate ) / 1000 / 60 / 60 /24) + 1;
+            if(timeInterval > 31){
+             this.$message.error('预发货时间区间超过31天,请重新选择!');
+            }else { 
+             this.getShipmentList() 
+           }       
+         }else{
+           this.getShipmentList() 
+         }
+         
       }
     },