Commit b55a47dd authored by youjie's avatar youjie

no message

parent a496a79e
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
}) })
data.scrollStyle = useScrollModule().scrollStyle data.scrollStyle = useScrollModule().scrollStyle
// 今天购买数量 // 今天购买数量
watch(HotelCarList._value, (n, o) => { watch(HotelCarList.value, (n, o) => {
methods.calculateNum() methods.calculateNum()
methods.getMoney() methods.getMoney()
}) })
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
}, },
getMoney(){ getMoney(){
data.parameters.Money = 0 data.parameters.Money = 0
HotelCarList._value.forEach(item=>{ HotelCarList.value.forEach(item=>{
item.timeList.forEach(t=>{ item.timeList.forEach(t=>{
t.rooms.forEach(room=>{ t.rooms.forEach(room=>{
let m = (room.PeopleNumber*room.Unit_Price)+(room.Number*room.TaxesPrice)+(room.Number*room.PriceInTangTax) let m = (room.PeopleNumber*room.Unit_Price)+(room.Number*room.TaxesPrice)+(room.Number*room.PriceInTangTax)
...@@ -224,6 +224,7 @@ ...@@ -224,6 +224,7 @@
}) })
}, },
submit() { submit() {
// context.emit('success')
// TCNumRef.value.validate() // TCNumRef.value.validate()
// ContactNameRef.value.validate() // ContactNameRef.value.validate()
// ContactNumberRef.value.validate() // ContactNumberRef.value.validate()
...@@ -242,7 +243,7 @@ ...@@ -242,7 +243,7 @@
} }
data.parameters.DetailList = [] as Array<any> data.parameters.DetailList = [] as Array<any>
HotelCarList._value.forEach(item=>{ HotelCarList.value.forEach(item=>{
item.timeList.forEach(t=>{ item.timeList.forEach(t=>{
let datas = { let datas = {
HotelId: item.HotelId, HotelId: item.HotelId,
...@@ -269,11 +270,19 @@ ...@@ -269,11 +270,19 @@
data.loading = true data.loading = true
HotelService.SetCustomerOrder(data.parameters) HotelService.SetCustomerOrder(data.parameters)
.then(r => { .then(r => {
if (r.data.resultCode == ApiResult.SUCCESS) { if (r.data.resultCode == ApiResult.SUCCESS) {
message.successMsg(`${t('success')}`) message.successMsg(`${t('success')}`)
HotelCarList._value = [] as Array<any> data.parameters = {
context.emit('close') Money: 0,
DetailList: [],
Remark: '',
OrderType: 1,//订单类型 1散客 2团队
TCNum: '',//=团队时 传递 组团号
ContactName: '',//=散客时 传递 联系人
ContactNumber: '',//=散客时 传递 联系人电话
OrderId: 0,
},
context.emit('success')
} else { } else {
message.errorMsg(r.data.message) message.errorMsg(r.data.message)
} }
...@@ -286,8 +295,8 @@ ...@@ -286,8 +295,8 @@
}, },
getLength(){ getLength(){
data.HotelLength = 0 data.HotelLength = 0
if(HotelCarList._value.length>0){ if(HotelCarList.value.length>0){
HotelCarList._value.forEach(item=>{ HotelCarList.value.forEach(item=>{
item.timeList.forEach(t=>{ item.timeList.forEach(t=>{
if(t.rooms.length>0){ if(t.rooms.length>0){
data.HotelLength+=t.rooms.length data.HotelLength+=t.rooms.length
...@@ -298,10 +307,10 @@ ...@@ -298,10 +307,10 @@
}, },
// 计算房间数量 // 计算房间数量
calculateNum(){ calculateNum(){
let list = HotelCarList._value let list = HotelCarList.value
if(list&&list[data.currentIndex]){ if(list&&list[data.currentIndex]){
// HotelCarList._value[data.currentIndex].timeList[data.currentI].total = 0 // HotelCarList.value[data.currentIndex].timeList[data.currentI].total = 0
HotelCarList._value&&HotelCarList._value.forEach((item,index)=> { HotelCarList.value&&HotelCarList.value.forEach((item,index)=> {
item.timeList.forEach(t=>{ item.timeList.forEach(t=>{
t.total = 0 t.total = 0
t.rooms.forEach(room=>{ t.rooms.forEach(room=>{
...@@ -334,14 +343,14 @@ ...@@ -334,14 +343,14 @@
} }
}else if(type==0&&room.Number>0){ }else if(type==0&&room.Number>0){
if(room.Number==1){ if(room.Number==1){
if(HotelCarList._value[index].timeList[i].rooms.length==1&&HotelCarList._value[index].timeList.length>1){ if(HotelCarList.value[index].timeList[i].rooms.length==1&&HotelCarList.value[index].timeList.length>1){
HotelCarList._value[index].timeList.splice(i, 1) HotelCarList.value[index].timeList.splice(i, 1)
}else if(HotelCarList._value[index].timeList.length==1&& }else if(HotelCarList.value[index].timeList.length==1&&
HotelCarList._value[index].timeList[i].rooms.length==1){ HotelCarList.value[index].timeList[i].rooms.length==1){
HotelCarList._value.splice(index, 1) HotelCarList.value.splice(index, 1)
return return
}else{ }else{
HotelCarList._value[index].timeList[i].rooms.splice(s, 1) HotelCarList.value[index].timeList[i].rooms.splice(s, 1)
} }
methods.getLength() methods.getLength()
} }
...@@ -351,6 +360,7 @@ ...@@ -351,6 +360,7 @@
}, },
} }
onMounted(()=>{ onMounted(()=>{
methods.getLength() methods.getLength()
methods.getMoney() methods.getMoney()
}) })
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</div> </div>
<q-dialog v-if="HotelCarList.length>0" v-model="rightCarOpen" maximized full-height position="right"> <q-dialog v-if="HotelCarList.length>0" v-model="rightCarOpen" maximized full-height position="right">
<ListCar @close="rightCarOpen=false"></ListCar> <ListCar @close="close" @success="setSuccess"></ListCar>
</q-dialog> </q-dialog>
</template> </template>
...@@ -181,10 +181,18 @@ export default defineComponent({ ...@@ -181,10 +181,18 @@ export default defineComponent({
console.log(search.HotelChooseArray) console.log(search.HotelChooseArray)
}, 1000) }, 1000)
}, },
close(){
data.rightCarOpen = false
},
setSuccess(){
data.rightCarOpen = false
// HotelCarList.value = []
// data.HotelLength = 0
},
getLength(){ getLength(){
data.HotelLength = 0 data.HotelLength = 0
if(HotelCarList._value.length>0){ if(HotelCarList.value.length>0){
HotelCarList._value.forEach(item=>{ HotelCarList.value.forEach(item=>{
item.timeList.forEach(t=>{ item.timeList.forEach(t=>{
if(t.rooms.length>0){ if(t.rooms.length>0){
data.HotelLength+=t.rooms.length data.HotelLength+=t.rooms.length
...@@ -208,7 +216,7 @@ export default defineComponent({ ...@@ -208,7 +216,7 @@ export default defineComponent({
}) })
methods.initAddress() methods.initAddress()
methods.initHotels() methods.initHotels()
watch(HotelCarList._value, (n, o) => { watch(HotelCarList.value, (n, o) => {
methods.getLength() methods.getLength()
}) })
onMounted(()=>{ onMounted(()=>{
......
...@@ -109,6 +109,7 @@ ...@@ -109,6 +109,7 @@
}, },
total: 0, total: 0,
}) })
data.onlyNum = JSON.parse(JSON.stringify(data.hotelInfor.RemainingInventory)) data.onlyNum = JSON.parse(JSON.stringify(data.hotelInfor.RemainingInventory))
// 今天购买数量 // 今天购买数量
watch(data.parameters, (n, o) => { watch(data.parameters, (n, o) => {
...@@ -177,18 +178,18 @@ ...@@ -177,18 +178,18 @@
}) })
msgData.timeList.push(msg) msgData.timeList.push(msg)
if(data.total>0){ if(data.total>0){
let list = HotelCarList._value let list = HotelCarList.value
if(list.length>0){ if(list.length>0){
let fault = true let fault = true
list.forEach((item,index)=>{ list.forEach((item,index)=>{
if(item.HotelId==parameters.HotelId){ if(item.HotelId==parameters.HotelId){
item.timeList.forEach((x,i)=>{ item.timeList.forEach((x,i)=>{
if(fault&&x.Date==parameters.Date){ if(fault&&x.Date==parameters.Date){
HotelCarList._value[index].timeList.splice(i,1) HotelCarList.value[index].timeList.splice(i,1)
HotelCarList._value[index].timeList.push(msg) HotelCarList.value[index].timeList.push(msg)
fault = false fault = false
}else if(fault&&x.Date!=parameters.Date){ }else if(fault&&x.Date!=parameters.Date){
HotelCarList._value[index].timeList.push(msg) HotelCarList.value[index].timeList.push(msg)
fault = false fault = false
}else{ }else{
// console.log(fault,x.Date,parameters.Date) // console.log(fault,x.Date,parameters.Date)
...@@ -196,9 +197,9 @@ ...@@ -196,9 +197,9 @@
}) })
} }
}) })
if(fault) HotelCarList._value.push(msgData) if(fault) HotelCarList.value.push(msgData)
}else{ }else{
HotelCarList._value.push(msgData) HotelCarList.value.push(msgData)
} }
} }
message.successMsg(`${t('success')}`) message.successMsg(`${t('success')}`)
...@@ -231,7 +232,7 @@ ...@@ -231,7 +232,7 @@
data.parameters.DetailList.push(dataMsg) data.parameters.DetailList.push(dataMsg)
} }
}) })
HotelCarList._value.forEach(item=>{ HotelCarList.value.forEach(item=>{
if(item.HotelId==data.HotelRow.HotelId){ if(item.HotelId==data.HotelRow.HotelId){
if(item.timeList.length>0){ if(item.timeList.length>0){
item.timeList.forEach(x=>{ item.timeList.forEach(x=>{
......
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