privilege50ActivityReport.dff00200.js 19 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["privilege50ActivityReport"],{"048f":function(t,e,a){},"1e9d":function(t,e,a){"use strict";a("048f")},c5d7:function(t,e,a){"use strict";a.r(e);a("b0c0"),a("ac1f"),a("841c"),a("498a");var n=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.pictLoading,expression:"pictLoading"}],staticClass:"view",attrs:{id:"report_Privilege50ActivityReport","element-loading-background":"rgba(43, 48, 67, 0.65)","element-loading-spinner":"el-icon-loading"}},[e("div",{staticClass:"crm_search"},[e("el-form",{ref:"search",attrs:{"label-position":"",model:t.search,"label-width":""}},[e("el-row",[e("el-col",{attrs:{span:24,md:24,lg:24}},[e("el-form-item",{staticStyle:{"margin-right":"10px","margin-top":"1px"},attrs:{prop:""}},[e("div",{staticStyle:{display:"flex","align-items":"center"}},[e("el-input",{staticClass:"crm-border-radius-no",staticStyle:{width:"160px"},attrs:{placeholder:t.$t("Placeholder.Input"),size:"small"},model:{value:t.newIb,callback:function(e){t.newIb="string"===typeof e?e.trim():e},expression:"newIb"}}),e("span",{directives:[{name:"t",rawName:"v-t",value:"Btn.Search",expression:"'Btn.Search'"}],staticClass:"dialogCheckSearch crm-cursor crm_state_blue",on:{click:function(e){return t.searchIbTreeSearch1(t.newIb)}}}),e("el-cascader",{staticClass:"crm-border-radius-no crm_select_icon",staticStyle:{width:"200px"},attrs:{props:t.props,options:t.agentId_options,placeholder:t.$t("Enter_info.All"),size:"small"},on:{"expand-change":t.handleItemChange},scopedSlots:t._u([{key:"default",fn:function(a){var n=a.data;return[e("div",[e("span",[t._v(t._s(n.label))]),n.name?e("span",[t._v(" - "+t._s(n.name)+" ")]):t._e()])]}}]),model:{value:t.value,callback:function(e){t.value=e},expression:"value"}})],1)]),e("el-form-item",{staticStyle:{"margin-right":"10px"},attrs:{prop:"date"}},[e("el-date-picker",{staticClass:"crm_date_pick crm-border-radius-no privilege50-date-range",attrs:{type:"daterange",align:"right","unlink-panels":"","value-format":"yyyy-MM-dd","range-separator":"-",size:"small","popper-class":"privilege50-date-range-popper","start-placeholder":t.$t("Placeholder.Start"),"end-placeholder":t.$t("Placeholder.End"),"picker-options":t.pickerOptions},on:{change:t.handleDateChange},model:{value:t.search.date,callback:function(e){t.$set(t.search,"date",e)},expression:"search.date"}})],1),e("el-form-item",{staticStyle:{"margin-right":"10px"},attrs:{prop:"ibNo"}},[e("el-input",{staticClass:"crm-border-radius-no",staticStyle:{width:"160px"},attrs:{size:"small",placeholder:t.$t("Label.AttributionNumber")},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.toSearch.apply(null,arguments)}},model:{value:t.search.ibNo,callback:function(e){t.$set(t.search,"ibNo","string"===typeof e?e.trim():e)},expression:"search.ibNo"}})],1)],1)],1),e("el-form-item",[e("el-button",{staticStyle:{"margin-left":"8px"},attrs:{type:"primary",size:"small"},on:{click:t.toSearch}},[e("span",{directives:[{name:"t",rawName:"v-t",value:"Label.GenerateReport",expression:"'Label.GenerateReport'"}]})]),e("el-dropdown",{staticStyle:{margin:"0 8px"},attrs:{trigger:"click"},on:{command:t.handleCommand}},[e("span",{staticClass:"el-dropdown-link crm-cursor"},[e("i",{staticClass:"iconfont iconcaidan",staticStyle:{"font-weight":"bold","font-size":"20px"}})]),e("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t.display["ActivityReport.R-Privilege50-Export"].show?e("el-dropdown-item",{attrs:{command:{type:"export"}}},[e("i",{staticClass:"el-icon-download"}),e("span",{directives:[{name:"t",rawName:"v-t",value:"Btn.Export",expression:"'Btn.Export'"}]})]):t._e()],1)],1)],1)],1)],1),e("el-table",{staticClass:"privilege50-activity-table",staticStyle:{width:"100%"},attrs:{data:t.mock_tableData,"show-summary":"","summary-method":t.getSummaries,stripe:"",border:""},on:{"sort-change":t.handleSortChange}},[e("el-table-column",{attrs:{align:"center",width:"72",label:" "}}),e("el-table-column",{attrs:{prop:"mt4Count","min-width":"130",align:"center",sortable:"custom",label:t.$t("ActivityReport.mt4Count")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatCount(e.row.mt4Count)))]}}])}),e("el-table-column",{attrs:{prop:"mt5count","min-width":"130",align:"center",sortable:"custom",label:t.$t("ActivityReport.mt5count")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatCount(e.row.mt5count)))]}}])}),e("el-table-column",{attrs:{prop:"passCount","min-width":"120",align:"center",sortable:"custom",label:t.$t("ActivityReport.passCount")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatCount(e.row.passCount)))]}}])}),e("el-table-column",{attrs:{prop:"rejectCount","min-width":"120",align:"center",sortable:"custom",label:t.$t("ActivityReport.rejectCount")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatCount(e.row.rejectCount)))]}}])}),e("el-table-column",{attrs:{prop:"processingCount","min-width":"130",align:"center",sortable:"custom",label:t.$t("ActivityReport.processingCount")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatCount(e.row.processingCount)))]}}])}),e("el-table-column",{attrs:{prop:"completedCount","min-width":"120",align:"center",sortable:"custom",label:t.$t("ActivityReport.completedCount")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatCount(e.row.completedCount)))]}}])}),e("el-table-column",{attrs:{prop:"maxWinRate","min-width":"100",align:"center",label:t.$t("ActivityReport.maxWinRate")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatRate(e.row.maxWinRate)))]}}])}),e("el-table-column",{attrs:{prop:"minWinRate","min-width":"100",align:"center",label:t.$t("ActivityReport.minWinRate")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatRate(e.row.minWinRate)))]}}])}),e("el-table-column",{attrs:{prop:"sumVolume","min-width":"100",align:"center",sortable:"custom",label:t.$t("ActivityReport.sumVolume")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatAmount(e.row.sumVolume)))]}}])}),e("el-table-column",{attrs:{prop:"maxVolume","min-width":"100",align:"center",label:t.$t("ActivityReport.maxVolume")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatAmount(e.row.maxVolume)))]}}])}),e("el-table-column",{attrs:{prop:"minVolume","min-width":"100",align:"center",label:t.$t("ActivityReport.minVolume")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatAmount(e.row.minVolume)))]}}])}),e("el-table-column",{attrs:{prop:"sumDeposit","min-width":"100",align:"center",sortable:"custom",label:t.$t("ActivityReport.sumDeposit")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatAmount(e.row.sumDeposit)))]}}])}),e("el-table-column",{attrs:{prop:"sumWithdraw","min-width":"100",align:"center",sortable:"custom",label:t.$t("ActivityReport.sumWithdraw")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatAmount(e.row.sumWithdraw)))]}}])}),e("el-table-column",{attrs:{prop:"depositCount","min-width":"100",align:"center",sortable:"custom",label:t.$t("ActivityReport.depositCount")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatCount(e.row.depositCount)))]}}])}),e("el-table-column",{attrs:{prop:"depoistRate","min-width":"100",align:"center",label:t.$t("ActivityReport.depoistRate")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatRate(e.row.depoistRate)))]}}])}),e("el-table-column",{attrs:{prop:"withdrawalCount","min-width":"100",align:"center",sortable:"custom",label:t.$t("ActivityReport.withdrawalCount")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatCount(e.row.withdrawalCount)))]}}])}),e("el-table-column",{attrs:{prop:"withdrawalRate","min-width":"100",align:"center",label:t.$t("ActivityReport.withdrawalRate")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatRate(e.row.withdrawalRate)))]}}])}),e("el-table-column",{attrs:{prop:"companyCustom","min-width":"100",align:"center",label:t.$t("ActivityReport.companyCustom")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.formatRate(e.row.companyCustom)))]}}])}),e("el-table-column",{attrs:{prop:"addTime","min-width":"160",align:"center",sortable:"custom",label:t.$t("ActivityReport.addTime")},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.addTime||"--"))]}}])})],1),t.pagerInfo.rowTotal?e("div",{staticClass:"crm_pagination"},[e("div",{staticClass:"crm_page_total"},[e("span",{directives:[{name:"t",rawName:"v-t",value:"Page.total.item1",expression:"'Page.total.item1'"}]}),e("span",[t._v(t._s(t.pagerInfo.rowTotal))]),e("span",{directives:[{name:"t",rawName:"v-t",value:"Page.total.item2",expression:"'Page.total.item2'"}]})]),e("el-pagination",{staticClass:"page",attrs:{background:"",layout:"sizes, prev, pager, next","page-sizes":[10,20,50,100],"page-size":t.pagerInfo.row,total:t.pagerInfo.rowTotal},on:{"current-change":t.handleCurrentChange,"size-change":t.handleSizeChange}})],1):t._e()],1)},r=[],o=a("c7eb"),i=a("1da1"),s=(a("99af"),a("d81d"),a("14d9"),a("e9f5"),a("7d54"),a("ab43"),a("a732"),a("b64b"),a("d3b7"),a("3ca3"),a("5319"),a("159b"),a("ddb0"),a("2b3d"),a("bf19"),a("9861"),a("88a7"),a("271a"),a("5494"),a("bc3a")),l=a.n(s),c=a("4477"),u=a("f121"),p=a.n(u),d=a("7f08"),m=p.a.Code,h={mt4Count:"1",mt5count:"2",passCount:"3",rejectCount:"4",processingCount:"5",completedCount:"6",sumVolume:"7",sumDeposit:"8",sumWithdraw:"9",depositCount:"10",withdrawalCount:"11",addTime:"12"},g={name:"Privilege50ActivityReport",data:function(){return{pictLoading:!1,flag:!1,mock_tableData:[],combined:{},search:{ibNo:"",agentId:null,date:[],startDate:"",endDate:"",orderColumn:null,orderType:null},pagerInfo:{row:10,current:1,pageTotal:0,rowTotal:0},newIb:"",value:[],agentId_options:[{value:0,label:this.$i18n.t("news_add_field.IbReport.ALL")},{value:-1,label:this.$i18n.t("news_add_field.IbReport.DirectlyUnder")}],props:{value:"value",children:"children",checkStrictly:!0},child:[],pickDate:null}},computed:{display:function(){return this.safeDisplay(this.Session)},pickerOptions:function(){var t=this,e=new Date;return e.setHours(23,59,59,999),{onPick:function(e){var a=e.maxDate,n=e.minDate;t.pickDate=n&&!a?n.getTime():null},disabledDate:function(a){if(a.getTime()>e.getTime())return!0;if(t.pickDate){var n=new Date(t.pickDate);return a.getFullYear()!==n.getFullYear()||a.getMonth()!==n.getMonth()}return!1}}}},methods:{formatYMD:function(t){var e=t.getFullYear(),a=t.getMonth()+1,n=t.getDate(),r=a<10?"0"+a:""+a,o=n<10?"0"+n:""+n;return"".concat(e,"-").concat(r,"-").concat(o)},isSameMonth:function(t,e){if(!t||!e)return!0;var a=new Date(t.replace(/-/g,"/")),n=new Date(e.replace(/-/g,"/"));return a.getFullYear()===n.getFullYear()&&a.getMonth()===n.getMonth()},syncDateRange:function(t){if(!t||2!==t.length)return this.search.startDate="",void(this.search.endDate="");this.search.startDate=t[0],this.search.endDate=t[1]},handleDateChange:function(t){var e=this;if(this.pickDate=null,t&&2===t.length)return this.isSameMonth(t[0],t[1])?void this.syncDateRange(t):(this.$pigeon.MessageWarning(this.$i18n.t("ActivityReport.dateSameMonth")),void this.$nextTick((function(){e.getDate()})));this.syncDateRange(null)},formatCount:function(t){return null===t||void 0===t||""===t?"--":t},formatAmount:function(t){return null===t||void 0===t||""===t?"--":"***"===t?"***":Object(d["a"])(t)},formatRate:function(t){return null===t||void 0===t||""===t?"--":"***"===t?"***":t},getSummaries:function(t){var e=this;if(0===Object.keys(this.combined).length)return[];var a=this.combined,n={mt4Count:null!=a.mt4Count?Object(d["a"])(a.mt4Count):0,mt5count:null!=a.mt5count?Object(d["a"])(a.mt5count):0,passCount:null!=a.passCount?Object(d["a"])(a.passCount):0,rejectCount:null!=a.rejectCount?Object(d["a"])(a.rejectCount):0,processingCount:null!=a.processingCount?Object(d["a"])(a.processingCount):0,completedCount:null!=a.completedCount?Object(d["a"])(a.completedCount):0,sumVolume:null!=a.sumVolume?Object(d["a"])(a.sumVolume):0,sumDeposit:null!=a.sumDeposit?Object(d["a"])(a.sumDeposit):0,sumWithdraw:null!=a.sumWithdraw?Object(d["a"])(a.sumWithdraw):0,depositCount:null!=a.depositCount?Object(d["a"])(a.depositCount):0,withdrawalCount:null!=a.withdrawalCount?Object(d["a"])(a.withdrawalCount):0};return t.columns.map((function(t){if(!t.property)return e.$i18n.t("Label.Total");var a=t.property;return void 0!==n[a]?n[a]:""}))},handleSortChange:function(t){var e=t.prop,a=t.order;a?(this.search.orderColumn=h[e]||null,this.search.orderType="ascending"===a?"asc":"desc"):(this.search.orderColumn=null,this.search.orderType=null),this.pagerInfo.current=1,this.searchFunc()},handleCommand:function(t){"export"===t.type&&this.exportAgents()},handleItemChange:function(t){this.child=this.agentId_options;for(var e=0;e<t.length;e++)this.tree(t[e],this.child)},tree:function(){var t=Object(i["a"])(Object(o["a"])().mark((function t(e,a){var n,r,i,s=this;return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:n=Object(o["a"])().mark((function t(n){var r;return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!(null!=a[n].children&&a[n].children.length>0&&a[n].value==e)){t.next=3;break}return s.child=a[n].children,t.abrupt("return",{v:void 0});case 3:if(a[n].value!=e){t.next=9;break}return t.next=6,c["a"].ibTree({pid:e});case 6:return r=t.sent,r.code==m.StatusOK?null!=r.data&&(r.data.forEach((function(t){t.ibNo&&a[n].children.push({value:t.id,label:t.ibNo,name:t.name,children:[]})})),s.child=a[n].children):s.$pigeon.MessageError(r.msg),t.abrupt("return",{v:void 0});case 9:case"end":return t.stop()}}),t)})),i=0;case 2:if(!(i<a.length)){t.next=10;break}return t.delegateYield(n(i),"t0",4);case 4:if(r=t.t0,!r){t.next=7;break}return t.abrupt("return",r.v);case 7:i++,t.next=2;break;case 10:case"end":return t.stop()}}),t)})));function e(e,a){return t.apply(this,arguments)}return e}(),searchIbTree:function(){var t=this;return Object(i["a"])(Object(o["a"])().mark((function e(){var a;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,c["a"].ibTree({pid:0});case 2:a=e.sent,a.code==m.StatusOK&&null!=a.data?a.data.forEach((function(e){e.ibNo&&t.agentId_options.push({value:e.id,label:e.ibNo,name:e.name,children:[]})})):a.code!=m.StatusOK&&t.$pigeon.MessageError(a.msg);case 4:case"end":return e.stop()}}),e)})))()},searchIbTreeSearch1:function(t){var e=this;return Object(i["a"])(Object(o["a"])().mark((function a(){var n,r;return Object(o["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(t){a.next=2;break}return a.abrupt("return");case 2:if(n=e.agentId_options.some((function(e){return e.label==t})),!n){a.next=5;break}return a.abrupt("return");case 5:return a.next=7,c["a"].ibTreeSearch({ibNo:t});case 7:r=a.sent,r.code==m.StatusOK?(null!=r.data&&r.data.forEach((function(t){t.ibNo&&e.agentId_options.unshift({value:t.id,label:t.ibNo,name:t.name,children:[]})})),e.$pigeon.MessageOK(e.$i18n.t("Msg.SearchSuccess"))):e.$pigeon.MessageError(r.msg);case 9:case"end":return a.stop()}}),a)})))()},searchFunc:function(){var t=this;return Object(i["a"])(Object(o["a"])().mark((function e(){var a;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.pictLoading=!0,e.prev=1,t.display["ActivityReport.R-Privilege50-Search"]&&t.display["ActivityReport.R-Privilege50-Search"].show){e.next=6;break}return t.$pigeon.MessageWarning(t.$i18n.t("Msg.NotDisplay")),t.pictLoading=!1,e.abrupt("return");case 6:e.next=13;break;case 8:return e.prev=8,e.t0=e["catch"](1),t.$pigeon.MessageWarning(t.$i18n.t("Msg.NotDisplay")),t.pictLoading=!1,e.abrupt("return");case 13:if(t.search.startDate&&t.search.endDate){e.next=17;break}return t.$pigeon.MessageWarning(t.$i18n.t("vaildate.date.empty")),t.pictLoading=!1,e.abrupt("return");case 17:return e.next=19,c["a"].tradeActivity({ibNo:t.search.ibNo||null,agentId:t.search.agentId||null,startDate:t.search.startDate,endDate:t.search.endDate,orderColumn:t.search.orderColumn||null,orderType:t.search.orderType||null,page:{current:t.pagerInfo.current,row:t.pagerInfo.row}});case 19:a=e.sent,a.code==m.StatusOK?(t.combined=null!=a.sum?a.sum:{},t.mock_tableData=null!=a.data?a.data:[],null!=a.page?(t.pagerInfo.rowTotal=a.page.rowTotal,t.pagerInfo.pageTotal=a.page.pageTotal):t.pagerInfo.rowTotal=0,t.$pigeon.MessageOK(t.$i18n.t("Msg.SearchSuccess"))):t.$pigeon.MessageError(a.msg),t.pictLoading=!1;case 22:case"end":return e.stop()}}),e,null,[[1,8]])})))()},toSearch:function(){if(null==this.search.date||0===this.search.date.length)this.search.startDate="",this.search.endDate="";else{if(!this.isSameMonth(this.search.date[0],this.search.date[1]))return this.$pigeon.MessageWarning(this.$i18n.t("ActivityReport.dateSameMonth")),void this.getDate();this.syncDateRange(this.search.date)}this.pagerInfo.current=1,this.searchFunc()},handleSizeChange:function(t){this.pagerInfo.row=t,this.searchFunc()},handleCurrentChange:function(t){this.pagerInfo.current=t,this.searchFunc()},exportAgents:function(){var t=this;return Object(i["a"])(Object(o["a"])().mark((function e(){var a,n,r;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.flag){e.next=2;break}return e.abrupt("return");case 2:if(t.flag=!0,t.search.startDate&&t.search.endDate){e.next=7;break}return t.$pigeon.MessageWarning(t.$i18n.t("vaildate.date.empty")),t.flag=!1,e.abrupt("return");case 7:a=t.search.startDate.split("-")[0]+t.search.startDate.split("-")[1]+t.search.startDate.split("-")[2],n=t.search.endDate.split("-")[0]+t.search.endDate.split("-")[1]+t.search.endDate.split("-")[2],r="/trade/activity/apply/export?ibNo="+(t.search.ibNo?t.search.ibNo:"")+"&startDate="+a+"&endDate="+n+"&agentId="+(null!=t.search.agentId&&""!==t.search.agentId?t.search.agentId:""),l.a.get(r,{responseType:"blob"}).then((function(e){if(e.status==m.StatusOK){if("msSaveOrOpenBlob"in navigator)window.navigator.msSaveOrOpenBlob(e.data,"Download.xlsx");else{var a=window.URL.createObjectURL(e.data),n=document.createElement("a");document.body.appendChild(n);var r=e.headers["content-disposition"]?e.headers["content-disposition"].split(";")[1].split("=")[1]:"Download.xlsx";n.href=a,n.download=r,n.click(),window.URL.revokeObjectURL(a),document.body.removeChild(n)}t.$pigeon.MessageOK(t.$i18n.t("Msg.ExportSuccess"))}else t.$pigeon.MessageError(t.$i18n.t("Msg.ExportFailed"));t.flag=!1})).catch((function(){t.$pigeon.MessageError(t.$i18n.t("Msg.ExportFailed")),t.flag=!1}));case 11:case"end":return e.stop()}}),e)})))()},getDate:function(){var t=new Date,e=this.formatYMD(new Date(t.getFullYear(),t.getMonth(),1)),a=this.formatYMD(new Date(t.getFullYear(),t.getMonth()+1,0));this.search.date=[e,a],this.syncDateRange(this.search.date)}},watch:{value:function(t){if(t){var e=t[t.length-1]||"";this.search.agentId=e}}},mounted:function(){var t=this;this.searchIbTree(),this.getDate(),this.$nextTick((function(){t.search.date&&t.search.date.length>0&&(t.syncDateRange(t.search.date),t.searchFunc())}))}},f=g,b=(a("1e9d"),a("2877")),v=Object(b["a"])(f,n,r,!1,null,null,null);e["default"]=v.exports}}]);