|
@@ -15,7 +15,8 @@
|
|
|
<el-select
|
|
<el-select
|
|
|
v-model="form.ticketTypeId"
|
|
v-model="form.ticketTypeId"
|
|
|
:disabled="dialogType === 'edit'"
|
|
:disabled="dialogType === 'edit'"
|
|
|
- filterable>
|
|
|
|
|
|
|
+ filterable
|
|
|
|
|
+ @change="handleTicketTypeChange">
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in ticketTypeList"
|
|
v-for="item in ticketTypeList"
|
|
|
:key="item.id"
|
|
:key="item.id"
|
|
@@ -32,7 +33,8 @@
|
|
|
v-model="form.otaSourceIds"
|
|
v-model="form.otaSourceIds"
|
|
|
multiple
|
|
multiple
|
|
|
filterable
|
|
filterable
|
|
|
- :disabled="dialogType === 'edit'">
|
|
|
|
|
|
|
+ :disabled="dialogType === 'edit'"
|
|
|
|
|
+ @change="handleOtaSourceChange">
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in otaList"
|
|
v-for="item in otaList"
|
|
|
:key="item.id"
|
|
:key="item.id"
|
|
@@ -271,6 +273,274 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
+ <!-- 美团场次票配置 -->
|
|
|
|
|
+ <template v-if="showMtBatchConfig">
|
|
|
|
|
+ <div class="block-title">
|
|
|
|
|
+ 美团场次票配置
|
|
|
|
|
+ <el-tooltip
|
|
|
|
|
+ effect="dark"
|
|
|
|
|
+ content="当票种为场次票且分销商包含美团时,需要配置各场次的价格信息"
|
|
|
|
|
+ placement="top">
|
|
|
|
|
+ <i class="el-icon-info"></i>
|
|
|
|
|
+ </el-tooltip>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div class="btn-wrap-left">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ plain
|
|
|
|
|
+ class="add-btn"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="handleAddMtBatch">
|
|
|
|
|
+ 添加美团场次
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="table-box">
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ border
|
|
|
|
|
+ stripe
|
|
|
|
|
+ :data="form.mtProductLevelRequests">
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="场次"
|
|
|
|
|
+ min-width="150">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="scope.row.batchConfigId"
|
|
|
|
|
+ placeholder="请选择场次">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in currentBatchConfigList"
|
|
|
|
|
+ :key="item.batchConfigId"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.batchConfigId">
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="市场价"
|
|
|
|
|
+ min-width="120">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-input-number
|
|
|
|
|
+ controls-position="right"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :precision="2"
|
|
|
|
|
+ v-model="scope.row.marketPrice">
|
|
|
|
|
+ </el-input-number>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="美团价"
|
|
|
|
|
+ min-width="120">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-input-number
|
|
|
|
|
+ controls-position="right"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :precision="2"
|
|
|
|
|
+ v-model="scope.row.mtPrice">
|
|
|
|
|
+ </el-input-number>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="结算价"
|
|
|
|
|
+ min-width="120">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-input-number
|
|
|
|
|
+ controls-position="right"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :precision="2"
|
|
|
|
|
+ v-model="scope.row.settlementPrice">
|
|
|
|
|
+ </el-input-number>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="开始日期"
|
|
|
|
|
+ min-width="150">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="scope.row.startDate"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
|
+ placeholder="开始日期">
|
|
|
|
|
+ </el-date-picker>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="结束日期"
|
|
|
|
|
+ min-width="150">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="scope.row.endDate"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
|
+ placeholder="结束日期">
|
|
|
|
|
+ </el-date-picker>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ width="90"
|
|
|
|
|
+ label="操作">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span
|
|
|
|
|
+ class="el-button el-button--primary el-button--small"
|
|
|
|
|
+ @click="delMtBatch(scope.$index)">
|
|
|
|
|
+ <i class="el-icon-delete"></i>
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 携程场次票配置 -->
|
|
|
|
|
+ <template v-if="showXcBatchConfig">
|
|
|
|
|
+ <div class="block-title">
|
|
|
|
|
+ 携程场次票配置
|
|
|
|
|
+ <el-tooltip
|
|
|
|
|
+ effect="dark"
|
|
|
|
|
+ content="当票种为场次票且分销商包含携程时,需要配置各场次的资源信息"
|
|
|
|
|
+ placement="top">
|
|
|
|
|
+ <i class="el-icon-info"></i>
|
|
|
|
|
+ </el-tooltip>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div class="btn-wrap-left">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ plain
|
|
|
|
|
+ class="add-btn"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="handleAddXcBatch">
|
|
|
|
|
+ 添加携程场次
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="table-box">
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ border
|
|
|
|
|
+ stripe
|
|
|
|
|
+ :data="form.xcProductLevelRequests">
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="场次"
|
|
|
|
|
+ min-width="150">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="scope.row.batchConfigId"
|
|
|
|
|
+ placeholder="请选择场次">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in currentBatchConfigList"
|
|
|
|
|
+ :key="item.batchConfigId"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.batchConfigId">
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="资源状态"
|
|
|
|
|
+ min-width="120">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="scope.row.status"
|
|
|
|
|
+ placeholder="请选择">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ label="有效"
|
|
|
|
|
+ value="active">
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ label="无效"
|
|
|
|
|
+ value="inactive">
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="可售天数"
|
|
|
|
|
+ min-width="120">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-input-number
|
|
|
|
|
+ controls-position="right"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :precision="0"
|
|
|
|
|
+ v-model="scope.row.effectiveDays">
|
|
|
|
|
+ </el-input-number>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="提前预订"
|
|
|
|
|
+ min-width="120">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="scope.row.requiredAdvanceBooking"
|
|
|
|
|
+ placeholder="请选择">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ label="无需提前"
|
|
|
|
|
+ :value="0">
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ label="需要提前"
|
|
|
|
|
+ :value="1">
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="提前天数"
|
|
|
|
|
+ min-width="100">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-input-number
|
|
|
|
|
+ v-if="scope.row.requiredAdvanceBooking === 1"
|
|
|
|
|
+ controls-position="right"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :precision="0"
|
|
|
|
|
+ v-model="scope.row.advanceDays">
|
|
|
|
|
+ </el-input-number>
|
|
|
|
|
+ <span v-else>-</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="预订时间"
|
|
|
|
|
+ min-width="120">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-time-picker
|
|
|
|
|
+ v-if="scope.row.requiredAdvanceBooking === 1"
|
|
|
|
|
+ v-model="scope.row.advanceTime"
|
|
|
|
|
+ value-format="HH:mm"
|
|
|
|
|
+ format="HH:mm"
|
|
|
|
|
+ placeholder="选择时间">
|
|
|
|
|
+ </el-time-picker>
|
|
|
|
|
+ <span v-else>-</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="生效等待(分钟)"
|
|
|
|
|
+ min-width="130">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-input-number
|
|
|
|
|
+ v-if="scope.row.requiredAdvanceBooking === 1"
|
|
|
|
|
+ controls-position="right"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :precision="0"
|
|
|
|
|
+ v-model="scope.row.advanceMinutes">
|
|
|
|
|
+ </el-input-number>
|
|
|
|
|
+ <span v-else>-</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ width="90"
|
|
|
|
|
+ label="操作">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span
|
|
|
|
|
+ class="el-button el-button--primary el-button--small"
|
|
|
|
|
+ @click="delXcBatch(scope.$index)">
|
|
|
|
|
+ <i class="el-icon-delete"></i>
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
<div class="dialog-btn-wrap">
|
|
<div class="dialog-btn-wrap">
|
|
|
<el-button @click="reset">重置</el-button>
|
|
<el-button @click="reset">重置</el-button>
|
|
@@ -324,6 +594,29 @@ export default {
|
|
|
},
|
|
},
|
|
|
hasXc () {
|
|
hasXc () {
|
|
|
return this.form.otaSourceIds.some(id => !!this.otaList.find(item => item.otaSourceId === id && item.otaSourceCode === 'XC'))
|
|
return this.form.otaSourceIds.some(id => !!this.otaList.find(item => item.otaSourceId === id && item.otaSourceCode === 'XC'))
|
|
|
|
|
+ },
|
|
|
|
|
+ hasMt () {
|
|
|
|
|
+ return this.form.otaSourceIds.some(id => !!this.otaList.find(item => item.otaSourceId === id && item.otaSourceCode === 'MT'))
|
|
|
|
|
+ },
|
|
|
|
|
+ // 当前选中的票种
|
|
|
|
|
+ currentTicketType () {
|
|
|
|
|
+ return this.ticketTypeList.find(item => item.ticketTypeId === this.form.ticketTypeId) || {}
|
|
|
|
|
+ },
|
|
|
|
|
+ // 判断是否是场次票
|
|
|
|
|
+ isBatchTicket () {
|
|
|
|
|
+ return this.currentTicketType.category === 'batch'
|
|
|
|
|
+ },
|
|
|
|
|
+ // 当前票种的场次列表
|
|
|
|
|
+ currentBatchConfigList () {
|
|
|
|
|
+ return this.currentTicketType.batchConfigList || []
|
|
|
|
|
+ },
|
|
|
|
|
+ // 是否显示美团场次配置
|
|
|
|
|
+ showMtBatchConfig () {
|
|
|
|
|
+ return this.isBatchTicket && this.currentBatchConfigList.length > 0 && this.hasMt
|
|
|
|
|
+ },
|
|
|
|
|
+ // 是否显示携程场次配置
|
|
|
|
|
+ showXcBatchConfig () {
|
|
|
|
|
+ return this.isBatchTicket && this.currentBatchConfigList.length > 0 && this.hasXc
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
data () {
|
|
data () {
|
|
@@ -358,7 +651,9 @@ export default {
|
|
|
useDateEnd: moment().add(30, 'years').endOf('year').format('YYYY-MM-DD'),
|
|
useDateEnd: moment().add(30, 'years').endOf('year').format('YYYY-MM-DD'),
|
|
|
totalStock: -1, // -1代表不限库存
|
|
totalStock: -1, // -1代表不限库存
|
|
|
xcRealNameType: '',
|
|
xcRealNameType: '',
|
|
|
- otaTicketTypeScenicSplitRequests: []
|
|
|
|
|
|
|
+ otaTicketTypeScenicSplitRequests: [],
|
|
|
|
|
+ mtProductLevelRequests: [],
|
|
|
|
|
+ xcProductLevelRequests: []
|
|
|
},
|
|
},
|
|
|
showDeletedOption: false,
|
|
showDeletedOption: false,
|
|
|
deletedOption: {
|
|
deletedOption: {
|
|
@@ -381,6 +676,42 @@ export default {
|
|
|
this.form = Object.assign({}, this.form, this.currentItem)
|
|
this.form = Object.assign({}, this.form, this.currentItem)
|
|
|
console.log('this.form', this.form)
|
|
console.log('this.form', this.form)
|
|
|
this.form.otaSourceIds = this.form.otaSourceId ? [this.form.otaSourceId] : []
|
|
this.form.otaSourceIds = this.form.otaSourceId ? [this.form.otaSourceId] : []
|
|
|
|
|
+ // 处理美团场次票数据回填
|
|
|
|
|
+ if (this.currentItem.mtProductLevelList && this.currentItem.mtProductLevelList.length > 0) {
|
|
|
|
|
+ this.form.mtProductLevelRequests = this.currentItem.mtProductLevelList.map(item => ({
|
|
|
|
|
+ batchConfigId: item.batchConfigId,
|
|
|
|
|
+ marketPrice: item.marketPrice,
|
|
|
|
|
+ mtPrice: item.mtPrice,
|
|
|
|
|
+ settlementPrice: item.settlementPrice,
|
|
|
|
|
+ startDate: item.priceDate ? item.priceDate.split(' - ')[0] : '',
|
|
|
|
|
+ endDate: item.priceDate ? item.priceDate.split(' - ')[1] : ''
|
|
|
|
|
+ }))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.form.mtProductLevelRequests = []
|
|
|
|
|
+ }
|
|
|
|
|
+ // 处理携程场次票数据回填
|
|
|
|
|
+ if (this.currentItem.xcProductLevelList && this.currentItem.xcProductLevelList.length > 0) {
|
|
|
|
|
+ this.form.xcProductLevelRequests = this.currentItem.xcProductLevelList.map(item => ({
|
|
|
|
|
+ batchConfigId: item.batchConfigId,
|
|
|
|
|
+ status: item.status || 'active',
|
|
|
|
|
+ effectiveDays: item.effectiveDays || 0,
|
|
|
|
|
+ requiredAdvanceBooking: item.requiredAdvanceBooking || 0,
|
|
|
|
|
+ advanceDays: item.advanceDays || 0,
|
|
|
|
|
+ advanceTime: item.advanceTime || '',
|
|
|
|
|
+ advanceMinutes: item.advanceMinutes || 0
|
|
|
|
|
+ }))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.form.xcProductLevelRequests = []
|
|
|
|
|
+ }
|
|
|
|
|
+ // 处理分账子景点数据回填
|
|
|
|
|
+ if (this.currentItem.otaTicketTypeScenicSplitList && this.currentItem.otaTicketTypeScenicSplitList.length > 0) {
|
|
|
|
|
+ this.form.otaTicketTypeScenicSplitRequests = this.currentItem.otaTicketTypeScenicSplitList.map(item => ({
|
|
|
|
|
+ scenicId: item.scenicId,
|
|
|
|
|
+ price: item.price
|
|
|
|
|
+ }))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.form.otaTicketTypeScenicSplitRequests = []
|
|
|
|
|
+ }
|
|
|
// 有绑定场次的情况
|
|
// 有绑定场次的情况
|
|
|
const batch = this.batchConfigList.find(v => v.id === this.form.batchConfigId)
|
|
const batch = this.batchConfigList.find(v => v.id === this.form.batchConfigId)
|
|
|
if (!batch && this.form.batchConfigId !== 0 && this.dialogType === 'edit') { // 有绑定场次 且该场次在不在现有可选范围中 ==》原来绑定的场次被删了 要保证正常显示 手动加这一项
|
|
if (!batch && this.form.batchConfigId !== 0 && this.dialogType === 'edit') { // 有绑定场次 且该场次在不在现有可选范围中 ==》原来绑定的场次被删了 要保证正常显示 手动加这一项
|
|
@@ -393,6 +724,9 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
this.form.batchConfigId = 0
|
|
this.form.batchConfigId = 0
|
|
|
this.form.batchConfigIds = []
|
|
this.form.batchConfigIds = []
|
|
|
|
|
+ this.form.mtProductLevelRequests = []
|
|
|
|
|
+ this.form.xcProductLevelRequests = []
|
|
|
|
|
+ this.form.otaTicketTypeScenicSplitRequests = []
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -418,6 +752,54 @@ export default {
|
|
|
delScenicSplit (index) {
|
|
delScenicSplit (index) {
|
|
|
this.form.otaTicketTypeScenicSplitRequests.splice(index, 1)
|
|
this.form.otaTicketTypeScenicSplitRequests.splice(index, 1)
|
|
|
},
|
|
},
|
|
|
|
|
+ // 添加美团场次配置
|
|
|
|
|
+ handleAddMtBatch () {
|
|
|
|
|
+ this.form.mtProductLevelRequests.push({
|
|
|
|
|
+ batchConfigId: '',
|
|
|
|
|
+ marketPrice: this.form.marketPrice || 0,
|
|
|
|
|
+ mtPrice: this.form.salePrice || 0,
|
|
|
|
|
+ settlementPrice: this.form.settlementPrice || 0,
|
|
|
|
|
+ startDate: moment().format('YYYY-MM-DD'),
|
|
|
|
|
+ endDate: moment().add(1, 'years').format('YYYY-MM-DD')
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 删除美团场次配置
|
|
|
|
|
+ delMtBatch (index) {
|
|
|
|
|
+ this.form.mtProductLevelRequests.splice(index, 1)
|
|
|
|
|
+ },
|
|
|
|
|
+ // 添加携程场次配置
|
|
|
|
|
+ handleAddXcBatch () {
|
|
|
|
|
+ this.form.xcProductLevelRequests.push({
|
|
|
|
|
+ batchConfigId: '',
|
|
|
|
|
+ status: 'active',
|
|
|
|
|
+ effectiveDays: 365,
|
|
|
|
|
+ requiredAdvanceBooking: 0,
|
|
|
|
|
+ advanceDays: 0,
|
|
|
|
|
+ advanceTime: '',
|
|
|
|
|
+ advanceMinutes: 0
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 删除携程场次配置
|
|
|
|
|
+ delXcBatch (index) {
|
|
|
|
|
+ this.form.xcProductLevelRequests.splice(index, 1)
|
|
|
|
|
+ },
|
|
|
|
|
+ // 票种变更时清空场次配置
|
|
|
|
|
+ handleTicketTypeChange () {
|
|
|
|
|
+ this.form.mtProductLevelRequests = []
|
|
|
|
|
+ this.form.xcProductLevelRequests = []
|
|
|
|
|
+ },
|
|
|
|
|
+ // 分销商变更时处理
|
|
|
|
|
+ handleOtaSourceChange () {
|
|
|
|
|
+ // 如果不再包含美团,清空美团配置
|
|
|
|
|
+ if (!this.hasMt) {
|
|
|
|
|
+ this.form.mtProductLevelRequests = []
|
|
|
|
|
+ }
|
|
|
|
|
+ // 如果不再包含携程,清空携程配置
|
|
|
|
|
+ if (!this.hasXc) {
|
|
|
|
|
+ this.form.xcProductLevelRequests = []
|
|
|
|
|
+ this.form.xcRealNameType = ''
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
submit () {
|
|
submit () {
|
|
|
this.$refs.form.validate((valid) => {
|
|
this.$refs.form.validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
@@ -438,6 +820,30 @@ export default {
|
|
|
addTicket () {
|
|
addTicket () {
|
|
|
const params = Object.assign({}, this.form)
|
|
const params = Object.assign({}, this.form)
|
|
|
delete params.id
|
|
delete params.id
|
|
|
|
|
+ // 如果不是场次票或不包含美团,清空美团配置
|
|
|
|
|
+ if (!this.showMtBatchConfig) {
|
|
|
|
|
+ params.mtProductLevelRequests = []
|
|
|
|
|
+ }
|
|
|
|
|
+ // 如果不是场次票或不包含携程,清空携程配置
|
|
|
|
|
+ if (!this.showXcBatchConfig) {
|
|
|
|
|
+ params.xcProductLevelRequests = []
|
|
|
|
|
+ }
|
|
|
|
|
+ // 验证美团场次票配置
|
|
|
|
|
+ if (this.showMtBatchConfig && params.mtProductLevelRequests.length > 0) {
|
|
|
|
|
+ const hasEmptyBatch = params.mtProductLevelRequests.some(item => !item.batchConfigId)
|
|
|
|
|
+ if (hasEmptyBatch) {
|
|
|
|
|
+ this.$message.error('请选择美团场次票的场次')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 验证携程场次票配置
|
|
|
|
|
+ if (this.showXcBatchConfig && params.xcProductLevelRequests.length > 0) {
|
|
|
|
|
+ const hasEmptyBatch = params.xcProductLevelRequests.some(item => !item.batchConfigId)
|
|
|
|
|
+ if (hasEmptyBatch) {
|
|
|
|
|
+ this.$message.error('请选择携程场次票的场次')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
addOTATicketSale(params).then(res => {
|
|
addOTATicketSale(params).then(res => {
|
|
|
this.$message.success('添加成功')
|
|
this.$message.success('添加成功')
|
|
@@ -448,6 +854,30 @@ export default {
|
|
|
},
|
|
},
|
|
|
updateTicket () {
|
|
updateTicket () {
|
|
|
const params = Object.assign({}, this.form)
|
|
const params = Object.assign({}, this.form)
|
|
|
|
|
+ // 如果不是场次票或不包含美团,清空美团配置
|
|
|
|
|
+ if (!this.showMtBatchConfig) {
|
|
|
|
|
+ params.mtProductLevelRequests = []
|
|
|
|
|
+ }
|
|
|
|
|
+ // 如果不是场次票或不包含携程,清空携程配置
|
|
|
|
|
+ if (!this.showXcBatchConfig) {
|
|
|
|
|
+ params.xcProductLevelRequests = []
|
|
|
|
|
+ }
|
|
|
|
|
+ // 验证美团场次票配置
|
|
|
|
|
+ if (this.showMtBatchConfig && params.mtProductLevelRequests.length > 0) {
|
|
|
|
|
+ const hasEmptyBatch = params.mtProductLevelRequests.some(item => !item.batchConfigId)
|
|
|
|
|
+ if (hasEmptyBatch) {
|
|
|
|
|
+ this.$message.error('请选择美团场次票的场次')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 验证携程场次票配置
|
|
|
|
|
+ if (this.showXcBatchConfig && params.xcProductLevelRequests.length > 0) {
|
|
|
|
|
+ const hasEmptyBatch = params.xcProductLevelRequests.some(item => !item.batchConfigId)
|
|
|
|
|
+ if (hasEmptyBatch) {
|
|
|
|
|
+ this.$message.error('请选择携程场次票的场次')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
updateOTATicketSale(params).then(res => {
|
|
updateOTATicketSale(params).then(res => {
|
|
|
this.$message.success('保存成功')
|
|
this.$message.success('保存成功')
|