feat(ticket): 添加自助购票功能

This commit is contained in:
woody 2025-05-27 16:05:02 +08:00
parent 7444b55d3c
commit 25bea0b3b7
2 changed files with 38 additions and 17 deletions

View File

@ -36,6 +36,21 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="8">
<el-form-item label="隶属体系" prop="pkVertex">
<!-- <imageUpload v-model="ruleForm.pkVertex" /> -->
<el-select v-model="ruleForm.pkVertex" placeholder="全部" clearable multiple>
<el-option
v-for="item in vertexList"
:key="item.pkId"
:label="item.vertexName"
:value="item.pkId"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="16"> <el-col :span="16">
<el-form-item :label="'活动说明'" prop="actExplain"> <el-form-item :label="'活动说明'" prop="actExplain">
@ -60,6 +75,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item :label="$t('门票金额')" required> <el-form-item :label="$t('门票金额')" required>
@ -149,6 +165,7 @@ import Editor from '@/components/Editor'
import * as api from '@/api/ticket.js' import * as api from '@/api/ticket.js'
import ImageUpload from '@/components/ImageUpload' import ImageUpload from '@/components/ImageUpload'
import { vertexList } from '@/api/settle.js'
// import directUpdata from '@/views/marketing/benefitsGift/directUpdata' // import directUpdata from '@/views/marketing/benefitsGift/directUpdata'
export default { export default {
name: 'AddTicket', name: 'AddTicket',
@ -164,10 +181,12 @@ export default {
ruleForm: { ruleForm: {
payMoney: '', payMoney: '',
quantity: '', quantity: '',
pkVertex: '',
limitQuantity: '', limitQuantity: '',
ruleFormTime: [], ruleFormTime: [],
ruleFormTime1: [] ruleFormTime1: []
}, },
vertexList: [],
rules: { rules: {
actName: [ actName: [
{ required: true, message: this.$t('请输入活动名称'), trigger: 'blur' } { required: true, message: this.$t('请输入活动名称'), trigger: 'blur' }
@ -212,14 +231,19 @@ export default {
} else { } else {
this.lookOver = false this.lookOver = false
} }
console.log(this.$route.query.controlType, 'this.$route.query.controlType')
this.controlType = this.$route.query.controlType this.controlType = this.$route.query.controlType
this.pkId = this.$route.query.pkId || '' this.pkId = this.$route.query.pkId || ''
this.getVertexList()
if (this.pkId) { if (this.pkId) {
this.getDetails() this.getDetails()
} }
}, },
methods: { methods: {
getVertexList() {
vertexList().then((res) => {
this.vertexList = res.data
})
},
cancel() { cancel() {
this.$router.go(-1) this.$router.go(-1)
}, },
@ -237,6 +261,7 @@ export default {
this.ruleForm.payMoney = res.data.payMoney this.ruleForm.payMoney = res.data.payMoney
this.ruleForm.quantity = res.data.quantity this.ruleForm.quantity = res.data.quantity
this.ruleForm.limitQuantity = res.data.limitQuantity this.ruleForm.limitQuantity = res.data.limitQuantity
this.ruleForm.pkVertex = res.data.pkVertex ? res.data.pkVertex.split(',').map(item => Number(item)) : []
this.$set(this.ruleForm, 'ruleFormTime', [ this.$set(this.ruleForm, 'ruleFormTime', [
res.data.actStartDate, res.data.actStartDate,
res.data.actEndDate res.data.actEndDate
@ -265,14 +290,16 @@ export default {
}, },
submit() { submit() {
console.log(this.controlType, 'obj')
this.$refs['ruleForm'].validate((valid) => { this.$refs['ruleForm'].validate((valid) => {
if (valid) { if (valid) {
let obj = {} let params = {}
obj = this.ruleForm params = {
...this.ruleForm,
pkVertex: this.ruleForm.pkVertex ? this.ruleForm.pkVertex.join(',') : ''
}
if (this.controlType == 1) { if (this.controlType == 1) {
api.ticketSave(obj).then((res) => { api.ticketSave(params).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message({ this.$message({
message: res.msg, message: res.msg,
@ -284,7 +311,7 @@ export default {
} }
}) })
} else { } else {
api.ticketUpdate(obj).then((res) => { api.ticketUpdate(params).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message({ this.$message({
message: res.msg, message: res.msg,

View File

@ -1,9 +1,3 @@
<!--
* @Descripttion:
* @version:
* @Author: kBank
* @Date: 2022-10-24 15:45:01
-->
<template> <template>
<div class="page"> <div class="page">
<topBar <topBar
@ -66,7 +60,7 @@
<el-table-column <el-table-column
align="center" align="center"
prop="actName" prop="actName"
width="150" width="160"
:label="'活动名称'" :label="'活动名称'"
/> />
<el-table-column <el-table-column
@ -96,25 +90,25 @@
<el-table-column <el-table-column
align="center" align="center"
prop="actStartDate" prop="actStartDate"
width="150" width="160"
:label="$t('活动开始时间')" :label="$t('活动开始时间')"
/> />
<el-table-column <el-table-column
align="center" align="center"
prop="actEndDate" prop="actEndDate"
width="150" width="160"
:label="$t('活动结束时间')" :label="$t('活动结束时间')"
/> />
<el-table-column <el-table-column
align="center" align="center"
prop="disStartDate" prop="disStartDate"
width="150" width="160"
:label="$t('活动显示开始时间')" :label="$t('活动显示开始时间')"
/> />
<el-table-column <el-table-column
align="center" align="center"
prop="disEndDate" prop="disEndDate"
width="150" width="160"
:label="$t('活动显示结束时间')" :label="$t('活动显示结束时间')"
/> />
<el-table-column <el-table-column