Przeglądaj źródła

feat: 订单查询增加票种多选筛选(ticketTypeIdList), 票种编辑弹框新增抖音门店绑定(系统配置douyin_multi_poi_id, 含抖音分销商时可选/否则清空)并移除分账子景点配置块

LaveyD 2 tygodni temu
rodzic
commit
83199b1526

+ 58 - 87
src/views/goodsCenter/priceList/EditDialog.vue

@@ -42,6 +42,29 @@
             :value="item.otaSourceId"></el-option>
         </el-select>
       </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
         verify
         class="is-required"
@@ -212,67 +235,6 @@
         </el-date-picker>
       </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">
         <div class="block-title">
@@ -552,7 +514,8 @@
 </template>
 
 <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 { CategoryDict } from '@/const'
 
@@ -598,6 +561,10 @@ export default {
     hasMt () {
       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 () {
       return this.ticketTypeList.find(item => item.ticketTypeId === this.form.ticketTypeId) || {}
@@ -628,7 +595,7 @@ export default {
       seatAreaList: [],
       seatAreas: [],
       batches: [],
-      scenicList: [],
+      dyPoiOptions: [], // 抖音门店下拉列表
       projectName: localStorage.getItem('otaProject'),
       dateOption: {
         disabledDate (theTime) {
@@ -650,8 +617,8 @@ export default {
         useDateStart: moment().format('YYYY-MM-DD'),
         useDateEnd: moment().add(30, 'years').endOf('year').format('YYYY-MM-DD'),
         totalStock: -1, // -1代表不限库存
+        dyPoiId: '', // 抖音门店id(非必填)
         xcRealNameType: '',
-        otaTicketTypeScenicSplitRequests: [],
         mtProductLevelRequests: [],
         xcProductLevelRequests: []
       },
@@ -670,7 +637,7 @@ export default {
       this.reset()
 
       if (val) {
-        this.getScenicList()
+        this.getDyPoiOptions()
         this.showDeletedOption = false
         if (this.dialogType === 'edit' && this.currentItem) {
           this.form = Object.assign({}, this.form, this.currentItem)
@@ -715,15 +682,6 @@ export default {
           } 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)
           if (!batch && this.form.batchConfigId !== 0 && this.dialogType === 'edit') { // 有绑定场次 且该场次在不在现有可选范围中  ==》原来绑定的场次被删了 要保证正常显示 手动加这一项
@@ -738,7 +696,6 @@ export default {
           this.form.batchConfigIds = []
           this.form.mtProductLevelRequests = []
           this.form.xcProductLevelRequests = []
-          this.form.otaTicketTypeScenicSplitRequests = []
         }
       }
     }
@@ -755,9 +712,20 @@ export default {
       }
       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 () {
@@ -766,15 +734,6 @@ export default {
     reset () {
       this.$refs.form.resetFields()
     },
-    handleAddScenicSplit () {
-      this.form.otaTicketTypeScenicSplitRequests.push({
-        scenicId: '',
-        price: 0
-      })
-    },
-    delScenicSplit (index) {
-      this.form.otaTicketTypeScenicSplitRequests.splice(index, 1)
-    },
     // 添加美团场次配置
     handleAddMtBatch () {
       this.form.mtProductLevelRequests.push({
@@ -822,6 +781,10 @@ export default {
         this.form.xcProductLevelRequests = []
         this.form.xcRealNameType = ''
       }
+      // 如果不再包含抖音,清空门店绑定
+      if (!this.hasDouyin) {
+        this.form.dyPoiId = ''
+      }
     },
     submit () {
       this.$refs.form.validate((valid) => {
@@ -851,6 +814,10 @@ export default {
       if (!this.showXcBatchConfig) {
         params.xcProductLevelRequests = []
       }
+      // 不包含抖音分销商时不传门店id
+      if (!this.hasDouyin) {
+        params.dyPoiId = ''
+      }
       // 验证美团场次票配置
       if (this.showMtBatchConfig && params.mtProductLevelRequests.length > 0) {
         const hasEmptyBatch = params.mtProductLevelRequests.some(item => !item.batchConfigId)
@@ -885,6 +852,10 @@ export default {
       if (!this.showXcBatchConfig) {
         params.xcProductLevelRequests = []
       }
+      // 不包含抖音分销商时不传门店id
+      if (!this.hasDouyin) {
+        params.dyPoiId = ''
+      }
       // 验证美团场次票配置
       if (this.showMtBatchConfig && params.mtProductLevelRequests.length > 0) {
         const hasEmptyBatch = params.mtProductLevelRequests.some(item => !item.batchConfigId)

+ 22 - 0
src/views/queryReport/orderList.vue

@@ -95,6 +95,23 @@
             </el-option>
           </el-select>
         </el-form-item> -->
+        <el-form-item
+          label="票种"
+          prop="ticketTypeIdList">
+          <el-select
+            filterable
+            multiple
+            clearable
+            v-model="form.ticketTypeIdList"
+            placeholder="请选择">
+            <el-option
+              v-for="item in ticketTypeList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.ticketTypeId">
+            </el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item
           label="订单状态"
           prop="orderStatus">
@@ -622,6 +639,7 @@ export default {
         createTimeBegin: moment().subtract(7, 'days').startOf('day'),
         createTimeEnd: moment().endOf('day'),
         otaSourceNameList: [], // 分销商名称
+        ticketTypeIdList: [], // 票种
         partnerOrderNo: '', // ota订单号
         visitorName: '', // 预订姓名
         visitorPhone: '', // 预订人手机
@@ -727,6 +745,10 @@ export default {
         this.form.playDateEnd = moment(this.form.playDateEnd).format('YYYY-MM-DD')
       }
 
+      if (!this.form.ticketTypeIdList) {
+        this.form.ticketTypeIdList = []
+      }
+
       getOrderList(this.form).then(res => {
         this.total = res.data.total || 0
         this.tableData = res.data.records || []