{
    template:'${tmpl}',
    data:function(){
        return {
          multipleSelection: [],
          isSingleSelect:false,
          c:"hello",
          bizCode:"profitcenter",
          balanceShow:true,
          account:"",
          applymoney:"",
          allmoney:"",
        }
    },
    mounted:function(){

    },
    created:function(){
      if(this.$route.path.indexOf("msgprofitcenter")>=0){
        this.bizCode="msgprofitcenter";
        this.balanceShow=false;
        this.$root.postReq("/web/profitcenterCtl/findByOptype",null).then(d=>{
          if(d.status==0){
            this.applymoney=d.data;
          }
        });
        this.$root.postReq("/web/tradeCtl/getBankCardInfo",null).then(d=>{
          if(d.status==0){
            console.log(d.data);
            this.allmoney=d.data.msg;
          }
        });
      }else{
        this.bizCode="profitcenter";
        this.balanceShow=true;
        this.$root.postReq("/web/accountCtl/findById",null).then(d=>{
          if(d.status==0){
            this.account=d.data;
          }
        });
      }
    },
    methods:{
      rowClick(row,key,t,e){
        if(key=="dealing"){
          this.$confirm('此操作将处理当前的提现记录, 是否继续?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         });
        }
      },
      onColFormater(row,column,cellvalue,index){
        if(column.property=="created_at"){
          var date = new Date(row["created_at"]);
          var time= date.toLocaleDateString();
          return time;
        }
        return cellvalue;
      },
      toolbarclick(key,b,selectedRows){
        if(key=="dealings"){
          if(selectedRows==null){
            this.$message.warning(`请选择至少一行记录`);
          }else{
            this.$confirm('此操作将处理所有选中的提现记录, 是否继续?', '提示', {
             confirmButtonText: '确定',
             cancelButtonText: '取消',
             type: 'warning'
           });
          }
        }
      },
      open(){
        this.$router.push("/platform/withdraw");
      },
      allIssue(){
        var that=this;
        if(that.applymoney==0){
          that.$message({
            showClose: true,
            type: 'warning',
            duration:3000,
            message: `将要发放额度：0元，无需发放!`
          });
          return;
        }
        const loading = this.$loading({
                 lock: true,
                 text: 'Loading',
                 spinner: 'el-icon-loading',
                 background: 'rgba(0, 0, 0, 0.7)'
               });
        this.$root.postReq("/web/tradeCtl/applyWithdrawMoney","").then(function(d){
          loading.close();
          if(d.code==1){
            that.$message({
              showClose: true,
              type: 'success',
              duration:6000,
              message: '操作成功，数据总共：'+d.total+' 条，成功：'+d.succeed+' 条，失败：'+d.failure+'条'
            });
            that.applymoney=d.totalApplying;
            if(d.totalBank>=0){
              that.allmoney=d.totalBank;
            }
            that.$refs.containerGrid.fetchData();
         }else {
           that.$message({
             showClose: true,
             type: 'warning',
             duration:6000,
             message: d.msg
           });
         }
        }).catch(function(e){
          that.$message.warning(`操作失败，请刷新页面后重新操作!`);
        });
      },
       handleSelectionChange:function(val){
         this.multipleSelection = val;
         console.log(this.cc);
       },
       headerCellStyle:function(){
         return {"background-color":"red"};
       },

    },
    computed:{
      headStyle:function(){
        return {"background-color":"white"};
      }
    },
    vname:"gsb-profitcenter"
}
