|
@@ -42,6 +42,29 @@
|
|
|
:value="item.otaSourceId"></el-option>
|
|
:value="item.otaSourceId"></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ v-if="hasDouyin"
|
|
|
|
|
+ label="门店ID"
|
|
|
|
|
+ prop="dyPoiId">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="form.dyPoiId"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ filterable
|
|
|
|
|
+ placeholder="请选择门店(非必填)">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in dyPoiOptions"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.id"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <el-tooltip
|
|
|
|
|
+ effect="dark"
|
|
|
|
|
+ content="分销商包含抖音团购或抖音日历票时,可绑定抖音门店(非必填)"
|
|
|
|
|
+ placement="top"
|
|
|
|
|
+ >
|
|
|
|
|
+ <i class="el-icon-info"></i>
|
|
|
|
|
+ </el-tooltip>
|
|
|
|
|
+ </el-form-item>
|
|
|
<!-- <el-form-item
|
|
<!-- <el-form-item
|
|
|
verify
|
|
verify
|
|
|
class="is-required"
|
|
class="is-required"
|
|
@@ -212,67 +235,6 @@
|
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
- <div class="block-title">
|
|
|
|
|
- 添加分账子景点
|
|
|
|
|
- </div>
|
|
|
|
|
- <div>
|
|
|
|
|
- <div class="btn-wrap-left">
|
|
|
|
|
- <el-button
|
|
|
|
|
- plain
|
|
|
|
|
- class="add-btn"
|
|
|
|
|
- type="primary"
|
|
|
|
|
- @click="handleAddScenicSplit">
|
|
|
|
|
- 添加
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="table-box">
|
|
|
|
|
- <el-table
|
|
|
|
|
- border
|
|
|
|
|
- stripe
|
|
|
|
|
- :data="form.otaTicketTypeScenicSplitRequests">
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- label="适用景点">
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="scope.row.scenicId">
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in scenicList"
|
|
|
|
|
- :key="item.scenicId"
|
|
|
|
|
- :label="item.name"
|
|
|
|
|
- :value="item.scenicId"
|
|
|
|
|
- >
|
|
|
|
|
- </el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- label="应分金额"
|
|
|
|
|
- min-width="90">
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- <el-input-number
|
|
|
|
|
- controls-position="right"
|
|
|
|
|
- :min="0"
|
|
|
|
|
- v-model="scope.row.price"
|
|
|
|
|
- ></el-input-number>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- width="90"
|
|
|
|
|
- class-name="align-item"
|
|
|
|
|
- label="操作">
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- <span
|
|
|
|
|
- class="el-button el-button--primary el-button--small"
|
|
|
|
|
- @click="delScenicSplit(scope.$index)">
|
|
|
|
|
- <i class="el-icon-delete"></i>
|
|
|
|
|
- 删除
|
|
|
|
|
- </span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
<!-- 美团场次票配置 -->
|
|
<!-- 美团场次票配置 -->
|
|
|
<template v-if="showMtBatchConfig">
|
|
<template v-if="showMtBatchConfig">
|
|
|
<div class="block-title">
|
|
<div class="block-title">
|
|
@@ -552,7 +514,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { addOTATicketSale, updateOTATicketSale, getScenicList } from '@/api/otaTicketSale'
|
|
|
|
|
|
|
+import { addOTATicketSale, updateOTATicketSale } from '@/api/otaTicketSale'
|
|
|
|
|
+import { getSystemConfig } from '@/api/systemSetting/system'
|
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
|
import { CategoryDict } from '@/const'
|
|
import { CategoryDict } from '@/const'
|
|
|
|
|
|
|
@@ -598,6 +561,10 @@ export default {
|
|
|
hasMt () {
|
|
hasMt () {
|
|
|
return this.form.otaSourceIds.some(id => !!this.otaList.find(item => item.otaSourceId === id && item.otaSourceCode === 'MT'))
|
|
return this.form.otaSourceIds.some(id => !!this.otaList.find(item => item.otaSourceId === id && item.otaSourceCode === 'MT'))
|
|
|
},
|
|
},
|
|
|
|
|
+ // 是否包含抖音团购/抖音日历票分销商(名称包含"抖音")
|
|
|
|
|
+ hasDouyin () {
|
|
|
|
|
+ return this.form.otaSourceIds.some(id => !!this.otaList.find(item => item.otaSourceId === id && item.otaSourceName && item.otaSourceName.indexOf('抖音') > -1))
|
|
|
|
|
+ },
|
|
|
// 当前选中的票种
|
|
// 当前选中的票种
|
|
|
currentTicketType () {
|
|
currentTicketType () {
|
|
|
return this.ticketTypeList.find(item => item.ticketTypeId === this.form.ticketTypeId) || {}
|
|
return this.ticketTypeList.find(item => item.ticketTypeId === this.form.ticketTypeId) || {}
|
|
@@ -628,7 +595,7 @@ export default {
|
|
|
seatAreaList: [],
|
|
seatAreaList: [],
|
|
|
seatAreas: [],
|
|
seatAreas: [],
|
|
|
batches: [],
|
|
batches: [],
|
|
|
- scenicList: [],
|
|
|
|
|
|
|
+ dyPoiOptions: [], // 抖音门店下拉列表
|
|
|
projectName: localStorage.getItem('otaProject'),
|
|
projectName: localStorage.getItem('otaProject'),
|
|
|
dateOption: {
|
|
dateOption: {
|
|
|
disabledDate (theTime) {
|
|
disabledDate (theTime) {
|
|
@@ -650,8 +617,8 @@ export default {
|
|
|
useDateStart: moment().format('YYYY-MM-DD'),
|
|
useDateStart: moment().format('YYYY-MM-DD'),
|
|
|
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代表不限库存
|
|
|
|
|
+ dyPoiId: '', // 抖音门店id(非必填)
|
|
|
xcRealNameType: '',
|
|
xcRealNameType: '',
|
|
|
- otaTicketTypeScenicSplitRequests: [],
|
|
|
|
|
mtProductLevelRequests: [],
|
|
mtProductLevelRequests: [],
|
|
|
xcProductLevelRequests: []
|
|
xcProductLevelRequests: []
|
|
|
},
|
|
},
|
|
@@ -670,7 +637,7 @@ export default {
|
|
|
this.reset()
|
|
this.reset()
|
|
|
|
|
|
|
|
if (val) {
|
|
if (val) {
|
|
|
- this.getScenicList()
|
|
|
|
|
|
|
+ this.getDyPoiOptions()
|
|
|
this.showDeletedOption = false
|
|
this.showDeletedOption = false
|
|
|
if (this.dialogType === 'edit' && this.currentItem) {
|
|
if (this.dialogType === 'edit' && this.currentItem) {
|
|
|
this.form = Object.assign({}, this.form, this.currentItem)
|
|
this.form = Object.assign({}, this.form, this.currentItem)
|
|
@@ -715,15 +682,6 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
this.form.xcProductLevelRequests = []
|
|
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') { // 有绑定场次 且该场次在不在现有可选范围中 ==》原来绑定的场次被删了 要保证正常显示 手动加这一项
|
|
@@ -738,7 +696,6 @@ export default {
|
|
|
this.form.batchConfigIds = []
|
|
this.form.batchConfigIds = []
|
|
|
this.form.mtProductLevelRequests = []
|
|
this.form.mtProductLevelRequests = []
|
|
|
this.form.xcProductLevelRequests = []
|
|
this.form.xcProductLevelRequests = []
|
|
|
- this.form.otaTicketTypeScenicSplitRequests = []
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -755,9 +712,20 @@ export default {
|
|
|
}
|
|
}
|
|
|
return label
|
|
return label
|
|
|
},
|
|
},
|
|
|
- getScenicList () {
|
|
|
|
|
- getScenicList().then(res => {
|
|
|
|
|
- this.scenicList = res.data || []
|
|
|
|
|
|
|
+ // 获取抖音门店列表,系统配置 douyin_multi_poi_id,格式: 门店idA:门店名称A,门店idB:门店名称B
|
|
|
|
|
+ getDyPoiOptions () {
|
|
|
|
|
+ getSystemConfig({ configKey: 'douyin_multi_poi_id' }).then(res => {
|
|
|
|
|
+ const list = res.data || []
|
|
|
|
|
+ const config = list.find(item => item.configKey === 'douyin_multi_poi_id')
|
|
|
|
|
+ const configValue = config ? (config.configValue || '') : ''
|
|
|
|
|
+ // 约定为英文符号,兼容误填的全角冒号/逗号
|
|
|
|
|
+ const normalized = configValue.replace(/:/g, ':').replace(/,/g, ',')
|
|
|
|
|
+ this.dyPoiOptions = normalized.split(',').map(item => item.trim()).filter(item => item && item.indexOf(':') > 0).map(item => {
|
|
|
|
|
+ const idx = item.indexOf(':')
|
|
|
|
|
+ const id = item.slice(0, idx).trim()
|
|
|
|
|
+ const name = item.slice(idx + 1).trim()
|
|
|
|
|
+ return { id: id, label: `${name}(${id})` }
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
handleClose () {
|
|
handleClose () {
|
|
@@ -766,15 +734,6 @@ export default {
|
|
|
reset () {
|
|
reset () {
|
|
|
this.$refs.form.resetFields()
|
|
this.$refs.form.resetFields()
|
|
|
},
|
|
},
|
|
|
- handleAddScenicSplit () {
|
|
|
|
|
- this.form.otaTicketTypeScenicSplitRequests.push({
|
|
|
|
|
- scenicId: '',
|
|
|
|
|
- price: 0
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- delScenicSplit (index) {
|
|
|
|
|
- this.form.otaTicketTypeScenicSplitRequests.splice(index, 1)
|
|
|
|
|
- },
|
|
|
|
|
// 添加美团场次配置
|
|
// 添加美团场次配置
|
|
|
handleAddMtBatch () {
|
|
handleAddMtBatch () {
|
|
|
this.form.mtProductLevelRequests.push({
|
|
this.form.mtProductLevelRequests.push({
|
|
@@ -822,6 +781,10 @@ export default {
|
|
|
this.form.xcProductLevelRequests = []
|
|
this.form.xcProductLevelRequests = []
|
|
|
this.form.xcRealNameType = ''
|
|
this.form.xcRealNameType = ''
|
|
|
}
|
|
}
|
|
|
|
|
+ // 如果不再包含抖音,清空门店绑定
|
|
|
|
|
+ if (!this.hasDouyin) {
|
|
|
|
|
+ this.form.dyPoiId = ''
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
submit () {
|
|
submit () {
|
|
|
this.$refs.form.validate((valid) => {
|
|
this.$refs.form.validate((valid) => {
|
|
@@ -851,6 +814,10 @@ export default {
|
|
|
if (!this.showXcBatchConfig) {
|
|
if (!this.showXcBatchConfig) {
|
|
|
params.xcProductLevelRequests = []
|
|
params.xcProductLevelRequests = []
|
|
|
}
|
|
}
|
|
|
|
|
+ // 不包含抖音分销商时不传门店id
|
|
|
|
|
+ if (!this.hasDouyin) {
|
|
|
|
|
+ params.dyPoiId = ''
|
|
|
|
|
+ }
|
|
|
// 验证美团场次票配置
|
|
// 验证美团场次票配置
|
|
|
if (this.showMtBatchConfig && params.mtProductLevelRequests.length > 0) {
|
|
if (this.showMtBatchConfig && params.mtProductLevelRequests.length > 0) {
|
|
|
const hasEmptyBatch = params.mtProductLevelRequests.some(item => !item.batchConfigId)
|
|
const hasEmptyBatch = params.mtProductLevelRequests.some(item => !item.batchConfigId)
|
|
@@ -885,6 +852,10 @@ export default {
|
|
|
if (!this.showXcBatchConfig) {
|
|
if (!this.showXcBatchConfig) {
|
|
|
params.xcProductLevelRequests = []
|
|
params.xcProductLevelRequests = []
|
|
|
}
|
|
}
|
|
|
|
|
+ // 不包含抖音分销商时不传门店id
|
|
|
|
|
+ if (!this.hasDouyin) {
|
|
|
|
|
+ params.dyPoiId = ''
|
|
|
|
|
+ }
|
|
|
// 验证美团场次票配置
|
|
// 验证美团场次票配置
|
|
|
if (this.showMtBatchConfig && params.mtProductLevelRequests.length > 0) {
|
|
if (this.showMtBatchConfig && params.mtProductLevelRequests.length > 0) {
|
|
|
const hasEmptyBatch = params.mtProductLevelRequests.some(item => !item.batchConfigId)
|
|
const hasEmptyBatch = params.mtProductLevelRequests.some(item => !item.batchConfigId)
|