zhuxinbo 4 年之前
父节点
当前提交
15956de89f
共有 4 个文件被更改,包括 77 次插入21 次删除
  1. 1 1
      package.json
  2. 53 0
      src/views/modules/Statistics/effectReport.vue
  3. 21 18
      src/views/modules/material/labelMaterial.vue
  4. 2 2
      vue.config.js

+ 1 - 1
package.json

@@ -3,7 +3,7 @@
   "version": "2.0.2",
   "private": true,
   "scripts": {
-    "serve": "vue-cli-service serve --open --max_old_space_size=10048",
+    "serve": "vue-cli-service serve  --max_old_space_size=8048 --open",
     "build": "vue-cli-service build",
     "lint": "vue-cli-service lint",
     "test:unit": "vue-cli-service test:unit",

+ 53 - 0
src/views/modules/Statistics/effectReport.vue

@@ -15,6 +15,7 @@
       </a-select>     
       <a-range-picker v-model="dateRange" @change="dateChange" style="width:200px" />      
       <div class="opt">
+        <!-- <a-button type='primary' @click="exportExcel" style="margin-right:15px">导出报表</a-button> -->
         <a-button type='primary' @click="(ipagination.current=1);(projectId = null);( unitId = null );(campaignId = null);(accountId = null) ;search()">查询</a-button>
       </div>
     </div>
@@ -25,6 +26,7 @@
             <a-tab-pane :key="3" tab="广告计划"> </a-tab-pane>
             <a-tab-pane :key="4" tab="广告组"> </a-tab-pane>
             <a-tab-pane :key="5" tab="广告创意"> </a-tab-pane>
+            <a-button slot="tabBarExtraContent" type='primary' @click="exportExcel"  :loading="exportLoading">导出报表</a-button>
         </a-tabs>
         <div class="tableBody">
           <a-spin :spinning="spinning">
@@ -480,9 +482,59 @@ export default {
         visible:false,
         imgSrc:undefined,
         currentRecords:{},
+        projectRecord:{},
+        exportLoading:false,
       }
     },
     methods: {
+      //导出报表
+        exportExcel() {
+          if(this.projectValue.length>0){
+            this.exportLoading=true;
+            let type='';
+           if(this.tabKey==1){
+              type='project'
+            }else if(this.tabKey==2){
+              type='account'
+            }else if(this.tabKey==3){
+              type='campaign'
+            }else if(this.tabKey==4){
+              type='group'
+            }else if(this.tabKey==5){
+              type='creative'
+            }
+
+          var name =`${this.dateRange[0].format('YYYY_MM_DD')}~${this.dateRange[1].format('YYYY_MM_DD')}_效果报表`;
+            
+          downFilePost(`/ctop/advertiser/exportKuaishouProjectInfo`, {
+            startDate:this.dateRange[0].format('YYYY-MM-DD'),
+            endDate:this.dateRange[1].format('YYYY-MM-DD'),
+            projectList:this.projectValue,
+            projectId:this.projectId,
+            accountId:this.accountId,
+            campaignId:this.campaignId,
+            unitId:this.unitId,
+            type,
+          }).then(res => {
+                // console.log(res)
+                this.exportLoading=false;
+                let blob = new Blob([res], {
+                    type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+                })
+                // console.log(blob)
+                let downloadElement = document.createElement('a')
+                let href = window.URL.createObjectURL(blob) //创建下载的链接
+                downloadElement.href = href
+                downloadElement.download = name+'.xlsx'    //下载后文件名
+                document.body.appendChild(downloadElement)
+                downloadElement.click() //点击下载
+                document.body.removeChild(downloadElement) //下载完成移除元素
+                window.URL.revokeObjectURL(href) //释放掉blob对象
+            })
+          }else{
+            this.$message.error('请选择项目!')
+          }
+        },
       handleOk(e) {
         // console.log(e);
         this.visible = false;
@@ -553,6 +605,7 @@ export default {
       // 从项目跳转到账户,并获取账户的table值
       goAccount(records){
         console.log(records,'--account');
+        this.projectRecord=records
         this.projectId=records.projectId 
         this.getTableAccountList()
 

+ 21 - 18
src/views/modules/material/labelMaterial.vue

@@ -51,15 +51,15 @@
       <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
         :pagination="ipagination" :loading="loading" @change="handleTableChange">
         <span slot="tagName" slot-scope="text,record">
-            <span v-if="record.status == 1">
-                {{text}}
-            </span>
-            <span v-else-if="record.status == 0" style="color:red">
-                {{text}}(未审核)
-            </span>
-            <span v-else>
-                {{text}}(已驳回)
-            </span>
+          <span v-if="record.status == 1">
+            {{text}}
+          </span>
+          <span v-else-if="record.status == 0" style="color:red">
+            {{text}}(未审核)
+          </span>
+          <span v-else>
+            {{text}}(已驳回)
+          </span>
         </span>
         <span slot="action" slot-scope="text, record">
           <a href="javascript:;" @click="handleAddSub(record)" :disabled="record.level==3">添加下级</a>
@@ -75,12 +75,13 @@
                   <a>删除</a>
                 </a-popconfirm>
               </a-menu-item>
-              <a-menu-item key="1"  :disabled="record.status==1">
+              <a-menu-item key="1" :disabled="record.status==1">
                 <a href="javascript:;" @click="handleDeleteStatus(record.id,'1')" :disabled="record.status==1">
                   通过</a>
               </a-menu-item>
               <a-menu-item key="3" :disabled="record.status==1">
-                <a style="margin-right:20px" @click="handleDeleteStatus(record.id,'2')" :disabled="record.status==1">驳回</a>
+                <a style="margin-right:20px" @click="handleDeleteStatus(record.id,'2')"
+                  :disabled="record.status==1">驳回</a>
 
               </a-menu-item>
             </a-menu>
@@ -150,14 +151,16 @@
          }
        },*/
     {
-      title: '标签编码',
-      dataIndex: 'tagCode',
-      key: 'tagCode',
+      title: '标签层级',
+      dataIndex: 'level',
+      key: 'level',
       customRender: function (text) {
-        if (text == null) {
-          return '-'
-        } else {
-          return text
+        if (text == 1) {
+          return '一级标签'
+        } else if (text == 2) {
+          return '二级标签'
+        } else if (text == 3) {
+          return '三级标签'
         }
       },
       align: 'center'

+ 2 - 2
vue.config.js

@@ -60,7 +60,7 @@ module.exports = {
       '/jeecg-boot': {
         //  target: 'http://192.168.1.90:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.0.59:8088', //请求本地 需要jeecg-boot后台项目  英豪
-        target: 'http://192.168.1.72:8088', //请求本地 需要jeecg-boot后台项目  英豪
+        // target: 'http://192.168.1.72:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.1.94:8088', //请求本地 需要jeecg-boot后台项目  孙震
         // target: 'http://192.168.0.230:8088', //请求本地 需要jeecg-boot后台项目  孙震
@@ -69,7 +69,7 @@ module.exports = {
         // target: 'http://192.168.1.51:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.0.252:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.0.170:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
-        //  target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目 
+         target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目 
          
         // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目 
         // target: 'http://39.106.184.70:8088/', //请求本地 需要jeecg-boot后台项目