فهرست منبع

1. 优化统计

MONSTER-ygh 1 سال پیش
والد
کامیت
81875baff7

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

@@ -0,0 +1,21 @@
+import request from '@/utils/request'
+
+// 场次统计分页查询
+export const performTimeCount = (query) => {
+  return request({
+    url: '/merchant/merchantPerformTime/performTimeSaleAnalyse',
+    method: 'get',
+    params: query
+  })
+}
+
+//  场次统计导出
+export function downTimeCountListXls(params) {
+  return request({
+    url: '/merchant/merchantPerformTime/performTimeSaleAnalyseExport',
+    method: 'get',
+    responseType: 'blob',
+    params
+  });
+}
+

+ 5 - 3
src/views/statisticalReport/seatInventory.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
+    <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"
@@ -19,7 +19,7 @@
         type="primary"
         size="mini"
         icon="el-icon-download"
-        :disabled="tableData.length === 0"
+        :disabled="dataList.length === 0"
         v-hasPermi="['statisticalReport:seatInventory:downloadExcel']"
         @click="handleExport"
         v-loading.fullscreen.lock="handleExportLoading"
@@ -104,6 +104,7 @@
 
 import { performTimeCount, downTimeCountListXls } from '@/api/statisticalReport/seatInventory'
 import { exportExcel } from '@/utils/exportexcel'
+import moment from "moment"
 export default {
   name: "seatInventory",
   data() {
@@ -121,7 +122,7 @@ export default {
       // 总条数
       total: 0,
       // 用户表格数据
-      dataList: null,
+      dataList: [],
       // 弹出层标题
       title: "",
 
@@ -142,6 +143,7 @@ export default {
     };
   },
   created() {
+    this.$set(this.queryParams,'performStartDate',moment().format("yyyy-MM-DD"))
     this.getList();
   },
   methods: {

+ 19 - 51
src/views/statisticalReport/session.vue

@@ -1,45 +1,12 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
-      <!-- <el-form-item label="票务管理:">
-        <el-select
-          v-model="queryParams.goodsId"
-          placeholder="票务管理"
-          clearable
-          @change="goodsChangeEven"
-          style="width: 100%;"
-        >
-          <el-option
-            v-for="dict in ticketList"
-            :key="dict.id"
-            :label="dict.goodsName"
-            :value="dict.goodsId"
-          />
-        </el-select>
-      </el-form-item> -->
-      <el-form-item label="座位类型:">
-        <el-select
-          v-model="queryParams.seatTypeId"
-          placeholder="座位类型"
-          clearable
-          style="width: 100%;"
-        >
-          <el-option
-            v-for="dict in seatList"
-            :key="dict.seatTypeId"
-            :label="dict.seatTypeName"
-            :value="dict.seatTypeId"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="场次日期">
+    <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.time"
-          type="daterange"
+          v-model="queryParams.performStartDate"
+          type="date"
           value-format="yyyy-MM-dd"
-          range-separator="至"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期">
+          placeholder="日期">
         </el-date-picker>
       </el-form-item>
       <el-form-item>
@@ -52,7 +19,7 @@
         type="primary"
         size="mini"
         icon="el-icon-download"
-        :disabled="tableData.length === 0"
+        :disabled="dataList.length === 0"
         v-hasPermi="['session:session:downloadExcel']"
         @click="handleExport"
         v-loading.fullscreen.lock="handleExportLoading"
@@ -77,25 +44,24 @@
           <span>{{ scope.row.performTimeStart }} -- {{ scope.row.performTimeEnd }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="座位类型" align="center" prop="seatTypeName" />
-      <el-table-column label="总库存" align="center">
+      <el-table-column label="销售量" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.total }}</span>
+          <span>{{ scope.row.saleTotal?scope.row.saleTotal+'张' : '-' }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="已售数量" align="center">
+      <el-table-column label="核销量" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.saleTotal }}</span>
+          <span>{{ scope.row.usedTotal?scope.row.usedTotal+'张' : '-' }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="已核销数量" align="center">
+      <el-table-column label="核销率" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.usedTotal }}张</span>
+          <span>{{ scope.row.usedRate?scope.row.usedRate+'%' : '-' }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="库存数量" align="center">
+      <el-table-column label="核销上座率" align="center">
         <template slot-scope="scope">
-          <span>{{ (scope.row.total - scope.row.saleTotal) >= 0 ? (scope.row.total - scope.row.saleTotal) : '' }}张</span>
+          <span>{{ scope.row.occupancyRate?scope.row.occupancyRate+'%' : '-' }}</span>
         </template>
       </el-table-column>
     </el-table>
@@ -113,9 +79,10 @@
 
 <script>
 
-import { performTimeCount, downTimeCountListXls } from '@/api/statistics'
+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: "agreement",
   dicts: ['agreement_type'],
@@ -134,7 +101,7 @@ export default {
       // 总条数
       total: 0,
       // 用户表格数据
-      dataList: null,
+      dataList: [],
       // 弹出层标题
       title: "",
 
@@ -157,6 +124,7 @@ export default {
     };
   },
   created() {
+    this.$set(this.queryParams,'performStartDate',moment().format("yyyy-MM-DD"))
     this.getList();
     this.ticketListApi();
   },
@@ -253,7 +221,7 @@ export default {
           }
           downTimeCountListXls(postMap)
             .then((res) => {
-              exportExcel(res, '场次统计', '.xlsx');
+              exportExcel(res, '场次销售分析', '.xlsx');
               this.handleExportLoading = false;
             })
             .catch(() => {

+ 5 - 3
src/views/statisticalReport/sessionInventory.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
+    <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"
@@ -19,7 +19,7 @@
         type="primary"
         size="mini"
         icon="el-icon-download"
-        :disabled="tableData.length === 0"
+        :disabled="dataList.length === 0"
         v-hasPermi="['statisticalReport:sessionInventory:downloadExcel']"
         @click="handleExport"
         v-loading.fullscreen.lock="handleExportLoading"
@@ -104,6 +104,7 @@
 
 import { performTimeCount, downTimeCountListXls } from '@/api/statisticalReport/sessionInventory'
 import { exportExcel } from '@/utils/exportexcel'
+import moment from "moment"
 export default {
   name: "sessionInventory",
   data() {
@@ -121,7 +122,7 @@ export default {
       // 总条数
       total: 0,
       // 用户表格数据
-      dataList: null,
+      dataList: [],
       // 弹出层标题
       title: "",
 
@@ -142,6 +143,7 @@ export default {
     };
   },
   created() {
+    this.$set(this.queryParams,'performStartDate',moment().format("yyyy-MM-DD"))
     this.getList();
   },
   methods: {

+ 1 - 1
src/views/statistics/index.vue

@@ -50,7 +50,7 @@ export default {
       itemList: [
         // {id: 1, name: '总览统计', url: ''},
         // {id: 2, name: '渠道统计', url: ''},
-        // {id: 3, name: '场次销售分析', hasPermi: 'session:session:list', url: 'statisticalReport/session'},
+        {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'},
       ]