{
    template:'${tmpl}',
    data:function(){
        return {
          multipleSelection: [],
          isSingleSelect:false,
        }
    },
    mounted:function(){
 
    },
    created:function(){
    },
    methods:{
      btnvisble(row,btn){
         if(row.isCurrent && btn.key=="setcurrent"){
          return false;
         }
         return true;
      },
      onsave(model,status){
        if(status=="edit"){
          /*保证修改后，返回到首页，公司信息也会同步变化*/
            this.$store.state.company=model;
            companyinfo=model;
        }
        if(status=="new"){
            tocompanyinfo=model;
        }
      },
      bkclick(){
        this.$router.go(-1);
      },
      async settocompany(row,key,e){
        if(key=="setcurrent"){
          var d=  await this.$root.postReq("/web/common/companyCtl/settocompany",row);
          if(d && d.status==0){
              tocompanyinfo=d.data;
               this.$router.push("/");
          }else{
            
          }
        }
   
        if(key=="comapps"){
             this.$router.push({path:"/comapps",query:{"compid":row.companykey}});
        }
        if(key=="comorgs"){
          this.$router.push({path:"/comorgs",query:{"compid":row.companykey,"comidnum":row.id}});
         }
      },
      onColFormater(row,column,cellvalue,index){
        if(column.property=="isSystem"){
          if(row["isSystem"]=="1"){
            return "是";
          }else{
            return "否";
          }
        }
        if(column.property=="isCurrent"){

          if(row["isCurrent"]=="1"){
            return "是";
          }else{
            return "否";
          }
        }
        return cellvalue;
      },
      handleSelectionChange:function(val){
         this.multipleSelection = val;
         console.log(val);
      }
    },
    computed: Vuex.mapState({
      count:state=>state.count,
      headStyle:function(){
        return {"background-color":"white"};
      }
    }),
    vname:"gsb-companyinfo"
}
