Parcourir la source

新增统计表单

gcz il y a 11 mois
Parent
commit
1f3543ae72

+ 18 - 0
src/api/statisticalReport/statistics.js

@@ -91,4 +91,22 @@ export function downTeamOrderListXls(params) {
   });
 }
 
+// 日报表
+export const dayReportCount = (query) => {
+  return request({
+    url: '/order/operationReport/dayReportCount',
+    method: 'get',
+    params: query
+  })
+}
+// 日报表统计导出
+export function downDayReportCount(params) {
+  return request({
+    url: '/order/operationReport/dayReportCountExport',
+    method: 'get',
+    responseType: 'blob',
+    params
+  });
+}
+
 

+ 337 - 0
src/views/statisticalReport/daily.vue

@@ -0,0 +1,337 @@
+<!--
+ * @Description: 
+ * @Author: gcz
+ * @Date: 2024-05-16 14:35:40
+ * @LastEditors: gcz
+ * @LastEditTime: 2024-05-20 15:02:41
+ * @FilePath: \great_webui\src\views\statisticalReport\daily.vue
+ * @Copyright: Copyright (c) 2016~2024 by gcz, All Rights Reserved. 
+-->
+<template>
+    <div class="app-container">
+      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="60px">
+        <el-form-item label="日期" required>
+          <el-date-picker
+            v-model="queryParams.performDate"
+            @change="dateChange"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="场次" v-if="!multiPerformDate" label-width="55px">
+            <el-select
+            v-model="queryParams.timeId"
+            placeholder="场次"
+            @change="getList"
+            clearable
+            style="width: 100%"
+            >
+            <el-option
+                v-for="dict in pagePerformTimeList"
+                :key="dict.id"
+                :label="dict.timeSnapshot+'('+dict.performTimeStart+'-'+dict.performTimeEnd+')'"
+                :value="dict.id"
+            />
+            </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
+      <el-row :gutter="10" class="mb8"  style="margin-left: 0; margin-top: 10px">
+        <el-button
+          type="primary"
+          size="mini"
+          icon="el-icon-download"
+          :disabled="dataList.length === 0"
+          v-hasPermi="['session:session:downloadExcel']"
+          @click="handleExport"
+          v-loading.fullscreen.lock="handleExportLoading"
+          element-loading-text="正在拼命生成数据中..."
+          element-loading-spinner="el-icon-loading"
+          element-loading-background="rgba(0, 0, 0, 0.5)"
+        >导出excel</el-button>
+        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      </el-row>
+  
+      <el-table ref="tables" v-loading="loading" :data="dataList" border>
+        <el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
+        <!-- <el-table-column label="剧目名称" align="center" prop="performName" />
+        <el-table-column label="票务名称" align="center" prop="goodsName" /> -->
+        <el-table-column label="场次日期" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.performDate }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="场次" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.performTimeStart }} -- {{ scope.row.performTimeEnd }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="渠道" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.sourceName?scope.row.sourceName: '-' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="票种(元)" align="center">
+          
+        </el-table-column>
+        <el-table-column label="结算价(元)" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.settlementAmount }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="人次" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.personNext }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="客单" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.perTicketSale }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="收入" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.salePriceAmount }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="收入占比" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.incomeRatio?scope.row.incomeRatio+'%' : '-' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="销售上座率" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.saleSeatRate?scope.row.saleSeatRate+'%' : '-' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="备注" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.remark }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <ul class="total-remark" v-if="responseData.totalRemark">
+        <li><span class="til">销售合计:</span>{{ responseData.saleTotalRemark||'-' }}</li>
+        <li><span class="til">推广票合计:</span>{{ responseData.promotionTicketTotalRemark||'-' }}</li>
+        <li><span class="til">0元购票合计:</span>{{ responseData.zeroTicketTotalRemark||'-' }}</li>
+        <li><span class="til">总计:</span>{{ responseData.totalRemark||'-' }}</li>
+      </ul>
+<!--   
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      /> -->
+  
+    </div>
+  </template>
+  
+  <script>
+  
+  import { dayReportCount, downDayReportCount } from '@/api/statisticalReport/statistics'
+  import { exportExcel } from '@/utils/exportexcel'
+  import { seatPricePageList } from '@/api/distribution/ticketMr'
+  import { pagePerformTimeList } from "@/api/schedulingMr/schedulingMr"
+  import moment from "moment"
+  export default {
+    name: "",
+    dicts: [],
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 选中数组
+        ids: [],
+        // 非单个禁用
+        single: true,
+        // 非多个禁用
+        multiple: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 用户表格数据
+        dataList: [],
+        // 弹出层标题
+        title: "",
+        responseData: {},
+  
+        // 是否显示弹出层
+        open: false,
+        // 日期范围
+        dateRange: [],
+        // 查询参数
+        queryParams: {
+          // pageNum: 1,
+          // pageSize: 10,
+        },
+        visibleStatus: false,
+        newObj: {},
+        visibleType: '',
+        handleExportLoading: false,
+        tableData: {},
+        ticketList: [],
+        seatList: [],
+        multiPerformDate:false,
+        pagePerformTimeList: [], // 场次列表
+      };
+    },
+    created() {
+      this.$set(this.queryParams,'performDate',moment().format("yyyy-MM-DD"));
+      this.pagePerformTimeListFun(this.performDate)
+      this.getList();
+    //   this.ticketListApi();
+    },
+    methods: {
+      /** 查询列表 */
+      getList() {
+        this.loading = true;
+        if(this.queryParams.time){
+          this.queryParams.performStartDate = this.queryParams.time[0];
+          this.queryParams.performEndDate = this.queryParams.time[1];
+        }
+        dayReportCount(this.addDateRange(this.queryParams, this.dateRange))
+        .then(response => {
+            this.responseData = response.data;
+            this.dataList = response.data.dataList||[];
+            this.total = response.data.total||0;
+            this.loading = false;
+          }
+        ).catch(()=>{
+          this.loading = false;
+        });
+      },
+      /** 票务列表查询 */
+      ticketListApi() {
+        this.ticketList = []
+        seatPricePageList(this.addDateRange({pageNum: 1, pageSize: 100}))
+          .then(response => {
+            let ticketItemList = []
+            response.data.rows.forEach(item => {
+              if(ticketItemList.indexOf(item.goodsId) == -1){
+                this.ticketList.push(item);
+                ticketItemList.push(item.goodsId);
+              }
+            })
+          });
+      },
+      /** 座位类型列表 */
+      getSeatTypeList(obj) {
+        seatPricePageList(this.addDateRange({pageNum: 1, pageSize: 100, goodsId: obj.goodsId}))
+          .then(response => {
+            let ticketList = []
+            response.data.rows.forEach(item => {
+              if(ticketList.indexOf(item.seatTypeId) == -1){
+                this.seatList.push(item);
+                ticketList.push(item.seatTypeId);
+              }
+            })
+          });
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+      },
+      // 票务改变事件
+      goodsChangeEven() {
+        this.seatList = [];
+        this.$set(this.queryParams, 'seatTypeId', '');
+        let selectMap = {goodsId: this.queryParams.goodsId}
+        this.getSeatTypeList(selectMap);
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        // this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.dateRange = [];
+        this.seatList = [];
+        this.$set(this.queryParams, 'time', '');
+        this.$set(this.queryParams, 'performStartDate', '');
+        this.$set(this.queryParams, 'performEndDate', '');
+        this.$set(this.queryParams, 'goodsId', '');
+        this.$set(this.queryParams, 'seatTypeId', '');
+        this.$set(this.queryParams, 'timeId', '');
+        // this.queryParams.pageNum = 1;
+        this.$set(this.queryParams,'performDate',moment().format("yyyy-MM-DD"));
+        this.handleQuery();
+      },
+      dateChange(e){
+        this.queryParams.timeId = '';
+        this.pagePerformTimeListFun(e)
+        console.log('dateChange',e)
+      },
+      async pagePerformTimeListFun(value) {
+            // console.log('value',value);
+            try {
+                let { data,code } = await pagePerformTimeList({
+                performDate: this.queryParams.performDate,
+                pageNum: 1,
+                pageSize: 999
+                })
+                this.pagePerformTimeList = [].concat(data.rows);
+                // if(data.rows[0]){
+                //   this.queryParams.timeId = data.rows[0].id;
+                // }
+                // this.getList();
+            } catch (error) {
+                console.log('pagePerformTimeListFun error',error);
+            }
+        },
+      /**
+       * 导出报表
+       * @date 2022-10-24
+       * @returns {any}
+       */
+      handleExport() {
+        this.$confirm('您确定要导出当前查询的数据吗?', '提示', {
+          confirmButtonText: '确定 ',
+          cancelButtonText: '取消 ',
+          type: 'warning'
+        })
+          .then(() => {
+            this.handleExportLoading = true;
+            // const { pageNum, pageSize} = this.params;
+            let postMap = {}
+            for (let key in this.queryParams) {
+              if(key != 'pageNum' && key != 'pageSize'){
+                postMap[key] = this.queryParams[key]
+              }
+            }
+            downDayReportCount(postMap)
+              .then((res) => {
+                exportExcel(res, '日报表', '.xlsx');
+                this.handleExportLoading = false;
+              })
+              .catch(() => {
+                this.handleExportLoading = false;
+              });
+          })
+          .catch(() => {
+            this.$message.info('您已取消导出!');
+          });
+      },
+    }
+  };
+  </script>
+  <style lang="scss" scoped>
+  .total-remark{
+    margin-top: 24px;
+    margin-bottom: 24px;
+    padding-left: 0;
+    li{
+      list-style: none;
+    }
+    .til{
+      font-weight: bold;
+    }
+  }
+  </style>

+ 1 - 1
src/views/statisticalReport/distributor.vue

@@ -62,7 +62,7 @@
           size="mini"
           icon="el-icon-download"
           :disabled="dataList.length === 0"
-          v-hasPermi="['session:session:downloadExcel']"
+          v-hasPermi="['distributor:distributor:downloadExcel']"
           @click="handleExport"
           v-loading.fullscreen.lock="handleExportLoading"
           element-loading-text="正在拼命生成数据中..."

+ 255 - 0
src/views/statisticalReport/distridbution.vue

@@ -0,0 +1,255 @@
+<template>
+    <div class="app-container">
+      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="40px">
+        <el-form-item label="日期">
+          <el-date-picker
+            v-model="queryParams.performStartDate"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="分销商类型" label-width="120px">
+          <el-select
+            v-model="queryParams.type"
+            placeholder="分销商类型"
+            @change="getList"
+            clearable
+            style="width: 140px"
+          >
+            <el-option
+              v-for="dict in dict.type.distribution_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
+      <el-row :gutter="10" class="mb8"  style="margin-left: 0; margin-top: 10px">
+        <el-button
+          type="primary"
+          size="mini"
+          icon="el-icon-download"
+          :disabled="dataList.length === 0"
+          v-hasPermi="['session:session:downloadExcel']"
+          @click="handleExport"
+          v-loading.fullscreen.lock="handleExportLoading"
+          element-loading-text="正在拼命生成数据中..."
+          element-loading-spinner="el-icon-loading"
+          element-loading-background="rgba(0, 0, 0, 0.5)"
+        >导出excel</el-button>
+        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      </el-row>
+  
+      <el-table ref="tables" v-loading="loading" :data="dataList" border>
+        <el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
+        <!-- <el-table-column label="剧目名称" align="center" prop="performName" />
+        <el-table-column label="票务名称" align="center" prop="goodsName" /> -->
+        <el-table-column label="场次日期" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.performDate }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="场次" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.performTimeStart }} -- {{ scope.row.performTimeEnd }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="销售量" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.saleTotal?scope.row.saleTotal+'张' : '-' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="核销量" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.usedTotal?scope.row.usedTotal+'张' : '-' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="核销率" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.usedRate?scope.row.usedRate+'%' : '-' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="核销上座率" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.occupancyRate?scope.row.occupancyRate+'%' : '-' }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+  
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+  
+    </div>
+  </template>
+  
+  <script>
+  
+  import { performTimeCount, downTimeCountListXls } from '@/api/statisticalReport/statistics'
+  import { exportExcel } from '@/utils/exportexcel'
+  import { seatPricePageList } from '@/api/distribution/ticketMr'
+  import moment from "moment"
+  export default {
+    name: "",
+    dicts: ['distribution_type'],
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 选中数组
+        ids: [],
+        // 非单个禁用
+        single: true,
+        // 非多个禁用
+        multiple: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 用户表格数据
+        dataList: [],
+        // 弹出层标题
+        title: "",
+  
+        // 是否显示弹出层
+        open: false,
+        // 日期范围
+        dateRange: [],
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+        },
+        visibleStatus: false,
+        newObj: {},
+        visibleType: '',
+        handleExportLoading: false,
+        tableData: {},
+        ticketList: [],
+        seatList: [],
+      };
+    },
+    created() {
+      this.$set(this.queryParams,'performStartDate',moment().format("yyyy-MM-DD"))
+      this.getList();
+      this.ticketListApi();
+    },
+    methods: {
+      /** 查询列表 */
+      getList() {
+        this.loading = true;
+        if(this.queryParams.time){
+          this.queryParams.performStartDate = this.queryParams.time[0];
+          this.queryParams.performEndDate = this.queryParams.time[1];
+        }
+        performTimeCount(this.addDateRange(this.queryParams, this.dateRange))
+        .then(response => {
+            this.dataList = response.data.rows;
+            this.total = response.data.total;
+            this.loading = false;
+          }
+        );
+      },
+      /** 票务列表查询 */
+      ticketListApi() {
+        this.ticketList = []
+        seatPricePageList(this.addDateRange({pageNum: 1, pageSize: 100}))
+          .then(response => {
+            let ticketItemList = []
+            response.data.rows.forEach(item => {
+              if(ticketItemList.indexOf(item.goodsId) == -1){
+                this.ticketList.push(item);
+                ticketItemList.push(item.goodsId);
+              }
+            })
+          });
+      },
+      /** 座位类型列表 */
+      getSeatTypeList(obj) {
+        seatPricePageList(this.addDateRange({pageNum: 1, pageSize: 100, goodsId: obj.goodsId}))
+          .then(response => {
+            let ticketList = []
+            response.data.rows.forEach(item => {
+              if(ticketList.indexOf(item.seatTypeId) == -1){
+                this.seatList.push(item);
+                ticketList.push(item.seatTypeId);
+              }
+            })
+          });
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+      },
+      // 票务改变事件
+      goodsChangeEven() {
+        this.seatList = [];
+        this.$set(this.queryParams, 'seatTypeId', '');
+        let selectMap = {goodsId: this.queryParams.goodsId}
+        this.getSeatTypeList(selectMap);
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.dateRange = [];
+        this.seatList = [];
+        this.$set(this.queryParams, 'time', '');
+        this.$set(this.queryParams, 'performStartDate', '');
+        this.$set(this.queryParams, 'performEndDate', '');
+        this.$set(this.queryParams, 'goodsId', '');
+        this.$set(this.queryParams, 'seatTypeId', '');
+        this.$set(this.queryParams, 'type', '');
+        this.queryParams.pageNum = 1;
+        this.handleQuery();
+      },
+      /**
+       * 导出报表
+       * @date 2022-10-24
+       * @returns {any}
+       */
+      handleExport() {
+        this.$confirm('您确定要导出当前查询的数据吗?', '提示', {
+          confirmButtonText: '确定 ',
+          cancelButtonText: '取消 ',
+          type: 'warning'
+        })
+          .then(() => {
+            this.handleExportLoading = true;
+            // const { pageNum, pageSize} = this.params;
+            let postMap = {}
+            for (let key in this.queryParams) {
+              if(key != 'pageNum' && key != 'pageSize'){
+                postMap[key] = this.queryParams[key]
+              }
+            }
+            downTimeCountListXls(postMap)
+              .then((res) => {
+                exportExcel(res, '场次销售分析', '.xlsx');
+                this.handleExportLoading = false;
+              })
+              .catch(() => {
+                this.handleExportLoading = false;
+              });
+          })
+          .catch(() => {
+            this.$message.info('您已取消导出!');
+          });
+      },
+    }
+  };
+  </script>
+  

+ 1 - 1
src/views/statisticalReport/product.vue

@@ -62,7 +62,7 @@
           size="mini"
           icon="el-icon-download"
           :disabled="dataList.length === 0"
-          v-hasPermi="['session:session:downloadExcel']"
+          v-hasPermi="['product:product:downloadExcel']"
           @click="handleExport"
           v-loading.fullscreen.lock="handleExportLoading"
           element-loading-text="正在拼命生成数据中..."

+ 1 - 1
src/views/statisticalReport/team.vue

@@ -62,7 +62,7 @@
           size="mini"
           icon="el-icon-download"
           :disabled="dataList.length === 0"
-          v-hasPermi="['session:session:downloadExcel']"
+          v-hasPermi="['team:team:downloadExcel']"
           @click="handleExport"
           v-loading.fullscreen.lock="handleExportLoading"
           element-loading-text="正在拼命生成数据中..."

+ 267 - 0
src/views/statisticalReport/teamdetail.vue

@@ -0,0 +1,267 @@
+<!--
+ * @Description: 
+ * @Author: gcz
+ * @Date: 2024-05-16 14:48:39
+ * @LastEditors: gcz
+ * @LastEditTime: 2024-05-16 14:48:49
+ * @FilePath: \great_webui\src\views\statisticalReport\teamdetail.vue
+ * @Copyright: Copyright (c) 2016~2024 by gcz, All Rights Reserved. 
+-->
+<template>
+    <div class="app-container">
+      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="40px">
+        <el-form-item label="日期">
+          <el-date-picker
+          style="width: 230px;"
+            v-model="selectTime"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            placeholder="日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="团队类型" label-width="120px">
+          <el-select
+            v-model="queryParams.type"
+            placeholder="团队类型"
+            @change="getList"
+            clearable
+            style="width: 140px"
+          >
+            <el-option
+              v-for="dict in dict.type.team_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
+      <el-row :gutter="10" class="mb8"  style="margin-left: 0; margin-top: 10px">
+        <el-button
+          type="primary"
+          size="mini"
+          icon="el-icon-download"
+          :disabled="dataList.length === 0"
+          v-hasPermi="['session:session:downloadExcel']"
+          @click="handleExport"
+          v-loading.fullscreen.lock="handleExportLoading"
+          element-loading-text="正在拼命生成数据中..."
+          element-loading-spinner="el-icon-loading"
+          element-loading-background="rgba(0, 0, 0, 0.5)"
+        >导出excel</el-button>
+        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      </el-row>
+  
+      <el-table ref="tables" v-loading="loading" :data="dataList" border>
+        <el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
+        <!-- <el-table-column label="剧目名称" align="center" prop="performName" />
+        <el-table-column label="票务名称" align="center" prop="goodsName" /> -->
+        <el-table-column label="场次日期" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.performDate }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="场次" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.performTimeStart }} -- {{ scope.row.performTimeEnd }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="销售量" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.saleTotal?scope.row.saleTotal+'张' : '-' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="核销量" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.usedTotal?scope.row.usedTotal+'张' : '-' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="核销率" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.usedRate?scope.row.usedRate+'%' : '-' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="核销上座率" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.occupancyRate?scope.row.occupancyRate+'%' : '-' }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+  
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+  
+    </div>
+  </template>
+  
+  <script>
+  
+  import { performTimeCount, downTimeCountListXls } from '@/api/statisticalReport/statistics'
+  import { exportExcel } from '@/utils/exportexcel'
+  import { seatPricePageList } from '@/api/distribution/ticketMr'
+  import moment from "moment"
+  export default {
+    name: "",
+    dicts: ['team_type'],
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 选中数组
+        ids: [],
+        // 非单个禁用
+        single: true,
+        // 非多个禁用
+        multiple: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 用户表格数据
+        dataList: [],
+        // 弹出层标题
+        title: "",
+  
+        // 是否显示弹出层
+        open: false,
+        // 日期范围
+        dateRange: [],
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+        },
+        visibleStatus: false,
+        newObj: {},
+        visibleType: '',
+        handleExportLoading: false,
+        tableData: {},
+        ticketList: [],
+        seatList: [],
+        selectTime:'',
+      };
+    },
+    created() {
+    //   this.$set(this.queryParams,'performStartDate',moment().format("yyyy-MM-DD"))
+    this.$set(this,'selectTime',[moment().format("yyyy-MM-DD"),moment().format("yyyy-MM-DD")]);
+      this.getList();
+      this.ticketListApi();
+    },
+    methods: {
+      /** 查询列表 */
+      getList() {
+        this.loading = true;
+        if(this.selectTime){
+          this.queryParams.beginDate = this.selectTime[0];
+          this.queryParams.endDate = this.selectTime[1];
+        }
+        performTimeCount(this.addDateRange(this.queryParams, this.dateRange))
+        .then(response => {
+            this.dataList = response.data.rows;
+            this.total = response.data.total;
+            this.loading = false;
+          }
+        );
+      },
+      /** 票务列表查询 */
+      ticketListApi() {
+        this.ticketList = []
+        seatPricePageList(this.addDateRange({pageNum: 1, pageSize: 100}))
+          .then(response => {
+            let ticketItemList = []
+            response.data.rows.forEach(item => {
+              if(ticketItemList.indexOf(item.goodsId) == -1){
+                this.ticketList.push(item);
+                ticketItemList.push(item.goodsId);
+              }
+            })
+          });
+      },
+      /** 座位类型列表 */
+      getSeatTypeList(obj) {
+        seatPricePageList(this.addDateRange({pageNum: 1, pageSize: 100, goodsId: obj.goodsId}))
+          .then(response => {
+            let ticketList = []
+            response.data.rows.forEach(item => {
+              if(ticketList.indexOf(item.seatTypeId) == -1){
+                this.seatList.push(item);
+                ticketList.push(item.seatTypeId);
+              }
+            })
+          });
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+      },
+      // 票务改变事件
+      goodsChangeEven() {
+        this.seatList = [];
+        this.$set(this.queryParams, 'seatTypeId', '');
+        let selectMap = {goodsId: this.queryParams.goodsId}
+        this.getSeatTypeList(selectMap);
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.dateRange = [];
+        this.seatList = [];
+        this.$set(this.queryParams, 'time', '');
+        this.$set(this.queryParams, 'performStartDate', '');
+        this.$set(this.queryParams, 'performEndDate', '');
+        this.$set(this.queryParams, 'goodsId', '');
+        this.$set(this.queryParams, 'seatTypeId', '');
+        this.$set(this.queryParams, 'type', '');
+        this.queryParams.pageNum = 1;
+        this.handleQuery();
+      },
+      /**
+       * 导出报表
+       * @date 2022-10-24
+       * @returns {any}
+       */
+      handleExport() {
+        this.$confirm('您确定要导出当前查询的数据吗?', '提示', {
+          confirmButtonText: '确定 ',
+          cancelButtonText: '取消 ',
+          type: 'warning'
+        })
+          .then(() => {
+            this.handleExportLoading = true;
+            // const { pageNum, pageSize} = this.params;
+            let postMap = {}
+            for (let key in this.queryParams) {
+              if(key != 'pageNum' && key != 'pageSize'){
+                postMap[key] = this.queryParams[key]
+              }
+            }
+            downTimeCountListXls(postMap)
+              .then((res) => {
+                exportExcel(res, '场次销售分析', '.xlsx');
+                this.handleExportLoading = false;
+              })
+              .catch(() => {
+                this.handleExportLoading = false;
+              });
+          })
+          .catch(() => {
+            this.$message.info('您已取消导出!');
+          });
+      },
+    }
+  };
+  </script>
+  

+ 23 - 0
src/views/statistics/index.vue

@@ -16,6 +16,7 @@
       </el-form-item>
     </el-form> -->
     <div class="box-class clearfix">
+      <div class="title-type">销售分析</div>
       <div 
       class="item-class clearfix" 
       @click="pageLink(item.url)" 
@@ -25,6 +26,17 @@
         <div class="span-text-class">{{ item.name }}</div>
       </div>
     </div>
+    <div class="box-class clearfix">
+      <div class="title-type">运营分析</div>
+      <div 
+      class="item-class clearfix" 
+      @click="pageLink(item.url)" 
+      v-hasPermi="[item.hasPermi]"
+      v-for="item in dataList" :key="item.id">
+        <div class="span-img-class"></div>
+        <div class="span-text-class">{{ item.name }}</div>
+      </div>
+    </div>
   </div>
 </template>
 
@@ -53,6 +65,11 @@ export default {
         {id: 3, name: '场次销售分析', hasPermi: 'session:session:list', url: '/statisticalReport/session'},
         {id: 4, name: '场次销售统计', hasPermi: 'statisticalReport:sessionInventory:downloadExcel', url: '/statisticalReport/sessionInventory'},
         {id: 5, name: '座位类型销售统计', hasPermi: 'statisticalReport:seatInventory:downloadExcel', url: '/statisticalReport/seatInventory'},
+      ],
+      dataList: [
+        {id: 21, name: '日报表', hasPermi: 'daily:daily:list', url: '/statisticalReport/daily'},
+        {id: 22, name: '分销明细', hasPermi: 'distridbution:distridbution:list', url: '/statisticalReport/distridbution'},
+        {id: 23, name: '团队明细', hasPermi: 'teamdetail:teamdetail:list', url: '/statisticalReport/teamdetail'},
       ]
     };
   },
@@ -118,7 +135,13 @@ export default {
          float: left;
          margin-left: 20px;
          line-height: 40px;
+         min-width: 112px;
        }
      }
    }
+   .title-type{
+    margin-bottom: 20px;
+    font-size: 18px;
+    font-weight: bold;
+   }
 </style>