Commit f8d1e97a authored by 华国豪's avatar 华国豪 🙄

1

parent 233f7202
...@@ -1765,38 +1765,38 @@ ...@@ -1765,38 +1765,38 @@
HotelList.push(res.data.data.HotelOrderListReport[i].HotelOrderList[o]) HotelList.push(res.data.data.HotelOrderListReport[i].HotelOrderList[o])
} }
} }
var Hotelmap = {},Hotelmap2 = {}, console.log(HotelList)
var Hotelmap = {},
Hoteldest = []; Hoteldest = [];
for (var i = 0; i < HotelList.length; i++) { for (var i = 0; i < HotelList.length; i++) {
var ai = HotelList[i]; var ai = HotelList[i];
console.log(ai.NewHotelId, ai.CheckInDateStr, i)
if (!Hotelmap[ai.CheckInDateStr]) { if (!Hotelmap[ai.CheckInDateStr]) {
Hoteldest.push({ Hoteldest.push({
CheckInDateStr: ai.CheckInDateStr, CheckInDateStr: ai.CheckInDateStr,
NewHotelId: ai.NewHotelId, NewHotelId: ai.NewHotelId,
id: ai.NewHotelId + ai.CheckInDateStr,
data: [ai] data: [ai]
}); });
Hotelmap[ai.CheckInDateStr] = ai; Hotelmap[ai.CheckInDateStr] = ai;
Hotelmap2[ai.NewHotelId] = ai; } else {
let list = []
}
else if (Hotelmap[ai.CheckInDateStr] && !Hotelmap2[ai.NewHotelId]) {
Hoteldest.push({
CheckInDateStr: ai.CheckInDateStr,
NewHotelId: ai.NewHotelId,
data: [ai]
});
Hotelmap2[ai.NewHotelId] = ai;
}
else {
for (var j = 0; j < Hoteldest.length; j++) { for (var j = 0; j < Hoteldest.length; j++) {
var dj = Hoteldest[j]; var dj = Hoteldest[j];
if (dj.CheckInDateStr == ai.CheckInDateStr && dj.NewHotelId == ai.NewHotelId) { if (dj.CheckInDateStr == ai.CheckInDateStr && dj.NewHotelId == ai.NewHotelId) {
dj.data.push(ai); dj.data.push(ai);
break; break;
} else {
list.push(ai)
} }
}
for (let i = 0; i < list.length; i++) {
Hoteldest.push({
CheckInDateStr: ai.CheckInDateStr,
NewHotelId: ai.NewHotelId,
id: ai.NewHotelId + ai.CheckInDateStr,
data: [ai]
});
} }
} }
} }
...@@ -1807,7 +1807,7 @@ ...@@ -1807,7 +1807,7 @@
} }
Hoteldest[i].row = row Hoteldest[i].row = row
} }
this.HotelDataList = Hoteldest; this.HotelDataList = this.unique(Hoteldest, 'id');
} else { } else {
this.$message.error(res.data.message); this.$message.error(res.data.message);
} }
......
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