|
@@ -47,6 +47,24 @@ export default {
|
|
|
// inboundDetails(scope){
|
|
|
// this.$router.push("/inboundDetails/" + scope.row.inboundId)
|
|
|
// },
|
|
|
+ // 获取当前月份的最后一天
|
|
|
+ getdaysinmonth(year,month){
|
|
|
+ month = parseInt(month,10)+1;
|
|
|
+ let days = 0;
|
|
|
+ month = month -1;
|
|
|
+ console.log("othermonth"+month)
|
|
|
+ console.log("otheryear"+year);
|
|
|
+ // 根据月份获取对应的天数
|
|
|
+ if(month == 2){
|
|
|
+ days = year % 4 == 0?29:28;
|
|
|
+ }else if(month == 1||month == 3||month == 5||month == 7||month == 8||month == 10||month == 12){
|
|
|
+ days = 31;
|
|
|
+ }else{
|
|
|
+ days = 30;
|
|
|
+ }
|
|
|
+ console.log("otherdays"+days)
|
|
|
+ return days;
|
|
|
+ },
|
|
|
onclick(){
|
|
|
let startTime = null;
|
|
|
let endTime = null;
|
|
@@ -105,8 +123,15 @@ export default {
|
|
|
this.endTime = year+"-"+month+"-"+day+" "+"23:30:00";
|
|
|
}else if(this.region == 3){
|
|
|
this.endTime = year+"-"+month+"-"+day+" "+"07:30:00";
|
|
|
- // 将开始时间减一
|
|
|
- day =parseInt(day)-1;
|
|
|
+ // 判断开始日期和结束日期是否跨月份了
|
|
|
+ if(month!=month2){
|
|
|
+ month = parseInt(month)-1
|
|
|
+ // 获取前一个月份的最后一天
|
|
|
+ day = this.$options.methods.getdaysinmonth(year,month)
|
|
|
+ }else{
|
|
|
+ // 将开始时间减一
|
|
|
+ day =parseInt(day)-1;
|
|
|
+ }
|
|
|
this.startTime = year+"-"+month+"-"+day+" "+"23:30:00";
|
|
|
}
|
|
|
this.startTime = new Date(this.startTime)
|
|
@@ -144,8 +169,6 @@ export default {
|
|
|
this.endTime = null;
|
|
|
this.$message.warning("开始时间要比结束时间早");
|
|
|
}
|
|
|
- } else {
|
|
|
- // this.getRequestUrl()
|
|
|
}
|
|
|
},
|
|
|
selectionChange(selection) {
|