LaveyD 6 months ago
parent
commit
e8d249b86d

+ 2 - 0
.editorconfig

@@ -3,3 +3,5 @@ indent_style = space
 indent_size = 2
 trim_trailing_whitespace = true
 insert_final_newline = true
+single_quote = true
+semi = false

+ 43 - 0
.eslint.js

@@ -0,0 +1,43 @@
+// https://eslint.org/docs/user-guide/configuring
+
+module.exports = {
+  root: true,
+  parserOptions: {
+    parser: 'babel-eslint'
+  },
+  env: {
+    browser: true,
+    jquery: true
+  },
+  extends: [
+    // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
+    // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
+    'plugin:vue/essential',
+    // https://github.com/standard/standard/blob/master/docs/RULES-en.md
+    'standard'
+  ],
+  // required to lint *.vue files
+  plugins: [
+    'vue'
+  ],
+  // add your custom rules here
+  rules: {
+    // allow async-await
+    'generator-star-spacing': 'off',
+    // allow debugger during development
+    // 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
+    'no-debugger': 'off',
+    'space-before-function-paren': 'off',
+    'comma-dangle': ['warn', {
+      arrays: 'always-multiline',
+      objects: 'always-multiline',
+      imports: 'always-multiline',
+      exports: 'always-multiline',
+      functions: 'always-multiline',
+    }],
+    semi: false,
+  },
+  globals: {
+    'ActiveXObject': true
+  }
+}

+ 7 - 1
.eslintrc.js

@@ -32,7 +32,13 @@ module.exports = {
     'vue/name-property-casing':'off',
     'vue/html-closing-bracket-newline': 'off',
     'vue/component-name-in-template-casing': 'off',
-    'camelcase':'off'
+    'camelcase':'off',
+    'prettier/prettier': [
+      'warn', {
+        singleQuote: true,
+        semi: false
+      }
+    ]
   },
   parserOptions: {
     parser: 'babel-eslint'

+ 4 - 0
src/api/queryReport.js

@@ -29,6 +29,10 @@ export function exportDailyOfflineSale (params) {
 export function getCheckerAccessStatistics (params) {
   return http.post('/admin/statistics/checkerAccessStatistics', { data: params })
 }
+// 检票核销统计
+export function getCheckerVerifyStatistics (params) {
+  return http.post('/admin/statistics/orderCheckStatistics', { data: params })
+}
 
 // 导出检票统计按票数
 export function exportCheckStatisticsInTicketCount (params) {

+ 7 - 7
src/components/GlobalComponents/OrderDetail.vue

@@ -151,6 +151,13 @@
                 {{ scope.row.playDateBegin || scope.row.playDateEnd ? `${scope.row.playDateBegin || ''} - ${scope.row.playDateEnd || ''}` : "无限制" }}
               </template>
             </el-table-column>
+            <el-table-column width="80" prop="price" label="小计">
+            </el-table-column>
+            <el-table-column min-width="180" label="检票景点">
+              <template slot-scope="scope">
+                {{ scope.row.ticketCheckScenicList.map(item => item.scenicName).join(',') }}
+              </template>
+            </el-table-column>
             <el-table-column width="240" prop="ticketCardInfo" label="卡信息">
               <template slot-scope="scope" v-if="scope.row.card">
                 <div class=""><span>卡片编号:</span>{{ scope.row.card.cardNo }}</div>
@@ -170,13 +177,6 @@
                 <div class=""><span>注册状态:</span>{{ scope.row.face.registerStatus === 0 ? '未注册' : '已注册' }}</div>
               </template>
             </el-table-column>
-            <el-table-column width="80" prop="price" label="小计">
-            </el-table-column>
-            <el-table-column min-width="180" label="检票景点">
-              <template slot-scope="scope">
-                {{ scope.row.ticketCheckScenicList.map(item => item.scenicName).join(',') }}
-              </template>
-            </el-table-column>
           </el-table>
           <!-- <el-table :data="checkDetailList" :max-height="200">
             <el-table-column prop="ticketNo" label="票号"> </el-table-column>

src/pages/queryReport/OrderStatistics.vue → src/pages/queryReport/OrderStatistic.vue


+ 23 - 89
src/pages/queryReport/checkStatistic.vue

@@ -8,24 +8,6 @@
       <div class="block-title">
         查询条件
       </div>
-      <el-form-item
-        label="检票闸机"
-        prop="checkerId">
-        <el-select
-          v-model="form.checkerId"
-          clearable
-          filterable>
-          <el-option
-            value=""
-            label="全部"></el-option>
-          <el-option
-            v-for="item in deviceList"
-            :key="item.id"
-            :label="item.name"
-            :value="item.id">
-          </el-option>
-        </el-select>
-      </el-form-item>
       <el-form-item
         label="起始时间"
         prop="checkTimeBegin">
@@ -45,7 +27,7 @@
           placeholder="选择日期时间">
         </el-date-picker>
       </el-form-item>
-      <!-- <el-form-item
+      <el-form-item
         label="票种"
         prop="ticketTypeIdList">
         <el-select v-model="form.ticketTypeIdList">
@@ -69,7 +51,7 @@
           multiple
           clearable>
           <el-option
-            v-for="(item,index) in saleChannel"
+            v-for="(item,index) in saleChannels"
             :key="index"
             :label="item"
             :value="item"
@@ -77,27 +59,6 @@
           </el-option>
         </el-select>
       </el-form-item>
-      <el-form-item
-        label="售票类型"
-        prop="keyWords7"
-      >
-        <el-select
-          v-model="form.keyWords7"
-          placeholder="请选择">
-          <el-option
-            value=""
-            label="全部">
-          </el-option>
-          <el-option
-            :value="1"
-            label="散客">
-          </el-option>
-          <el-option
-            :value="2"
-            label="团体">
-          </el-option>
-        </el-select>
-      </el-form-item> -->
 
       <div
         class="btn-wrap"
@@ -129,56 +90,39 @@
         v-loading="loading"
         :data="tableData"
         :row-class-name="totalRowClassName">
-        <!-- <el-table-column
-          v-for="(item,index) in finalGroup"
-          :key="index"
-          :prop="item.prop||item.value"
-          :label="item.label">
-        </el-table-column> -->
-        <!-- <el-table-column
-          v-if="tableData.find(v=>v.otaSourceName)"
+        <el-table-column
           prop="otaSourceName"
-          label="分销商">
+          label="订单渠道">
         </el-table-column>
         <el-table-column
-          v-if="tableData.find(v=>v.tagName)"
-          prop="tagName"
-          label="票种标签">
-        </el-table-column> -->
-        <el-table-column
-          prop="checkerName"
-          label="检票设备">
+          prop="ticketTypeName"
+          label="票种名称">
         </el-table-column>
         <el-table-column
-          prop="enterNums"
-          label="进入总次数">
+          prop="unitPrice"
+          label="单价">
         </el-table-column>
         <el-table-column
-          prop="outNums"
-          label="出入总次数">
-        </el-table-column>
-        <!-- <el-table-column
           prop="checkCount"
           label="检票数量">
         </el-table-column>
         <el-table-column
-          prop="检票人数"
-          label="人数">
+          prop="checkNum"
+          label="检票人数">
         </el-table-column>
         <el-table-column
           prop="checkPrice"
           label="检票金额">
-        </el-table-column> -->
+        </el-table-column>
       </el-table>
     </div>
   </div>
 </template>
 <script>
-import { getCheckerAccessStatistics } from '@/api/queryReport'
+import { getCheckerVerifyStatistics } from '@/api/queryReport'
 import { totalRowClassName } from '@/utils'
 import moment from 'moment'
-// import { apiOrder } from '@/api/order.js'
-import { getDeviceList } from '@/api/checker'
+import { getSaleChannelList } from '@/api/order'
 // import ReaderInput from '@/components/ReaderInput'
 // import draggable from 'vuedraggable'
 // import moment from 'moment'
@@ -220,29 +164,18 @@ export default {
       finalGroup: [],
       tableIndex: 1,
       OrderIndexArr: [],
-      isShow_otaName: false,
       tableData: [],
       deviceList: [],
+      saleChannels: [],
+      // ticketTypeList: [],
       loading: false
     }
   },
   created () {
     this.getCheckStatistic()
+    this.getSaleChannelList()
   },
   mounted () {
-    if (this.scenicName !== '铭投山庄') return
-    setTimeout(() => {
-      this.form.keyList2 = this.userScenic.map(v => v.id)
-      this.getCheckStatistic()
-    }, 1000)
-  },
-  watch: {
-    isShow_otaName (newName, oldName) {
-      if (newName) {
-        this.form.keyGroupBy = ['otaSourceName']
-        this.getCheckStatistic()
-      }
-    }
   },
   methods: {
     hideClear () {
@@ -275,9 +208,9 @@ export default {
     reset () {
       this.$refs.form.resetFields()
     },
-    getDeviceList () {
-      getDeviceList({ pageSize: -1, pageNum: 1 }).then((res) => {
-        this.deviceList = res?.data.records
+    getSaleChannelList () {
+      getSaleChannelList({ pageSize: -1, pageNum: 1 }).then((res) => {
+        this.saleChannels = res?.data || []
       })
     },
     // 获取表格数据
@@ -295,7 +228,7 @@ export default {
         this.form.checkTimeEnd = moment(this.form.checkTimeEnd).format('YYYY-MM-DD HH:mm:ss')
       }
       // this.form.keyGroupBy = this.finalGroup.map(i => i.value)
-      getCheckerAccessStatistics(this.form).then(res => {
+      getCheckerVerifyStatistics(this.form).then(res => {
         this.tableData = res.data
       }).finally(() => {
         this.loading = false
@@ -328,13 +261,14 @@ export default {
     },
     reportExport () {
       this.form.export = true
-      this.form.exportDetail = true
-      getCheckerAccessStatistics(this.form).then(() => {
+      // this.form.exportDetail = true
+      getCheckerVerifyStatistics(this.form).then(() => {
         this.$message.success('导出成功。')
         this.goToDownload()
       }, () => {
         this.$message.success('导出失败。')
       })
+      this.reset()
     }
   }
 }

+ 341 - 0
src/pages/queryReport/checkerStatistic.vue

@@ -0,0 +1,341 @@
+<template>
+  <div class="form-wrap">
+    <el-form
+      class="search-box"
+      ref="form"
+      :model="form"
+      :inline="true">
+      <div class="block-title">
+        查询条件
+      </div>
+      <el-form-item
+        label="检票闸机"
+        prop="checkerId">
+        <el-select
+          v-model="form.checkerId"
+          clearable
+          filterable>
+          <el-option
+            value=""
+            label="全部"></el-option>
+          <el-option
+            v-for="item in deviceList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        label="起始时间"
+        prop="checkTimeBegin">
+        <el-date-picker
+          v-model="form.checkTimeBegin"
+          type="datetime"
+          placeholder="选择日期时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item
+        label="截止时间"
+        prop="checkTimeEnd">
+        <el-date-picker
+          default-time="23:59:59"
+          v-model="form.checkTimeEnd"
+          type="datetime"
+          placeholder="选择日期时间">
+        </el-date-picker>
+      </el-form-item>
+      <!-- <el-form-item
+        label="票种"
+        prop="ticketTypeIdList">
+        <el-select v-model="form.ticketTypeIdList">
+          <el-option
+            value=""
+            label="全部"></el-option>
+          <el-option
+            v-for="item in ticketTypeList"
+            :key="item.id"
+            :value="item.id"
+            :label="item.name">
+          </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item
+        label="销售渠道"
+        prop="sourceList">
+        <el-select
+          v-model="form.sourceList"
+          multiple
+          clearable>
+          <el-option
+            v-for="(item,index) in saleChannel"
+            :key="index"
+            :label="item"
+            :value="item"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        label="售票类型"
+        prop="keyWords7"
+      >
+        <el-select
+          v-model="form.keyWords7"
+          placeholder="请选择">
+          <el-option
+            value=""
+            label="全部">
+          </el-option>
+          <el-option
+            :value="1"
+            label="散客">
+          </el-option>
+          <el-option
+            :value="2"
+            label="团体">
+          </el-option>
+        </el-select>
+      </el-form-item> -->
+
+      <div
+        class="btn-wrap"
+        style="margin-bottom:20px">
+        <el-button
+          @click="reportExport">
+          导出
+        </el-button>
+        <el-button
+          @click="reset">
+          重置
+        </el-button>
+        <el-button
+          :disabled="loading"
+          type="primary"
+          @click="getCheckStatistic">
+          搜索
+        </el-button>
+      </div>
+    </el-form>
+
+    <div class="table-box">
+      <div class="block-title">
+        统计结果
+      </div>
+      <el-table
+        border
+        stripe
+        v-loading="loading"
+        :data="tableData"
+        :row-class-name="totalRowClassName">
+        <!-- <el-table-column
+          v-for="(item,index) in finalGroup"
+          :key="index"
+          :prop="item.prop||item.value"
+          :label="item.label">
+        </el-table-column> -->
+        <!-- <el-table-column
+          v-if="tableData.find(v=>v.otaSourceName)"
+          prop="otaSourceName"
+          label="分销商">
+        </el-table-column>
+        <el-table-column
+          v-if="tableData.find(v=>v.tagName)"
+          prop="tagName"
+          label="票种标签">
+        </el-table-column> -->
+        <el-table-column
+          prop="checkerName"
+          label="检票设备">
+        </el-table-column>
+        <el-table-column
+          prop="enterNums"
+          label="进入总次数">
+        </el-table-column>
+        <el-table-column
+          prop="outNums"
+          label="出入总次数">
+        </el-table-column>
+        <!-- <el-table-column
+          prop="checkCount"
+          label="检票数量">
+        </el-table-column>
+        <el-table-column
+          prop="检票人数"
+          label="人数">
+        </el-table-column>
+        <el-table-column
+          prop="checkPrice"
+          label="检票金额">
+        </el-table-column> -->
+      </el-table>
+    </div>
+  </div>
+</template>
+<script>
+import { getCheckerAccessStatistics } from '@/api/queryReport'
+import { totalRowClassName } from '@/utils'
+import moment from 'moment'
+// import { apiOrder } from '@/api/order.js'
+import { getDeviceList } from '@/api/checker'
+// import ReaderInput from '@/components/ReaderInput'
+// import draggable from 'vuedraggable'
+// import moment from 'moment'
+
+export default {
+  name: 'checkStatistic',
+  computed: {
+    scenicName () {
+      return this.$localStore.get('scenicName') || this.$store.state.user.scenicName
+    },
+    saleChannel () {
+      return this.$store.state.app.saleChannel
+    },
+    scenicList () {
+      return this.$store.state.app.scenicList
+    },
+    ticketTypeList () {
+      return this.$store.state.app.ticketTypeList
+    },
+    userScenic () {
+      return this.$store.state.app.account.manager_scenic_matrix ? this.$store.state.app.account.manager_scenic_matrix : this.$store.state.app.scenicList
+    }
+  },
+  components: {
+  },
+  data () {
+    return {
+      groupKeys: [{ value: 'tagName', label: '票种标签' }, { value: 'otaSourceName', label: '分销商' }],
+      form: {
+        export: false,
+        checkTimeBegin: new Date(moment().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss')),
+        checkTimeEnd: new Date(moment().format('YYYY-MM-DD HH:mm:ss')),
+        ticketTypeIdList: [], //
+        sourceList: [],
+        pageNum: 1,
+        pageSize: 10
+      },
+      selectKeys: [],
+      finalGroup: [],
+      tableIndex: 1,
+      OrderIndexArr: [],
+      isShow_otaName: false,
+      tableData: [],
+      deviceList: [],
+      loading: false
+    }
+  },
+  created () {
+    this.getCheckStatistic()
+  },
+  mounted () {
+    if (this.scenicName !== '铭投山庄') return
+    setTimeout(() => {
+      this.form.keyList2 = this.userScenic.map(v => v.id)
+      this.getCheckStatistic()
+    }, 1000)
+  },
+  methods: {
+    hideClear () {
+      if (['铭投山庄'].includes(this.scenicName)) {
+        if (this.form.keyList2.length === 1) {
+          return 'hideClear'
+        } else {
+          return ''
+        }
+      } else {
+        return ''
+      }
+    },
+    disabled (item) {
+      if (['铭投山庄'].includes(this.scenicName)) {
+        if (this.form.keyList2.length > 1) {
+          return false
+        } else if (this.form.keyList2.length === 1) {
+          if (this.form.keyList2.includes(item.id)) {
+            return true
+          } else {
+            return false
+          }
+        }
+      } else {
+        return false
+      }
+    },
+    totalRowClassName,
+    reset () {
+      this.$refs.form.resetFields()
+    },
+    getDeviceList () {
+      getDeviceList({ pageSize: -1, pageNum: 1 }).then((res) => {
+        this.deviceList = res?.data.records
+      })
+    },
+    // 获取表格数据
+    getCheckStatistic () {
+      this.loading = true
+      this.tableIndex++
+      this.finalGroup = []
+      this.finalGroup = this.groupKeys.filter(i => {
+        return this.selectKeys.includes(i.value)
+      })
+      if (this.form.checkTimeBegin) {
+        this.form.checkTimeBegin = moment(this.form.checkTimeBegin).format('YYYY-MM-DD HH:mm:ss')
+      }
+      if (this.form.checkTimeEnd) {
+        this.form.checkTimeEnd = moment(this.form.checkTimeEnd).format('YYYY-MM-DD HH:mm:ss')
+      }
+      // this.form.keyGroupBy = this.finalGroup.map(i => i.value)
+      getCheckerAccessStatistics(this.form).then(res => {
+        this.tableData = res.data
+      }).finally(() => {
+        this.loading = false
+      })
+    },
+    objectSpanMethod ({ row, column, rowIndex, columnIndex }) {
+      if (columnIndex < this.finalGroup.length) {
+        if (!(this.OrderIndexArr[columnIndex] && this.OrderIndexArr[columnIndex].length)) return
+
+        for (let i = 0; i < this.OrderIndexArr[columnIndex].length; i++) {
+          let element = this.OrderIndexArr[columnIndex][i]
+          for (let j = 0; j < element.length; j++) {
+            let item = element[j]
+            if (rowIndex === item) {
+              if (j === 0) {
+                return {
+                  rowspan: element.length,
+                  colspan: 1
+                }
+              } else if (j !== 0) {
+                return {
+                  rowspan: 0,
+                  colspan: 0
+                }
+              }
+            }
+          }
+        }
+      }
+    },
+    reportExport () {
+      this.form.export = true
+      this.form.exportDetail = true
+      getCheckerAccessStatistics(this.form).then(() => {
+        this.$message.success('导出成功。')
+        this.goToDownload()
+      }, () => {
+        this.$message.success('导出失败。')
+      })
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.hideClear{
+  ::v-deep .el-tag.el-tag--info .el-tag__close{
+    display: none;
+  }
+}
+</style>

+ 6 - 3
src/pages/queryReport/handOverReport.vue

@@ -273,7 +273,7 @@ export default {
 
         try {
           const stat = JSON.parse(handOverStatistics) || {}
-          console.log(stat, 'bbb')
+          console.log('handOverStatistics', stat)
           this.saleList = stat.order_sale || []
           this.printList = stat.payChannel_sale || []
         } catch (error) {
@@ -290,10 +290,13 @@ export default {
         type: 'warning'
       }).then(() => {
         apiHandOverAdd().then(res => {
-          if (res.data.code === '200') {
+          if (res.code === '200') {
             this.$message.success('操作成功')
-            window.location.reload()
           }
+
+          setTimeout(() => {
+            window.location.reload()
+          }, 1000)
         })
       }).catch(() => {
       })

src/pages/queryReport/refundStatistics.vue → src/pages/queryReport/refundStatistic.vue


+ 1 - 0
src/pages/ticketSetting/ticket/Dialog.vue

@@ -1059,6 +1059,7 @@ export default {
     // },
     handleClose () {
       this.visible = false
+      this.reset()
       this.$emit('updateList')
     },
     reset () {

+ 1 - 1
src/pages/ticketSetting/ticketStorage/recordOfStorage/columns.js

@@ -1,6 +1,6 @@
 export default [
   {
-    title: '名称',
+    title: '票种名称',
     dataIndex: 'ticketTypeName',
     key: 'ticketTypeName',
     scopedSlots: { customRender: 'ticketTypeName' }

+ 26 - 8
src/router/index.js

@@ -81,8 +81,8 @@ let routerMap = [
   {
     path: '/ticketSale',
     component: Layout,
-    name: '售票管理',
-    meta: { title: '售票管理', icon: 'order-center', permissionName: 'order-center' },
+    name: '订单中心',
+    meta: { title: '订单中心', icon: 'order-center', permissionName: 'order-center' },
     redirect: 'noredirect',
     alwaysShow: true,
     children: [
@@ -120,7 +120,7 @@ let routerMap = [
         path: 'handOverReport',
         name: 'handOverReport',
         component: require('@/pages/queryReport/handOverReport').default,
-        meta: { title: '交班管理', permissionName: 'order-center:hand-over-report' }
+        meta: { title: '交班报表', permissionName: 'order-center:hand-over-report' }
       },
       {
         path: 'handOverList',
@@ -172,7 +172,7 @@ let routerMap = [
         path: 'payChannel',
         name: 'payChannel',
         component: require('@/pages/systemSetting/payChannel').default,
-        meta: { title: '支付设置', permissionName: 'ticket-manage:payChannel-manage' }
+        meta: { title: '支付渠道设置', permissionName: 'ticket-manage:payChannel-manage' }
       },
       {
         path: 'freeConfig',
@@ -229,15 +229,33 @@ let routerMap = [
       {
         path: 'orderStatistic',
         name: 'orderStatistic',
-        component: require('@/pages/queryReport/OrderStatistics').default,
+        component: require('@/pages/queryReport/OrderStatistic').default,
         meta: { title: '售票统计', permissionName: 'statistics-center:order-statistics' }
       },
       {
         path: 'checkQuery',
         name: 'checkQuery',
         component: require('@/pages/queryReport/checkQuery').default,
+        meta: { title: '检票记录', permissionName: 'statistics-center:check-list' }
+      },
+      {
+        path: 'checkStatistic',
+        name: 'checkStatistic',
+        component: require('@/pages/queryReport/checkStatistic').default,
         meta: { title: '核销统计', permissionName: 'statistics-center:check-statistics' }
       },
+      {
+        path: 'refundQuery',
+        name: 'refundQuery',
+        component: require('@/pages/queryReport/refundQuery').default,
+        meta: { title: '退票记录', permissionName: 'statistics-center:refund-list' }
+      },
+      {
+        path: 'refundStatistic',
+        name: 'refundStatistic',
+        component: require('@/pages/queryReport/refundStatistic').default,
+        meta: { title: '退票统计', permissionName: 'statistics-center:refund-statistics' }
+      },
       {
         path: 'freeQuery',
         name: 'freeQuery',
@@ -263,9 +281,9 @@ let routerMap = [
         meta: { title: '游客画像', permissionName: 'statistics-center:customer-statistics' }
       },
       {
-        path: 'checkStatistic',
-        name: 'checkStatistic',
-        component: require('@/pages/queryReport/checkStatistic').default,
+        path: 'checkerStatistic',
+        name: 'checkerStatistic',
+        component: require('@/pages/queryReport/checkerStatistic').default,
         meta: { title: '检票设备统计', permissionName: 'statistics-center:checker-statistics' }
       },
       {