魏志佳 5 年之前
父節點
當前提交
5889abf1de

+ 2 - 2
src/views/dashboard/Analysis.vue

@@ -146,12 +146,12 @@
     <!-- <newHome v-if="roleCode == 'operator' || roleCode == 'touTiaoOperationManager'" /> -->
     <statistics v-else-if="roleCode == 'kuaishouOperationManager'" />
     <statistics v-else-if="roleCode == 'sale'||roleCode=='saleDirector'" />
-    <statistics v-else-if="roleCode == 'admin'" />
+    <!-- <statistics v-else-if="roleCode == 'admin'" /> -->
     <Workbench v-else-if="roleCode == 'clip'" />
     <Workbench v-else-if="roleCode == 'plane'" />
 
     
-     <!-- <newHome v-else-if="roleCode == 'admin'" /> -->
+     <newHome v-else-if="roleCode == 'admin'" />
   </div>
 </template>
 

+ 10 - 5
src/views/modules/Statistics/CompareData.vue

@@ -37,7 +37,9 @@
             <span>  {{costcompare.next|decimalsHandle}} </span>
             </p>
           <p>环比:
-            <span class="huanbi">  {{(costcompare.next-costcompare.prev)/costcompare.prev| toPercentage}}
+            <span class="huanbi"> 
+              <span v-if="(costcompare.next-costcompare.prev)/costcompare.prev">{{(costcompare.next-costcompare.prev)/costcompare.prev| toPercentage}}</span> 
+              <span v-else>{{'-'}}</span>
                 <span
                   class="greenIcon"
                   v-if="(costcompare.next-costcompare.prev)/costcompare.prev >0"
@@ -56,8 +58,9 @@
             <span>  {{clickcompare.next |formatCurrency}}</span>
             </p>
           <p >环比:
-            <span class="huanbi">  {{
-                (clickcompare.next-clickcompare.prev)/clickcompare.prev| toPercentage}}
+            <span class="huanbi">  
+                <span v-if="(clickcompare.next-clickcompare.prev)/clickcompare.prev">{{(clickcompare.next-clickcompare.prev)/clickcompare.prev| toPercentage}}</span>
+                <span v-else>{{'-'}}</span>
                  <span
                   class="greenIcon"
                   v-if="(clickcompare.next-clickcompare.prev)/clickcompare.prev >0"
@@ -76,7 +79,9 @@
             <span>  {{showNumcompare.prev|formatCurrency}}</span>
               </p>
           <p>环比:
-            <span class="huanbi">  {{(showNumcompare.next-showNumcompare.prev)/showNumcompare.prev| toPercentage}}
+            <span class="huanbi"> 
+              <span v-if="(showNumcompare.next-showNumcompare.prev)/showNumcompare.prev">{{(showNumcompare.next-showNumcompare.prev)/showNumcompare.prev| toPercentage}}</span> 
+              <span v-else>{{'-'}}</span>
                 <span
                   class="greenIcon"
                   v-if="(showNumcompare.next-showNumcompare.prev)/showNumcompare.prev>0"
@@ -695,7 +700,7 @@ export default {
       .huanbi{
           font-weight: 500;
           font-size: 16px;
-         
+          margin-left: 0;
           position: relative;
           display: inline-block;
           padding: 0 15px  0;

+ 86 - 5
src/views/modules/Statistics/accountReport.vue

@@ -22,12 +22,14 @@
           <span>返点比例:</span>
           <a-input-number :min="0" :max="10" :step="0.1" v-model="rebateProp" />
       </div>
-      <div class="optItem">
-
+      <div class="time"  @click="opendate">
+            <DatePicker :openOptions='openOptions'/>
       </div>
         
       <div class="btn">
-        <a-button type="primary" @click="getData">查询</a-button>
+        <a-button type="primary" @click="searchgetData" :disabled='searchDisabled'>查询</a-button>
+        <a-button type="primary" @click="refreshgetData" :disabled='refreshDisabled'>刷新</a-button>
+        <a-button type="primary" @click="resetgetData" :disabled='resetDisabled'>重置</a-button>
       </div>
     </div>
   </div>
@@ -66,6 +68,17 @@ export default {
       discount:1.0,
       //返点比例
       rebateProp:1.0,
+      //日期矿打开
+      openOptions:false,
+      //子元素的数据存储
+    
+        type:1,
+        dateValue:[moment(),moment()],
+
+        //处理按钮禁用
+        searchDisabled:false,
+        refreshDisabled:false,
+        resetDisabled:false,
     }
   },
   methods: {
@@ -100,14 +113,82 @@ export default {
       return current && current > moment().subtract(1, 'day')
     },
 
-    //确定按钮的事件
-    getData(){
+    //查询按钮的事件
+    searchgetData(){
            
         console.log();
         this.loading=true;
+        this.searchDisabled=true;
         // this.HttpPost()
             
     },
+    //刷新
+    refreshgetData(){
+         this.loading=true;
+         this.refreshDisabled=true;
+    },
+    //重置
+    resetgetData(){
+         this.loading=true;
+         this.resetDisabled=true;
+    },
+      //打开日期框
+   opendate(){
+       this.openOptions=!this.openOptions;
+      //  console.log(this.openOptions)
+   },
+
+   HttpPost(params){
+     return new Promise((resolve, reject) => {
+        postAction('/ctop/byteDance/homePage/report/week', {}).then(res => {
+        //   console.log(res)
+          if (res.success) {
+            this.loading = false
+            this.refreshDisabled=false;
+            this.resetDisabled=false;
+            this.searchDisabled=false;
+            this.cost = res.result.costWeekLink
+            this.click = res.result.clickWeekLink
+            this.showNum = res.result.showNumWeekLink
+            res.result.top.top7.forEach((element, index) => {
+              this.topOption.xAxis[0].data.push(element.authName)
+              this.topOption.series[0].data.push(element.cost)
+            })
+
+            for (let [key, value] of Object.entries(res.result.costWeek)) {
+              this.costOption.xAxis[0].data.push(key)
+              this.costOption.series[0].data.push(value)
+            }
+            for (let [key, value] of Object.entries(res.result.clickWeek)) {
+              this.clickOption.xAxis[0].data.push(key)
+              this.clickOption.series[0].data.push(value)
+            }
+            for (let [key, value] of Object.entries(res.result.showNumWeek)) {
+              this.showOption.xAxis[0].data.push(key)
+              this.showOption.series[0].data.push(value)
+            }
+
+            this.getEchartData('topChart', this.topOption)
+            this.getEchartData('costChart', this.costOption)
+            this.getEchartData('clickChart', this.clickOption)
+            this.getEchartData('showChart', this.showOption)
+            
+          }
+        })
+      })
+   },
+    //获取echart的值
+    getEchartData(idName, optionName) {
+      const chart = this.$refs[idName]
+      //   console.log(chart)
+      if (chart) {
+        const myChart = echarts.init(document.getElementById(idName))
+        myChart.setOption(optionName)
+        window.addEventListener('resize', function() {
+          myChart.resize()
+        })
+      }
+    },
   }
 }
 </script>

+ 12 - 3
src/views/modules/Statistics/newHome.vue

@@ -33,7 +33,8 @@
             <div class="footerInfo">
               周同比
               <span class="num">
-                {{cost.weekCostSumLink|toPercentage}}
+                <span v-if="cost.weekCostSumLink">{{cost.weekCostSumLink|toPercentage}}</span>
+                <span v-else>{{'-'}}</span>
                 <span
                   class="greenIcon"
                   v-if="cost.weekCostSumLink>0"
@@ -59,7 +60,9 @@
             <div class="footerInfo">
               周同比
               <span class="num">
-                {{click.weekClickSumLink|toPercentage}}
+                <span v-if="click.weekClickSumLink">{{click.weekClickSumLink|toPercentage}}</span>
+                <span v-else>{{'-'}}</span>
+                
                 <span
                   class="greenIcon"
                   v-if="click.weekClickSumLink>0"
@@ -85,7 +88,9 @@
             <div class="footerInfo">
               周同比
               <span class="num">
-                {{showNum.weekShowNumSumLink | toPercentage}}
+                <span v-if="showNum.weekShowNumSumLink">{{showNum.weekShowNumSumLink | toPercentage}}</span>
+                <span v-else>{{'-'}}</span>
+                
                 <span
                   class="greenIcon"
                   v-if="showNum.weekShowNumSumLink>0"
@@ -476,6 +481,9 @@ export default {
           if (res.success) {
             this.loading = false
             //处理今天
+            if(res.result){
+
+            
             if(res.result.chart[0].afterData && res.result.chart[0].afterData.statDate==moment().format('YYYY-MM-DD')){
                 this.tabCost=JSON.parse(JSON.stringify(init))
                 this.tabClick=JSON.parse(JSON.stringify(init))
@@ -598,6 +606,7 @@ export default {
            total.cpm=(total.cost/total.showNum*1000).toFixed(2)
            this.tableData=[total,...res.result.list]
           }
+          }
         })
       })
     },

+ 2 - 2
vue.config.js

@@ -66,13 +66,13 @@ module.exports = {
       '/jeecg-boot': {
         // target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目  生产环境
         // target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
-        target: 'http://192.168.1.13:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
+        // target: 'http://192.168.1.13:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.1.22:8080', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.0.125:8080', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.1.103:8080', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.1.54:8080', //请求本地 需要jeecg-boot后台项目  孙震
-        // target: 'http://192.168.1.165:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
+        target: 'http://192.168.1.165:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
         ws: false,
         changeOrigin: true
       },