Commit 853c5719 authored by youjie's avatar youjie

no message

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