Browse Source

添加票

dct 1 month ago
parent
commit
4bbe234791

+ 2 - 0
src/pages/sellManage/common/TicketList.vue

@@ -471,6 +471,8 @@ export default {
           item.isSale = this.currentTicket.isSale
           item.isSale = this.currentTicket.isSale
         }
         }
       })
       })
+
+      EventBus.$emit('ticketChanged', this.currentTicket)
     },
     },
     handleBatchChange (row) {
     handleBatchChange (row) {
       console.log('当前选择的场次', row)
       console.log('当前选择的场次', row)

+ 18 - 8
src/pages/sellManage/retail/FormInfo.vue

@@ -244,6 +244,7 @@ import TouristList from '../common/TouristList'
 import moment from 'moment'
 import moment from 'moment'
 import { IDENTIFY_TYPES } from '@/const'
 import { IDENTIFY_TYPES } from '@/const'
 import { getTeamList, getGuideList } from '@/api/checker'
 import { getTeamList, getGuideList } from '@/api/checker'
+import { EventBus } from '@/utils/eventBus'
 
 
 export default {
 export default {
   props: {
   props: {
@@ -595,6 +596,23 @@ export default {
     }
     }
 
 
   },
   },
+  mounted () {
+    EventBus.$on('ticketChanged', () => {
+      if (!this.currentTicket) return
+
+      setTimeout(() => {
+        if (this.category === 'batch' || this.isTeam) return
+        // if (!this.ticketAutoAddMap[this.currentTicket.id]) {
+        //   this.ticketAutoAddMap[this.currentTicket.id] = true
+        // }
+        this.addToOrder()
+      }, 500)
+    })
+  },
+  beforeDestroy () {
+    EventBus.$off('ticketChanged')
+  },
+
   watch: {
   watch: {
     async currentTicket (val, oldVal) {
     async currentTicket (val, oldVal) {
       if (!val) return
       if (!val) return
@@ -646,14 +664,6 @@ export default {
       this.timer = setTimeout(() => {
       this.timer = setTimeout(() => {
         this.setPrice(this.currentTicket.price)
         this.setPrice(this.currentTicket.price)
       }, 300)
       }, 300)
-
-      this.setTimeout = setTimeout(() => {
-        if (this.category === 'batch' || this.isTeam) return
-        if (!this.ticketAutoAddMap[val.id]) {
-          this.ticketAutoAddMap[val.id] = true
-          this.addToOrder()
-        }
-      }, 500)
     },
     },
     retailLockCheckStyle (val) {
     retailLockCheckStyle (val) {
       if (val) {
       if (val) {