Commit d462445d authored by youjie's avatar youjie

no message

parent 4a81f725
...@@ -133,6 +133,7 @@ import { useQuasar } from 'quasar' ...@@ -133,6 +133,7 @@ import { useQuasar } from 'quasar'
export default defineComponent({ export default defineComponent({
props: {}, props: {},
setup(props, context) { setup(props, context) {
const HotelLength = inject(DirtionmaryHelper.HOTEL_CAR_ORDER_LENGTH) as any
const orderstatus = inject(DirtionmaryHelper.HOTEL_CAR_ORDER_STATUS) as any const orderstatus = inject(DirtionmaryHelper.HOTEL_CAR_ORDER_STATUS) 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
...@@ -158,7 +159,7 @@ export default defineComponent({ ...@@ -158,7 +159,7 @@ export default defineComponent({
currentI: 0, currentI: 0,
currentS: 0, currentS: 0,
RemainingInventory: 0, RemainingInventory: 0,
HotelLength: 0, // HotelLength: 0,
loading: false, loading: false,
cacheHotels: [ cacheHotels: [
{ Name: t('hotel.car.scattered'), ID: 1 }, { Name: t('hotel.car.scattered'), ID: 1 },
...@@ -235,6 +236,7 @@ export default defineComponent({ ...@@ -235,6 +236,7 @@ export default defineComponent({
localStorage.removeItem(DirtionmaryHelper.HOTEL_HOTELCARS_CACHE) localStorage.removeItem(DirtionmaryHelper.HOTEL_HOTELCARS_CACHE)
cars.value=[] cars.value=[]
orderstatus.value = true orderstatus.value = true
HotelLength.value = 0
context.emit('success') context.emit('success')
} else { } else {
message.errorMsg(r.data.message) message.errorMsg(r.data.message)
...@@ -247,9 +249,9 @@ export default defineComponent({ ...@@ -247,9 +249,9 @@ export default defineComponent({
}) })
}, },
getLength() { getLength() {
data.HotelLength = 0 HotelLength.value = 0
cars.value.forEach((item: any) => { cars.value.forEach((item: any) => {
data.HotelLength += item.Hotels.length HotelLength.value += item.Hotels.length
}) })
}, },
removeHotelHandler(x:number,y:number){ removeHotelHandler(x:number,y:number){
...@@ -274,7 +276,18 @@ export default defineComponent({ ...@@ -274,7 +276,18 @@ export default defineComponent({
} }
methods.getLength() methods.getLength()
methods.getMoney() methods.getMoney()
return { ...toRefs(data), cars, TCNumRef, ContactNameRef, ContactNumberRef, ...methods, moneyFormat, info, panning, rightColor,} return {
...toRefs(data),
cars,
TCNumRef,
ContactNameRef,
ContactNumberRef,
moneyFormat,
info,
panning,
rightColor,
HotelLength,
...methods }
} }
}) })
</script> </script>
......
...@@ -68,6 +68,7 @@ import { DirtionmaryHelper } from '../../../config/dictionary' ...@@ -68,6 +68,7 @@ import { DirtionmaryHelper } from '../../../config/dictionary'
export default defineComponent({ export default defineComponent({
components: { svgIcon, ListCar }, components: { svgIcon, ListCar },
setup() { setup() {
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 $q = useQuasar() const $q = useQuasar()
const qDateProxy = ref(null) as any const qDateProxy = ref(null) as any
...@@ -89,7 +90,7 @@ export default defineComponent({ ...@@ -89,7 +90,7 @@ 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 // 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,10 +187,10 @@ export default defineComponent({ ...@@ -186,10 +187,10 @@ export default defineComponent({
data.rightCarOpen = false data.rightCarOpen = false
}, },
getLength(){ getLength(){
data.HotelLength = 0 HotelLength.value = 0
if(cars.value.length>0){ if(cars.value.length>0){
cars.value.forEach((item:any)=>{ cars.value.forEach((item:any)=>{
data.HotelLength+=item.Hotels.length HotelLength.value+=item.Hotels.length
}) })
} }
}, },
...@@ -222,7 +223,8 @@ export default defineComponent({ ...@@ -222,7 +223,8 @@ export default defineComponent({
qNameProxy, qNameProxy,
searchCnt, searchCnt,
search, search,
cars cars,
HotelLength
} }
} }
}) })
......
...@@ -48,5 +48,10 @@ class DirtionmaryHelper { ...@@ -48,5 +48,10 @@ class DirtionmaryHelper {
* 酒店訂單確定下單狀態 * 酒店訂單確定下單狀態
*/ */
static readonly HOTEL_CAR_ORDER_STATUS = "hotelcarorderstatus" static readonly HOTEL_CAR_ORDER_STATUS = "hotelcarorderstatus"
/**
* 酒店訂單數量
*/
static readonly HOTEL_CAR_ORDER_LENGTH = "hotelcarorderlength"
} }
export { userDictionmary,DirtionmaryHelper } export { userDictionmary,DirtionmaryHelper }
...@@ -50,6 +50,8 @@ export default defineComponent({ ...@@ -50,6 +50,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)
provide(DirtionmaryHelper.HOTEL_CAR_ORDER_LENGTH,HotelLength)
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