Browse Source

按时间检索

lilei 3 years ago
parent
commit
babe02fb39
4 changed files with 56 additions and 9 deletions
  1. 1 1
      public/version.json
  2. 11 1
      src/libs/getDate.js
  3. 42 5
      src/views/Home.vue
  4. 2 2
      vue.config.js

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1653988383820
+  "version": 1653991214857
 }

+ 11 - 1
src/libs/getDate.js

@@ -135,5 +135,15 @@ export default {
     obj.starttime = moment(moment().month(moment().month() - 2).startOf('month').valueOf()).format('YYYY-MM-DD 00:00:00')
     obj.endtime = moment(moment().month(moment().month() - 2).endOf('month').valueOf()).format('YYYY-MM-DD 23:59:59')
     return obj
-  }
+  },
+  // 获取从今天到指定月的
+  getMonthDays (month) {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month() - month).valueOf()).format('YYYY-MM-DD 00:00:00')
+    obj.endtime = moment().format('YYYY-MM-DD 23:59:59')
+    return obj
+  },
 }

+ 42 - 5
src/views/Home.vue

@@ -2,7 +2,7 @@
   <div class="home" :class="[fontSize]">
     <!-- <a-alert :message="message" type="info" /> -->
     <a-card size="small" :bordered="false" class="page-cont" :bodyStyle="{padding: '17px 30px 20px'}">
-      <h3 class="page-tit">客户信息</h3>
+      <h3 class="page-tit"><span>客户信息</span></h3>
       <ul class="page-list">
         <li>商户名称:{{ $store.getters.userInfo.orgName || '--' }}</li>
         <li>商户别名:{{ dealerData&&dealerData.dealerAlias || '--' }}</li>
@@ -233,7 +233,20 @@
       <a-row>
         <a-col :span="16">
           <a-card size="small" :bordered="false" class="page-cont" :bodyStyle="{padding: '17px 30px 20px'}">
-            <h3 class="page-tit">销售/采购/调拨指引</h3>
+            <h3 class="page-tit">
+              <span>销售/采购/调拨指引</span>
+              <a-radio-group v-model="curDate" @change="onDateChange">
+                <a-radio-button value="12">
+                  最近一年
+                </a-radio-button>
+                <a-radio-button value="6">
+                  最近半年
+                </a-radio-button>
+                <a-radio-button value="0">
+                  全部
+                </a-radio-button>
+              </a-radio-group>
+            </h3>
             <div class="page-nav-main">
               <!-- 导航指引  start -->
               <div class="page-nav-con" v-for="(item, index) in navList" :key="index">
@@ -261,7 +274,7 @@
         </a-col>
         <a-col :span="8">
           <a-card size="small" :bordered="false" class="page-cont right-con" :bodyStyle="{padding: '17px 30px 20px'}">
-            <h3 class="page-tit">财务指引</h3>
+            <h3 class="page-tit"><span>财务指引</span></h3>
             <!-- 财务指引  start -->
             <div class="page-nav-con" v-for="(item, index) in navFinancialList" :key="index">
               <div class="page-nav-box" v-for="(subItem, subInd) in item" :key="subInd" style="width: 50%;">
@@ -279,7 +292,7 @@
             <!-- 财务指引  end -->
           </a-card>
           <a-card size="small" :bordered="false" class="page-cont right-con" :bodyStyle="{padding: '17px 30px 20px'}">
-            <h3 class="page-tit">其他指引</h3>
+            <h3 class="page-tit"><span>其他指引</span></h3>
             <!-- 其他指引  start -->
             <div class="page-nav-con" v-for="(item, index) in navOtherList" :key="index">
               <div class="page-nav-box" v-for="(subItem, subInd) in item" :key="subInd" style="width: 50%;">
@@ -331,6 +344,7 @@
 
 <script>
 import { mixin, commonMixin } from '@/utils/mixin'
+import getDate from '@/libs/getDate.js'
 import { mapGetters } from 'vuex'
 import ResetPwd from '@/views/user/ResetPwd.vue'
 import newProduct from '@/views/productManagement/newProduct/modal.vue'
@@ -347,6 +361,11 @@ export default {
       openResetPwd: false, //  重置密码是否显示
       openNewProduct: false,
       onlineFalg: '1', // 上下线标识  1为上线,0为下线
+      queryParams: {
+        beginDate: getDate.getMonthDays(12).starttime,
+        endDate: getDate.getMonthDays(12).endtime
+      },
+      curDate: '12',
       navList: [
         [ // 客户
           [
@@ -799,7 +818,7 @@ export default {
     },
     // 导航指引合计
     getNavCount () {
-      bizStateCount({}).then(res => {
+      bizStateCount(this.queryParams).then(res => {
         if (res.status == 200) {
           this.countData = res.data
         } else {
@@ -807,6 +826,18 @@ export default {
         }
       })
     },
+    onDateChange (e) {
+      console.log(e.target.value)
+      const v = e.target.value
+      if (v != 0) {
+        this.queryParams.beginDate = getDate.getMonthDays(v).starttime
+        this.queryParams.endDate = getDate.getMonthDays(v).endtime
+      } else {
+        this.queryParams.beginDate = undefined
+        this.queryParams.endDate = undefined
+      }
+      this.getNavCount()
+    },
     // 导航跳转
     goPage (data, subInd) {
       if (data) {
@@ -878,6 +909,12 @@ export default {
         font-size: 16px;
         font-weight: 500;
         margin-bottom: 18px;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        span{
+          font-weight: bold;
+        }
       }
       .page-list{
         list-style: none;

+ 2 - 2
vue.config.js

@@ -211,8 +211,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.16.151/qpls-md',
-        target: 'http://p.iscm.360arrow.com/qpls-md',
+        target: 'http://192.168.16.105:8503/qpls-md',
+        // target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,
         changeOrigin: true,