{
  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 (column.property == "reg_at") {
        return self.formateTime(row["reg_at"]);
      }

      if(typeof(cellvalue) == 'number') {
        return cellvalue || 0;
      }
      return cellvalue || "---";
    },
    handleSelectionChange: function (val) {
      this.multipleSelection = val;
      console.log(val);
    },
    fetchData: function () {

    },
    onRowClick(row, key, e) {
      console.log("................////////////////////////////");
      var that = this;
      if (key == "stop") {
        this.modelName = "epartneraudit";
        var url = this.getUrl("update");
        row.isEnabled = !row.isEnabled;
        this.$root.postReq(url, row).then(rd => {
          console.log("................////////////////////////////");
          if (rd.status == 0) {
            that.$refs.epartnerauditGrid.fetchData();
          }
        });
      }

      if (key == "auditPass") {
        console.log(row);
        if (row.auditStatus == '1') {
          that.$message.warning(`该申请已审核通过`);
          return false;
        }
        this.$confirm('确定审核通过?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$root.postReq("/web/epartnerCtl/pass", {
            id: row.id
          }).then(function (d) {
            if (d.status == 0) {
              that.$message.success(`审核成功`);
              that.$refs.epartnerauditGrid.fetchData();
            } else {
              that.$message.warning(d.msg || `审核失败，请刷新页面后重新操作`);
            }
          });
        });
      }
      if (key == "auditReject") {
        if (row.auditStatus == '2') {
          that.$message.warning(`该申请已审核驳回`);
          return false;
        }
        this.$confirm('确定审核驳回?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$root.postReq("/web/epartnerCtl/reject", {
            id: row.id
          }).then(function (d) {
            if (d.status == 0) {
              that.$message.success(`审核成功`);
              that.$refs.epartnerauditGrid.fetchData();
            } else {
              that.$message.warning(d.msg || `审核失败，请刷新页面后重新操作`);
            }
          });
        });
      }

      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-epartneraudit"
}