1e0b9945 by 杨炀

Merge branch 'dev' of https://code.itechtop.cn/yangyang/dance-pc into dev

2 parents 4cc56372 1075ec4f
......@@ -527,6 +527,14 @@ export function getListByAtstId(params) {
})
}
export function getDeskInfo(params) {
return request({
url: `/ota/activitySeat/getDeskInfo`,
method: 'get',
params
})
}
// 根据赛事ID获取票档
export function getTicketListApi(params) {
return request({
......@@ -655,4 +663,10 @@ export function getMyFriends() {
})
}
export function checkPurchasedCustomers(data) {
return request({
url: `/ota/orderCustomer/checkPurchasedCustomers `,
method: 'post',
data
})
}
......
......@@ -15,15 +15,15 @@ import useUserStore from '@/store/modules/user'
import { sendNotification } from '@/assets/lib/extend'
import _ from 'lodash'
// const language = cache.local.get('language') || 0
import {useStorage} from "@vueuse/core/index";
const language= useStorage('language',0)
import { useStorage } from '@vueuse/core/index'
const language = useStorage('language', 0)
let downloadLoadingInstance
// 是否显示重新登录
export const isRelogin = { show: false }
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 对应国际化资源文件后缀
axios.defaults.headers['Content-Language'] = (language.value==0? 'zh_CN':'en_US' )
axios.defaults.headers['Content-Language'] = (language.value == 0 ? 'zh_CN' : 'en_US')
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
......@@ -34,7 +34,7 @@ const service = axios.create({
const otherWeb = ['ztx-match/', 'ztx-webSite/', 'ztx-train/']
const excludeUrl = ['system/remindCount/getCounts']
const noModal = ['person/info/extractInfo']
const noModal = ['person/info/extractInfo', 'ota/orderCustomer/checkPurchasedCustomers']
// request拦截器
service.interceptors.request.use(
......@@ -167,7 +167,7 @@ service.interceptors.response.use(
}
return Promise.reject('会话已过期,请重新登录。')
} else if (code === 500) {
if(msg){
if (msg) {
ElMessage({ message: msg, type: 'error' })
sendNotification('错误提示', { body: msg })
}
......
......@@ -31,6 +31,21 @@
<div class="form">
<el-form ref="formRef" :model="orderForm" :rules="rules" label-width="120px">
<div v-if="TickForm2.ticketType == '1'">
<el-form-item :label="language == 0 ? '桌号' : 'zuohao'">
<el-radio-group v-model="currDesk">
<el-radio-button v-for="(it, index) in deskList" :key="index" :label="it.deskNo" :value="it" :disabled="it.status!=0" />
</el-radio-group>
</el-form-item>
<el-form-item :label="language == 0 ? '座位号' : 'zuoweihao'">
<el-checkbox-group v-model="currSeat">
<el-checkbox-button v-for="(it, index) in currDesk?.seatList" :key="index" :label="it.seatNo" :value="it" :disabled="it.status!=0" />
</el-checkbox-group>
</el-form-item>
<el-form-item label="已选座位号">
<el-tag v-for="s in currSeat" :key="s.id">{{ s.deskNo }} - {{ s.seatNo }}</el-tag>
</el-form-item>
</div>
<el-form-item
:label="language == 0 ? '联系人' : 'contact person'" prop="contacts"
>
......@@ -66,6 +81,7 @@
</div>
<el-checkbox
:value="it.id"
:disabled="!!it.disabled"
/>
</div>
</el-checkbox-group>
......@@ -128,7 +144,6 @@
{{ languageFormat(language, "立即支付", "Pay Now") }}
</div>
</div>
</div>
</el-card>
......@@ -141,7 +156,9 @@ import {
submitOrderTicket,
getTicketInfoByActivityId,
getActivityTypeVoById,
getListByAtstId
getListByAtstId,
checkPurchasedCustomers,
getDeskInfo
} from '@/apiPc/booking'
import { ElMessage, ElMessageBox } from 'element-plus'
import { languageFormat } from '@/viewsPc/seat/utils/language.js'
......@@ -191,6 +208,9 @@ const formRef = ref(null)
const TickForm = ref({})
const TickForm2 = ref({})
const TickForm3 = ref({})
const deskList = ref([])
const currDesk = ref(null)
const currSeat = ref([])
onMounted(() => {
customerList()
......@@ -200,27 +220,53 @@ onMounted(() => {
id: route.params.latstId
}).then((res) => {
TickForm2.value = res.data
}).then(() => {
// vip
if (TickForm2.value.ticketType == '1') {
getDeskInfo({
atstId: route.params.latstId
}).then(res => {
deskList.value = res.data
currDesk.value = res.data[0]
})
}
// 普通票
else {
getListByAtstId({
atstId: route.params.latstId
}).then(res => {
TickForm3.value = res.data
TickForm3.value = res.data[0]
})
}
})
})
function changeGroup(e) {
if (e.length > 0) {
checkPurchasedCustomers({
atstId: route.params.latstId,
customers: e
}).then(res => {
if (res.data.length > 0) {
const names = _.map(res.data, (d) => d.name).join(',')
ElMessage({
message: language.value == 0 ? `${names} 已购买该票` : 'The user has purchased the ticket',
type: 'error'
})
_.each(res.data, (d) => {
_.remove(orderForm.value.customerIds, (c) => c == d.id)
_.find(personnelList.value, (p) => p.id == d.id).disabled = true
})
}
})
}
}
// 获取人员列表
async function customerList() {
const res = await customerListApi({
activeId: orderForm.value.activeId,
attId: orderForm.value.attId,
atId: orderForm.value.atId
})
const res = await customerListApi()
personnelList.value = res.rows
}
......@@ -231,6 +277,21 @@ async function paymentHandle() {
return
}
if (currSeat.value.length == 0) {
ElMessage({
message: language.value == 0 ? '请选择座位' : 'Please select the seat',
type: 'error'
})
return
}
if (currSeat.value.length != orderForm.value.customerIds.length) {
ElMessage({
message: language.value == 0 ? '座位数与人数不一致' : '',
type: 'error'
})
return
}
await formRef.value.validate()
await ElMessageBox.confirm(language.value == 0 ? '确认提交订单吗?' : 'Confirm to submit the order?', {
......@@ -240,14 +301,17 @@ async function paymentHandle() {
}).then(async() => {
try {
const orderCustomerList = []
_.each(orderForm.value.customerIds, (id) => {
_.each(orderForm.value.customerIds, (id, index) => {
const person = _.find(personnelList.value, (item) => item.id == id)
const tempSeat = currSeat.value[index] || {}
orderCustomerList.push({
customerId: person.id,
name: person.name,
idcType: person.idcType,
idCard: person.idCard,
paymentType: language.value == 0 ? '1' : '3'
paymentType: language.value == 0 ? '1' : '3',
deskNo: tempSeat.deskNo,
seatNo: tempSeat.seatNo
})
})
......
......@@ -248,7 +248,7 @@ import {
} from '@/apiPc/booking'
import { dayjs } from 'element-plus'
import { ElMessageBox, ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus'
import { getDayName } from '@/viewsPc/seat/utils/language'
import { fillImgUrl } from '/@/utils/ruoyi'
import useUserStore from '/@/store/modules/user'
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!