Bladeren bron

bug修改

LaveyD 3 maanden geleden
bovenliggende
commit
7f0ad1eeac

+ 5 - 5
src/api/systemConfig.js

@@ -23,7 +23,7 @@ export function getPayChannel () {
     }
   }).then(res => {
     let item = res.data.find(item => item.configKey === 'payChannel')
-    return item.configValue.split(',')
+    return item?.configValue?.split(',') || []
   })
 }
 
@@ -35,7 +35,7 @@ export function getCustomerType () {
     }
   }).then(res => {
     let item = res.data.find(item => item.configKey === 'customerType')
-    return item.configValue.split(',')
+    return item?.configValue?.split(',') || []
   })
 }
 
@@ -47,7 +47,7 @@ export function getTravelAgencyType () {
     }
   }).then(res => {
     let item = res.data.find(item => item.configKey === 'travel_agency_type')
-    return item.configValue.split(',')
+    return item?.configValue?.split(',') || []
   })
 }
 
@@ -60,8 +60,8 @@ export function getManualTicketCheckScenic () {
     }
   }).then(res => {
     let item = res.data.find(item => item.configKey === 'manual_ticket_check_scenic')
-    console.log('系统配置里的人工检票是否开启景点选择:', JSON.stringify(item), 'Y/N:', item.configValue)
+    console.log('系统配置里的人工检票是否开启景点选择:', JSON.stringify(item), 'Y/N:', item?.configValue)
     /* item.configValue.split(',') 为 [1] 这种数组, item.configValue为1或9 */
-    return item.configValue /* 1 or 0 */
+    return item?.configValue /* 1 or 0 */
   })
 }

+ 1 - 1
src/main.js

@@ -145,7 +145,7 @@ Vue.mixin({
     transformUrl () {
       const configs = this.$store.state.app.systemConfig || []
       const item = configs.find(i => i.configKey === 'reportfile_url_serverip_replace') || {}
-      const value = item.configValue
+      const value = item?.configValue
       console.log('reportfile_url_serverip_replace', value, typeof value)
       return value === '1'
     }

+ 12 - 6
src/pages/queryReport/salesQuery.vue

@@ -241,11 +241,15 @@
         >
           搜索
         </el-button>
-        <el-button
-          type="primary"
-          @click="reportExport">
-          导出
-        </el-button>
+        <el-dropdown @command="reportExport" style="margin-left: 10px;">
+          <el-button type="primary">
+            导出<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="order">订单级别</el-dropdown-item>
+            <el-dropdown-item command="ticket">门票级别</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
 
         <i class="el-icon-setting" style="cursor: pointer; margin-left: 10px;" title="设置显示列" @click="showColumnConfig" />
       </div>
@@ -1974,7 +1978,7 @@ export default {
       })
       this.reset()
     },
-    reportExport () {
+    reportExport (exportType) {
       this.$confirm(`是否要导出明细数据`, '确认提示', {
         confirmButtonText: '是',
         cancelButtonText: '否',
@@ -1982,12 +1986,14 @@ export default {
       }).then(() => {
         this.handleExport({
           ...this.form,
+          exportType: exportType || 'ticket',
           export: true,
           exportDetail: true
         })
       }).catch(() => {
         this.handleExport({
           ...this.form,
+          exportType: exportType || 'ticket',
           export: true,
           exportDetail: false
         })

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

@@ -123,6 +123,7 @@
           </i>
         </el-input>
         <el-button
+          v-if="category !== 'batch'"
           size="small"
           class="sort-btn"
           icon="el-icon-sort"
@@ -396,8 +397,11 @@ export default {
       if (this.category === 'batch') {
         this.getBatchList()
       } else {
-        this.changeTicket(this.currentTicket)
+        // this.changeTicket(this.currentTicket)
       }
+
+      this.currentTicket = {}
+      this.$emit('update', null)
     })
   },
   methods: {
@@ -469,7 +473,7 @@ export default {
                 batchConfigId: this.currentBatch.batchConfigId
               }
             })
-            this.changeTicket(this.tableData[0])
+            // this.changeTicket(this.tableData[0])
             this.$emit('set-batch', this.currentBatch)
           }
         }

+ 13 - 21
src/pages/sellManage/retail/FormInfo.vue

@@ -269,12 +269,6 @@ export default {
     ReaderInput
   },
   computed: {
-    category () {
-      return this.$route.meta.category || 'ticket'
-    },
-    isTeam () {
-      return this.$route.meta.type === 'team'
-    },
     totalPrice () {
       if (!this.currentTicket) {
         return 0
@@ -306,7 +300,12 @@ export default {
     }
   },
   data () {
+    const category = this.$route.meta.category || 'ticket'
+    const type = this.$route.meta.type
+    console.log('category', category, type)
     return {
+      category,
+      isTeam: type === 'team',
       loading: false,
       keyControl: 2, // 键盘控制:1,2,3标识选中顺序
       isFocus: false, // 当前组件是否选中
@@ -315,17 +314,7 @@ export default {
       pricePlan: [],
       currentPrice: 0,
       currentPlan: null,
-      saleType: (() => {
-        const category = this.$route.meta.category || 'ticket'
-        const type = this.$route.meta.type
-        if (category === 'batch') return 'batch'
-        if (category === 'member') return 'member'
-        if (type === 'team') return 'team'
-        return 'single'
-      })(),
       retailLockCheckStyle: (() => {
-        const category = this.$route.meta.category || 'ticket'
-        const type = this.$route.meta.type
         let prefix = 'single'
         if (category === 'batch') prefix = 'batch'
         else if (category === 'member') prefix = 'member'
@@ -333,15 +322,18 @@ export default {
         return this.$localStore.get(`${prefix}_lockCheckStyle`) || false
       })(),
       identifyLockCheckStyle: (() => {
-        const category = this.$route.meta.category || 'ticket'
-        const type = this.$route.meta.type
         let prefix = 'single'
         if (category === 'batch') prefix = 'batch'
         else if (category === 'member') prefix = 'member'
         else if (type === 'team') prefix = 'team'
         return this.$localStore.get(`${prefix}_identifyLockCheckStyle`) || false
       })(),
-
+      saleType: (() => {
+        if (category === 'batch') return 'batch'
+        else if (category === 'member') return 'member'
+        else if (type === 'team') return 'team'
+        else return 'single'
+      })(),
       touristList: [{
         batchConfigId: randomString(),
         guestName: '',
@@ -361,7 +353,7 @@ export default {
         buyerIdentifyType: 0,
         buyerPhone: '',
         groupIndividual: 1,
-        teamIndividual: 1,
+        teamIndividual: type === 'team' ? 2 : 1,
         count: this.$localStore.get('initNum') === '空' ? undefined : 1,
         payChannel: '现金',
         playDateBegin: new Date(moment().startOf('day').valueOf()),
@@ -369,7 +361,7 @@ export default {
         price: 0,
         teamId: '',
         guideId: '',
-        checkWay: this.isTeam ? 2 : 1,
+        checkWay: type === 'team' ? 2 : 1,
         actualMoney: 0 // 实付金额,不需要传给后台
       },
       Certificate: {

+ 1 - 1
src/store/modules/permission.js

@@ -18,7 +18,7 @@ function filterAsyncRouter (asyncRouterMap, menuList, permissionList) {
         // 过滤子路由
         route.children = route.children.filter(i => {
           if (i.meta && i.meta.permissionName) {
-            return permissionCodes.find((code) => i.meta.permissionName.indexOf(code) > -1)
+            return permissionCodes.find((code) => i.meta.permissionName.indexOf(`:${code}`) > -1)
           } else {
             return true
           }