Commit 199ae380 authored by youjie's avatar youjie

no message

parent 8937ab8d
......@@ -579,7 +579,8 @@
// 删除
deleteLine(index){
this.msg.details.splice(index,1)
this.msg.details.UseDayNum = this.msg.details.length
console.log(this.msg.details.length,'==-----')
this.msg.UseDayNum = this.msg.details.length
},
// 获取车型座位数
getBusType(){
......@@ -597,12 +598,10 @@
checkInteger() {
let that= this
if(this.msg.UseDayNum<this.msg.details.length){
console.log(this.msg.details.length-this.msg.UseDayNum)
for (let i = 0; i < (this.msg.details.length-this.msg.UseDayNum); i++){
this.msg.details.splice(this.msg.details.length-1,1)
}
}else{
this.msg.details = []
let details2 = []
let timelist = []
if (this.msg.UseDayNum && this.msg.UseDayNum > 0) {
......@@ -611,16 +610,33 @@
timelist = this.getDiffDate(this.msg.StartDate, list)
if (timelist && timelist.length > 0) {
timelist.forEach((item, i) => {
details2.push({
let dataObj = {
DayNum: i + 1,
UseDate: item,//日期
UseType: '',//用车类型(接口返下拉列表)
// UseTime: '',//接送机时间
TripInfo: '',//行程信息
})
}
details2.push(dataObj)
if(this.msg.details&&this.msg.details.length==0){
this.msg.details = []
this.msg.details = JSON.parse(JSON.stringify(details2))
}else{
let UseDateArr = this.msg.details.map(x=>{return x.UseDate})
if(UseDateArr.indexOf(item)==-1){
this.msg.details.push(dataObj)
this.msg.details.sort((a,b)=>{
let obj1 = a['UseDate']
let obj2 = b['UseDate']
const val1 = Math.floor(new Date(obj1).getTime() / 1000)
const val2 = Math.floor(new Date(obj2).getTime() / 1000)
return val1 - val2
})
}
}
})
this.msg.details = JSON.parse(JSON.stringify(details2))
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment