|
@@ -46,6 +46,11 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ payUrl:'',
|
|
|
+ monthId: '',
|
|
|
+ vehicleNo:'',
|
|
|
+ monthEndTime:'',
|
|
|
+ monthStartTime:'',
|
|
|
lastActiveDate:null,
|
|
|
roadNo:null,
|
|
|
carLicenseList: [],
|
|
@@ -63,8 +68,7 @@
|
|
|
onLoad (page) {
|
|
|
let locationLocaturl = window.location.hash;
|
|
|
// this.roadNo = this.$u.queryParams(page).slice();
|
|
|
- this.roadNo = getUrlParams(locationLocaturl,"roadNo");
|
|
|
- console.log("roadNo" ,this.roadNo)
|
|
|
+ this.roadNo = getUrlParams(locationLocaturl,"roadNo");
|
|
|
this.getMonthInfo(this.roadNo);
|
|
|
// this.form.dateRange=this.getMonthRange(this.lastActiveDate,1)
|
|
|
// this.getCarsLicenseList();
|
|
@@ -87,6 +91,9 @@
|
|
|
const year = Date1.getFullYear()
|
|
|
const month = Date1.getMonth()+1
|
|
|
const day = Date1.getDate()
|
|
|
+ const hours = Date1.getHours();
|
|
|
+ const minutes = Date1.getMinutes();
|
|
|
+ const seconds = Date1.getSeconds();
|
|
|
let days = new Date(year, month, 0)
|
|
|
days = days.getDate() //获取当前日期中的月的天数
|
|
|
let year2 = year;
|
|
@@ -106,6 +113,8 @@
|
|
|
}
|
|
|
const t1 = year + '.' + (month > 9 ? month : '0' + month) + '.' + (day > 9 ? day : '0' + day)
|
|
|
const t2 = year2 + '.' + month2 + '.' + day2
|
|
|
+ this.monthStartTime=year + '-' + (month > 9 ? month : '0' + month) + '-' + (day > 9 ? day : '0' + day) + ' ' + hours + ':' + minutes + ':' +seconds
|
|
|
+ this.monthEndTime=year2 + '-' + month2 + '-' + day2 + ' ' + hours + ':' + minutes + ':' +seconds
|
|
|
return t1 + '-' + t2
|
|
|
},
|
|
|
/**
|
|
@@ -138,8 +147,8 @@
|
|
|
getMonthInfo(roadNo){
|
|
|
this.$u.api.monthInfo({roadNo: this.roadNo})
|
|
|
.then(res => {
|
|
|
- console.log('getMonthInfo',res)
|
|
|
if (res.code === 200){
|
|
|
+ this.vehicleNo = res.data.vehicleList[0].vehicleNo
|
|
|
this.lastActiveDate = res.data.lastActiveDate;
|
|
|
this.form.energyType=res.data.vehicleList[0].energyType;
|
|
|
this.form.monthAmount=res.data.monthAmount;
|
|
@@ -156,14 +165,42 @@
|
|
|
})
|
|
|
},
|
|
|
submit(roadNo){
|
|
|
- // this.$u.api.createMonth({roadNo:})
|
|
|
+ // console.log(this.monthStartTime)
|
|
|
+ this.$u.api.createMonth({
|
|
|
+ roadNo:this.roadNo,
|
|
|
+ vehicleNo:this.form.carLicense.label,
|
|
|
+ energyType:this.form.energyType,
|
|
|
+ monthStartTime:this.monthStartTime,
|
|
|
+ monthEndTime:this.monthEndTime,
|
|
|
+ monthCount:this.form.monthAmount})
|
|
|
+ .then(res => {
|
|
|
+ console.log("1111",res)
|
|
|
+ if(res.code === 200){
|
|
|
+ this.monthId = res.data.monthId
|
|
|
+ console.log(this.monthId)
|
|
|
+ this.$u.api.monthPay({
|
|
|
+ monthId:this.monthId
|
|
|
+ }).then(res => {
|
|
|
+ console.log("monthPay",res)
|
|
|
+ if(res.code === 200){
|
|
|
+ this.payUrl=encodeURIComponent(res.data.url);
|
|
|
+ this.$u.route({
|
|
|
+ url: 'pages/handleMonthly/monthPay',
|
|
|
+ params: {
|
|
|
+ payUrl:this.payUrl
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
// this.getMonthInfo(roadNo)
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
dateRange:function(){
|
|
|
return this.getMonthRange(this.lastActiveDate,this.form.month)
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
filters:{
|
|
|
verifyStatusFilter(value) {
|