Commit 853c5719 authored by youjie's avatar youjie

no message

parent d462445d
......@@ -159,7 +159,6 @@ export default defineComponent({
currentI: 0,
currentS: 0,
RemainingInventory: 0,
// HotelLength: 0,
loading: false,
cacheHotels: [
{ Name: t('hotel.car.scattered'), ID: 1 },
......@@ -248,12 +247,6 @@ export default defineComponent({
data.loading = false
})
},
getLength() {
HotelLength.value = 0
cars.value.forEach((item: any) => {
HotelLength.value += item.Hotels.length
})
},
removeHotelHandler(x:number,y:number){
$q.dialog({
title: t('dialog.titles.hotel'),
......@@ -266,6 +259,7 @@ export default defineComponent({
}else{
cars.value[x].Hotels.splice(y,1)
}
HotelLength.value = cars.value.length
})
},
......@@ -274,7 +268,6 @@ export default defineComponent({
context.emit('close')
}
}
methods.getLength()
methods.getMoney()
return {
...toRefs(data),
......
......@@ -90,7 +90,6 @@ export default defineComponent({
cacheHotels: [] as Array<any>,
hotelsRates: [] as Array<HotelRate>,
canHide: false,
// HotelLength: 0
})
data.scrollStyle = useScrollModule().scrollStyle
const search = inject(DirtionmaryHelper.HOTEL_QUERY_PARAM) as any
......@@ -186,14 +185,6 @@ export default defineComponent({
setSuccess(){
data.rightCarOpen = false
},
getLength(){
HotelLength.value = 0
if(cars.value.length>0){
cars.value.forEach((item:any)=>{
HotelLength.value+=item.Hotels.length
})
}
},
}
const searchCnt = computed(() => {
let setCnt = 0
......@@ -211,10 +202,13 @@ export default defineComponent({
methods.initHotels()
watch(cars.value, (n, o) => {
localStorage.setItem(DirtionmaryHelper.HOTEL_HOTELCARS_CACHE,JSON.stringify(cars.value))
methods.getLength()
})
watch(HotelLength, (n, o) => {
HotelLength.value = n
})
onMounted(()=>{
methods.getLength()
})
return {
...toRefs(data),
......
......@@ -108,6 +108,7 @@ export default defineComponent({
setup(props, context) {
const { t } = useI18n()
const qDateProxyOpera = ref<any>(null)
const HotelLength = inject(DirtionmaryHelper.HOTEL_CAR_ORDER_LENGTH) as any
const cars = inject(DirtionmaryHelper.HOTEL_CAR_LIST) as any
const editor = inject(DirtionmaryHelper.HOTEL_UPDATEHOTEL_CAR) as any
const data = reactive({
......@@ -201,6 +202,7 @@ export default defineComponent({
cars.value.sort((x:any,y:any)=>{
return new Date(x.Date).getTime()-new Date(y.Date).getTime()
})
HotelLength.value = cars.value.length
message.successMsg(t('success'))
editor.value={}
context.emit('close')
......@@ -282,7 +284,7 @@ export default defineComponent({
}
})
return { ...toRefs(data), ...methods,editor }
return { ...toRefs(data),editor,HotelLength, ...methods }
}
})
</script>
......
......@@ -41,6 +41,7 @@ export default defineComponent({
provide(DirtionmaryHelper.HOTEL_QUERY_PARAM, search)
const HotelCarList = ref<Array<any>>([])
const cacheCars = localStorage.getItem(DirtionmaryHelper.HOTEL_HOTELCARS_CACHE)
if(cacheCars){
HotelCarList.value = JSON.parse(cacheCars)
......@@ -50,8 +51,8 @@ export default defineComponent({
provide(DirtionmaryHelper.HOTEL_UPDATEHOTEL_CAR,updateObj)
const orderstatus = ref(false)
provide(DirtionmaryHelper.HOTEL_CAR_ORDER_STATUS,orderstatus)
const HotelLength = ref(0)
provide(DirtionmaryHelper.HOTEL_CAR_ORDER_LENGTH,HotelLength)
const HotelLengths = ref(0)
provide(DirtionmaryHelper.HOTEL_CAR_ORDER_LENGTH,HotelLengths)
const menu=inject(DirtionmaryHelper.MENU_KEYS) as any
menu.value=2
......
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