Ver Fonte

日消费报表

wangtao há 2 anos atrás
pai
commit
14ebfbec29

+ 18 - 0
src/api/recharge/daylyStatistics.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+// 查询
+export function listReport(data) {
+    return request({
+        url: '/dxtop/dish/dayCollect',
+        method: 'get',
+        params: data
+    })
+}
+// 导出
+export function exportReport(data) {
+    return request({
+        url: '/dxtop/dish/exportDyaCollect',
+        method: 'get',
+        params: data,
+    })
+}

+ 1 - 11
src/router/index.js

@@ -124,17 +124,7 @@ export const constantRoutes = [{
     // //     }]
     // // },
 
-    // {
-    //     path: '',
-    //     component: Layout,
-    //     redirect: 'channel',
-    //     children: [{
-    //         path: '/recharge/channel',
-    //         component: (resolve) => require(['@/views/recharge/channel'], resolve),
-    //         name: '渠道管理',
-    //         meta: { title: '渠道管理', icon: 'tree', noCache: false, affix: false },
-    //     }, ]
-    // },
+
     // {
     //     path: '',
     //     component: Layout,

+ 150 - 0
src/views/recharge/daylyStatistics/index.vue

@@ -0,0 +1,150 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" >
+      <el-form-item label="时间:" >
+         <el-date-picker
+          style="margin-top:5px;"
+          v-model="dateRange"
+          size="small"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          type="datetimerange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        ></el-date-picker>
+      </el-form-item>
+      <el-form-item class="right">
+        <el-button plain  size="mini" @click="resetQuery">重置</el-button>
+        <el-button type="primary"  size="mini" @click="handleQuery">搜索</el-button>
+      </el-form-item>
+      <br>
+      <el-form-item>
+        <el-button
+          plain
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['daylyStatistics:role:export']"
+        >导出</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" :data="adminList" border>
+      <el-table-column label="序号" align="left" prop="" show-overflow-tooltip >
+        <template slot-scope="scope">
+         {{scope.$index + 1}}
+        </template>
+      </el-table-column>
+      <el-table-column label="时间" align="left"  prop="reportDate" show-overflow-tooltip />
+      <el-table-column label="报表种类" align="left" prop="reportDate" show-overflow-tooltip />
+      <el-table-column label="总金额" align="left" prop="totalMoney"  show-overflow-tooltip >
+        <template slot-scope="scope">
+          <span>{{Number(scope.row.totalMoney).toFixed(2) || "0.00"}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="餐厅" align="left" prop="canteen"  show-overflow-tooltip >
+        <template slot-scope="scope">
+          <span>{{Number(scope.row.canteen).toFixed(2) || "0.00"}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="6F" align="left" prop="sixFloor"  show-overflow-tooltip >
+        <template slot-scope="scope">
+          <span>{{Number(scope.row.sixFloor).toFixed(2) || "0.00"}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="1F便利店" align="left" prop="oneCircle"  show-overflow-tooltip >
+        <template slot-scope="scope">
+          <span>{{Number(scope.row.oneCircle).toFixed(2) || "0.00"}}</span>
+        </template>
+      </el-table-column>
+       <el-table-column label="1F咖啡厅" align="left" prop="oneCoffee"  show-overflow-tooltip >
+        <template slot-scope="scope">
+          <span>{{Number(scope.row.oneCoffee).toFixed(2) || "0.00"}}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.current"
+      :limit.sync="queryParams.size"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { listReport, exportReport } from "@/api/recharge/daylyStatistics";
+
+export default {
+  name: "admin",
+  data() {
+    return {
+      // 导出遮罩层
+      exportLoading: false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 参数表格数据
+      adminList: [],
+      // 日期范围
+      dateRange: [],
+      // 查询参数
+      queryParams: {
+        current: 1,
+        size: 10,
+      },
+      // 表单参数
+      form: {},
+    };
+  },
+  created() {
+    this.getList();
+
+  },
+  methods: {
+    /** 查询参数列表 */
+    getList() {
+      this.loading = true;
+      listReport(this.addDateRange(this.queryParams,this.dateRange,'section')).then(response => {
+          this.adminList = response.data.records.map(val=>{
+            return {
+              ...val,
+              type:this.queryParams.type
+            }
+          });
+          this.total = response.data.total;
+          this.loading = false;
+        }
+      );
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.current = 1;
+      this.queryParams.startTime = undefined;
+      this.queryParams.endTime = undefined;
+      this.dateRange = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      let queryParams = {...this.queryParams};
+      delete queryParams.current
+      delete queryParams.size
+      this.exportLoading = true;
+      exportReport(queryParams).then(response =>{
+        this.exportLoading = false;
+        localStorage.setItem('fileExportId', response.data)
+        this.$router.push({path:'/recharge/fileExport'})
+      })
+    },
+  }
+};
+</script>

+ 0 - 1
src/views/recharge/reportForm/index.vue

@@ -137,7 +137,6 @@ export default {
       this.queryParams.current = 1;
       this.queryParams.startTime = undefined;
       this.queryParams.endTime = undefined;
-      this.queryParams.endTime = undefined;
       this.queryParams.type = 1
       this.dateRange = [];
       this.resetForm("queryForm");