no message
Showing
4 changed files
with
105 additions
and
27 deletions
| ... | @@ -527,6 +527,14 @@ export function getListByAtstId(params) { | ... | @@ -527,6 +527,14 @@ export function getListByAtstId(params) { |
| 527 | }) | 527 | }) |
| 528 | } | 528 | } |
| 529 | 529 | ||
| 530 | export function getDeskInfo(params) { | ||
| 531 | return request({ | ||
| 532 | url: `/ota/activitySeat/getDeskInfo`, | ||
| 533 | method: 'get', | ||
| 534 | params | ||
| 535 | }) | ||
| 536 | } | ||
| 537 | |||
| 530 | // 根据赛事ID获取票档 | 538 | // 根据赛事ID获取票档 |
| 531 | export function getTicketListApi(params) { | 539 | export function getTicketListApi(params) { |
| 532 | return request({ | 540 | return request({ |
| ... | @@ -655,4 +663,10 @@ export function getMyFriends() { | ... | @@ -655,4 +663,10 @@ export function getMyFriends() { |
| 655 | }) | 663 | }) |
| 656 | } | 664 | } |
| 657 | 665 | ||
| 658 | 666 | export function checkPurchasedCustomers(data) { | |
| 667 | return request({ | ||
| 668 | url: `/ota/orderCustomer/checkPurchasedCustomers `, | ||
| 669 | method: 'post', | ||
| 670 | data | ||
| 671 | }) | ||
| 672 | } | ... | ... |
| ... | @@ -15,15 +15,15 @@ import useUserStore from '@/store/modules/user' | ... | @@ -15,15 +15,15 @@ import useUserStore from '@/store/modules/user' |
| 15 | import { sendNotification } from '@/assets/lib/extend' | 15 | import { sendNotification } from '@/assets/lib/extend' |
| 16 | import _ from 'lodash' | 16 | import _ from 'lodash' |
| 17 | // const language = cache.local.get('language') || 0 | 17 | // const language = cache.local.get('language') || 0 |
| 18 | import {useStorage} from "@vueuse/core/index"; | 18 | import { useStorage } from '@vueuse/core/index' |
| 19 | const language= useStorage('language',0) | 19 | const language = useStorage('language', 0) |
| 20 | let downloadLoadingInstance | 20 | let downloadLoadingInstance |
| 21 | // 是否显示重新登录 | 21 | // 是否显示重新登录 |
| 22 | export const isRelogin = { show: false } | 22 | export const isRelogin = { show: false } |
| 23 | 23 | ||
| 24 | axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' | 24 | axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' |
| 25 | // 对应国际化资源文件后缀 | 25 | // 对应国际化资源文件后缀 |
| 26 | axios.defaults.headers['Content-Language'] = (language.value==0? 'zh_CN':'en_US' ) | 26 | axios.defaults.headers['Content-Language'] = (language.value == 0 ? 'zh_CN' : 'en_US') |
| 27 | // 创建axios实例 | 27 | // 创建axios实例 |
| 28 | const service = axios.create({ | 28 | const service = axios.create({ |
| 29 | // axios中请求配置有baseURL选项,表示请求URL公共部分 | 29 | // axios中请求配置有baseURL选项,表示请求URL公共部分 |
| ... | @@ -34,7 +34,7 @@ const service = axios.create({ | ... | @@ -34,7 +34,7 @@ const service = axios.create({ |
| 34 | 34 | ||
| 35 | const otherWeb = ['ztx-match/', 'ztx-webSite/', 'ztx-train/'] | 35 | const otherWeb = ['ztx-match/', 'ztx-webSite/', 'ztx-train/'] |
| 36 | const excludeUrl = ['system/remindCount/getCounts'] | 36 | const excludeUrl = ['system/remindCount/getCounts'] |
| 37 | const noModal = ['person/info/extractInfo'] | 37 | const noModal = ['person/info/extractInfo', 'ota/orderCustomer/checkPurchasedCustomers'] |
| 38 | 38 | ||
| 39 | // request拦截器 | 39 | // request拦截器 |
| 40 | service.interceptors.request.use( | 40 | service.interceptors.request.use( |
| ... | @@ -143,7 +143,7 @@ service.interceptors.response.use( | ... | @@ -143,7 +143,7 @@ service.interceptors.response.use( |
| 143 | if (code === 401) { | 143 | if (code === 401) { |
| 144 | if (!isRelogin.show) { | 144 | if (!isRelogin.show) { |
| 145 | isRelogin.show = true | 145 | isRelogin.show = true |
| 146 | // ElMessage({ message: '登录状态已过期', type: 'error' }) | 146 | // ElMessage({ message: '登录状态已过期', type: 'error' }) |
| 147 | // ElMessageBox.confirm( | 147 | // ElMessageBox.confirm( |
| 148 | // '登录状态已过期,您可以继续留在该页面,或者重新登录', | 148 | // '登录状态已过期,您可以继续留在该页面,或者重新登录', |
| 149 | // '系统提示', | 149 | // '系统提示', |
| ... | @@ -167,10 +167,10 @@ service.interceptors.response.use( | ... | @@ -167,10 +167,10 @@ service.interceptors.response.use( |
| 167 | } | 167 | } |
| 168 | return Promise.reject('会话已过期,请重新登录。') | 168 | return Promise.reject('会话已过期,请重新登录。') |
| 169 | } else if (code === 500) { | 169 | } else if (code === 500) { |
| 170 | if(msg){ | 170 | if (msg) { |
| 171 | ElMessage({ message: msg, type: 'error' }) | 171 | ElMessage({ message: msg, type: 'error' }) |
| 172 | sendNotification('错误提示', { body: msg }) | 172 | sendNotification('错误提示', { body: msg }) |
| 173 | } | 173 | } |
| 174 | return Promise.reject(new Error(msg)) | 174 | return Promise.reject(new Error(msg)) |
| 175 | } else if (code === 601) { | 175 | } else if (code === 601) { |
| 176 | ElMessage({ message: msg, type: 'warning' }) | 176 | ElMessage({ message: msg, type: 'warning' }) | ... | ... |
| ... | @@ -31,6 +31,21 @@ | ... | @@ -31,6 +31,21 @@ |
| 31 | 31 | ||
| 32 | <div class="form"> | 32 | <div class="form"> |
| 33 | <el-form ref="formRef" :model="orderForm" :rules="rules" label-width="120px"> | 33 | <el-form ref="formRef" :model="orderForm" :rules="rules" label-width="120px"> |
| 34 | <div v-if="TickForm2.ticketType == '1'"> | ||
| 35 | <el-form-item :label="language == 0 ? '桌号' : 'zuohao'"> | ||
| 36 | <el-radio-group v-model="currDesk"> | ||
| 37 | <el-radio-button v-for="(it, index) in deskList" :key="index" :label="it.deskNo" :value="it" :disabled="it.status!=0" /> | ||
| 38 | </el-radio-group> | ||
| 39 | </el-form-item> | ||
| 40 | <el-form-item :label="language == 0 ? '座位号' : 'zuoweihao'"> | ||
| 41 | <el-checkbox-group v-model="currSeat"> | ||
| 42 | <el-checkbox-button v-for="(it, index) in currDesk?.seatList" :key="index" :label="it.seatNo" :value="it" :disabled="it.status!=0" /> | ||
| 43 | </el-checkbox-group> | ||
| 44 | </el-form-item> | ||
| 45 | <el-form-item label="已选座位号"> | ||
| 46 | <el-tag v-for="s in currSeat" :key="s.id">{{ s.deskNo }} - {{ s.seatNo }}</el-tag> | ||
| 47 | </el-form-item> | ||
| 48 | </div> | ||
| 34 | <el-form-item | 49 | <el-form-item |
| 35 | :label="language == 0 ? '联系人' : 'contact person'" prop="contacts" | 50 | :label="language == 0 ? '联系人' : 'contact person'" prop="contacts" |
| 36 | > | 51 | > |
| ... | @@ -66,6 +81,7 @@ | ... | @@ -66,6 +81,7 @@ |
| 66 | </div> | 81 | </div> |
| 67 | <el-checkbox | 82 | <el-checkbox |
| 68 | :value="it.id" | 83 | :value="it.id" |
| 84 | :disabled="!!it.disabled" | ||
| 69 | /> | 85 | /> |
| 70 | </div> | 86 | </div> |
| 71 | </el-checkbox-group> | 87 | </el-checkbox-group> |
| ... | @@ -128,7 +144,6 @@ | ... | @@ -128,7 +144,6 @@ |
| 128 | {{ languageFormat(language, "立即支付", "Pay Now") }} | 144 | {{ languageFormat(language, "立即支付", "Pay Now") }} |
| 129 | </div> | 145 | </div> |
| 130 | </div> | 146 | </div> |
| 131 | |||
| 132 | </div> | 147 | </div> |
| 133 | </el-card> | 148 | </el-card> |
| 134 | 149 | ||
| ... | @@ -141,7 +156,9 @@ import { | ... | @@ -141,7 +156,9 @@ import { |
| 141 | submitOrderTicket, | 156 | submitOrderTicket, |
| 142 | getTicketInfoByActivityId, | 157 | getTicketInfoByActivityId, |
| 143 | getActivityTypeVoById, | 158 | getActivityTypeVoById, |
| 144 | getListByAtstId | 159 | getListByAtstId, |
| 160 | checkPurchasedCustomers, | ||
| 161 | getDeskInfo | ||
| 145 | } from '@/apiPc/booking' | 162 | } from '@/apiPc/booking' |
| 146 | import { ElMessage, ElMessageBox } from 'element-plus' | 163 | import { ElMessage, ElMessageBox } from 'element-plus' |
| 147 | import { languageFormat } from '@/viewsPc/seat/utils/language.js' | 164 | import { languageFormat } from '@/viewsPc/seat/utils/language.js' |
| ... | @@ -191,6 +208,9 @@ const formRef = ref(null) | ... | @@ -191,6 +208,9 @@ const formRef = ref(null) |
| 191 | const TickForm = ref({}) | 208 | const TickForm = ref({}) |
| 192 | const TickForm2 = ref({}) | 209 | const TickForm2 = ref({}) |
| 193 | const TickForm3 = ref({}) | 210 | const TickForm3 = ref({}) |
| 211 | const deskList = ref([]) | ||
| 212 | const currDesk = ref(null) | ||
| 213 | const currSeat = ref([]) | ||
| 194 | 214 | ||
| 195 | onMounted(() => { | 215 | onMounted(() => { |
| 196 | customerList() | 216 | customerList() |
| ... | @@ -200,27 +220,53 @@ onMounted(() => { | ... | @@ -200,27 +220,53 @@ onMounted(() => { |
| 200 | id: route.params.latstId | 220 | id: route.params.latstId |
| 201 | }).then((res) => { | 221 | }).then((res) => { |
| 202 | TickForm2.value = res.data | 222 | TickForm2.value = res.data |
| 203 | }) | 223 | }).then(() => { |
| 204 | 224 | // vip | |
| 205 | getListByAtstId({ | 225 | if (TickForm2.value.ticketType == '1') { |
| 206 | atstId: route.params.latstId | 226 | getDeskInfo({ |
| 207 | }).then(res => { | 227 | atstId: route.params.latstId |
| 208 | TickForm3.value = res.data | 228 | }).then(res => { |
| 229 | deskList.value = res.data | ||
| 230 | currDesk.value = res.data[0] | ||
| 231 | }) | ||
| 232 | } | ||
| 233 | // 普通票 | ||
| 234 | else { | ||
| 235 | getListByAtstId({ | ||
| 236 | atstId: route.params.latstId | ||
| 237 | }).then(res => { | ||
| 238 | TickForm3.value = res.data[0] | ||
| 239 | }) | ||
| 240 | } | ||
| 209 | }) | 241 | }) |
| 210 | }) | 242 | }) |
| 211 | 243 | ||
| 212 | |||
| 213 | function changeGroup(e) { | 244 | function changeGroup(e) { |
| 245 | if (e.length > 0) { | ||
| 246 | checkPurchasedCustomers({ | ||
| 247 | atstId: route.params.latstId, | ||
| 248 | customers: e | ||
| 249 | }).then(res => { | ||
| 250 | if (res.data.length > 0) { | ||
| 251 | const names = _.map(res.data, (d) => d.name).join(',') | ||
| 252 | |||
| 253 | ElMessage({ | ||
| 254 | message: language.value == 0 ? `${names} 已购买该票` : 'The user has purchased the ticket', | ||
| 255 | type: 'error' | ||
| 256 | }) | ||
| 214 | 257 | ||
| 258 | _.each(res.data, (d) => { | ||
| 259 | _.remove(orderForm.value.customerIds, (c) => c == d.id) | ||
| 260 | _.find(personnelList.value, (p) => p.id == d.id).disabled = true | ||
| 261 | }) | ||
| 262 | } | ||
| 263 | }) | ||
| 264 | } | ||
| 215 | } | 265 | } |
| 216 | 266 | ||
| 217 | // 获取人员列表 | 267 | // 获取人员列表 |
| 218 | async function customerList() { | 268 | async function customerList() { |
| 219 | const res = await customerListApi({ | 269 | const res = await customerListApi() |
| 220 | activeId: orderForm.value.activeId, | ||
| 221 | attId: orderForm.value.attId, | ||
| 222 | atId: orderForm.value.atId | ||
| 223 | }) | ||
| 224 | personnelList.value = res.rows | 270 | personnelList.value = res.rows |
| 225 | } | 271 | } |
| 226 | 272 | ||
| ... | @@ -231,6 +277,21 @@ async function paymentHandle() { | ... | @@ -231,6 +277,21 @@ async function paymentHandle() { |
| 231 | return | 277 | return |
| 232 | } | 278 | } |
| 233 | 279 | ||
| 280 | if (currSeat.value.length == 0) { | ||
| 281 | ElMessage({ | ||
| 282 | message: language.value == 0 ? '请选择座位' : 'Please select the seat', | ||
| 283 | type: 'error' | ||
| 284 | }) | ||
| 285 | return | ||
| 286 | } | ||
| 287 | if (currSeat.value.length != orderForm.value.customerIds.length) { | ||
| 288 | ElMessage({ | ||
| 289 | message: language.value == 0 ? '座位数与人数不一致' : '', | ||
| 290 | type: 'error' | ||
| 291 | }) | ||
| 292 | return | ||
| 293 | } | ||
| 294 | |||
| 234 | await formRef.value.validate() | 295 | await formRef.value.validate() |
| 235 | 296 | ||
| 236 | await ElMessageBox.confirm(language.value == 0 ? '确认提交订单吗?' : 'Confirm to submit the order?', { | 297 | await ElMessageBox.confirm(language.value == 0 ? '确认提交订单吗?' : 'Confirm to submit the order?', { |
| ... | @@ -240,14 +301,17 @@ async function paymentHandle() { | ... | @@ -240,14 +301,17 @@ async function paymentHandle() { |
| 240 | }).then(async() => { | 301 | }).then(async() => { |
| 241 | try { | 302 | try { |
| 242 | const orderCustomerList = [] | 303 | const orderCustomerList = [] |
| 243 | _.each(orderForm.value.customerIds, (id) => { | 304 | _.each(orderForm.value.customerIds, (id, index) => { |
| 244 | const person = _.find(personnelList.value, (item) => item.id == id) | 305 | const person = _.find(personnelList.value, (item) => item.id == id) |
| 306 | const tempSeat = currSeat.value[index] || {} | ||
| 245 | orderCustomerList.push({ | 307 | orderCustomerList.push({ |
| 246 | customerId: person.id, | 308 | customerId: person.id, |
| 247 | name: person.name, | 309 | name: person.name, |
| 248 | idcType: person.idcType, | 310 | idcType: person.idcType, |
| 249 | idCard: person.idCard, | 311 | idCard: person.idCard, |
| 250 | paymentType: language.value == 0 ? '1' : '3' | 312 | paymentType: language.value == 0 ? '1' : '3', |
| 313 | deskNo: tempSeat.deskNo, | ||
| 314 | seatNo: tempSeat.seatNo | ||
| 251 | }) | 315 | }) |
| 252 | }) | 316 | }) |
| 253 | 317 | ... | ... |
| ... | @@ -248,7 +248,7 @@ import { | ... | @@ -248,7 +248,7 @@ import { |
| 248 | } from '@/apiPc/booking' | 248 | } from '@/apiPc/booking' |
| 249 | 249 | ||
| 250 | import { dayjs } from 'element-plus' | 250 | import { dayjs } from 'element-plus' |
| 251 | import { ElMessageBox, ElMessage } from 'element-plus' | 251 | import { ElMessageBox } from 'element-plus' |
| 252 | import { getDayName } from '@/viewsPc/seat/utils/language' | 252 | import { getDayName } from '@/viewsPc/seat/utils/language' |
| 253 | import { fillImgUrl } from '/@/utils/ruoyi' | 253 | import { fillImgUrl } from '/@/utils/ruoyi' |
| 254 | import useUserStore from '/@/store/modules/user' | 254 | import useUserStore from '/@/store/modules/user' | ... | ... |
-
Please register or sign in to post a comment