{
  template: '${tmpl}',
  data: function () {
    return {
      multipleSelection: [],
      isSingleSelect: false,
    }
  },
  mounted: function () {},
  created: function () {},
  methods: {
    onColFormater(row, column, cellvalue, index) {
      var self = this;
      if (column.property == "isEnabled") {
        if (row["isEnabled"]) {
          return "正常";
        } else {
          return "停用";
        }
      }

      if(typeof(cellvalue) == 'number') {
        return cellvalue || 0;
      }
      return cellvalue || "---";
    },
    onDlgFormClick(k, model){
      if(k=="custsave"){
        var that=this;
        that.$refs.ecompanymyGrid.$refs.dlgform.validate((valid)=>{
           if(valid){
             this.$root.postReq("/web/ecompanyCtl/custsave", model).then(rd=>{
               if(rd.status==0){
                   that.$message({
                     type: 'success',
                     message: '保存成功!'
                   });
                   that.$refs.ecompanymyGrid.showLeft();
                   that.$refs.ecompanymyGrid.status="common";
                   that.$refs.ecompanymyGrid.fetchData();
               } else {
                 console.log(rd);
                 this.$message({
                   type: 'warning',
                   message: rd.msg+',保存失败!'
                 });
               }
             });
           }else{
             console.log("表单验证不过......");
           }
        });
      }

    },
    handleSelectionChange: function (val) {
      this.multipleSelection = val;
      console.log(val);
    },
    fetchData: function () {

    },
    toolbarclick(key, title, items){
    },
    onRowClick(row, key, e) {
      var self = this;
      if(key == 'cancel') {
        window.history.back(-1);
      }

      if(key == 'showpay') {
        this.$root.pushx({
          title : "查看订单",
          name : "/epartneramtlist",
          params: {ecompanyId: row.id},
        });
        /* this.$router.push({path:"/ecommissionlist",query:{epartnerId: row.id}}); */
      }
      console.log($(e.target).text());
    },
    formateTime(inputTime) {
      if(!inputTime) {
        return "";
      }
      var date = new Date(inputTime);
      var y = date.getFullYear();
      var m = date.getMonth() + 1;
      m = m < 10 ? ('0' + m) : m;
      var d = date.getDate();
      d = d < 10 ? ('0' + d) : d;
      var h = date.getHours();
      h = h < 10 ? ('0' + h) : h;
      var minute = date.getMinutes();
      minute = minute < 10 ? ('0' + minute) : minute;
      return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
    },
  },
  computed: Vuex.mapState({
    count: state => state.count,
    headStyle: function () {
      return {
        "background-color": "white"
      };
    }
  }),
  vname: "gsb-ecompanymy"
}