{
  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){
      console.log(model, "-----1111111111------------------------------model1");
      if(k=="mysave"){
        console.log(model, "----2222222222222-------------------------------model1");
        var that=this;
        that.$refs.epartnerallGrid.$refs.dlgform.validate((valid)=>{
           if(valid){
             this.$root.postReq("/web/epartnerCtl/mysave", model).then(rd=>{
               if(rd.status==0){
                   that.$message({
                     type: 'success',
                     message: '保存成功!'
                   });
                   that.$refs.epartnerallGrid.showLeft();
                   that.$refs.epartnerallGrid.status="common";
                   that.$refs.epartnerallGrid.fetchData();
               } else {
                 console.log(rd);
                 this.$message({
                   type: 'success',
                   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 == 'orders') {
        console.log(key, row.id, "----------------------------------");
        this.$root.pushx({
          title : "查看订单",
          name : "/epartneramtlist",
          params: {epartnerId: 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-epartnerall"
}