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

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

    },
    toolBarClick(k, t) {
      var self = this;
      if (k == "mynew") {
        this.$prompt('请输入合同编号', '新增', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          inputPlaceholder: '输入已存在的合同编号'
        }).then(({ value }) => {
          self.$root.postReq("/web/ecompanycontractCtl/updateUserId", { contractNo: value }).then(function (d) {
            console.info(d, "***************请输入合同编号请输入合同编号请输入合同编号***********************");
            if(d.code === 0){
              self.$message.error(d.msg);              
            }else{
              self.$message({
                type: 'success',
                message: d.msg
              });
              /*findAndCountAll*/
            }
            
          });
        }).catch(() => {
            /*取消操作 */       
        });
      }
    },    
    onRowClick(row, key, e) {
      console.log(key, row.id, "---------------onRowClick-------------------");

      var self = this;
      if(key == 'cancel') {
        window.history.back(-1);
      }
      console.log($(e.target).text());

      if(key == 'showpay') {
        console.log(key, row.id, "----------------------------------");
        this.$root.pushx({
          title : "查看订单",
          name : "/epartneramtlist",
          params: {ecompanyId: row.id},
        });
        /* this.$router.push({path:"/ecommissionlist",query:{epartnerId: row.id}}); */
      }

      if(key == 'info') {
        this.$root.pushx({
          title : "查看合同",
          name : "/ecompanycontractinfo",
          params: {contrId: row.id}
        });
      }
    },
    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-ecompanycontractmy"
}