Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bigwood
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
bigwood
Commits
1aa7a293
Commit
1aa7a293
authored
Nov 11, 2022
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
1c2412b5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
290 additions
and
68 deletions
+290
-68
List-Table.vue
src/components/hotel/list/List-Table.vue
+4
-2
ListCar.vue
src/components/hotel/list/ListCar.vue
+142
-53
ListHeader.vue
src/components/hotel/list/ListHeader.vue
+22
-3
Table-Operation.vue
src/components/hotel/list/Table-Operation.vue
+120
-9
index.ts
src/i18n/zh-TW/index.ts
+2
-1
No files found.
src/components/hotel/list/List-Table.vue
View file @
1aa7a293
...
...
@@ -33,16 +33,18 @@
<template
v-if=
"x.PriceList && x.PriceList.length > 0"
>
<div
class=
"td-item cursor-pointer"
:class=
"[x.PriceList[0].ins.bg, x.PriceList[0].ins.color]"
>
{{
x
.
PriceList
[
0
].
CostPrice
}}
<q-popup-proxy
v-if=
"x.RemainingInventory>0"
class=
"no-shadow"
>
<q-popup-proxy
v-if=
"x.RemainingInventory>0"
class=
"no-shadow"
transition-show=
"scale"
transition-hide=
"scale"
>
<TableOperation
:HotelRow=
"props.row"
:hotelInfor=
"x"
></TableOperation>
<q-btn
v-close-popup
label=
"关闭"
color=
"primary"
flat
style=
"float:right"
/>
</q-popup-proxy>
</div>
</
template
>
<div
class=
"td-item bg-dark"
v-else
></div>
<div
class=
"td-item cursor-pointer"
>
{{ x.Inventory }}/{{ x.UseInventory }}/{{ x.RemainingInventory }}
<q-popup-proxy
v-if=
"x.RemainingInventory>0"
class=
"no-shadow"
>
<q-popup-proxy
v-if=
"x.RemainingInventory>0"
class=
"no-shadow"
transition-show=
"scale"
transition-hide=
"scale"
>
<TableOperation
:HotelRow=
"props.row"
:hotelInfor=
"x"
></TableOperation>
<q-btn
v-close-popup
label=
"关闭"
color=
"primary"
flat
style=
"float:right"
/>
</q-popup-proxy>
</div>
<div
class=
"td-item"
:class=
"{ 'bg-red-9 text-white': x.UseInventory - x.Inventory > 0 }"
>
...
...
src/components/hotel/list/ListCar.vue
View file @
1aa7a293
This diff is collapsed.
Click to expand it.
src/components/hotel/list/ListHeader.vue
View file @
1aa7a293
...
...
@@ -10,7 +10,7 @@
<n-select
v-if=
"$q.platform.is.desktop"
filterable
@
update:value=
"changeHotel"
class=
"q-ml-lg col-2"
style=
"min-width: 190px"
clearable
v-model:value=
"search.HotelChooseArray"
:placeholder=
"$t('hotel.searchName')"
multiple
:options=
"cacheHotels"
max-tag-count=
"responsive"
size=
"large"
value-field=
"ID"
label-field=
"Name"
/>
<div
class=
"col"
></div>
<q-btn
unelevated
class=
"bg-grey-3 hover q-mr-md"
icon=
"shopping_cart"
:title=
"$t('hotel.car.shoppingTitle')"
@
click=
"rightCarOpen=true"
>
<q-badge
color=
"red"
rounded
floating
>
{{
Hotel
CarList
.
l
ength
}}
</q-badge>
<q-badge
color=
"red"
rounded
floating
>
{{
Hotel
L
ength
}}
</q-badge>
</q-btn>
<q-btn
unelevated
class=
"bg-grey-3 hover q-mr-md"
:title=
"$t('morequery')"
>
<q-badge
rounded
class=
"din bg-red-2 text-red-14 text-weight-bold"
floating
:label=
"searchCnt"
v-if=
"searchCnt > 0"
/>
...
...
@@ -54,7 +54,7 @@
<
script
lang=
"ts"
>
import
svgIcon
from
'../../global/svg-icon.vue'
import
{
computed
,
inject
,
provide
,
reactive
,
ref
,
toRefs
,
defineComponent
}
from
'vue'
import
{
computed
,
inject
,
provide
,
reactive
,
ref
,
toRefs
,
defineComponent
,
onMounted
,
watch
}
from
'vue'
import
{
DirtionmaryHelper
}
from
'../../../config/dictionary'
import
HotelService
from
'../../../api/hotel'
import
message
from
'../../../utils/message'
...
...
@@ -91,6 +91,7 @@ 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
...
...
@@ -179,7 +180,19 @@ export default defineComponent({
setTimeout
(()
=>
{
console
.
log
(
search
.
HotelChooseArray
)
},
1000
)
}
},
getLength
(){
data
.
HotelLength
=
0
if
(
HotelCarList
.
_value
.
length
>
0
){
HotelCarList
.
_value
.
forEach
(
item
=>
{
item
.
timeList
.
forEach
(
t
=>
{
if
(
t
.
rooms
.
length
>
0
){
data
.
HotelLength
+=
t
.
rooms
.
length
}
})
})
}
},
}
const
searchCnt
=
computed
(()
=>
{
let
setCnt
=
0
...
...
@@ -195,6 +208,12 @@ export default defineComponent({
})
methods
.
initAddress
()
methods
.
initHotels
()
watch
(
HotelCarList
.
_value
,
(
n
,
o
)
=>
{
methods
.
getLength
()
})
onMounted
(()
=>
{
methods
.
getLength
()
})
return
{
...
toRefs
(
data
),
...
methods
,
...
...
src/components/hotel/list/Table-Operation.vue
View file @
1aa7a293
<
template
>
<q-card
flat
class=
"q-px-lg q-py-sm bg-grey-1"
style=
"shadow: 0px 0px 50px 0px rgba(82, 63, 105, 0.15)"
>
<div
class=
"text-blue column q-pb-
sm
fz16"
>
<div
class=
"text-blue column q-pb-
xs
fz16"
>
<div
class=
"row items-center justify-center"
>
{{
HotelRow
.
HotelName
}}
</div>
<div
class=
"row justify-start"
>
<span
class=
"fz12 text-grey-6"
>
{{
hotelInfor
.
DateStr
}}
</span>
...
...
@@ -26,7 +26,7 @@
<div>
<q-btn
rounded
dense
color=
"white"
text-color=
"black"
size=
"xs"
icon=
"remove"
@
click=
'addGoods(item,0)'
/>
</div>
<div
class=
"q-px-sm"
style=
"width:
11
0px;"
>
<div
class=
"q-px-sm"
style=
"width:
8
0px;"
>
<q-input
style=
"width: 100%;"
v-model=
"item.Number"
class=
"col q-mr-md"
mask=
"#.##"
reverse-fill-mask
dense
type=
"text"
standout
:label=
"$t('hotel.shopping.labelNum')"
/>
</div>
...
...
@@ -34,12 +34,24 @@
<q-btn
rounded
dense
color=
"primary"
size=
"xs"
icon=
"add"
@
click=
'addGoods(item,1)'
/>
</div>
</div>
<div
class=
"row items-center justify-between q-pl-md"
>
<div>
<q-btn
rounded
dense
color=
"white"
text-color=
"black"
size=
"xs"
icon=
"remove"
@
click=
'addPeople(item,0)'
/>
</div>
<div
class=
"q-px-sm"
style=
"width: 80px;"
>
<q-input
style=
"width: 100%;"
v-model=
"item.PeopleNumber"
class=
"col q-mr-md"
mask=
"#.##"
reverse-fill-mask
dense
type=
"text"
standout
:label=
"$t('hotel.shopping.peopleNum')"
/>
</div>
<div>
<q-btn
rounded
dense
color=
"primary"
size=
"xs"
icon=
"add"
@
click=
'addPeople(item,1)'
/>
</div>
</div>
</div>
</template>
<div
class=
"row justify-between q-pt-md"
>
<div
class=
"row
items-center
justify-between q-pt-md"
>
<div
class=
"text-grey-6 fz12"
>
{{$t('hotel.shopping.only')}}
<span
class=
"text-orange-14 fz1
6
q-px-xs"
>
{{onlyNum}}
</span>
<span
class=
"text-orange-14 fz1
4
q-px-xs"
>
{{onlyNum}}
</span>
{{$t('hotel.shopping.between')}}
</div>
<div
class=
"row items-center q-pl-md"
>
...
...
@@ -86,6 +98,11 @@
hotelInfor
:
props
.
hotelInfor
,
onlyNum
:
''
as
any
,
parameters
:{
HotelId
:
''
as
String
,
HotelName
:
''
as
String
,
Date
:
''
as
String
,
RemainingInventory
:
''
as
String
,
total
:
0
,
Money
:
''
as
String
,
DetailList
:
[]
as
Array
<
any
>
,
Remark
:
''
as
String
,
...
...
@@ -98,6 +115,13 @@
methods
.
calculateNum
()
})
const
methods
=
{
addPeople
(
item
:
String
,
type
:
any
){
if
(
type
==
1
&&
item
.
Number
<
data
.
hotelInfor
.
RemainingInventory
){
item
.
PeopleNumber
++
}
else
if
(
type
==
0
&&
item
.
Number
>
1
){
item
.
PeopleNumber
--
}
},
addGoods
(
item
:
String
,
type
:
any
){
if
(
type
==
1
&&
item
.
Number
<
data
.
hotelInfor
.
RemainingInventory
){
if
(
data
.
total
<
data
.
hotelInfor
.
RemainingInventory
){
...
...
@@ -121,11 +145,75 @@
if
(
data
.
total
<
1
||
data
.
total
>
data
.
hotelInfor
.
RemainingInventory
){
message
.
errorMsg
(
`
${
t
(
'hotel.shopping.small'
)}
1
${
t
(
'hotel.shopping.big'
)}${
data
.
hotelInfor
.
RemainingInventory
}
`
)
}
data
.
parameters
.
DetailList
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
Number
>
0
){
HotelCarList
.
_value
.
push
(
item
)
const
parameters
=
data
.
parameters
let
msgData
=
{
HotelId
:
parameters
.
HotelId
,
HotelName
:
parameters
.
HotelName
,
timeList
:
[]
as
Array
<
any
>
}
let
msg
=
{
Date
:
parameters
.
Date
,
total
:
data
.
total
,
RemainingInventory
:
parameters
.
RemainingInventory
,
rooms
:
[]
as
Array
<
any
>
}
data
.
parameters
.
DetailList
.
forEach
((
x
,
index
)
=>
{
if
(
x
.
Number
>
0
){
let
ArrData
=
{
HotelId
:
x
.
HotelId
,
Date
:
x
.
Date
,
RoomType
:
x
.
RoomType
,
Unit_Price
:
x
.
Unit_Price
,
Number
:
x
.
Number
,
PeopleNumber
:
x
.
PeopleNumber
,
Destription
:
x
.
Destription
,
TaxesPrice
:
x
.
TaxesPrice
,
PriceInTangTax
:
x
.
PriceInTangTax
,
}
msg
.
rooms
.
push
(
ArrData
)
}
})
msgData
.
timeList
.
push
(
msg
)
if
(
data
.
total
>
0
){
let
list
=
HotelCarList
.
_value
let
fault
=
true
if
(
list
.
length
>
0
){
list
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
HotelId
==
parameters
.
HotelId
){
item
.
timeList
.
forEach
((
x
,
i
)
=>
{
if
(
fault
&&
x
.
Date
==
parameters
.
Date
){
HotelCarList
.
_value
[
index
].
timeList
.
splice
(
i
,
1
)
HotelCarList
.
_value
[
index
].
timeList
.
push
(
msg
)
console
.
log
(
'000--'
)
fault
=
false
}
else
if
(
fault
&&
x
.
Date
!=
parameters
.
Date
){
HotelCarList
.
_value
[
index
].
timeList
.
push
(
msg
)
console
.
log
(
'11111--'
)
fault
=
false
}
})
}
else
if
(
fault
&&
item
.
HotelId
!=
parameters
.
HotelId
){
item
.
timeList
.
forEach
((
x
,
i
)
=>
{
if
(
fault
&&
x
.
Date
==
parameters
.
Date
){
HotelCarList
.
_value
[
index
].
timeList
.
splice
(
i
,
1
)
HotelCarList
.
_value
[
index
].
timeList
.
push
(
msg
)
fault
=
false
}
else
if
(
fault
&&
x
.
Date
!=
parameters
.
Date
){
HotelCarList
.
_value
[
index
].
timeList
.
push
(
msg
)
fault
=
false
console
.
log
(
'3333'
)
}
})
}
})
fault
=
true
}
else
{
HotelCarList
.
_value
.
push
(
msgData
)
}
}
message
.
successMsg
(
`
${
t
(
'success'
)}
`
)
},
// 组装可选房间
setList
(){
...
...
@@ -134,7 +222,10 @@
let
roomTyps
=
[
'CostPrice'
,
'BidroomPrice'
,
'SingleroomPrice'
,
'AddBedPrice'
,
'GuideRoomPrice'
]
let
tempPrice
=
data
.
hotelInfor
.
PriceList
[
0
]
let
hotel
=
data
.
hotelInfor
console
.
log
(
data
.
HotelRow
)
data
.
parameters
.
HotelId
=
data
.
HotelRow
.
HotelId
,
data
.
parameters
.
HotelName
=
data
.
HotelRow
.
HotelName
data
.
parameters
.
Date
=
hotel
.
DateStr
data
.
parameters
.
RemainingInventory
=
hotel
.
RemainingInventory
,
roomTyps
.
forEach
((
x
:
any
,
i
:
number
)
=>
{
if
(
tempPrice
[
x
]
>
0
){
let
dataMsg
=
{
...
...
@@ -142,7 +233,8 @@
Date
:
hotel
.
DateStr
,
RoomType
:
i
+
1
,
Unit_Price
:
tempPrice
[
x
],
Number
:
1
,
Number
:
0
,
PeopleNumber
:
1
,
Destription
:
''
,
TaxesPrice
:
tempPrice
.
TaxesPrice
,
PriceInTangTax
:
tempPrice
.
PriceInTangTax
,
...
...
@@ -151,6 +243,25 @@
data
.
parameters
.
DetailList
.
push
(
dataMsg
)
}
})
HotelCarList
.
_value
.
forEach
(
item
=>
{
if
(
item
.
HotelId
==
data
.
HotelRow
.
HotelId
){
if
(
item
.
timeList
.
length
>
0
){
item
.
timeList
.
forEach
(
x
=>
{
if
(
x
.
Date
==
hotel
.
DateStr
){
x
.
rooms
.
forEach
(
room
=>
{
data
.
parameters
.
DetailList
.
forEach
(
j
=>
{
if
(
j
.
RoomType
==
room
.
RoomType
){
j
.
Number
=
room
.
Number
j
.
PeopleNumber
=
room
.
PeopleNumber
}
})
})
}
})
}
}
})
},
}
onMounted
(()
=>
{
...
...
src/i18n/zh-TW/index.ts
View file @
1aa7a293
...
...
@@ -46,7 +46,8 @@ export default {
between
:
'间'
,
},
shopping
:{
labelNum
:
'數量'
,
labelNum
:
'房數'
,
peopleNum
:
'人數'
,
small
:
'數量不能小於'
,
big
:
'大於剩餘數嘚'
,
StandardRooms
:
'標間'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment