|
|
@@ -48,6 +48,7 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item
|
|
|
+ verify
|
|
|
label="在售状态"
|
|
|
prop="isSale"
|
|
|
>
|
|
|
@@ -65,13 +66,7 @@
|
|
|
label="销售价格"
|
|
|
prop="price"
|
|
|
>
|
|
|
- <el-input-number
|
|
|
- controls-position="right"
|
|
|
- v-model="form.price"
|
|
|
- :min="0"
|
|
|
- :step="0.01"
|
|
|
- :precision="2"
|
|
|
- ></el-input-number>
|
|
|
+ <el-input v-model="form.price"></el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
<!-- <el-form-item
|
|
|
@@ -102,6 +97,7 @@
|
|
|
|
|
|
<el-form-item
|
|
|
v-if="form.category !== 'member'"
|
|
|
+ verify
|
|
|
label="日期类型"
|
|
|
prop="useDateType"
|
|
|
>
|
|
|
@@ -146,6 +142,7 @@
|
|
|
</el-form-item> -->
|
|
|
<el-form-item
|
|
|
v-if="form.category === 'member'"
|
|
|
+ verify
|
|
|
label="会员时长类型"
|
|
|
prop="memberUseDateType"
|
|
|
>
|
|
|
@@ -163,6 +160,7 @@
|
|
|
|
|
|
<el-form-item
|
|
|
v-if="!(form.category === 'member' && form.memberUseDateType === 2)"
|
|
|
+ verify
|
|
|
label="使用天数"
|
|
|
prop="useDays"
|
|
|
>
|
|
|
@@ -189,7 +187,7 @@
|
|
|
placeholder="开始日期"
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
- <span>至</span>
|
|
|
+ <span style="margin:0 10px">至</span>
|
|
|
<el-date-picker
|
|
|
:editable="false"
|
|
|
:clearable="false"
|
|
|
@@ -203,6 +201,7 @@
|
|
|
|
|
|
<el-form-item
|
|
|
v-if="form.category === 'member'"
|
|
|
+ verify
|
|
|
label="激活方式"
|
|
|
prop="memberActiveType"
|
|
|
>
|
|
|
@@ -273,6 +272,7 @@
|
|
|
|
|
|
<el-form-item
|
|
|
v-if="form.isSaleDateLimit === 1"
|
|
|
+ verify
|
|
|
label="售卖时间"
|
|
|
prop="saleDateStart"
|
|
|
>
|
|
|
@@ -285,7 +285,7 @@
|
|
|
placeholder="开始日期"
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
- <span>至</span>
|
|
|
+ <span style="margin:0 10px">至</span>
|
|
|
<el-date-picker
|
|
|
:editable="false"
|
|
|
:clearable="false"
|
|
|
@@ -459,6 +459,7 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item
|
|
|
+ verify
|
|
|
label="票种绑定的销售渠道"
|
|
|
prop="ticketTypeSourceList"
|
|
|
>
|
|
|
@@ -651,7 +652,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- width="90"
|
|
|
+ width="110"
|
|
|
class-name="align-item"
|
|
|
label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
@@ -715,6 +716,18 @@
|
|
|
></el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="单日限制检票次数"
|
|
|
+ min-width="90">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input-number
|
|
|
+ controls-position="right"
|
|
|
+ :min="-1"
|
|
|
+ :precision="0"
|
|
|
+ v-model="scope.row.singleDayLimitTimes"
|
|
|
+ ></el-input-number>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
width="90"
|
|
|
class-name="align-item"
|
|
|
@@ -772,7 +785,7 @@
|
|
|
></el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
+ <!-- <el-table-column
|
|
|
label="单景点检票次数"
|
|
|
min-width="90">
|
|
|
<template slot-scope="scope">
|
|
|
@@ -783,16 +796,22 @@
|
|
|
v-model="scope.row.scenicLimitTimes"
|
|
|
></el-input-number>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column
|
|
|
- width="90"
|
|
|
+ width="210"
|
|
|
class-name="align-item"
|
|
|
label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
<div style="display:flex">
|
|
|
<span
|
|
|
class="el-button el-button--primary el-button--small"
|
|
|
- @click="delScenic(scope.$index,'multiple')">
|
|
|
+ @click="setSceneTimes(scope.$index, scope.row)">
|
|
|
+ <i class="el-icon-edit-outline"></i>
|
|
|
+ 分配次数
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ class="el-button el-button--primary el-button--small"
|
|
|
+ @click="delScenic(scope.$index, 'multiple')">
|
|
|
<i class="el-icon-delete"></i>
|
|
|
删除
|
|
|
</span>
|
|
|
@@ -823,20 +842,76 @@
|
|
|
</div>
|
|
|
</el-form>
|
|
|
</el-scrollbar>
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="setTimeVisible"
|
|
|
+ title="分配次数"
|
|
|
+ append-to-body
|
|
|
+ @close="handleGroupTimeClose">
|
|
|
+ <div class="table-box">
|
|
|
+ <el-table
|
|
|
+ border
|
|
|
+ stripe
|
|
|
+ :data="currGroupScenicInfo">
|
|
|
+ <el-table-column
|
|
|
+ label="景点">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.scenicName }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="单个景点的检票次数"
|
|
|
+ min-width="90">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input-number
|
|
|
+ controls-position="right"
|
|
|
+ :min="-1"
|
|
|
+ :precision="0"
|
|
|
+ v-model="scope.row.scenicLimitTimes"
|
|
|
+ ></el-input-number>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="单日限制检票次数"
|
|
|
+ min-width="90">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input-number
|
|
|
+ controls-position="right"
|
|
|
+ :min="-1"
|
|
|
+ :precision="0"
|
|
|
+ v-model="scope.row.singleDayLimitTimes"
|
|
|
+ ></el-input-number>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ slot="footer"
|
|
|
+ class="dialog-btn-wrap">
|
|
|
+ <el-button
|
|
|
+ @click="handleGroupTimeClose">
|
|
|
+ 取消
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ @click="handleGroupTimeSubmit"
|
|
|
+ type="primary">
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { addTicket, updateTicket, queueList, addTicketBatch, updateTicketBatch, delTicketBatch } from '@/api/ticketType'
|
|
|
import { getLabelName } from '@/utils'
|
|
|
-import { cloneDeep } from 'lodash'
|
|
|
+import { cloneDeep, isNumber } from 'lodash'
|
|
|
import moment from 'moment'
|
|
|
|
|
|
const defaultForm = {
|
|
|
category: 'ticket', // 大类
|
|
|
name: '', // 名称
|
|
|
isSale: 1, // 在售状态 0为禁售 1为在售 默认为1
|
|
|
- price: 0, // 窗口价格
|
|
|
+ price: '', // 窗口价格
|
|
|
onlinePrice: 0, // 线上价格
|
|
|
highPrice: 0, // 虚拟高价(划线价格)
|
|
|
memberUseDateType: 1, // 会员时长类型 1【按天】:购买后多少天的有效期 由票种字段use_days生效 。2【按照使用日期】:固定某个时间期内可以用
|
|
|
@@ -885,14 +960,14 @@ export default {
|
|
|
type: Array,
|
|
|
default: () => []
|
|
|
},
|
|
|
- ticketItem: {
|
|
|
- type: Object,
|
|
|
- default: () => {}
|
|
|
- },
|
|
|
- dialogType: {
|
|
|
- type: String,
|
|
|
- default: ''
|
|
|
- },
|
|
|
+ // ticketItem: {
|
|
|
+ // type: Object,
|
|
|
+ // default: () => {}
|
|
|
+ // },
|
|
|
+ // dialogType: {
|
|
|
+ // type: String,
|
|
|
+ // default: ''
|
|
|
+ // },
|
|
|
scenicList: {
|
|
|
type: Array,
|
|
|
default: () => []
|
|
|
@@ -908,6 +983,8 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ ticketItem: {},
|
|
|
+ dialogType: 'add',
|
|
|
projectName: process.env.VUE_APP_PROJECT,
|
|
|
visible: false,
|
|
|
pickerOptions: {
|
|
|
@@ -935,7 +1012,11 @@ export default {
|
|
|
preCheckMinutes: -1, // 预检时间
|
|
|
stopCheckMinutes: -1, // 停止检票时间
|
|
|
maxSaleNums: -1 // 最大售卖数量
|
|
|
- }
|
|
|
+ },
|
|
|
+ setTimeVisible: false,
|
|
|
+ groupIndex: -1,
|
|
|
+ currGroupScenicInfo: [],
|
|
|
+ groupScenicMap: new Map()
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -997,7 +1078,8 @@ export default {
|
|
|
if (!item.groupFlag) {
|
|
|
this.form.singleScenicList.push({
|
|
|
scenicId: item.scenicId,
|
|
|
- checkLimitTimes: item.checkLimitTimes
|
|
|
+ checkLimitTimes: item.checkLimitTimes,
|
|
|
+ singleDayLimitTimes: item.singleDayLimitTimes
|
|
|
})
|
|
|
} else {
|
|
|
if (groupFlag !== item.groupFlag) {
|
|
|
@@ -1006,7 +1088,8 @@ export default {
|
|
|
this.form.groupScenicList.push({
|
|
|
scenicId: [item.scenicId],
|
|
|
checkLimitTimes: item.checkLimitTimes,
|
|
|
- scenicLimitTimes: item.scenicLimitTimes
|
|
|
+ scenicLimitTimes: item.scenicLimitTimes,
|
|
|
+ singleDayLimitTimes: item.singleDayLimitTimes
|
|
|
})
|
|
|
} else {
|
|
|
this.form.groupScenicList[groupIndex - 1].scenicId.push(item.scenicId)
|
|
|
@@ -1079,16 +1162,56 @@ export default {
|
|
|
this.form.groupScenicList.push({
|
|
|
scenicId: [],
|
|
|
checkLimitTimes: -1,
|
|
|
+ singleDayLimitTimes: -1,
|
|
|
scenicLimitTimes: -1
|
|
|
})
|
|
|
} else {
|
|
|
this.form.singleScenicList.push({
|
|
|
scenicId: '',
|
|
|
checkLimitTimes: -1,
|
|
|
+ singleDayLimitTimes: -1,
|
|
|
scenicLimitTimes: -1
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ setSceneTimes (idx, item) {
|
|
|
+ if (!item || !item.scenicId || !item.scenicId.length) {
|
|
|
+ return this.$message.error('请先添加适用景点')
|
|
|
+ }
|
|
|
+
|
|
|
+ this.groupIndex = idx
|
|
|
+ const groupScenic = this.groupScenicMap.get(idx)
|
|
|
+
|
|
|
+ if (groupScenic) {
|
|
|
+ this.currGroupScenicInfo = groupScenic
|
|
|
+ } else {
|
|
|
+ this.currGroupScenicInfo = []
|
|
|
+ item.scenicId.forEach(id => {
|
|
|
+ const scene = this.scenicList.find((scene) => scene.id === id)
|
|
|
+
|
|
|
+ if (scene) {
|
|
|
+ this.currGroupScenicInfo.push({
|
|
|
+ scenicId: scene.id,
|
|
|
+ scenicName: scene.name,
|
|
|
+ scenicLimitTimes: -1,
|
|
|
+ singleDayLimitTimes: -1,
|
|
|
+ checkLimitTimes: item.checkLimitTimes
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ this.setTimeVisible = true
|
|
|
+ },
|
|
|
+ handleGroupTimeClose () {
|
|
|
+ this.currGroupScenicInfo = []
|
|
|
+ this.setTimeVisible = false
|
|
|
+ },
|
|
|
+ handleGroupTimeSubmit () {
|
|
|
+ this.groupScenicMap.set(this.groupIndex, this.currGroupScenicInfo)
|
|
|
+ this.currGroupScenicInfo = []
|
|
|
+ this.setTimeVisible = false
|
|
|
+ },
|
|
|
// 删除 适用景点-检票次数
|
|
|
delScenic (index, type) {
|
|
|
if (type === 'multiple') {
|
|
|
@@ -1148,58 +1271,87 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ setGroupScenicConfig () {
|
|
|
+ const gsList = []
|
|
|
+ const { groupScenicList } = this.form
|
|
|
+
|
|
|
+ for (let i = 0; i < groupScenicList.length; i++) {
|
|
|
+ const item = groupScenicList[i]
|
|
|
+ const sList = this.groupScenicMap.get(i) || item.scenicId.map(scenicId => {
|
|
|
+ return {
|
|
|
+ scenicId,
|
|
|
+ checkLimitTimes: item.checkLimitTimes,
|
|
|
+ singleDayLimitTimes: item.singleDayLimitTimes || -1,
|
|
|
+ scenicLimitTimes: item.scenicLimitTimes || -1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ gsList.push(sList)
|
|
|
+ }
|
|
|
+
|
|
|
+ this.form.groupScenicList = gsList
|
|
|
+ },
|
|
|
async submit () {
|
|
|
this.$refs.form.validate(valid => {
|
|
|
// 会员不检查景点
|
|
|
+ const {
|
|
|
+ price,
|
|
|
+ useDateStart,
|
|
|
+ useDateEnd,
|
|
|
+ isSaleDateLimit,
|
|
|
+ saleDateStart,
|
|
|
+ saleDateEnd,
|
|
|
+ category,
|
|
|
+ batchConfigList
|
|
|
+ } = this.form
|
|
|
|
|
|
if (valid) {
|
|
|
- if (this.form.price <= 0) {
|
|
|
+ if (!price || isNaN(Number(price)) || price <= 0) {
|
|
|
this.$message.error('请填写销售价格')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (moment(this.form.useDateStart).isAfter(this.form.useDateEnd)) {
|
|
|
+ if (moment(useDateStart).isAfter(useDateEnd)) {
|
|
|
this.$message.error('游玩开始时间不可晚于游玩截止时间')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (this.form.isSaleDateLimit === 1 && moment(this.form.saleDateStart).isAfter(this.form.saleDateEnd)) {
|
|
|
+ if (isSaleDateLimit === 1 && moment(saleDateStart).isAfter(saleDateEnd)) {
|
|
|
this.$message.error('起售时间不可晚于停售时间')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (moment(this.form.useDateStart).isAfter(this.form.useDateEnd)) {
|
|
|
+ if (moment(useDateStart).isAfter(useDateEnd)) {
|
|
|
this.$message.error('游玩开始时间不可晚于游玩截止时间')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (this.form.isSaleDateLimit === 1 && moment(this.form.saleDateEnd).isAfter(this.form.useDateEnd)) {
|
|
|
+ if (isSaleDateLimit === 1 && moment(saleDateEnd).isAfter(useDateEnd)) {
|
|
|
this.$message.error('停售时间不可晚于游玩截止时间')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (this.form.isSaleDateLimit === 1 && moment(this.form.saleDateStart).isAfter(this.form.useDateStart)) {
|
|
|
+ if (isSaleDateLimit === 1 && moment(saleDateStart).isAfter(useDateStart)) {
|
|
|
this.$message.error('起售时间不可晚于游玩开始时间')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (this.form.category === 'batch') {
|
|
|
- if (this.form.batchConfigList.length === 0) {
|
|
|
+ if (category === 'batch') {
|
|
|
+ if (batchConfigList.length === 0) {
|
|
|
this.$message.error('请添加场次时间')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (this.form.batchConfigList.some(item => !item.name)) {
|
|
|
+ if (batchConfigList.some(item => !item.name)) {
|
|
|
this.$message.error('场次名称不能为空')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (this.form.batchConfigList.some(item => !item.startTime)) {
|
|
|
+ if (batchConfigList.some(item => !item.startTime)) {
|
|
|
this.$message.error('场次开始时间不能为空')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (this.form.batchConfigList.some(item => !item.endTime)) {
|
|
|
+ if (batchConfigList.some(item => !item.endTime)) {
|
|
|
this.$message.error('场次结束时间不能为空')
|
|
|
return
|
|
|
}
|
|
|
@@ -1222,22 +1374,12 @@ export default {
|
|
|
// this.form.useDateEnd = this.formatEndTime(this.form.useDateEnd)
|
|
|
// this.form.requiredField = JSON.stringify(this.form.requiredField)
|
|
|
// form.useDayOfWeek.join is not a function"
|
|
|
+ this.form.price = Number(price)
|
|
|
this.form.useDayOfWeek = this.form.useDayOfWeek?.join(',')
|
|
|
this.form.checkRule = this.form.checkRule.join(',')
|
|
|
this.form.checkType = this.form.checkType.join(',')
|
|
|
|
|
|
- const groupScenicList = this.form.groupScenicList.map(item => {
|
|
|
- const sList = item.scenicId.map(scenicId => {
|
|
|
- return {
|
|
|
- scenicId,
|
|
|
- checkLimitTimes: item.checkLimitTimes,
|
|
|
- scenicLimitTimes: item.scenicLimitTimes
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- return sList
|
|
|
- })
|
|
|
- this.form.groupScenicList = groupScenicList
|
|
|
+ this.setGroupScenicConfig()
|
|
|
|
|
|
switch (this.dialogType) {
|
|
|
case 'add':
|
|
|
@@ -1249,6 +1391,7 @@ export default {
|
|
|
}
|
|
|
} else {
|
|
|
console.log('error submit!!')
|
|
|
+ this.$message.error('请补充表单内容')
|
|
|
return false
|
|
|
}
|
|
|
})
|