1 |
- webpackJsonp([93],{JyjZ:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("Gu7T"),n=a.n(i),r=a("u2KI"),s=a.n(r),o=a("Xxa5"),l=a.n(o),d=a("exGp"),c=a.n(d),p=a("gzej"),u=a("KnvP"),h=a("3ivx"),m=a("erru"),f=a("la//"),_={components:{datePicker:p.a,inputRange:u.a,switchMpAdq:h.a,selfChannel:m.a},data:function(){return{height:"",loading:!1,page:1,pages:0,total:0,page_size:20,default_time:[this.$getDay(-30,!1),this.$getDay(0,!1)],time:[],summaryTableCol:[],detailsTableCol:[],firstDayRoi:["",""],firstOrderCost:["",""],perFollowCost:["",""],totalRoi:["",""],paid:["",""],reset:!1,order_type:"",plat_order_type:"",closing_date:"",sort_field:"date",sort_type:"desc",updateTime:"",isShowEmpty:!1}},computed:{isMP:function(){return this.order_type===f.D.MP},isADQ:function(){return this.order_type===f.D.ADQ},isShowAdqBtn:function(){return!!this.$store.state.dataBoardAuth.adq_auth},isShowMpBtn:function(){return!!this.$store.state.dataBoardAuth.mp_auth},isCanExport:function(){return!!this.$store.state.dataBoardAuth.can_export}},created:function(){this.getDefaultOrderType()?(this.height=document.documentElement.clientHeight-200>400?document.documentElement.clientHeight-200:400,this.time=this.default_time,this.init(1),this.handleGetUpdateTime()):this.isShowEmpty=!0},methods:{getDefaultOrderType:function(){return this.isShowAdqBtn?(this.order_type=f.D.ADQ,f.D.ADQ):this.isShowMpBtn?(this.order_type=f.D.MP,f.D.MP):(this.$message.warning('暂无数据权限,请前往"账号管理"添加配置'),!1)},handleGetUpdateTime:function(){var t=this;return c()(l.a.mark(function e(){var a,i,n,r;return l.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,a={type:""},t.isMP&&(a.type="data_cycle_mp"),t.isADQ&&(a.type="data_cycle_adq"),e.next=6,t.$axios.get(""+t.URL.BASEURL+t.URL.dataBoard_uptime,{params:a});case 6:i=e.sent,n=i.data,(r=void 0===n?{}:n)&&0==r.errno?t.updateTime=r.rst.uptime:4002!=r.errno&&(t.$message.warning(r.err),t.updateTime=""),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),t.updateTime="";case 15:case"end":return e.stop()}},e,t,[[0,12]])}))()},handleReset:function(){this.reset=!this.reset,this.order_type=this.getDefaultOrderType(),this.plat_order_type="",this.closing_date="",this.time=this.default_time,this.firstDayRoi=["",""],this.firstOrderCost=["",""],this.perFollowCost=["",""],this.totalRoi=["",""],this.paid=["",""],this.sort_field="date",this.sort_type="desc",this.init(1),this.handleGetUpdateTime()},changeTime:function(t){!t||t&&0==t.length?this.time=[]:this.time=t,this.init(1),this.handleGetUpdateTime()},init:function(t,e){var a=this;return c()(l.a.mark(function i(){var n,r,o,d,c;return l.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(i.prev=0,"export"==e){i.next=5;break}a.page=t||a.page,i.next=7;break;case 5:if(0!=a.total){i.next=7;break}return i.abrupt("return",a.$message.warning("暂无数据可导出"));case 7:return a.loading=!0,i.next=10,a.$axios.get(""+a.URL.BASEURL+a.URL.dataBoard_dataCycleListByAccount,{params:{page:"export"==e?1:a.page,page_size:"export"==e?a.$store.state.exportNumber:a.page_size,begin_date:a.time[0],end_date:a.time[1],first_order_cost_min:a.firstOrderCost[0],first_order_cost_max:a.firstOrderCost[1],per_follow_cost_min:a.perFollowCost[0],per_follow_cost_max:a.perFollowCost[1],total_roi_min:a.totalRoi[0],total_roi_max:a.totalRoi[1],first_day_roi_min:a.firstDayRoi[0],first_day_roi_max:a.firstDayRoi[1],order_type:a.order_type,plat_order_type:a.plat_order_type,closing_date:a.closing_date,paid_min:a.paid[0],paid_max:a.paid[1],sort_field:a.sort_field,sort_type:a.sort_type}});case 10:if(n=i.sent,r=n.data,!(o=void 0===r?{}:r)||0!=o.errno){i.next=32;break}if("export"!=e){i.next=18;break}a.exportEvent(o.rst.data),i.next=30;break;case 18:return o.rst.data.list.head[0].fixed="left",o.rst.data.overview.head[0].fixed="left",a.summaryTableCol=s()(o.rst.data.overview.head||[]),a.detailsTableCol=s()(o.rst.data.list.head||[]),i.next=24,a.$nextTick();case 24:d=Array.isArray(o.rst.data.overview.list)?o.rst.data.overview.list:[o.rst.data.overview.list],c=Array.isArray(o.rst.data.list.list)?o.rst.data.list.list:[o.rst.data.list.list],a.$refs.summaryTable.reloadData(d),a.$refs.detailsTable.reloadData(c),a.total=o.rst.pageInfo.total,a.pages=o.rst.pageInfo.pages;case 30:i.next=33;break;case 32:4002!=o.errno&&(a.$message.warning(o.err),a.handleSetEmptyTable());case 33:i.next=40;break;case 35:i.prev=35,i.t0=i.catch(0),console.log(i.t0),a.$message.warning("操作失败"),a.handleSetEmptyTable();case 40:return i.prev=40,a.loading=!1,i.finish(40);case 43:case"end":return i.stop()}},i,a,[[0,35,40,43]])}))()},handleSetEmptyTable:function(){this.$refs.summaryTable.reloadData([]),this.$refs.detailsTable.reloadData([]),this.total=0,this.pages=0},handleCurrentChange:function(t){this.init(t),this.handleGetUpdateTime()},handleSizeChange:function(t){this.page_size=t,this.init(1),this.handleGetUpdateTime()},onChangeClosingDate:function(t){this.closing_date=t||"",this.init(1),this.handleGetUpdateTime()},onClickSort:function(t,e){this.sort_field===t?this.sort_type===e?(this.sort_field="date",this.sort_type="desc"):this.sort_type=e:(this.sort_field=t,this.sort_type=e),this.init(1),this.handleGetUpdateTime()},exportEvent:function(t){var e=[{tHeader:t.list.head.map(function(t){return t.name}),filterVal:t.list.head.map(function(t){return t.column}),tableDatas:[t.overview.list].concat(n()(t.list.list)),sheetName:""}];this.$exportOrder({excelDatas:e,name:"数据循环统计(导出时间:"+this.$getDay(0)+")"})}}},g={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"regRangeReport-wrap"},[t.isShowEmpty?a("el-empty",{staticClass:"empty-wrap",attrs:{description:"暂无数据权限"}}):[a("div",{staticClass:"screenBox flex"},[a("switchMpAdq",{attrs:{isShowAdqBtn:t.isShowAdqBtn,isShowMpBtn:t.isShowMpBtn},on:{change:function(e){t.init(1),t.handleGetUpdateTime()}},model:{value:t.order_type,callback:function(e){t.order_type=e},expression:"order_type"}}),t._v(" "),t.isCanExport?a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.init(1,"export")}}},[t._v("导出Excel")]):t._e()],1),t._v(" "),a("div",{staticClass:"screenBox filter-wrap"},[a("date-picker",{attrs:{reset:t.reset,title:"自定义",quickFlag:!0,afferent_time:t.default_time,clearFlag:!1},on:{changeTime:t.changeTime}}),t._v(" "),a("selfChannel",{staticStyle:{"margin-left":"-30px","margin-right":"0"},attrs:{reset:t.reset,title:"推广类型",type:"promotionType"},on:{channelDefine:function(e){t.plat_order_type=e,t.init(1),t.handleGetUpdateTime()}}}),t._v(" "),a("div",{staticClass:"common-screen-item",staticStyle:{"margin-left":"10px"}},[a("label",{staticClass:"common-screen-label"},[t._v("收益截止日期")]),t._v(" "),a("el-date-picker",{staticStyle:{width:"150px"},attrs:{"value-format":"yyyy-MM-dd",type:"date",placeholder:"选择日期",size:"small"},on:{change:t.onChangeClosingDate},model:{value:t.closing_date,callback:function(e){t.closing_date=e},expression:"closing_date"}})],1),t._v(" "),a("input-range",{attrs:{label:"首日ROI"},model:{value:t.firstDayRoi,callback:function(e){t.firstDayRoi=e},expression:"firstDayRoi"}}),t._v(" "),a("input-range",{attrs:{label:"下单成本"},model:{value:t.firstOrderCost,callback:function(e){t.firstOrderCost=e},expression:"firstOrderCost "}}),t._v(" "),a("input-range",{attrs:{label:"企微成本"},model:{value:t.perFollowCost,callback:function(e){t.perFollowCost=e},expression:"perFollowCost"}}),t._v(" "),a("input-range",{attrs:{label:"回本率"},model:{value:t.totalRoi,callback:function(e){t.totalRoi=e},expression:"totalRoi"}}),t._v(" "),a("input-range",{attrs:{label:"消耗"},model:{value:t.paid,callback:function(e){t.paid=e},expression:"paid"}}),t._v(" "),a("div",[a("el-button",{attrs:{size:"mini",type:"primary",plain:""},on:{click:function(e){t.init(1),t.handleGetUpdateTime()}}},[t._v("确定")]),t._v(" "),a("el-button",{attrs:{size:"mini",plain:""},on:{click:t.handleReset}},[t._v("重置")])],1)],1),t._v(" "),a("div",{staticClass:"update-time"},[a("i",{staticClass:"el-icon-warning-outline"}),t._v("数据更新时间:"+t._s(t.updateTime||"-"))]),t._v(" "),a("ux-grid",{ref:"summaryTable",staticStyle:{"margin-top":"10px"},attrs:{border:!1,"header-cell-style":function(){return{backgroundColor:"#FFFFFF !important",border:"none!important"}},"show-footer-overflow":"tooltip","show-overflow":"tooltip",size:"mini"},on:{"row-click":function(){}}},t._l(t.summaryTableCol,function(e){return a("ux-table-column",{key:e.column+e.name,attrs:{resizable:!0,field:e.column,title:e.name,"min-width":e.min_width?e.min_width:140,fixed:e.fixed?e.fixed:"",align:"center"},scopedSlots:t._u([{key:"header",fn:function(){return[a("div",{staticClass:"flex-align-jus-center"},[t._v("\n "+t._s(e.name)+"\n "),e.notes?a("el-tooltip",{attrs:{content:e.notes,placement:"top"}},[a("div",[a("i",{staticClass:"el-icon-question"})])]):t._e()],1)]},proxy:!0},{key:"default",fn:function(i){var n=i.row;return[a("span",[t._v(t._s(n[e.column]||0==n[e.column]?t.$formatNum(n[e.column]):"-"))])]}}],null,!0)})}),1),t._v(" "),a("ux-grid",{ref:"detailsTable",staticStyle:{"margin-top":"10px"},attrs:{border:!1,"header-cell-style":function(){return{backgroundColor:"#FFFFFF !important",border:"none!important"}},height:t.height,"show-footer-overflow":"tooltip","show-overflow":"tooltip",size:"mini"},on:{"row-click":function(){}}},t._l(t.detailsTableCol,function(e){return a("ux-table-column",{key:e.column+e.name,attrs:{resizable:!0,field:e.column,title:e.name,"min-width":e.min_width?e.min_width:140,fixed:e.fixed?e.fixed:"",align:"center"},scopedSlots:t._u([{key:"header",fn:function(){return[a("div",{staticClass:"flex-align-jus-center"},[t._v("\n "+t._s(e.name)+"\n "),e.notes?a("el-tooltip",{attrs:{content:e.notes,placement:"top"}},[a("div",[a("i",{staticClass:"el-icon-question"})])]):t._e(),t._v(" "),e.enable_to_sort?a("div",{staticClass:"sort-wrap"},[a("i",{staticClass:"el-icon-caret-top",class:{active:t.sort_field===e.column&&"asc"===t.sort_type},on:{click:function(a){return t.onClickSort(e.column,"asc")}}}),t._v(" "),a("i",{staticClass:"el-icon-caret-bottom",class:{active:t.sort_field===e.column&&"desc"===t.sort_type},on:{click:function(a){return t.onClickSort(e.column,"desc")}}})]):t._e()],1)]},proxy:!0},{key:"default",fn:function(i){var n=i.row;return[a("span",[t._v(t._s(n[e.column]||0==n[e.column]?t.$formatNum(n[e.column]):"-"))])]}}],null,!0)})}),1),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total > 0"}],staticClass:"pagination"},[a("el-pagination",{attrs:{background:"","current-page":t.page,layout:"prev, pager, next, sizes","page-sizes":[20,50,100],"page-count":Number(t.pages)},on:{"current-change":t.handleCurrentChange,"size-change":t.handleSizeChange}})],1)]],2)},staticRenderFns:[]};var v=a("VU/8")(_,g,!1,function(t){a("K13Q")},"data-v-2bda64ac",null);e.default=v.exports},K13Q:function(t,e){}});
|