ソースを参照

'视频报表修改首次进入'

魏志佳 5 年 前
コミット
8aba915532

+ 25 - 32
src/views/modules/Statistics/videoStatics/vDay.vue

@@ -1,15 +1,16 @@
 <template>
   <div class="vsummary">
-    <div class="timeDiv">
-      <div>
-        <!-- <span>项目选择:</span>
-        <a-select  default-value="" style="width: 200px" @change="selectChange"  placeholder="请选择项目账户">
+    <div class="xiangmuxuanze">
+      <span>项目选择:</span>
+        <a-select  default-value="" style="width: 500px" @change="selectChange"  placeholder="请选择项目账户">
           <a-select-option v-for="(item,index) in projectArr" :key="index" :value='item.id'>
             {{ item }}
           </a-select-option>
-        </a-select> -->
-
-        <span class="timeSpan">时间范围:</span>
+        </a-select>
+    </div>
+    <div class="timeDiv">
+      <div>
+        <span >时间范围:</span>
         <a-button type="default" @click="yesterdayHandle">昨日</a-button>
         <a-date-picker
           :disabled-date="disabledDate"
@@ -336,11 +337,17 @@ export default {
       let yesterday = moment()
           .subtract(1, 'days')
           .format('YYYY-MM-DD')
-       this.dateRange=moment(yesterday)
+      this.dateRange=moment(yesterday)
       console.log(this.dateRange);
       this.timedata=this.dateRange
       // this.totalSelect = 1
       // this.daysFlag = true
+      this.HttpPost();
+    },
+    //table数据查询时间
+    HttpPost(){
+      this.loading = true
+      this.date = []
       postAction('/toutiao/videoReportDaily/bytedanceVideoInfoListDaily', {
         date: this.timedata,
         cost: this.consumeValue,
@@ -359,29 +366,10 @@ export default {
         }
       })
     },
-
     //查询按钮
     searchRes() {
       console.log(this.timedata[0])
-      this.date = []
-      this.loading = true
-      postAction('/toutiao/videoReportDaily/bytedanceVideoInfoListDaily', {
-        date: this.timedata,
-        cost: this.consumeValue,
-        signature:this.videoID
-      }).then(res => {
-        let resArr = []
-        this.loading = false
-        console.log(res)
-        if (res.success) {
-          let result = res.result
-          this.data.push({ ...result, key: 1 })
-          result.map((item, index) => {
-            item.key = index
-          })
-          this.data = result
-        }
-      })
+      this.HttpPost();
     },
 
    
@@ -544,7 +532,11 @@ export default {
       return Number(val).toFixed(2)
     }
   },
-
+  mounted() {
+      this.dateRange=moment().subtract(1,'days')  
+      this.timedata=moment().subtract(1,'days').format('YYYY-MM-DD')
+      this.HttpPost();
+  },
 
 }
 </script>
@@ -564,12 +556,13 @@ export default {
   width: 100%;
   height: 100%;
 }
+.xiangmuxuanze{
+  margin-bottom: 20px;;
+}
 .timeDiv {
   display: flex;
   justify-content: space-between;
-  .timeSpan{
-    margin-left: 15px;
-  }
+  
 }
 span {
   margin-left: 5px;

+ 46 - 26
src/views/modules/Statistics/videoStatics/vMonth.vue

@@ -1,5 +1,13 @@
 <template>
   <div class="vsummary">
+    <div class="xiangmuxuanze">
+      <span>项目选择:</span>
+        <a-select  default-value="" style="width: 500px" @change="selectChange"  placeholder="请选择项目账户">
+          <a-select-option v-for="(item,index) in projectArr" :key="index" :value='item.id'>
+            {{ item }}
+          </a-select-option>
+        </a-select>
+    </div>
     <div class="timeDiv">
       <div>
         <span>时间范围:</span>
@@ -345,7 +353,9 @@ let detailConsum = [
 export default {
   data() {
     return {
-
+       //下拉选择框的数据
+      projectArr:[],
+      selectValue:'',
        //gudinglie
       columnsFixd:columnsFixd,
 
@@ -401,6 +411,10 @@ export default {
   mixins: [JeecgListMixin],
   methods: {
     moment,
+    //select切换---项目
+    selectChange(key){
+        this.selectValue=key;
+    },
     //打开视频
     openVideo(val){
         this.Videovisible=true;
@@ -432,34 +446,16 @@ export default {
       this.totalSelect = (this.dateRange[1]._d - this.dateRange[0]._d) / (24 * 60 * 60 * 1000) + 1;
       this.timedata=[this.dateRange[0]._i,this.dateRange[1]._i]
       this.daysFlag = true
-      postAction('/toutiao/videoReportDaily/bytedanceVideoInfoListMonth', {
-        startDate: this.timedata[0],
-        endDate: this.timedata[1],
-        cost: this.consumeValue,
-        signature: this.videoID
-      }).then(res => {
-        let resArr = []
-        this.loading = false
-        console.log(res)
-        if (res.success) {
-          let result = res.result
-          this.data.push({ ...result, key: 1 })
-          result.map((item, index) => {
-            item.key = index
-          })
-          this.data = result;
-          
-        }
-      })
+     this.HttpPost();
 
     },
 
     consumeOnChange() {},
-    //查询按钮
-    searchRes() {
-      this.date = []
-      this.loading = true
-      postAction('/toutiao/videoReportDaily/bytedanceVideoInfoListMonth', {
+    //获取table数据请求
+    HttpPost(){
+      this.loading=true;
+      this.date=[];
+       postAction('/toutiao/videoReportDaily/bytedanceVideoInfoListMonth', {
         startDate: this.timedata[0],
         endDate: this.timedata[1],
         cost: this.consumeValue,
@@ -479,6 +475,10 @@ export default {
         }
       })
     },
+    //查询按钮
+    searchRes() {
+      this.HttpPost();      
+    },
 
     //导出报表
     exportExcel() {
@@ -718,7 +718,24 @@ export default {
     tofixed(val){
       return Number(val).toFixed(2)
     }
-  }
+  },
+  mounted() {
+    let lastStart = 
+        moment()
+          .subtract(1, 'months')
+          .format('YYYY-MM-DD')
+      let lastEnd =   moment()
+          .subtract(1, 'days')
+          .format('YYYY-MM-DD')
+      
+
+      this.dateRange=[moment(lastStart),moment(lastEnd)]
+      // console.log(this.dateRange)
+      this.totalSelect = (this.dateRange[1]._d - this.dateRange[0]._d) / (24 * 60 * 60 * 1000) + 1;
+      this.timedata=[this.dateRange[0]._i,this.dateRange[1]._i]
+      this.daysFlag = true
+    this.HttpPost();
+  },
 }
 </script>
 <style lang="less">
@@ -737,6 +754,9 @@ export default {
   width: 100%;
   height: 100%;
 }
+.xiangmuxuanze{
+  margin-bottom: 20px;;
+}
 .timeDiv {
   display: flex;
   justify-content: space-between;

+ 18 - 0
src/views/modules/Statistics/videoStatics/vSummary.vue

@@ -1,5 +1,13 @@
 <template>
   <div class="vsummary">
+    <div class="xiangmuxuanze">
+      <span>项目选择:</span>
+        <a-select  default-value="" style="width: 500px" @change="selectChange"  placeholder="请选择项目账户">
+          <a-select-option v-for="(item,index) in projectArr" :key="index" :value='item.id'>
+            {{ item }}
+          </a-select-option>
+        </a-select>
+    </div>
     <div class="timeDiv">
       <div>
         <span>时间范围:</span>
@@ -280,6 +288,9 @@ let variableCol = [
 export default {
   data() {
     return {
+       //下拉选择框的数据
+      projectArr:[],
+      selectValue:'',
       //设置表格的列宽
       tableWidth: '',
 
@@ -320,6 +331,10 @@ export default {
   },
   methods: {
     moment,
+    //select切换---项目
+    selectChange(key){
+        this.selectValue=key;
+    },
     //打开视频
     openVideo(val) {
       this.Videovisible = true
@@ -657,6 +672,9 @@ export default {
   width: 100%;
   height: 100%;
 }
+.xiangmuxuanze{
+  margin-bottom: 20px;;
+}
 .timeDiv {
   display: flex;
   justify-content: space-between;

+ 31 - 27
src/views/modules/Statistics/videoStatics/vWeek.vue

@@ -1,5 +1,13 @@
 <template>
   <div class="vsummary">
+    <div class="xiangmuxuanze">
+      <span>项目选择:</span>
+        <a-select  default-value="" style="width: 500px" @change="selectChange"  placeholder="请选择项目账户">
+          <a-select-option v-for="(item,index) in projectArr" :key="index" :value='item.id'>
+            {{ item }}
+          </a-select-option>
+        </a-select>
+    </div>
     <div class="timeDiv">
       <div>
         <span>时间范围:</span>
@@ -340,7 +348,9 @@ let detailConsum = [
 export default {
   data() {
     return {
-
+       //下拉选择框的数据
+      projectArr:[],
+      selectValue:'',
        //gudinglie
       columnsFixd:columnsFixd,
 
@@ -394,6 +404,10 @@ export default {
   mixins: [JeecgListMixin],
   methods: {
     moment,
+    //select切换---项目
+    selectChange(key){
+        this.selectValue=key;
+    },
      //打开视频
     openVideo(val){
         this.Videovisible=true;
@@ -418,37 +432,17 @@ export default {
       
 
       this.dateRange=[lastStart,lastEnd]
-      console.log(this.dateRange);
-      this.timedata=this.dateRange
-      this.timedata=this.dateRange
-      // console.log(this.dateRange)
+      
       this.totalSelect = 7
       this.daysFlag = true
-      this.timedata=[this.dateRange[0]._i,this.dateRange[1]._i]
-      postAction('/toutiao/videoReportDaily/bytedanceVideoInfoListWeek', {
-        startDate: this.timedata[0],
-        endDate: this.timedata[1],
-        cost: this.consumeValue,
-        signature: this.videoID
-      }).then(res => {
-        let resArr = []
-        this.loading = false
-        console.log(res)
-        if (res.success) {
-          let result = res.result
-          this.data.push({ ...result, key: 1 })
-          result.map((item, index) => {
-            item.key = index
-          })
-          this.data = result
-        }
-      })
+      this.timedata=[moment(this.dateRange[0]).format('YYYY-MM-DD'),moment(this.dateRange[1]).format('YYYY-MM-DD')]
+      this.HttpPost();
 
     },
 
     consumeOnChange() {},
-    //查询按钮
-    searchRes() {
+    //tableshuju请求
+    HttpPost(){
       this.date = []
       this.loading = true
       postAction('/toutiao/videoReportDaily/bytedanceVideoInfoListWeek', {
@@ -470,6 +464,10 @@ export default {
         }
       })
     },
+    //查询按钮
+    searchRes() {
+      this.HttpPost();
+    },
 
     //导出报表
     exportExcel() {
@@ -709,7 +707,10 @@ export default {
     tofixed(val){
       return Number(val).toFixed(2)
     }
-  }
+  },
+  mounted() {
+    this.lastWeekHandle();
+  },
 }
 </script>
 <style lang="less">
@@ -728,6 +729,9 @@ export default {
   width: 100%;
   height: 100%;
 }
+.xiangmuxuanze{
+  margin-bottom: 20px;;
+}
 .timeDiv {
   display: flex;
   justify-content: space-between;