Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jijin
/
dance-pc
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
566e93c5
authored
2025-05-19 15:43:42 +0800
by
华明祺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
no message
1 parent
8cdfd2c8
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
420 additions
and
82 deletions
src/apiPc/booking.js
src/viewsPc/booking/component/choosePerson.vue
src/viewsPc/booking/pay.vue
src/viewsPc/booking/travelDetail.vue
src/viewsPc/booking/travelOrder.vue
vite.config.js
src/apiPc/booking.js
View file @
566e93c
...
...
@@ -72,6 +72,14 @@ export function newsSubmitOrderHotel(data) {
})
}
export
function
submitOrderScenic
(
data
)
{
return
request
({
url
:
`/ota/norder/submitOrderScenic`
,
method
:
'post'
,
data
:
data
})
}
export
function
getRoomBilldetailbyId
(
params
)
{
return
request
({
url
:
`/ota/orderRoom/getRoomOrderInfoByOrderId`
,
...
...
@@ -533,6 +541,22 @@ export function aadCustomer(data) {
})
}
export
function
aadSceneCustomer
(
data
)
{
return
request
({
url
:
`/ota/customer/insertSceneCustomer`
,
method
:
'post'
,
data
})
}
export
function
checkSceneCustomer
(
data
)
{
return
request
({
url
:
`/ota/orderTourist/checkDiscounts`
,
method
:
'post'
,
data
})
}
// 删除观影人
export
function
delCustomer
(
id
)
{
return
request
({
...
...
@@ -575,3 +599,12 @@ export function getGateListByLasId(params) {
params
})
}
export
function
getMyFriends
()
{
return
request
({
url
:
`/ota/orderTourist/getMyFriends`
,
method
:
'get'
})
}
...
...
src/viewsPc/booking/component/choosePerson.vue
0 → 100644
View file @
566e93c
<
template
>
<el-dialog
v-model=
"show"
title=
"出行人信息"
center
append-to-body
>
<el-form>
<el-form-item
prop=
"message"
>
<div
class=
"p_box"
>
<div
class=
"people"
>
<el-radio-group
v-model=
"personId"
>
<div
v-for=
"(it, index) in personList"
:key=
"index"
class=
"prople_item"
>
<el-radio
:value=
"it.id"
:disabled=
"hasPersonIds?.indexOf(it.id)!=-1"
>
<div>
{{
it
.
name
}}
{{
it
.
idCard
}}
</div>
</el-radio>
</div>
</el-radio-group>
</div>
<el-button
@
click=
"addPeopl"
>
{{
languageFormat
(
language
,
"新增"
,
"Add"
)
}}
</el-button>
</div>
</el-form-item>
</el-form>
<template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
@
click=
"show = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"addPerson"
>
完成
</el-button>
</div>
</
template
>
</el-dialog>
<el-dialog
v-model=
"showAdd"
title=
"新增出现人"
center
append-to-body
>
<el-form
ref=
"formRef"
:model=
"form"
label-width=
"100px"
size=
"large"
style=
"margin: 80px"
>
<el-form-item
:label=
"language==0?'姓名':'name'"
prop=
"name"
required
:show-message=
"false"
>
<el-input
v-model=
"form.name"
:placeholder=
"language==0?'请输入':'Please input'"
/>
</el-form-item>
<el-form-item
:label=
"language==0?'证件类型':'ID Type'"
prop=
"idcType"
required
:show-message=
"false"
>
<el-select
v-model=
"form.idcType"
:placeholder=
"language==0?'请选择':'Please choose'"
>
<el-option
:label=
"language==0?'身份证':'Identity card'"
value=
"0"
/>
<el-option
:label=
"language==0?'护照':'Passport'"
value=
"1"
/>
<el-option
:label=
"language==0?'其他':'Other'"
value=
"2"
/>
</el-select>
</el-form-item>
<el-form-item
:label=
"language==0?'证件号':'ID number'"
prop=
"idCard"
required
:show-message=
"false"
>
<el-input
v-model=
"form.idCard"
:placeholder=
"language==0?'请输入证件号':'Please enter the ID after ah'"
/>
</el-form-item>
</el-form>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
class=
"can_pay"
@
click=
"showAdd = false"
>
{{
language
==
0
?
'取 消'
:
'cancel'
}}
</el-button>
<el-button
class=
"pay"
type=
"primary"
@
click=
"submit"
>
{{
language
==
0
?
'确 定'
:
'confirm'
}}
</el-button>
</div>
</
template
>
</el-dialog>
</template>
<
script
setup
>
import
{
aadSceneCustomer
,
checkSceneCustomer
,
getMyFriends
}
from
'/@/apiPc/booking'
import
{
languageFormat
}
from
'/@/viewsPc/seat/utils/language'
import
{
onMounted
,
ref
}
from
'vue'
import
{
useStorage
}
from
'@vueuse/core/index'
import
_
from
'lodash'
import
{
getCurrentInstance
}
from
'@vue/runtime-core'
const
emit
=
defineEmits
([
'addPerson'
])
const
{
proxy
}
=
getCurrentInstance
()
const
show
=
ref
(
false
)
const
showAdd
=
ref
(
false
)
const
personList
=
ref
([])
const
personId
=
ref
(
null
)
const
hasPersonIds
=
ref
(
null
)
const
language
=
useStorage
(
'language'
,
0
)
const
form
=
ref
({})
const
formRef
=
ref
(
null
)
onMounted
(()
=>
{
getData
()
})
const
getData
=
()
=>
{
getMyFriends
().
then
((
res
)
=>
{
personList
.
value
=
res
.
data
})
}
const
addPeopl
=
()
=>
{
formRef
.
value
?.
resetFields
()
showAdd
.
value
=
true
}
const
addPerson
=
()
=>
{
const
person
=
_
.
find
(
personList
.
value
,
(
it
)
=>
it
.
id
==
personId
.
value
)
checkSceneCustomer
({
customerId
:
person
.
id
,
gateType
:
currParams
.
gateType
}).
then
((
res
)
=>
{
if
(
res
.
data
==
201
)
{
proxy
.
$modal
.
msgError
(
'护照只能购买成人票'
)
}
else
if
(
res
.
data
==
202
)
{
proxy
.
$modal
.
msgError
(
'此身份证不能购买老人票'
)
}
else
if
(
res
.
data
==
203
)
{
proxy
.
$modal
.
msgError
(
'此身份证不能购买儿童票'
)
}
else
{
show
.
value
=
false
emit
(
'addPerson'
,
Object
.
assign
(
currParams
,
{
customerId
:
person
.
id
,
name
:
person
.
name
,
idcType
:
person
.
idcType
,
idCard
:
person
.
idCard
}))
}
})
}
const
submit
=
()
=>
{
formRef
.
value
.
validate
((
valid
)
=>
{
if
(
valid
)
{
aadSceneCustomer
(
form
.
value
).
then
(
res
=>
{
if
(
res
.
data
==
-
100
)
{
proxy
.
$modal
.
msgError
(
'人员信息已存在'
)
}
else
if
(
res
.
data
==
-
101
)
{
proxy
.
$modal
.
msgError
(
'实名认证未通过'
)
}
else
{
proxy
.
$modal
.
msgSuccess
(
language
.
value
==
0
?
'添加成功'
:
'successfully added'
)
showAdd
.
value
=
false
getData
()
}
})
}
else
{
proxy
.
$modal
.
msgWarning
(
language
.
value
==
0
?
'请完善信息'
:
'Please complete the information'
)
}
})
}
let
currParams
defineExpose
({
open
:
(
params
)
=>
{
currParams
=
params
personId
.
value
=
params
.
customerId
hasPersonIds
.
value
=
params
.
hasCustomerIds
show
.
value
=
true
}
})
</
script
>
<
style
scoped
lang=
"scss"
>
</
style
>
src/viewsPc/booking/pay.vue
View file @
566e93c
...
...
@@ -163,6 +163,55 @@
<
/el-row
>
<
/div
>
<
/div
>
<
div
v
-
if
=
"type == 'travel'"
>
<
div
class
=
"leftboderTT"
>
{{
language
==
0
?
'购票信息'
:
'Ticket Information'
}}
<
/div
>
<
div
class
=
"border-info mt20"
>
<
h3
>
{{
matchForm
.
name
}}
<
/h3
>
<
el
-
row
>
<
el
-
col
>
{{
language
==
0
?
'地址'
:
'Address'
}}
:
{{
matchForm
.
address
}}
<
/el-col
>
<
el
-
col
>
{{
form
?.
extJson
?.
ticketType
?.
name
}}
:{{
form
?.
extJson
?.
num
}}
{{
language
==
0
?
'张'
:
'Tickets'
}}
<
/el-col
>
<
el
-
col
>
{{
language
==
0
?
'时间'
:
'Time'
}}
:
{{
dayjs
(
form
?.
extJson
?.
ticketDate
?.
ticketStart
).
format
(
'YYYY-MM-DD'
)
}}
{{
form
.
extJson
?.
ticketDate
?.
ticketType
==
1
?
'~'
+
dayjs
(
form
?.
extJson
?.
ticketDate
?.
ticketEnd
).
format
(
'YYYY-MM-DD'
)
:
''
}}
<
/el-col
>
<
el
-
col
v
-
if
=
"form?.extJson?.ticketDate?.isCountSale==1"
>
{{
language
==
0
?
`满${form?.extJson?.ticketDate.counts
}
人优惠`
:
`Discount for up to ${form?.extJson?.ticketDate.counts
}
people`
}}
<
span
v
-
if
=
"language == 0"
>
{{
form
?.
extJson
?.
ticketDate
.
discount
}}
折
<
/span
>
<
span
v
-
else
>
{{
(
10
-
form
?.
extJson
?.
ticketDate
.
discount
)
*
10
+
'%'
}}
off
<
/span
>
<
/el-col
>
<!--
<
el
-
col
>-->
<!--
{{
-->
<!--
language
==
0
?
'原价票'
:
'Cost Ticket'
-->
<!--
}}
:
{{
-->
<!--
language
==
0
?
form
?.
extJson
?.
ticketDate
?.
price
:
form
?.
extJson
?.
ticketDate
?.
priceEn
-->
<!--
}}
{{
language
==
0
?
'元'
:
'Euro'
}}
x
1
-->
<!--
{{
language
==
0
?
'张'
:
'Tickets'
}}
-->
<!--
<
/el-col>--
>
<!--
<
el
-
col
>-->
<!--
{{
-->
<!--
language
==
0
?
'优惠票'
:
'Concession Ticket'
-->
<!--
}}
:
{{
-->
<!--
language
==
0
?
form
?.
extJson
?.
ticketDate
?.
rebatePrice
:
form
?.
extJson
?.
ticketDate
?.
rebatePriceEn
-->
<!--
}}
{{
language
==
0
?
'元'
:
'Euro'
}}
x
1
-->
<!--
{{
language
==
0
?
'张'
:
'Tickets'
}}
-->
<!--
<
/el-col>--
>
<
/el-row
>
<
/div
>
<
/div
>
<
div
class
=
"leftboderTT"
>
{{
language
==
0
?
'预订信息'
:
'Booking information'
}}
<
/div
>
...
...
@@ -328,7 +377,56 @@
<
/el-row
>
<
/el-row
>
<
el
-
row
v
-
if
=
"type == 'travel'"
style
=
"width: 100%"
>
<
el
-
row
v
-
for
=
"v in form.extJson?.message"
style
=
"width: 100%"
>
<
el
-
col
:
lg
=
"8"
:
md
=
"12"
:
sm
=
"12"
:
xs
=
"24"
>
<
div
>
{{
v
.
name
}}
<
/div
>
<
/el-col
>
<
el
-
col
:
lg
=
"8"
:
md
=
"12"
:
sm
=
"12"
:
xs
=
"24"
>
<!--
<
div
>
{{
-->
<!--
!
v
.
discount
?
language
==
0
?
'原价票'
:
'Cost Ticket'
:
language
==
0
?
'优惠票'
:
'Concession Ticket'
-->
<!--
}}
-->
<!--
<
/div>--
>
<
div
>
{{
v
.
idCard
}}
<
/div
>
<
/el-col
>
<
el
-
col
:
lg
=
"8"
:
md
=
"12"
:
sm
=
"12"
:
xs
=
"24"
>
<
div
v
-
if
=
"language == 0 "
>
{{
language
==
0
?
'¥'
:
'€'
}}
{{
!
v
.
discount
?
form
.
extJson
?.
ticketDate
?.
price
:
form
.
extJson
?.
ticketDate
?.
rebatePrice
}}
/{{ language == 0
?
'张' : 'Tickets'
}}
<
/div
>
<
div
v
-
else
>
{{
language
==
0
?
'¥'
:
'€'
}}
{{
!
v
.
discount
?
form
.
extJson
?.
ticketDate
?.
priceEn
:
form
.
extJson
?.
ticketDate
?.
rebatePriceEn
}}
/{{ language == 0
?
'张' : 'Tickets'
}}
<
/div
>
<
/el-col
>
<
/el-row
>
<
el
-
row
style
=
"width: 100%"
>
<
el
-
col
:
lg
=
"8"
:
md
=
"12"
:
sm
=
"12"
:
xs
=
"24"
>
<
div
>
{{
language
==
0
?
'购票数量'
:
'Number of tickets purchased'
}}
:
{{
form
.
num
}}
{{
language
==
0
?
'张'
:
'Tickets'
}}
<
/div
>
<
/el-col
>
<
el
-
col
:
lg
=
"8"
:
md
=
"12"
:
sm
=
"12"
:
xs
=
"24"
>
{{
language
==
0
?
'联系方式'
:
'Contact Information'
}}
:
{{
form
.
phone
}}
<
/el-col
>
<
el
-
col
:
lg
=
"8"
:
md
=
"12"
:
sm
=
"12"
:
xs
=
"24"
>
{{
language
==
0
?
'共计'
:
'total'
}}
:{{
language
==
0
?
'¥'
:
'€'
}}
{{
Number
(
totalFee
).
toFixed
(
2
)
}}
<
/el-col
>
<
/el-row
>
<
/el-row
>
<
/div
>
<
el
-
row
align
=
"middle"
justify
=
"space-between"
>
...
...
src/viewsPc/booking/travelDetail.vue
View file @
566e93c
...
...
@@ -173,7 +173,6 @@ const formTime = ref({})
let
baseHotTime
onMounted
(()
=>
{
console
.
log
(
route
.
params
)
getBaseInfoByActiveId
(
route
.
params
.
cptId
).
then
(
res
=>
{
formTime
.
value
=
res
.
data
||
null
}).
catch
(
err
=>
{
...
...
@@ -323,7 +322,7 @@ function goNext() {
start
:
dayjs
(
currentDate
.
value
).
format
(
'YYYY-MM-DD'
)
},
query
:
{
lasId
:
query
.
value
.
i
d
lasId
:
query
.
value
.
lasI
d
}
})
}
...
...
src/viewsPc/booking/travelOrder.vue
View file @
566e93c
...
...
@@ -60,38 +60,41 @@
<!-- :picker-options="pickerOptions"-->
</el-form-item>
<el-form-item
v-for=
"(n,i) in gateList"
:key=
"i"
:label=
"language==0? n.name:'Rooms'"
required
prop=
"roomNum"
>
<el-input-number
v-model=
"n.count"
:min=
"0"
:max=
"n.leftNum"
@
change=
"changeRoomNum(n)"
/>
<el-form-item
v-for=
"(n,i) in gateList"
:key=
"i"
:label=
"language==0? n.name:'Rooms'"
prop=
"count"
>
<el-input-number
v-model=
"n.count"
:min=
"0"
:max=
"n.leftNum"
@
change=
"changeNum(n)"
/>
<div
class=
"red ml20"
>
<span
v-if=
"language == 0"
>
单价:
{{
n
.
price
}}
</span>
<span
v-else
>
{{
n
.
priceEn
}}
</span>
</div>
<div
class=
"red ml20"
>
<span
v-if=
"language == 0"
>
剩余票数:
{{
n
.
leftNum
}}
</span>
<span
v-else
>
{{
n
.
leftNum
}}
Remaining rooms
</span>
</div>
<div
v-if=
"language==1"
class=
"tip"
>
If you need to make a hotel reservation, please fill in the full names of all required persons when booking the hotel. (For two or more people, please use ',')
</div>
</el-form-item>
<div
class=
"fakeFormItem"
>
<div
v-if=
"needPersonNum>0"
class=
"fakeFormItem"
>
<label>
需填写
{{
needPersonNum
}}
位游客
</label>
<div>
<div
v-show=
"needPersonNum > form.personArr.length"
>
还需填写
{{
needPersonNum
-
form
.
personArr
.
length
}}
位游客
</div>
<div>
<el-button
plain
type=
"primary"
@
click=
"showAddPerson"
>
新增出行人
</el-button>
<div
v-show=
"needPersonNum > hasPersonNum"
>
还需填写
{{
needPersonNum
-
hasPersonNum
}}
位游客
</div>
</div>
</div>
</div>
<div
v-show=
"form.personArr.length>0"
>
<div
v-for=
"(n,index) in form.personArr"
class=
"fakeFormItem personIt"
>
<div
v-for=
"(n,i) in gateList"
:key=
"i"
>
<div
v-for=
"(p,j) in n.personArr"
:key=
"j"
class=
"fakeFormItem personIt"
>
<label>
<el-icon
@
click=
"delPerson(n,
index
)"
><Remove
/></el-icon>
游客
{{
index
+
1
}}
<el-icon
@
click=
"delPerson(n,
j
)"
><Remove
/></el-icon>
{{
n
.
name
}}{{
j
+
1
}}
</label>
<div
class=
"mation"
>
<div>
{{
n
.
name
}}
</div>
身份证:
{{
n
.
idcCode
}}
<div>
{{
p
.
name
}}
</div>
身份证:
{{
p
.
idCard
}}
</div>
<el-icon
@
click=
"showAddPerson(n)"
><Edit
/></el-icon>
<el-icon
@
click=
"showAddPerson(n
, j,p
)"
><Edit
/></el-icon>
</div>
</div>
<el-form-item
:label=
"language==0?'联系人':'Contact'"
required
prop=
"contacts"
>
<el-input
v-model=
"form.contacts"
/>
</el-form-item>
<el-form-item
:label=
"language==0?'联系手机':'Contact phone'"
required
prop=
"phone"
>
<el-input
v-model=
"form.phone"
/>
</el-form-item>
...
...
@@ -103,20 +106,12 @@
<div
class=
"leftboderTT"
>
{{
language
==
0
?
'订单明细'
:
'Order details'
}}
</div>
<div
class=
"border-rr mt20 pd20 ccitemBox"
>
<label>
{{
language
==
0
?
'基本费用'
:
'Room fee'
}}
<span
v-if=
"language==0"
class=
"fr"
>
{{
language
==
0
?
'¥'
:
'€'
}}{{
(
form
.
roomNum
*
choseRooms
.
length
).
toFixed
(
2
)
}}
</span>
<span
v-else
class=
"fr"
>
{{
language
==
0
?
'¥'
:
'€'
}}{{
(
form
.
roomNum
*
choseRooms
.
length
).
toFixed
(
2
)
}}
</span>
</label>
<div
v-for=
"(c, index) in choseRooms"
v-show=
"form.roomNum>0"
:key=
"index"
class=
"ccitem"
>
{{
c
}}
<span
v-if=
"language==0"
>
{{
form
.
roomNum
}}
*
{{
language
==
0
?
'¥'
:
'€'
}}{{
room
.
roomPrice
}}
</span>
<span
v-else
>
{{
form
.
roomNum
}}
*
{{
language
==
0
?
'¥'
:
'€'
}}{{
room
.
roomPriceEn
}}
</span>
<div
v-for=
"(c, index) in gateList"
v-show=
"c.count>0"
:key=
"index"
class=
"ccitem"
>
<span
v-if=
"language==0"
>
{{
c
.
count
}}
*
{{
'¥'
}}{{
c
.
price
}}
</span>
<span
v-else
>
{{
c
.
count
}}
*
{{
'€'
}}{{
c
.
priceEn
}}
</span>
</div>
<label>
{{
language
==
0
?
'共计'
:
'Total'
}}
<span
class=
"fr bigMoney"
>
{{
language
==
0
?
'¥'
:
'€'
}}{{
money
}}
</span></label>
...
...
@@ -139,27 +134,9 @@
</el-row>
</el-card>
<div
style=
"height: 60px;"
/>
</div>
<el-dialog
v-model=
"show"
title=
"出行人信息"
width=
"500px"
center
>
<div>
<el-form
ref=
"personRef"
label-width=
"100"
>
<el-form-item
label=
"姓名"
>
<el-input
v-model=
"person.name"
placeholder=
"请与证件姓名一致"
/>
</el-form-item>
<el-form-item
label=
"证件号"
>
<el-input
v-model=
"person.idcCode"
placeholder=
"请填写身份证号"
/>
</el-form-item>
</el-form>
</div>
<template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
@
click=
"show = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"addPerson"
>
完成
</el-button>
</div>
</
template
>
</el-dialog>
<choose-person
ref=
"choosePersonRef"
@
add-person=
"addPerson"
/>
</div>
</
template
>
...
...
@@ -167,11 +144,17 @@
import
{
useRouter
,
useRoute
}
from
'vue-router'
import
{
ref
,
onMounted
}
from
'vue'
import
{
useStorage
}
from
'@vueuse/core/index'
import
{
getBaseInfoByActiveId
,
getGateListByLasId
,
getScenicById
,
newsSubmitOrderHotel
}
from
'@/apiPc/booking'
import
{
getBaseInfoByActiveId
,
getGateListByLasId
,
getScenicById
,
submitOrderScenic
}
from
'@/apiPc/booking'
import
dayjs
from
'dayjs'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
useUserStore
from
'@/store/modules/user'
import
_
from
'lodash'
import
ChoosePerson
from
'./component/choosePerson.vue'
const
user
=
useUserStore
().
user
const
language
=
useStorage
(
'language'
,
0
)
...
...
@@ -181,6 +164,7 @@ const room = ref({})
const
loading
=
ref
(
false
)
const
canOrderNum
=
ref
(
0
)
const
needPersonNum
=
ref
(
0
)
const
hasPersonNum
=
ref
(
0
)
const
person
=
ref
({
name
:
''
,
idcCode
:
''
...
...
@@ -189,13 +173,15 @@ const show = ref(false)
const
lform
=
ref
({})
const
scenicItem
=
ref
({})
const
form
=
ref
({
contacts
:
user
?.
nickName
||
''
,
phone
:
user
?.
phonenumber
||
''
,
personArr
:
[]
touristList
:
[]
})
const
rzRange
=
ref
(
''
)
const
gateList
=
ref
([])
const
money
=
ref
(
0
)
const
choseRooms
=
ref
([])
const
choosePersonRef
=
ref
([])
const
rules
=
ref
({
phone
:
{
required
:
true
,
message
:
language
.
value
==
0
?
'请输入联系电话'
:
'Please enter a contact number'
,
trigger
:
'blur'
}
})
...
...
@@ -231,6 +217,7 @@ function getGate() {
_
.
each
(
gateList
.
value
,
item
=>
{
item
.
count
=
0
item
.
leftNum
=
item
.
num
-
item
.
orderCount
item
.
personArr
=
[]
})
}).
finally
(()
=>
{
loading
.
value
=
false
...
...
@@ -254,45 +241,82 @@ function dateChange() {
getGate
()
}
function
changeRoomNum
(
e
)
{
console
.
log
(
e
)
countMoney
()
const
checkPersonNum
=
()
=>
{
needPersonNum
.
value
=
0
hasPersonNum
.
value
=
0
_
.
each
(
gateList
.
value
,
item
=>
{
needPersonNum
.
value
+=
item
.
count
_
.
each
(
item
.
personArr
,
person
=>
{
if
(
person
.
customerId
)
{
hasPersonNum
.
value
++
}
})
})
}
const
showAddPerson
=
(
item
)
=>
{
if
(
item
)
{
person
.
value
=
item
}
else
{
person
.
value
=
{
function
changeNum
(
e
)
{
checkPersonNum
()
if
(
e
.
personArr
.
length
<
e
.
count
)
{
e
.
personArr
.
push
({
customerId
:
''
,
name
:
''
,
idcCode
:
''
}
idcType
:
''
,
idCard
:
''
})
}
else
if
(
e
.
personArr
.
length
>
e
.
count
)
{
e
.
personArr
.
splice
(
e
.
count
)
}
show
.
value
=
true
countMoney
()
}
const
addPerson
=
()
=>
{
if
(
!
person
.
value
.
name
)
{
ElMessage
.
warning
(
language
.
value
==
0
?
'请填写姓名'
:
'Please fill in the name'
)
return
const
showAddPerson
=
(
item
,
index
,
person
)
=>
{
const
customerIds
=
[]
_
.
each
(
gateList
.
value
,
(
g
)
=>
{
_
.
each
(
g
.
personArr
,
(
p
)
=>
{
if
(
p
.
customerId
&&
p
.
customerId
!=
person
.
customerId
)
{
customerIds
.
push
(
p
.
customerId
)
}
if
(
!
person
.
value
.
idcCode
)
{
ElMessage
.
warning
(
language
.
value
==
0
?
'请填写身份证号'
:
'Please fill in the ID number'
)
return
})
})
choosePersonRef
.
value
.
open
({
gateId
:
item
.
id
,
gateType
:
item
.
gateType
,
personIndex
:
index
,
customerId
:
person
.
customerId
,
hasCustomerIds
:
customerIds
.
join
(
','
)
})
}
const
addPerson
=
(
item
)
=>
{
const
gate
=
_
.
find
(
gateList
.
value
,
(
g
)
=>
g
.
id
==
item
.
gateId
)
gate
.
personArr
[
item
.
personIndex
]
=
{
customerId
:
item
.
customerId
,
name
:
item
.
name
,
idcType
:
item
.
idcType
,
idCard
:
item
.
idCard
}
form
.
value
.
personArr
.
push
(
person
.
value
)
show
.
value
=
false
checkPersonNum
()
}
const
delPerson
=
(
item
,
index
)
=>
{
form
.
value
.
personArr
.
splice
(
index
,
1
)
item
.
personArr
.
splice
(
index
,
1
)
item
.
count
--
checkPersonNum
()
countMoney
()
}
function
countMoney
()
{
if
(
language
.
value
==
0
)
{
money
.
value
=
((
form
.
value
.
roomNum
*
usedays
)
+
(
form
.
value
.
addNum
*
usedays
)).
toFixed
(
2
)
}
else
{
money
.
value
=
((
form
.
value
.
roomNum
*
usedays
)
+
(
form
.
value
.
addNum
*
usedays
)).
toFixed
(
2
)
money
.
value
=
0
_
.
each
(
gateList
.
value
,
(
g
)
=>
{
if
(
g
.
count
>
0
)
{
money
.
value
+=
g
.
count
*
(
language
.
value
==
0
?
g
.
price
:
g
.
priceEn
)
}
if
(
money
.
value
==
'NaN'
)
money
.
value
=
0.00
})
money
.
value
=
(
money
.
value
).
toFixed
(
2
)
}
function
submit
()
{
...
...
@@ -300,12 +324,11 @@ function submit() {
useUserStore
().
setReLogin
()
return
}
if
(
!
rzRange
.
value
)
return
ElMessage
.
warning
(
language
.
value
==
0
?
'请选择预订日期'
:
'Please select check-in time'
)
if
(
!
form
.
value
.
phone
)
{
ElMessage
.
warning
(
language
.
value
==
0
?
'请填写手机号'
:
'Please fill in the phone number'
)
return
}
if
(
form
.
value
.
personArr
.
length
!=
need
PersonNum
.
value
)
{
if
(
needPersonNum
.
value
!=
has
PersonNum
.
value
)
{
ElMessage
.
warning
(
language
.
value
==
0
?
'出行人数与票数不匹配'
:
'The number of people travelling does not match the number of rooms'
)
return
}
...
...
@@ -316,11 +339,38 @@ function submit() {
cancelButtonText
:
language
.
value
==
0
?
'取消'
:
'Cancel'
,
type
:
'warning'
}).
then
(()
=>
{
newsSubmitOrderHotel
(
form
.
value
).
then
(
res
=>
{
form
.
value
.
activeId
=
route
.
params
.
cptId
form
.
value
.
asId
=
route
.
query
.
lasId
form
.
value
.
orderName
=
scenicItem
.
value
.
name
form
.
value
.
dcStart
=
rzRange
.
value
const
personArr
=
[]
_
.
each
(
gateList
.
value
,
(
item
)
=>
{
if
(
item
.
count
>
0
)
{
_
.
each
(
item
.
personArr
,
(
person
)
=>
{
personArr
.
push
({
activeId
:
route
.
params
.
cptId
,
asId
:
item
.
lasId
,
asgId
:
item
.
lasgId
,
asgcId
:
item
.
id
,
gateName
:
item
.
name
,
gateType
:
item
.
gateType
,
price
:
language
.
value
==
0
?
item
.
price
:
item
.
priceEn
,
paymentType
:
language
.
value
==
0
?
'1'
:
'3'
,
customerId
:
person
.
customerId
,
name
:
person
.
name
,
idcType
:
person
.
idcType
,
idCard
:
person
.
idCard
})
})
}
})
form
.
value
.
touristList
=
personArr
submitOrderScenic
(
form
.
value
).
then
(
res
=>
{
if
(
res
.
data
)
{
if
(
res
.
data
.
roomNum
==
-
100
)
{
ElMessage
.
warning
(
language
.
value
==
0
?
'剩余票数不足'
:
'The remaining number of rooms is insufficient'
)
checkreRooms
()
}
else
{
// 去付钱
router
.
push
({
...
...
@@ -328,7 +378,7 @@ function submit() {
query
:
{
orderId
:
res
.
data
.
orderId
,
money
:
res
.
data
.
total
,
type
:
'
hot
el'
type
:
'
trav
el'
}
})
}
...
...
vite.config.js
View file @
566e93c
...
...
@@ -81,8 +81,8 @@ export default defineConfig(({ mode, command }) => {
rewrite
:
(
p
)
=>
p
.
replace
(
/^
\/
dev-api
\/
ztx-webSite/
,
''
)
},
'/dev-api'
:
{
//
target: 'http://192.168.1.118:8081/',
target
:
'http://192.168.1.253:8081'
,
target
:
'http://192.168.1.118:8081/'
,
//
target: 'http://192.168.1.253:8081',
// target: 'https://jijin.wtwuxicenter.com/stage-api',
// target: 'https://wdsfwuxicenter.com/stage-api/',
changeOrigin
:
true
,
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment