ソースを参照

'order修改为报表查询'

Rorschach 5 年 前
コミット
e4cbc85353

+ 1 - 1
config/dev.env.js

@@ -4,5 +4,5 @@ const prodEnv = require('./prod.env')
 
 module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
-  BASE_API: '"http://192.168.1.46:8060/cms"',
+  BASE_API: '"http://res.yifangjiaoyu.cn/cms"',
 })

+ 9 - 4
package-lock.json

@@ -3786,7 +3786,8 @@
         "ansi-regex": {
           "version": "2.1.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "aproba": {
           "version": "1.2.0",
@@ -4201,7 +4202,8 @@
         "safe-buffer": {
           "version": "5.1.2",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "safer-buffer": {
           "version": "2.1.2",
@@ -4257,6 +4259,7 @@
           "version": "3.0.1",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "ansi-regex": "^2.0.0"
           }
@@ -4300,12 +4303,14 @@
         "wrappy": {
           "version": "1.0.2",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "yallist": {
           "version": "3.0.3",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         }
       }
     },

+ 2 - 2
src/api/order.js

@@ -1,9 +1,9 @@
 import request from '../utils/request'
 
-// 获取课程列表
+// 获取统计日报
 export function getOrderList (params) {
   return request({
-    url: '/orders',
+    url: '/statistics',
     method: 'get',
     params
   })

+ 5 - 5
src/pages/layout/leftnav/LeftNav.vue

@@ -7,7 +7,7 @@
       active-text-color="#20a0ff"
       :router=true
       :default-active="$route.path">
-      <el-menu-item index="/channel/index" route="/channel/index">
+      <!-- <el-menu-item index="/channel/index" route="/channel/index">
         <span slot="title">渠道管理</span>
       </el-menu-item>
       <el-menu-item index="/course/index" route="/course/index">
@@ -15,13 +15,13 @@
       </el-menu-item>
       <el-menu-item index="/relation/index" route="/relation/index">
           <span slot="title">渠道课程管理</span>
-      </el-menu-item>
+      </el-menu-item> -->
       <el-menu-item index="/order/index" route="/order/index">
-          <span slot="title">订单管理</span>
+          <span slot="title">订购报表</span>
       </el-menu-item>
-      <el-menu-item index="/operation/index" route="/operation/index">
+      <!-- <el-menu-item index="/operation/index" route="/operation/index">
           <span slot="title">操作日志</span>
-      </el-menu-item>
+      </el-menu-item> -->
     </el-menu>
   </div>
 </template>

+ 1 - 1
src/pages/login/Login.vue

@@ -69,7 +69,7 @@
                 type: 'success',
                 duration: 5 * 1000
               })
-              this.$router.push({ path: '/channel/index' })
+              this.$router.push({ path: '/order/index' })
             })
             //alert('submit!');
           } else {

+ 101 - 98
src/pages/order/Order.vue

@@ -7,10 +7,10 @@
             v-for="item in channeList.list"
             :key="item.code"
             :label="item.title"
-            :value="item.code">
-          </el-option>
+            :value="item.code"
+          ></el-option>
         </el-select>
-        <el-input v-model="orderParams.userId" placeholder="请输入用户ID"></el-input>
+        <!-- <el-input v-model="orderParams.userId" placeholder="请输入用户ID"></el-input> -->
         <el-date-picker
           v-model="dateValue"
           type="daterange"
@@ -19,135 +19,138 @@
           range-separator="至"
           start-placeholder="开始日期"
           end-placeholder="结束日期"
-          :picker-options="pickerOptions">
-        </el-date-picker>
+          :picker-options="pickerOptions"
+        ></el-date-picker>
         <el-button type="primary" style="float: right;" @click="search">搜索</el-button>
       </div>
-      <el-table
-        :data="orderList.content"
-        style="width: 100%"
-        height="700">
-        <el-table-column
-          label="用户 ID"
-          prop="userId">
-        </el-table-column>
-        <el-table-column
-          label="订单名称"
-          prop="name">
-        </el-table-column>
-        <el-table-column
-          label="渠道号"
-          prop="channelCode">
-        </el-table-column>
-        <el-table-column
-          label="价格"
-          prop="price">
-        </el-table-column>
-        <el-table-column
-          label="用户手机"
-          prop="userPhone">
-        </el-table-column>
-        <el-table-column
-          label="订单时间"
-          prop="gmtCreated"
-          :formatter="formatTime">
-        </el-table-column>
+      <el-table :data="orderList" style="width: 100%" height="700">
+        <el-table-column label="日期" prop="day"></el-table-column>
+        <el-table-column label="包名" prop="packageTitle"></el-table-column>
+        <el-table-column label="包月数量" prop="monthlyPayment"></el-table-column>
+        <el-table-column label="续包月数量" prop="consecutiveMonthly"></el-table-column>
+        <el-table-column label="年包数量" prop="yearlyPayment"></el-table-column>
+        <el-table-column label="UV" prop="uv"></el-table-column>
+        <el-table-column label="PV" prop="pv"></el-table-column>
       </el-table>
-      <el-pagination
+      <!-- <el-pagination
       v-if="orderList.totalElements"
       background
       layout="prev, pager, next"
       :total="orderList.totalElements"
       @current-change="changePage">
-      </el-pagination>
-  </el-card>
+      </el-pagination>-->
+    </el-card>
   </div>
 </template>
 <script>
-import { mapGetters } from 'vuex';
+import { mapGetters } from "vuex";
 export default {
   data() {
     return {
       pickerOptions: {
-        shortcuts: [{
-          text: '最近一周',
-          onClick(picker) {
-            const end = new Date();
-            const start = new Date();
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
-            picker.$emit('pick', [start, end]);
+        shortcuts: [
+          {
+            text: "最近一周",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit("pick", [start, end]);
+            }
+          },
+          {
+            text: "最近一个月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit("pick", [start, end]);
+            }
+          },
+          {
+            text: "最近三个月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit("pick", [start, end]);
+            }
           }
-        }, {
-          text: '最近一个月',
-          onClick(picker) {
-            const end = new Date();
-            const start = new Date();
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-            picker.$emit('pick', [start, end]);
-          }
-        }, {
-          text: '最近三个月',
-          onClick(picker) {
-            const end = new Date();
-            const start = new Date();
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-            picker.$emit('pick', [start, end]);
-          }
-        }]
+        ]
       },
-      dateValue: '',
+      dateValue: "",
       orderParams: {
-        userId: '',
-        channelCode: '',
-        pageNo: 1,
-        pageSize: 10
+        // userId: '',
+        channelCode: ""
+        // pageNo: 1,
+        // pageSize: 10
       },
       formatTime: (row, column) => {
         let date = new Date(row.gmtCreated);
-        let Y = date.getFullYear() + '-';
-        let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) + '-' : date.getMonth() + 1 + '-';
-        let D = date.getDate() < 10 ? '0' + date.getDate() + ' ' : date.getDate() + ' ';
-        let h = date.getHours() < 10 ? '0' + date.getHours() + ':' : date.getHours() + ':';
-        let m = date.getMinutes()  < 10 ? '0' + date.getMinutes() + ':' : date.getMinutes() + ':';
-        let s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
+        let Y = date.getFullYear() + "-";
+        let M =
+          date.getMonth() + 1 < 10
+            ? "0" + (date.getMonth() + 1) + "-"
+            : date.getMonth() + 1 + "-";
+        let D =
+          date.getDate() < 10
+            ? "0" + date.getDate() + " "
+            : date.getDate() + " ";
+        let h =
+          date.getHours() < 10
+            ? "0" + date.getHours() + ":"
+            : date.getHours() + ":";
+        let m =
+          date.getMinutes() < 10
+            ? "0" + date.getMinutes() + ":"
+            : date.getMinutes() + ":";
+        let s =
+          date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
         return Y + M + D + h + m + s;
-      }
-    }
+      },
+      // orderList:[]
+    };
   },
   computed: {
     ...mapGetters({
-      channeList: 'channeList',
-      orderList: 'orderList'
-      })
+      channeList: "channeList",
+      orderList: "orderList"
+    })
   },
-  created () {
-    this.$store.dispatch('getChannelList', {pageNo: '', pageSize: '' })
+  created() {
+    this.$store.dispatch("getChannelList", { pageNo: "", pageSize: "" });
   },
   methods: {
     // 搜索
-    search () {
-      this.orderParams.startTime = this.dateValue.length > 1 ? this.dateValue[1].toLocaleDateString().replace(/\//g,'-') : ''
-      this.orderParams.endTime = this.dateValue.length > 1 ? this.dateValue[1].toLocaleDateString().replace(/\//g,'-') : ''
-      this.$store.dispatch('getOrderList', this.orderParams)
+    search() {
+      this.orderParams.startDate =
+        this.dateValue.length > 1
+          ? this.dateValue[0].toLocaleDateString().replace(/\//g, "-")
+          : "";
+      this.orderParams.endDate =
+        this.dateValue.length > 1
+          ? this.dateValue[1].toLocaleDateString().replace(/\//g, "-")
+          : "";
+      this.$store.dispatch("getOrderList", this.orderParams);
     },
     // 渠道下课程分页
-    changePage (e) {
+    changePage(e) {
       this.orderParams.pageNo = e;
-      this.$store.dispatch('getRelationList', this.orderParams)
+      this.$store.dispatch("getRelationList", this.orderParams);
     }
-  },
-}
+  }
+};
 </script>
 <style lang="less">
-  .el-pagination {
-    text-align: center;
-    margin-top: 20px;
-  }
-  .el-form-item__content {
-    width: 50%;
-  }
-  .el-input {
-    width: 217px;
-  }
+.el-pagination {
+  text-align: center;
+  margin-top: 20px;
+}
+.el-form-item__content {
+  width: 50%;
+}
+.el-input {
+  width: 217px;
+}
 </style>
 

+ 41 - 40
src/router/router.js

@@ -22,36 +22,6 @@ const router = new Router({
       hidden: true
     },
     {
-      path: '/channel',
-      component: Layout,
-      children: [{
-        path: 'index',
-        name:'Channel',
-        meta: { title: '渠道管理', url: '/channel/index' },
-        component: () => import('@/pages/channel/Channel'),
-      }]
-    },
-    {
-      path: '/course',
-      component: Layout,
-      children: [{
-        path: 'index',
-        name:'Course',
-        meta: { title: '课程管理', url: '/course/index' },
-        component: () => import('@/pages/course/Course'),
-      }]
-    },
-    {
-      path: '/relation',
-      component: Layout,
-      children: [{
-        path: 'index',
-        name:'Relation',
-        meta: { title: '渠道课程管理', url: '/relation/index' },
-        component: () => import('@/pages/relation/Relation'),
-      }]
-    },
-    {
       path: '/order',
       component: Layout,
       children: [{
@@ -61,16 +31,47 @@ const router = new Router({
         component: () => import('@/pages/order/Order'),
       }]
     },
-    {
-      path: '/operation',
-      component: Layout,
-      children: [{
-        path: 'index',
-        name:'Operation',
-        meta: { title: '渠道课程管理', url: '/operation/index' },
-        component: () => import('@/pages/operation/Operation'),
-      }]
-    }
+    // {
+    //   path: '/channel',
+    //   component: Layout,
+    //   children: [{
+    //     path: 'index',
+    //     name:'Channel',
+    //     meta: { title: '渠道管理', url: '/channel/index' },
+    //     component: () => import('@/pages/channel/Channel'),
+    //   }]
+    // },
+    // {
+    //   path: '/course',
+    //   component: Layout,
+    //   children: [{
+    //     path: 'index',
+    //     name:'Course',
+    //     meta: { title: '课程管理', url: '/course/index' },
+    //     component: () => import('@/pages/course/Course'),
+    //   }]
+    // },
+    // {
+    //   path: '/relation',
+    //   component: Layout,
+    //   children: [{
+    //     path: 'index',
+    //     name:'Relation',
+    //     meta: { title: '渠道课程管理', url: '/relation/index' },
+    //     component: () => import('@/pages/relation/Relation'),
+    //   }]
+    // },
+    
+    // {
+    //   path: '/operation',
+    //   component: Layout,
+    //   children: [{
+    //     path: 'index',
+    //     name:'Operation',
+    //     meta: { title: '渠道课程管理', url: '/operation/index' },
+    //     component: () => import('@/pages/operation/Operation'),
+    //   }]
+    // }
   ]
 })
 

+ 2 - 1
src/store/modules/order.js

@@ -2,7 +2,7 @@ import { getOrderList } from '../../api/order'
 
 const order = {
   state: {
-    orderList: {}
+    orderList: []
   },
   mutations: {
     GET_ORDER_LIST: (state, data) => {
@@ -13,6 +13,7 @@ const order = {
     getOrderList({dispatch, commit }, data) {
       return new Promise((resolve, reject) => {
         getOrderList(data).then(res => {
+          console.log(res.data)
           if(res.code == 200) {
             resolve(res.data);
             commit('GET_ORDER_LIST', res.data)