lilei 2 gadi atpakaļ
vecāks
revīzija
f5331e6628

+ 15 - 10
src/api/bigScreen.js

@@ -21,31 +21,35 @@ export function countLevelProductQty () {
   })
 }
 // 实时销售看板-区域销售金额占比
-export function queryAreaSaleAmount () {
+export function queryAreaSaleAmount (params) {
   return axios({
     url: '/report/dataScreen/queryAreaSaleAmount',
-    method: 'get'
+    data: params,
+    method: 'post'
   })
 }
 // 实时销售看板-品类销售分布
-export function queryBrandTypeSaleAmount () {
+export function queryBrandTypeSaleAmount (params) {
   return axios({
     url: '/report/dataScreen/queryBrandTypeSaleAmount',
-    method: 'get'
+    data: params,
+    method: 'post'
   })
 }
 // 实时销售看板-地图
-export function queryMapSaleData () {
+export function queryMapSaleData (params) {
   return axios({
     url: '/report/dataScreen/queryMapSaleData',
-    method: 'get'
+    data: params,
+    method: 'post'
   })
 }
 // 实时销售看板-销售金额top15省份
-export function queryProvinceSaleAmount () {
+export function queryProvinceSaleAmount (params) {
   return axios({
     url: '/report/dataScreen/queryProvinceSaleAmount',
-    method: 'get'
+    data: params,
+    method: 'post'
   })
 }
 // 实时销售看板-本月/周销售
@@ -63,10 +67,11 @@ export function querySaleToday () {
   })
 }
 // 实时销售看板-销售趋势分析
-export function querySaleTrend () {
+export function querySaleTrend (params) {
   return axios({
     url: '/report/dataScreen/querySaleTrend',
-    method: 'get'
+    data: params,
+    method: 'post'
   })
 }
  

+ 7 - 0
src/libs/getDate.js

@@ -135,5 +135,12 @@ 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
+  },
+  // 获取某一年的开始和结束时间
+  getBeDateByYear(year){
+    return {
+      	beginDate: moment(year.toString()).startOf('year').format('YYYY-MM-DD 00:00:00'),
+      	endDate: moment(year.toString()).endOf('year').format('YYYY-MM-DD 23:59:59')
+    }
   }
 }

+ 2 - 1
src/views/bigScreen/fPanalysisReport/index.vue

@@ -87,7 +87,8 @@ export default {
 	  this.$nextTick(() => {
 		  this.$tv.requestFocus(this.$refs.curTab2)
 	  })
-    this.curYear = new Date().getFullYear()
+    const year = location.href.split('?')[1]
+    this.curYear = year ? year.split('=')[1] : new Date().getFullYear()
   },
   mounted () {},
   methods: {

+ 8 - 2
src/views/bigScreen/realTimeSalesReport/center-bottom.vue

@@ -11,7 +11,14 @@
 <script>
 import { graphic } from 'echarts'
 import { queryBrandTypeSaleAmount } from '@/api/bigScreen.js'
+import getDate from '@/libs/getDate.js'
 export default {
+  props: {
+    curYear: {
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       options: {},
@@ -20,7 +27,6 @@ export default {
       loading: false
     }
   },
-  props: {},
   mounted () {
     this.getData()
   },
@@ -36,7 +42,7 @@ export default {
     },
     getData () {
       this.loading = true
-      queryBrandTypeSaleAmount().then((res) => {
+      queryBrandTypeSaleAmount(getDate.getBeDateByYear(this.curYear)).then((res) => {
         console.log('品类销售分布', res)
         if (res.status == 200) {
           const ret = { category: [], barData: [] }

+ 9 - 2
src/views/bigScreen/realTimeSalesReport/center-map.vue

@@ -18,7 +18,14 @@ import xzqCode from '@/utils/map/xzqCode'
 import * as echarts from 'echarts'
 import { GETNOBASE } from '@/utils/request'
 import { queryMapSaleData } from '@/api/bigScreen.js'
+import getDate from '@/libs/getDate.js'
 export default {
+  props: {
+    curYear: {
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       options: {},
@@ -56,7 +63,7 @@ export default {
     },
     getData (code) {
       this.loading = true
-      queryMapSaleData().then((res) => {
+      queryMapSaleData(getDate.getBeDateByYear(this.curYear)).then((res) => {
         console.log('地图', res)
         if (res.status == 200) {
           this.getGeojson('china', res.data.dataList)
@@ -146,7 +153,7 @@ export default {
               '#3483b4',
               '#43a9e8',
               '#0389ff',
-              '#06aa42',
+              '#ffaa00',
               '#ff5500'
             ]
           },

+ 6 - 4
src/views/bigScreen/realTimeSalesReport/center-top.vue

@@ -2,11 +2,11 @@
   <div class="center-top-wrap">
     <div>
       <dv-digital-flop :config="config" style="width:90%;height:50px;" />
-      <div>{{ year }}年总销售数量</div>
+      <div>{{ curYear }}年总销售数量</div>
     </div>
     <div>
       <dv-digital-flop :config="config1" style="width:90%;height:50px;" />
-      <div>{{ year }}年总销售金额</div>
+      <div>{{ curYear }}年总销售金额</div>
     </div>
   </div>
 </template>
@@ -22,17 +22,19 @@ export default {
     totalAmount: {
       type: [Number, String],
       default: 0
+    },
+    curYear: {
+      type: [Number, String],
+      default: ''
     }
   },
   data () {
     return {
-      year: 0,
       config: null,
       config1: null
     }
   },
   mounted () {
-    this.year = new Date().getFullYear()
   },
   watch: {
     totalNums (newValue, oldValue) {

+ 14 - 11
src/views/bigScreen/realTimeSalesReport/index.vue

@@ -6,25 +6,25 @@
           ﹤加盟商/产品分析
         </div>
       </div>
-      <ItemWrap class="contetn_left-top contetn_lr-item" title="区域销售金额占比">
-        <LeftTop />
+      <ItemWrap class="contetn_left-top contetn_lr-item" :title="'区域销售金额占比('+curYear+'年)'">
+        <LeftTop :curYear="curYear" />
       </ItemWrap>
-      <ItemWrap class="contetn_left-bottom contetn_lr-bitem" title="销售金额TOP15">
-        <LeftBottom />
+      <ItemWrap class="contetn_left-bottom contetn_lr-bitem" :title="'销售金额TOP15('+curYear+'年)'">
+        <LeftBottom :curYear="curYear" />
       </ItemWrap>
     </div>
     <div class="contetn_center">
       <dv-border-box-8 class="contetn_center-top">
-        <CenterTop :totalNums="yearTotalNums" :totalAmount="yearTotalAmount"/>
+        <CenterTop :curYear="curYear" :totalNums="yearTotalNums" :totalAmount="yearTotalAmount"/>
       </dv-border-box-8>
-      <CenterMap @onData="setYearData" class="contetn_center_topMap" />
-      <ItemWrap class="contetn_center-bottom" title="品类销售分布">
-        <CenterBottom />
+      <CenterMap :curYear="curYear" @onData="setYearData" class="contetn_center_topMap" />
+      <ItemWrap class="contetn_center-bottom" :title="'品类销售分布('+curYear+'年)'">
+        <CenterBottom :curYear="curYear" />
       </ItemWrap>
     </div>
     <div class="contetn_right">
-      <ItemWrap class="contetn_right-top contetn_lrr-item" title="销售趋势分析">
-        <RightTop style="height: 94%;" />
+      <ItemWrap class="contetn_right-top contetn_lrr-item" :title="'销售趋势分析('+curYear+'年)'">
+        <RightTop :curYear="curYear" style="height: 94%;" />
       </ItemWrap>
       <ItemWrap class="contetn_right-bottom contetn_right_bottom" title="本月/周销售">
         <RightBottom />
@@ -67,7 +67,8 @@ export default {
   data () {
     return {
       yearTotalNums: 0,
-      yearTotalAmount: 0
+      yearTotalAmount: 0,
+      curYear: ''
     }
   },
   filters: {
@@ -79,6 +80,8 @@ export default {
 	  this.$nextTick(() => {
 		  this.$tv.requestFocus(this.$refs.myDiv)
 	  })
+    const year = location.href.split('?')[1]
+    this.curYear = year ? year.split('=')[1] : new Date().getFullYear()
   },
   mounted () { },
   methods: {

+ 8 - 1
src/views/bigScreen/realTimeSalesReport/left-bottom.vue

@@ -7,7 +7,14 @@
 
 <script>
 import { queryProvinceSaleAmount } from '@/api/bigScreen.js'
+import getDate from '@/libs/getDate.js'
 export default {
+  props: {
+    curYear: {
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       gatewayno: '',
@@ -48,7 +55,7 @@ export default {
     },
     getData () {
       this.loading = true
-      queryProvinceSaleAmount().then(res => {
+      queryProvinceSaleAmount(getDate.getBeDateByYear(this.curYear)).then(res => {
         if (!this.timer) {
           console.log('销售金额top15省份', res)
         }

+ 8 - 1
src/views/bigScreen/realTimeSalesReport/left-top.vue

@@ -10,7 +10,14 @@
 
 <script>
 import { queryAreaSaleAmount } from '@/api/bigScreen.js'
+import getDate from '@/libs/getDate.js'
 export default {
+  props: {
+    curYear: {
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       options: {},
@@ -36,7 +43,7 @@ export default {
     },
     getData () {
       this.loading = true
-      queryAreaSaleAmount({}).then(res => {
+      queryAreaSaleAmount(getDate.getBeDateByYear(this.curYear)).then(res => {
         // 只打印一次
         if (!this.timer) {
           console.log('区域销售金额占比', res)

+ 8 - 1
src/views/bigScreen/realTimeSalesReport/right-top.vue

@@ -17,7 +17,14 @@
 <script>
 import { graphic } from 'echarts'
 import { querySaleTrend } from '@/api/bigScreen.js'
+import getDate from '@/libs/getDate.js'
 export default {
+  props: {
+    curYear: {
+      type: [Number, String],
+      default: ''
+    }
+  },
   data () {
     return {
       option: {},
@@ -41,7 +48,7 @@ export default {
     },
     getData () {
       this.loading = true
-      querySaleTrend().then((res) => {
+      querySaleTrend(getDate.getBeDateByYear(this.curYear)).then((res) => {
         if (!this.timer) {
           console.log('销售趋势分析', res)
         }