旅游
Showing
1 changed file
with
61 additions
and
52 deletions
| 1 | <template> | 1 | <template> |
| 2 | <el-dialog v-model="show" width="500" :title="languageFormat(language, '出行人信息', 'Travelers')" center | 2 | <el-dialog |
| 3 | append-to-body> | 3 | v-model="show" :title="languageFormat(language, '出行人信息', 'Travelers')" append-to-body center |
| 4 | <el-button type="primary" plain @click="addPeopl">{{ languageFormat(language, "新增", "Add") }}</el-button> | 4 | width="500" |
| 5 | > | ||
| 6 | <el-button plain type="primary" @click="addPeopl">{{ languageFormat(language, "新增", "Add") }}</el-button> | ||
| 5 | <el-radio-group v-model="personId"> | 7 | <el-radio-group v-model="personId"> |
| 6 | <div v-for="(it, index) in personList" :key="index" class="e_item"> | 8 | <div v-for="(it, index) in personList" :key="index" class="e_item"> |
| 7 | <el-radio border :value="it.id" :disabled="hasPersonIds?.indexOf(it.id)!=-1"> | 9 | <el-radio :disabled="hasPersonIds?.indexOf(it.id)!=-1" :value="it.id" border> |
| 8 | 10 | ||
| 9 | <div class="name">{{ it.name }}</div> | 11 | <div class="name">{{ it.name }}</div> |
| 10 | <div class="code"> | 12 | <div class="code"> |
| 11 | <span v-if="it.idcType==0">{{ language == 0 ? '身份证' : 'ID number' }}</span> | 13 | <span v-if="it.idcType==0">{{ language == 0 ? '身份证' : 'ID number' }}</span> |
| 12 | <span v-if="it.idcType==1">{{ language == 0 ? '护照' : 'Passport' }}</span> | 14 | <span v-if="it.idcType==1">{{ language == 0 ? '护照' : 'Passport' }}</span> |
| 13 | <span v-if="it.idcType==2">{{ language == 0 ? '其他' : 'Other' }}</span> | 15 | <span v-if="it.idcType==2">{{ language == 0 ? '其他' : 'Other' }}</span> |
| 14 | 16 | ||
| 15 | {{ it.idCard }} | 17 | {{ it.idCard }} |
| 16 | </div> | 18 | </div> |
| 17 | 19 | ||
| 18 | </el-radio> | 20 | </el-radio> |
| 19 | </div> | 21 | </div> |
| 20 | </el-radio-group> | 22 | </el-radio-group> |
| ... | @@ -25,28 +27,28 @@ | ... | @@ -25,28 +27,28 @@ |
| 25 | </div> | 27 | </div> |
| 26 | </template> | 28 | </template> |
| 27 | </el-dialog> | 29 | </el-dialog> |
| 28 | 30 | ||
| 29 | 31 | ||
| 30 | <el-dialog v-model="showAdd" :title="language ==0?'新增出行人':'Add traveler'" center append-to-body> | 32 | <el-dialog v-model="showAdd" :title="language ==0?'新增出行人':'Add traveler'" append-to-body center> |
| 31 | <el-form | 33 | <el-form |
| 32 | ref="formRef" :model="form" label-width="100px" size="large" | 34 | ref="formRef" :model="form" label-width="100px" size="large" |
| 33 | style="margin: 80px" | 35 | style="margin: 80px" |
| 34 | > | 36 | > |
| 35 | <el-form-item :label="language==0?'姓名':'name'" prop="name" required :show-message="false"> | 37 | <el-form-item :label="language==0?'姓名':'name'" :show-message="false" prop="name" required> |
| 36 | <el-input v-model="form.name" :placeholder="language==0?'请输入':'Please input'"/> | 38 | <el-input v-model="form.name" :placeholder="language==0?'请输入':'Please input'" /> |
| 37 | </el-form-item> | 39 | </el-form-item> |
| 38 | <el-form-item :label="language==0?'证件类型':'ID Type'" prop="idcType" required :show-message="false"> | 40 | <el-form-item :label="language==0?'证件类型':'ID Type'" :show-message="false" prop="idcType" required> |
| 39 | <el-select v-model="form.idcType" :placeholder="language==0?'请选择':'Please choose'"> | 41 | <el-select v-model="form.idcType" :placeholder="language==0?'请选择':'Please choose'"> |
| 40 | <el-option :label="language==0?'身份证':'Identity card'" value="0"/> | 42 | <el-option :label="language==0?'身份证':'Identity card'" value="0" /> |
| 41 | <el-option :label="language==0?'护照':'Passport'" value="1"/> | 43 | <el-option :label="language==0?'护照':'Passport'" value="1" /> |
| 42 | <el-option :label="language==0?'其他':'Other'" value="2"/> | 44 | <el-option :label="language==0?'其他':'Other'" value="2" /> |
| 43 | </el-select> | 45 | </el-select> |
| 44 | </el-form-item> | 46 | </el-form-item> |
| 45 | <el-form-item :label="language==0?'证件号':'ID number'" prop="idCard" required :show-message="false"> | 47 | <el-form-item :label="language==0?'证件号':'ID number'" :show-message="false" prop="idCard" required> |
| 46 | <el-input v-model="form.idCard" :placeholder="language==0?'请输入证件号':'Please enter the ID after ah'"/> | 48 | <el-input v-model="form.idCard" :placeholder="language==0?'请输入证件号':'Please enter the ID after ah'" /> |
| 47 | </el-form-item> | 49 | </el-form-item> |
| 48 | </el-form> | 50 | </el-form> |
| 49 | 51 | ||
| 50 | <template #footer> | 52 | <template #footer> |
| 51 | <div class="dialog-footer"> | 53 | <div class="dialog-footer"> |
| 52 | <el-button class="can_pay" @click="showAdd = false">{{ language == 0 ? '取 消' : 'cancel' }}</el-button> | 54 | <el-button class="can_pay" @click="showAdd = false">{{ language == 0 ? '取 消' : 'cancel' }}</el-button> |
| ... | @@ -58,15 +60,15 @@ | ... | @@ -58,15 +60,15 @@ |
| 58 | </template> | 60 | </template> |
| 59 | 61 | ||
| 60 | <script setup> | 62 | <script setup> |
| 61 | import {aadSceneCustomer, checkSceneCustomer, getMyFriends} from '/@/apiPc/booking' | 63 | import { aadSceneCustomer, checkSceneCustomer, getMyFriends } from '/@/apiPc/booking' |
| 62 | import {languageFormat} from '/@/viewsPc/seat/utils/language' | 64 | import { languageFormat } from '/@/viewsPc/seat/utils/language' |
| 63 | import {onMounted, ref} from 'vue' | 65 | import { onMounted, ref } from 'vue' |
| 64 | import {useStorage} from '@vueuse/core/index' | 66 | import { useStorage } from '@vueuse/core/index' |
| 65 | import _ from 'lodash' | 67 | import _ from 'lodash' |
| 66 | import {getCurrentInstance} from '@vue/runtime-core' | 68 | import { getCurrentInstance } from '@vue/runtime-core' |
| 67 | 69 | ||
| 68 | const emit = defineEmits(['addPerson']) | 70 | const emit = defineEmits(['addPerson']) |
| 69 | const {proxy} = getCurrentInstance() | 71 | const { proxy } = getCurrentInstance() |
| 70 | 72 | ||
| 71 | const show = ref(false) | 73 | const show = ref(false) |
| 72 | const showAdd = ref(false) | 74 | const showAdd = ref(false) |
| ... | @@ -95,27 +97,34 @@ const addPeopl = () => { | ... | @@ -95,27 +97,34 @@ const addPeopl = () => { |
| 95 | 97 | ||
| 96 | const addPerson = () => { | 98 | const addPerson = () => { |
| 97 | const person = _.find(personList.value, (it) => it.id == personId.value) | 99 | const person = _.find(personList.value, (it) => it.id == personId.value) |
| 98 | 100 | ||
| 99 | checkSceneCustomer({ | 101 | show.value = false |
| 102 | emit('addPerson', Object.assign(currParams, { | ||
| 100 | customerId: person.id, | 103 | customerId: person.id, |
| 101 | gateType: currParams.gateType | 104 | name: person.name, |
| 102 | }).then((res) => { | 105 | idcType: person.idcType, |
| 103 | if (res.data == 201) { | 106 | idCard: person.idCard |
| 104 | proxy.$modal.msgError(language.value == 0 ? '护照只能购买成人票' : 'Passport can only buy adult tickets') | 107 | })) |
| 105 | } else if (res.data == 202) { | 108 | // checkSceneCustomer({ |
| 106 | proxy.$modal.msgError(language.value == 0 ? '此身份证不能购买老人票' : 'This ID cannot buy senior tickets') | 109 | // customerId: person.id, |
| 107 | } else if (res.data == 203) { | 110 | // gateType: currParams.gateType |
| 108 | proxy.$modal.msgError(language.value == 0 ? '此身份证不能购买儿童票' : 'This ID cannot buy child tickets') | 111 | // }).then((res) => { |
| 109 | } else { | 112 | // if (res.data == 201) { |
| 110 | show.value = false | 113 | // proxy.$modal.msgError(language.value == 0 ? '护照只能购买成人票' : 'Passport can only buy adult tickets') |
| 111 | emit('addPerson', Object.assign(currParams, { | 114 | // } else if (res.data == 202) { |
| 112 | customerId: person.id, | 115 | // proxy.$modal.msgError(language.value == 0 ? '此身份证不能购买老人票' : 'This ID cannot buy senior tickets') |
| 113 | name: person.name, | 116 | // } else if (res.data == 203) { |
| 114 | idcType: person.idcType, | 117 | // proxy.$modal.msgError(language.value == 0 ? '此身份证不能购买儿童票' : 'This ID cannot buy child tickets') |
| 115 | idCard: person.idCard | 118 | // } else { |
| 116 | })) | 119 | // show.value = false |
| 117 | } | 120 | // emit('addPerson', Object.assign(currParams, { |
| 118 | }) | 121 | // customerId: person.id, |
| 122 | // name: person.name, | ||
| 123 | // idcType: person.idcType, | ||
| 124 | // idCard: person.idCard | ||
| 125 | // })) | ||
| 126 | // } | ||
| 127 | // }) | ||
| 119 | } | 128 | } |
| 120 | 129 | ||
| 121 | const submit = () => { | 130 | const submit = () => { |
| ... | @@ -144,14 +153,14 @@ defineExpose({ | ... | @@ -144,14 +153,14 @@ defineExpose({ |
| 144 | currParams = params | 153 | currParams = params |
| 145 | personId.value = params.customerId | 154 | personId.value = params.customerId |
| 146 | hasPersonIds.value = params.hasCustomerIds | 155 | hasPersonIds.value = params.hasCustomerIds |
| 147 | 156 | ||
| 148 | show.value = true | 157 | show.value = true |
| 149 | } | 158 | } |
| 150 | }) | 159 | }) |
| 151 | 160 | ||
| 152 | </script> | 161 | </script> |
| 153 | 162 | ||
| 154 | <style scoped lang="scss"> | 163 | <style lang="scss" scoped> |
| 155 | .el-radio-group { | 164 | .el-radio-group { |
| 156 | display: block; | 165 | display: block; |
| 157 | } | 166 | } |
| ... | @@ -159,17 +168,17 @@ defineExpose({ | ... | @@ -159,17 +168,17 @@ defineExpose({ |
| 159 | .e_item { | 168 | .e_item { |
| 160 | margin: 20px 0 0 0; | 169 | margin: 20px 0 0 0; |
| 161 | width: 100%; | 170 | width: 100%; |
| 162 | 171 | ||
| 163 | .el-radio { | 172 | .el-radio { |
| 164 | width: 100%; | 173 | width: 100%; |
| 165 | height: auto; | 174 | height: auto; |
| 166 | padding: 10px; | 175 | padding: 10px; |
| 167 | } | 176 | } |
| 168 | 177 | ||
| 169 | .name { | 178 | .name { |
| 170 | font-size: 16px; | 179 | font-size: 16px; |
| 171 | } | 180 | } |
| 172 | 181 | ||
| 173 | .code { | 182 | .code { |
| 174 | font-size: 14px; | 183 | font-size: 14px; |
| 175 | margin: 4px 0 0; | 184 | margin: 4px 0 0; | ... | ... |
-
Please register or sign in to post a comment