|
|
@@ -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>
|