|
@@ -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()
|
|
|
|