|
|
@@ -478,9 +478,9 @@
|
|
|
<el-form-item
|
|
|
verify
|
|
|
label="票种绑定的销售渠道"
|
|
|
- prop="ticketTypeSourceList"
|
|
|
+ prop="source"
|
|
|
>
|
|
|
- <el-checkbox-group v-model="form.ticketTypeSourceList">
|
|
|
+ <el-checkbox-group v-model="form.source">
|
|
|
<el-checkbox
|
|
|
label="window">
|
|
|
窗口
|
|
|
@@ -918,7 +918,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { addTicket, updateTicket, queueList, addTicketBatch, updateTicketBatch, delTicketBatch } from '@/api/ticketType'
|
|
|
+import { addTicket, updateTicket, queueList, batchUpdateTicketBatch, delTicketBatch } from '@/api/ticketType'
|
|
|
import { getLabelName } from '@/utils'
|
|
|
import { cloneDeep } from 'lodash'
|
|
|
import moment from 'moment'
|
|
|
@@ -962,7 +962,7 @@ const defaultForm = {
|
|
|
groupScenicList: [], // 包含项目-组合景点数组 二维数组结构
|
|
|
batchConfigList: [], // 批次配置数组
|
|
|
ticketTypeScenicList: [], // 票种绑定的景点数组
|
|
|
- ticketTypeSourceList: ['window', 'term'], // 票种绑定的销售渠道 窗口:window ; 自助机:term,示例值([window])
|
|
|
+ source: ['window', 'term'], // 票种绑定的销售渠道 窗口:window ; 自助机:term,示例值([window])
|
|
|
useDateType: 1 // 使用日期类型 1日历票 2期票 默认为1
|
|
|
}
|
|
|
export default {
|
|
|
@@ -1066,13 +1066,13 @@ export default {
|
|
|
this.dialogType = type
|
|
|
if (ticketItem) {
|
|
|
this.form = cloneDeep(ticketItem)
|
|
|
- this.form.ticketTypeSourceList = ticketItem.ticketTypeSourceList || ticketItem.source || []
|
|
|
+ this.form.source = ticketItem.source || []
|
|
|
this.form.useDayOfWeek = this.form.useDayOfWeek.split(',')
|
|
|
this.form.checkType = this.form.checkType.split(',')
|
|
|
this.form.checkRule = this.form.checkRule.split(',')
|
|
|
|
|
|
- if (!this.form.ticketTypeSourceList) {
|
|
|
- this.form.ticketTypeSourceList = []
|
|
|
+ if (!this.form.source) {
|
|
|
+ this.form.source = []
|
|
|
}
|
|
|
|
|
|
if (!this.form.ticketTypeScenicList) {
|
|
|
@@ -1276,17 +1276,13 @@ export default {
|
|
|
},
|
|
|
async saveAllBatchConfig () {
|
|
|
const ticketTypeId = this.form.id
|
|
|
- const updateBatchList = this.form.batchConfigList.map(item => {
|
|
|
- if (item.id) {
|
|
|
- return updateTicketBatch(item)
|
|
|
- } else {
|
|
|
- return addTicketBatch(ticketTypeId, item)
|
|
|
- }
|
|
|
- })
|
|
|
+ if (!ticketTypeId) {
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
- return Promise.all(updateBatchList).then(res => {
|
|
|
- if (res.some(item => item.code !== '200')) {
|
|
|
- this.$message.error('时间场次保存失败')
|
|
|
+ batchUpdateTicketBatch(ticketTypeId, this.form.batchConfigList).then(res => {
|
|
|
+ if (res.code !== '200') {
|
|
|
+ this.$message.error('场次保存失败')
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -1324,7 +1320,7 @@ export default {
|
|
|
} = this.form
|
|
|
|
|
|
if (valid) {
|
|
|
- if (!price || isNaN(Number(price)) || price <= 0) {
|
|
|
+ if (isNaN(Number(price)) || price < 0) {
|
|
|
this.$message.error('请填写销售价格')
|
|
|
return
|
|
|
}
|