566e93c5 by 华明祺

no message

1 parent 8cdfd2c8
...@@ -72,6 +72,14 @@ export function newsSubmitOrderHotel(data) { ...@@ -72,6 +72,14 @@ export function newsSubmitOrderHotel(data) {
72 }) 72 })
73 } 73 }
74 74
75 export function submitOrderScenic(data) {
76 return request({
77 url: `/ota/norder/submitOrderScenic`,
78 method: 'post',
79 data: data
80 })
81 }
82
75 export function getRoomBilldetailbyId(params) { 83 export function getRoomBilldetailbyId(params) {
76 return request({ 84 return request({
77 url: `/ota/orderRoom/getRoomOrderInfoByOrderId`, 85 url: `/ota/orderRoom/getRoomOrderInfoByOrderId`,
...@@ -533,6 +541,22 @@ export function aadCustomer(data) { ...@@ -533,6 +541,22 @@ export function aadCustomer(data) {
533 }) 541 })
534 } 542 }
535 543
544 export function aadSceneCustomer(data) {
545 return request({
546 url: `/ota/customer/insertSceneCustomer`,
547 method: 'post',
548 data
549 })
550 }
551
552 export function checkSceneCustomer(data) {
553 return request({
554 url: `/ota/orderTourist/checkDiscounts`,
555 method: 'post',
556 data
557 })
558 }
559
536 // 删除观影人 560 // 删除观影人
537 export function delCustomer(id) { 561 export function delCustomer(id) {
538 return request({ 562 return request({
...@@ -575,3 +599,12 @@ export function getGateListByLasId(params) { ...@@ -575,3 +599,12 @@ export function getGateListByLasId(params) {
575 params 599 params
576 }) 600 })
577 } 601 }
602
603 export function getMyFriends() {
604 return request({
605 url: `/ota/orderTourist/getMyFriends`,
606 method: 'get'
607 })
608 }
609
610
......
1 <template>
2 <el-dialog v-model="show" title="出行人信息" center append-to-body>
3 <el-form>
4 <el-form-item prop="message">
5 <div class="p_box">
6 <div class="people">
7 <el-radio-group v-model="personId">
8 <div
9 v-for="(it, index) in personList" :key="index" class="prople_item"
10 >
11 <el-radio :value="it.id" :disabled="hasPersonIds?.indexOf(it.id)!=-1">
12 <div>
13 {{ it.name }} {{ it.idCard }}
14 </div>
15 </el-radio>
16 </div>
17 </el-radio-group>
18 </div>
19 <el-button @click="addPeopl">{{ languageFormat(language, "新增", "Add") }}</el-button>
20 </div>
21 </el-form-item>
22 </el-form>
23 <template #footer>
24 <div class="dialog-footer">
25 <el-button @click="show = false">取 消</el-button>
26 <el-button type="primary" @click="addPerson">完成</el-button>
27 </div>
28 </template>
29 </el-dialog>
30
31
32 <el-dialog v-model="showAdd" title="新增出现人" center append-to-body>
33 <el-form
34 ref="formRef" :model="form" label-width="100px" size="large"
35 style="margin: 80px"
36 >
37 <el-form-item :label="language==0?'姓名':'name'" prop="name" required :show-message="false">
38 <el-input v-model="form.name" :placeholder="language==0?'请输入':'Please input'" />
39 </el-form-item>
40 <el-form-item :label="language==0?'证件类型':'ID Type'" prop="idcType" required :show-message="false">
41 <el-select v-model="form.idcType" :placeholder="language==0?'请选择':'Please choose'">
42 <el-option :label="language==0?'身份证':'Identity card'" value="0" />
43 <el-option :label="language==0?'护照':'Passport'" value="1" />
44 <el-option :label="language==0?'其他':'Other'" value="2" />
45 </el-select>
46 </el-form-item>
47 <el-form-item :label="language==0?'证件号':'ID number'" prop="idCard" required :show-message="false">
48 <el-input v-model="form.idCard" :placeholder="language==0?'请输入证件号':'Please enter the ID after ah'" />
49 </el-form-item>
50 </el-form>
51
52 <template #footer>
53 <div class="dialog-footer">
54 <el-button class="can_pay" @click="showAdd = false">{{ language == 0 ? '取 消' : 'cancel' }}</el-button>
55 <el-button class="pay" type="primary" @click="submit">{{ language == 0 ? '确 定' : 'confirm' }}</el-button>
56 </div>
57 </template>
58 </el-dialog>
59
60 </template>
61
62 <script setup>
63 import { aadSceneCustomer, checkSceneCustomer, getMyFriends } from '/@/apiPc/booking'
64 import { languageFormat } from '/@/viewsPc/seat/utils/language'
65 import { onMounted, ref } from 'vue'
66 import { useStorage } from '@vueuse/core/index'
67 import _ from 'lodash'
68 import { getCurrentInstance } from '@vue/runtime-core'
69
70 const emit = defineEmits(['addPerson'])
71 const { proxy } = getCurrentInstance()
72
73 const show = ref(false)
74 const showAdd = ref(false)
75 const personList = ref([])
76 const personId = ref(null)
77 const hasPersonIds = ref(null)
78 const language = useStorage('language', 0)
79 const form = ref({})
80 const formRef = ref(null)
81
82
83 onMounted(() => {
84 getData()
85 })
86
87 const getData = () => {
88 getMyFriends().then((res) => {
89 personList.value = res.data
90 })
91 }
92
93 const addPeopl = () => {
94 formRef.value?.resetFields()
95 showAdd.value = true
96 }
97
98 const addPerson = () => {
99 const person = _.find(personList.value, (it) => it.id == personId.value)
100
101 checkSceneCustomer({
102 customerId: person.id,
103 gateType: currParams.gateType
104 }).then((res) => {
105 if (res.data == 201) {
106 proxy.$modal.msgError('护照只能购买成人票')
107 } else if (res.data == 202) {
108 proxy.$modal.msgError('此身份证不能购买老人票')
109 } else if (res.data == 203) {
110 proxy.$modal.msgError('此身份证不能购买儿童票')
111 } else {
112 show.value = false
113 emit('addPerson', Object.assign(currParams, {
114 customerId: person.id,
115 name: person.name,
116 idcType: person.idcType,
117 idCard: person.idCard
118 }))
119 }
120 })
121 }
122
123 const submit = () => {
124 formRef.value.validate((valid) => {
125 if (valid) {
126 aadSceneCustomer(form.value).then(res => {
127 if (res.data == -100) {
128 proxy.$modal.msgError('人员信息已存在')
129 } else if (res.data == -101) {
130 proxy.$modal.msgError('实名认证未通过')
131 } else {
132 proxy.$modal.msgSuccess(language.value == 0 ? '添加成功' : 'successfully added')
133 showAdd.value = false
134 getData()
135 }
136 })
137 } else {
138 proxy.$modal.msgWarning(language.value == 0 ? '请完善信息' : 'Please complete the information')
139 }
140 })
141 }
142
143 let currParams
144 defineExpose({
145 open: (params) => {
146 currParams = params
147 personId.value = params.customerId
148 hasPersonIds.value = params.hasCustomerIds
149
150 show.value = true
151 }
152 })
153
154 </script>
155
156 <style scoped lang="scss">
157
158 </style>
...@@ -163,6 +163,55 @@ ...@@ -163,6 +163,55 @@
163 </el-row> 163 </el-row>
164 </div> 164 </div>
165 </div> 165 </div>
166 <div v-if="type == 'travel'">
167 <div class="leftboderTT">{{ language == 0 ? '购票信息' : 'Ticket Information' }}</div>
168 <div class="border-info mt20">
169 <h3>{{ matchForm.name }}</h3>
170 <el-row>
171 <el-col>
172 {{ language == 0 ? '地址' : 'Address' }}
173 {{ matchForm.address }}
174 </el-col>
175 <el-col>
176 {{
177 form?.extJson?.ticketType?.name
178 }}:{{ form?.extJson?.num }}{{ language == 0 ? '张' : 'Tickets' }}
179 </el-col>
180 <el-col>
181 {{
182 language == 0 ? '时间' : 'Time'
183 }}{{
184 dayjs(form?.extJson?.ticketDate?.ticketStart).format('YYYY-MM-DD')
185 }}{{
186 form.extJson?.ticketDate?.ticketType == 1 ? '~' + dayjs(form?.extJson?.ticketDate?.ticketEnd).format('YYYY-MM-DD') : ''
187 }}
188 </el-col>
189 <el-col v-if="form?.extJson?.ticketDate?.isCountSale==1">
190 {{
191 language == 0 ? `满${form?.extJson?.ticketDate.counts}人优惠` : `Discount for up to ${form?.extJson?.ticketDate.counts} people`
192 }}<span v-if="language == 0">{{ form?.extJson?.ticketDate.discount }}</span>
193 <span v-else>{{ (10 - form?.extJson?.ticketDate.discount) * 10 + '%' }}off</span>
194 </el-col>
195 <!-- <el-col>-->
196 <!-- {{-->
197 <!-- language == 0 ? '原价票' : 'Cost Ticket'-->
198 <!-- }}{{-->
199 <!-- language == 0 ? form?.extJson?.ticketDate?.price : form?.extJson?.ticketDate?.priceEn-->
200 <!-- }}{{ language == 0 ? '元' : 'Euro' }} x 1-->
201 <!-- {{ language == 0 ? '张' : 'Tickets' }}-->
202 <!-- </el-col>-->
203 <!-- <el-col>-->
204 <!-- {{-->
205 <!-- language == 0 ? '优惠票' : 'Concession Ticket'-->
206 <!-- }}{{-->
207 <!-- language == 0 ? form?.extJson?.ticketDate?.rebatePrice : form?.extJson?.ticketDate?.rebatePriceEn-->
208 <!-- }}{{ language == 0 ? '元' : 'Euro' }} x 1-->
209 <!-- {{ language == 0 ? '张' : 'Tickets' }}-->
210 <!-- </el-col>-->
211
212 </el-row>
213 </div>
214 </div>
166 215
167 <div class="leftboderTT">{{ language == 0 ? '预订信息' : 'Booking information' }}</div> 216 <div class="leftboderTT">{{ language == 0 ? '预订信息' : 'Booking information' }}</div>
168 217
...@@ -328,7 +377,56 @@ ...@@ -328,7 +377,56 @@
328 </el-row> 377 </el-row>
329 378
330 </el-row> 379 </el-row>
380 <el-row v-if="type == 'travel'" style="width: 100%">
381 <el-row v-for="v in form.extJson?.message" style="width: 100%">
382 <el-col :lg="8" :md="12" :sm="12" :xs="24">
383 <div>{{ v.name }}
384 </div>
385 </el-col>
386 <el-col :lg="8" :md="12" :sm="12" :xs="24">
387 <!-- <div>{{-->
388 <!-- !v.discount ? language == 0 ? '原价票' : 'Cost Ticket' : language == 0 ? '优惠票' : 'Concession Ticket'-->
389 <!-- }}-->
390 <!-- </div>-->
391 <div>{{ v.idCard }}
392 </div>
393 </el-col>
394 <el-col :lg="8" :md="12" :sm="12" :xs="24">
395 <div v-if="language == 0 ">
396 {{ language == 0 ? '¥' : '€' }}
397 {{
398 !v.discount ? form.extJson?.ticketDate?.price : form.extJson?.ticketDate?.rebatePrice
399 }}
400 /{{ language == 0 ? '张' : 'Tickets' }}
401 </div>
402 <div v-else>
403 {{ language == 0 ? '¥' : '€' }}
404 {{
405 !v.discount ? form.extJson?.ticketDate?.priceEn : form.extJson?.ticketDate?.rebatePriceEn
406 }}
407 /{{ language == 0 ? '张' : 'Tickets' }}
408 </div>
409 </el-col>
410 </el-row>
411 <el-row style="width: 100%">
412 <el-col :lg="8" :md="12" :sm="12" :xs="24">
413 <div>{{
414 language == 0 ? '购票数量' : 'Number of tickets purchased'
415 }}{{ form.num }}{{ language == 0 ? '张' : 'Tickets' }}
416 </div>
417 </el-col>
418 <el-col :lg="8" :md="12" :sm="12" :xs="24">{{
419 language == 0 ? '联系方式' : 'Contact Information'
420 }}{{ form.phone }}
421 </el-col>
422 <el-col :lg="8" :md="12" :sm="12" :xs="24">
423 {{ language == 0 ? '共计' : 'total' }}:{{
424 language == 0 ? '¥' : '€'
425 }}{{ Number(totalFee).toFixed(2) }}
426 </el-col>
427 </el-row>
331 428
429 </el-row>
332 </div> 430 </div>
333 431
334 <el-row align="middle" justify="space-between"> 432 <el-row align="middle" justify="space-between">
......
...@@ -173,7 +173,6 @@ const formTime = ref({}) ...@@ -173,7 +173,6 @@ const formTime = ref({})
173 let baseHotTime 173 let baseHotTime
174 174
175 onMounted(() => { 175 onMounted(() => {
176 console.log(route.params)
177 getBaseInfoByActiveId(route.params.cptId).then(res => { 176 getBaseInfoByActiveId(route.params.cptId).then(res => {
178 formTime.value = res.data || null 177 formTime.value = res.data || null
179 }).catch(err => { 178 }).catch(err => {
...@@ -323,7 +322,7 @@ function goNext() { ...@@ -323,7 +322,7 @@ function goNext() {
323 start: dayjs(currentDate.value).format('YYYY-MM-DD') 322 start: dayjs(currentDate.value).format('YYYY-MM-DD')
324 }, 323 },
325 query: { 324 query: {
326 lasId: query.value.id 325 lasId: query.value.lasId
327 } 326 }
328 }) 327 })
329 } 328 }
......
...@@ -60,38 +60,41 @@ ...@@ -60,38 +60,41 @@
60 60
61 <!-- :picker-options="pickerOptions"--> 61 <!-- :picker-options="pickerOptions"-->
62 </el-form-item> 62 </el-form-item>
63 <el-form-item v-for="(n,i) in gateList" :key="i" :label="language==0? n.name:'Rooms'" required prop="roomNum"> 63 <el-form-item v-for="(n,i) in gateList" :key="i" :label="language==0? n.name:'Rooms'" prop="count">
64 <el-input-number v-model="n.count" :min="0" :max="n.leftNum" @change="changeRoomNum(n)" /> 64 <el-input-number v-model="n.count" :min="0" :max="n.leftNum" @change="changeNum(n)" />
65 <div class="red ml20">
66 <span v-if="language == 0">单价:{{ n.price }}</span>
67 <span v-else>{{ n.priceEn }}</span>
68 </div>
65 <div class="red ml20"> 69 <div class="red ml20">
66 <span v-if="language == 0">剩余票数:{{ n.leftNum }}</span> 70 <span v-if="language == 0">剩余票数:{{ n.leftNum }}</span>
67 <span v-else>{{ n.leftNum }} Remaining rooms</span> 71 <span v-else>{{ n.leftNum }} Remaining rooms</span>
68 </div> 72 </div>
69 <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>
70 </el-form-item> 73 </el-form-item>
71 74
72 <div class="fakeFormItem"> 75 <div v-if="needPersonNum>0" class="fakeFormItem">
73 <label>需填写{{ needPersonNum }}位游客</label> 76 <label>需填写{{ needPersonNum }}位游客</label>
74 <div> 77 <div>
75 <div v-show="needPersonNum > form.personArr.length">还需填写{{ needPersonNum-form.personArr.length }}位游客</div> 78 <div v-show="needPersonNum > hasPersonNum">还需填写{{ needPersonNum-hasPersonNum }}位游客</div>
76 <div>
77 <el-button plain type="primary" @click="showAddPerson">新增出行人</el-button>
78 </div>
79 </div> 79 </div>
80 </div> 80 </div>
81 <div v-show="form.personArr.length>0"> 81 <div v-for="(n,i) in gateList" :key="i">
82 <div v-for="(n,index) in form.personArr" class="fakeFormItem personIt"> 82 <div v-for="(p,j) in n.personArr" :key="j" class="fakeFormItem personIt">
83 <label> 83 <label>
84 <el-icon @click="delPerson(n,index)"><Remove /></el-icon> 84 <el-icon @click="delPerson(n,j)"><Remove /></el-icon>
85 游客{{ index+1 }} 85 {{ n.name }}{{ j+1 }}
86 </label> 86 </label>
87 <div class="mation"> 87 <div class="mation">
88 <div>{{ n.name }}</div> 88 <div>{{ p.name }}</div>
89 身份证:{{ n.idcCode }} 89 身份证:{{ p.idCard }}
90 </div> 90 </div>
91 <el-icon @click="showAddPerson(n)"><Edit /></el-icon> 91 <el-icon @click="showAddPerson(n, j,p)"><Edit /></el-icon>
92 </div> 92 </div>
93 </div> 93 </div>
94 94
95 <el-form-item :label="language==0?'联系人':'Contact'" required prop="contacts">
96 <el-input v-model="form.contacts" />
97 </el-form-item>
95 <el-form-item :label="language==0?'联系手机':'Contact phone'" required prop="phone"> 98 <el-form-item :label="language==0?'联系手机':'Contact phone'" required prop="phone">
96 <el-input v-model="form.phone" /> 99 <el-input v-model="form.phone" />
97 </el-form-item> 100 </el-form-item>
...@@ -103,20 +106,12 @@ ...@@ -103,20 +106,12 @@
103 <div class="leftboderTT">{{ language == 0 ? '订单明细' : 'Order details' }}</div> 106 <div class="leftboderTT">{{ language == 0 ? '订单明细' : 'Order details' }}</div>
104 <div class="border-rr mt20 pd20 ccitemBox"> 107 <div class="border-rr mt20 pd20 ccitemBox">
105 <label> {{ language == 0 ? '基本费用' : 'Room fee' }} 108 <label> {{ language == 0 ? '基本费用' : 'Room fee' }}
106 <span v-if="language==0" class="fr">{{
107 language == 0 ? '¥' : '€'
108 }}{{ ( form.roomNum * choseRooms.length).toFixed(2) }}</span>
109 <span v-else class="fr">{{
110 language == 0 ? '¥' : '€'
111 }}{{ ( form.roomNum * choseRooms.length).toFixed(2) }}</span>
112 </label> 109 </label>
113 <div v-for="(c, index) in choseRooms" v-show="form.roomNum>0" :key="index" class="ccitem"> 110 <div v-for="(c, index) in gateList" v-show="c.count>0" :key="index" class="ccitem">
114 {{ c }} 111 <span v-if="language==0">{{ c.count }}*{{ '¥' }}{{ c.price }}</span>
115 <span v-if="language==0">{{ form.roomNum }}*{{ language == 0 ? '¥' : '€' }}{{ room.roomPrice }}</span> 112 <span v-else>{{ c.count }}*{{ '€' }}{{ c.priceEn }}</span>
116 <span v-else>{{ form.roomNum }}*{{ language == 0 ? '¥' : '€' }}{{ room.roomPriceEn }}</span>
117 </div> 113 </div>
118 114
119
120 <label>{{ language == 0 ? '共计' : 'Total' }}<span 115 <label>{{ language == 0 ? '共计' : 'Total' }}<span
121 class="fr bigMoney" 116 class="fr bigMoney"
122 >{{ language == 0 ? '¥' : '€' }}{{ money }}</span></label> 117 >{{ language == 0 ? '¥' : '€' }}{{ money }}</span></label>
...@@ -139,27 +134,9 @@ ...@@ -139,27 +134,9 @@
139 </el-row> 134 </el-row>
140 </el-card> 135 </el-card>
141 <div style="height: 60px;" /> 136 <div style="height: 60px;" />
142
143 </div> 137 </div>
144 138
145 <el-dialog v-model="show" title="出行人信息" width="500px" center> 139 <choose-person ref="choosePersonRef" @add-person="addPerson" />
146 <div>
147 <el-form ref="personRef" label-width="100">
148 <el-form-item label="姓名">
149 <el-input v-model="person.name" placeholder="请与证件姓名一致" />
150 </el-form-item>
151 <el-form-item label="证件号">
152 <el-input v-model="person.idcCode" placeholder="请填写身份证号" />
153 </el-form-item>
154 </el-form>
155 </div>
156 <template #footer>
157 <div class="dialog-footer">
158 <el-button @click="show = false">取 消</el-button>
159 <el-button type="primary" @click="addPerson">完成</el-button>
160 </div>
161 </template>
162 </el-dialog>
163 </div> 140 </div>
164 </template> 141 </template>
165 142
...@@ -167,11 +144,17 @@ ...@@ -167,11 +144,17 @@
167 import { useRouter, useRoute } from 'vue-router' 144 import { useRouter, useRoute } from 'vue-router'
168 import { ref, onMounted } from 'vue' 145 import { ref, onMounted } from 'vue'
169 import { useStorage } from '@vueuse/core/index' 146 import { useStorage } from '@vueuse/core/index'
170 import { getBaseInfoByActiveId, getGateListByLasId, getScenicById, newsSubmitOrderHotel } from '@/apiPc/booking' 147 import {
148 getBaseInfoByActiveId,
149 getGateListByLasId,
150 getScenicById,
151 submitOrderScenic
152 } from '@/apiPc/booking'
171 import dayjs from 'dayjs' 153 import dayjs from 'dayjs'
172 import { ElMessage, ElMessageBox } from 'element-plus' 154 import { ElMessage, ElMessageBox } from 'element-plus'
173 import useUserStore from '@/store/modules/user' 155 import useUserStore from '@/store/modules/user'
174 import _ from 'lodash' 156 import _ from 'lodash'
157 import ChoosePerson from './component/choosePerson.vue'
175 158
176 const user = useUserStore().user 159 const user = useUserStore().user
177 const language = useStorage('language', 0) 160 const language = useStorage('language', 0)
...@@ -181,6 +164,7 @@ const room = ref({}) ...@@ -181,6 +164,7 @@ const room = ref({})
181 const loading = ref(false) 164 const loading = ref(false)
182 const canOrderNum = ref(0) 165 const canOrderNum = ref(0)
183 const needPersonNum = ref(0) 166 const needPersonNum = ref(0)
167 const hasPersonNum = ref(0)
184 const person = ref({ 168 const person = ref({
185 name: '', 169 name: '',
186 idcCode: '' 170 idcCode: ''
...@@ -189,13 +173,15 @@ const show = ref(false) ...@@ -189,13 +173,15 @@ const show = ref(false)
189 const lform = ref({}) 173 const lform = ref({})
190 const scenicItem = ref({}) 174 const scenicItem = ref({})
191 const form = ref({ 175 const form = ref({
176 contacts: user?.nickName || '',
192 phone: user?.phonenumber || '', 177 phone: user?.phonenumber || '',
193 personArr: [] 178 touristList: []
194 }) 179 })
195 const rzRange = ref('') 180 const rzRange = ref('')
196 const gateList = ref([]) 181 const gateList = ref([])
197 const money = ref(0) 182 const money = ref(0)
198 const choseRooms = ref([]) 183 const choseRooms = ref([])
184 const choosePersonRef = ref([])
199 const rules = ref({ 185 const rules = ref({
200 phone: { required: true, message: language.value == 0 ? '请输入联系电话' : 'Please enter a contact number', trigger: 'blur' } 186 phone: { required: true, message: language.value == 0 ? '请输入联系电话' : 'Please enter a contact number', trigger: 'blur' }
201 }) 187 })
...@@ -231,6 +217,7 @@ function getGate() { ...@@ -231,6 +217,7 @@ function getGate() {
231 _.each(gateList.value, item => { 217 _.each(gateList.value, item => {
232 item.count = 0 218 item.count = 0
233 item.leftNum = item.num - item.orderCount 219 item.leftNum = item.num - item.orderCount
220 item.personArr = []
234 }) 221 })
235 }).finally(() => { 222 }).finally(() => {
236 loading.value = false 223 loading.value = false
...@@ -254,45 +241,82 @@ function dateChange() { ...@@ -254,45 +241,82 @@ function dateChange() {
254 getGate() 241 getGate()
255 } 242 }
256 243
257 function changeRoomNum(e) { 244 const checkPersonNum = () => {
258 console.log(e) 245 needPersonNum.value = 0
259 countMoney() 246 hasPersonNum.value = 0
247 _.each(gateList.value, item => {
248 needPersonNum.value += item.count
249 _.each(item.personArr, person => {
250 if (person.customerId) {
251 hasPersonNum.value++
252 }
253 })
254 })
260 } 255 }
261 256
262 const showAddPerson = (item) => { 257 function changeNum(e) {
263 if (item) { 258 checkPersonNum()
264 person.value = item 259
265 } else { 260 if (e.personArr.length < e.count) {
266 person.value = { 261 e.personArr.push({
262 customerId: '',
267 name: '', 263 name: '',
268 idcCode: '' 264 idcType: '',
269 } 265 idCard: ''
266 })
267 } else if (e.personArr.length > e.count) {
268 e.personArr.splice(e.count)
270 } 269 }
271 show.value = true 270
271 countMoney()
272 } 272 }
273 const addPerson = () => { 273
274 if (!person.value.name) { 274 const showAddPerson = (item, index, person) => {
275 ElMessage.warning(language.value == 0 ? '请填写姓名' : 'Please fill in the name') 275 const customerIds = []
276 return 276 _.each(gateList.value, (g) => {
277 } 277 _.each(g.personArr, (p) => {
278 if (!person.value.idcCode) { 278 if (p.customerId && p.customerId != person.customerId) {
279 ElMessage.warning(language.value == 0 ? '请填写身份证号' : 'Please fill in the ID number') 279 customerIds.push(p.customerId)
280 return 280 }
281 })
282 })
283
284
285 choosePersonRef.value.open({
286 gateId: item.id,
287 gateType: item.gateType,
288 personIndex: index,
289 customerId: person.customerId,
290 hasCustomerIds: customerIds.join(',')
291 })
292 }
293 const addPerson = (item) => {
294 const gate = _.find(gateList.value, (g) => g.id == item.gateId)
295 gate.personArr[item.personIndex] = {
296 customerId: item.customerId,
297 name: item.name,
298 idcType: item.idcType,
299 idCard: item.idCard
281 } 300 }
282 form.value.personArr.push(person.value) 301
283 show.value = false 302 checkPersonNum()
284 } 303 }
285 const delPerson = (item, index) => { 304 const delPerson = (item, index) => {
286 form.value.personArr.splice(index, 1) 305 item.personArr.splice(index, 1)
306 item.count--
307
308 checkPersonNum()
309 countMoney()
287 } 310 }
288 311
289 function countMoney() { 312 function countMoney() {
290 if (language.value == 0) { 313 money.value = 0
291 money.value = ((form.value.roomNum * usedays) + (form.value.addNum * usedays)).toFixed(2) 314 _.each(gateList.value, (g) => {
292 } else { 315 if (g.count > 0) {
293 money.value = ((form.value.roomNum * usedays) + (form.value.addNum * usedays)).toFixed(2) 316 money.value += g.count * (language.value == 0 ? g.price : g.priceEn)
294 } 317 }
295 if (money.value == 'NaN') money.value = 0.00 318 })
319 money.value = (money.value).toFixed(2)
296 } 320 }
297 321
298 function submit() { 322 function submit() {
...@@ -300,12 +324,11 @@ function submit() { ...@@ -300,12 +324,11 @@ function submit() {
300 useUserStore().setReLogin() 324 useUserStore().setReLogin()
301 return 325 return
302 } 326 }
303 if (!rzRange.value) return ElMessage.warning(language.value == 0 ? '请选择预订日期' : 'Please select check-in time')
304 if (!form.value.phone) { 327 if (!form.value.phone) {
305 ElMessage.warning(language.value == 0 ? '请填写手机号' : 'Please fill in the phone number') 328 ElMessage.warning(language.value == 0 ? '请填写手机号' : 'Please fill in the phone number')
306 return 329 return
307 } 330 }
308 if (form.value.personArr.length != needPersonNum.value) { 331 if (needPersonNum.value != hasPersonNum.value) {
309 ElMessage.warning(language.value == 0 ? '出行人数与票数不匹配' : 'The number of people travelling does not match the number of rooms') 332 ElMessage.warning(language.value == 0 ? '出行人数与票数不匹配' : 'The number of people travelling does not match the number of rooms')
310 return 333 return
311 } 334 }
...@@ -316,11 +339,38 @@ function submit() { ...@@ -316,11 +339,38 @@ function submit() {
316 cancelButtonText: language.value == 0 ? '取消' : 'Cancel', 339 cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
317 type: 'warning' 340 type: 'warning'
318 }).then(() => { 341 }).then(() => {
319 newsSubmitOrderHotel(form.value).then(res => { 342 form.value.activeId = route.params.cptId
343 form.value.asId = route.query.lasId
344 form.value.orderName = scenicItem.value.name
345 form.value.dcStart = rzRange.value
346
347 const personArr = []
348 _.each(gateList.value, (item) => {
349 if (item.count > 0) {
350 _.each(item.personArr, (person) => {
351 personArr.push({
352 activeId: route.params.cptId,
353 asId: item.lasId,
354 asgId: item.lasgId,
355 asgcId: item.id,
356 gateName: item.name,
357 gateType: item.gateType,
358 price: language.value == 0 ? item.price : item.priceEn,
359 paymentType: language.value == 0 ? '1' : '3',
360 customerId: person.customerId,
361 name: person.name,
362 idcType: person.idcType,
363 idCard: person.idCard
364 })
365 })
366 }
367 })
368 form.value.touristList = personArr
369
370 submitOrderScenic(form.value).then(res => {
320 if (res.data) { 371 if (res.data) {
321 if (res.data.roomNum == -100) { 372 if (res.data.roomNum == -100) {
322 ElMessage.warning(language.value == 0 ? '剩余票数不足' : 'The remaining number of rooms is insufficient') 373 ElMessage.warning(language.value == 0 ? '剩余票数不足' : 'The remaining number of rooms is insufficient')
323 checkreRooms()
324 } else { 374 } else {
325 // 去付钱 375 // 去付钱
326 router.push({ 376 router.push({
...@@ -328,7 +378,7 @@ function submit() { ...@@ -328,7 +378,7 @@ function submit() {
328 query: { 378 query: {
329 orderId: res.data.orderId, 379 orderId: res.data.orderId,
330 money: res.data.total, 380 money: res.data.total,
331 type: 'hotel' 381 type: 'travel'
332 } 382 }
333 }) 383 })
334 } 384 }
......
...@@ -81,8 +81,8 @@ export default defineConfig(({ mode, command }) => { ...@@ -81,8 +81,8 @@ export default defineConfig(({ mode, command }) => {
81 rewrite: (p) => p.replace(/^\/dev-api\/ztx-webSite/, '') 81 rewrite: (p) => p.replace(/^\/dev-api\/ztx-webSite/, '')
82 }, 82 },
83 '/dev-api': { 83 '/dev-api': {
84 // target: 'http://192.168.1.118:8081/', 84 target: 'http://192.168.1.118:8081/',
85 target: 'http://192.168.1.253:8081', 85 // target: 'http://192.168.1.253:8081',
86 // target: 'https://jijin.wtwuxicenter.com/stage-api', 86 // target: 'https://jijin.wtwuxicenter.com/stage-api',
87 // target: 'https://wdsfwuxicenter.com/stage-api/', 87 // target: 'https://wdsfwuxicenter.com/stage-api/',
88 changeOrigin: true, 88 changeOrigin: true,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!