{
    template:'${tmpl}',
    data:function(){
        return {
          id : "",
          contract : {
            ecompany:{},
            user:{},
            usereaccount:{}
          },
          formLabelWidth:'120px',
          dialogFormVisible: false,
          form:{
            mail:""
          }
        };
    },
    mounted:function() {
      this.id = this.$router.currentRoute.query.id;
      this.getContract();
    },
    created:function(){
    },
    methods:{
      getContract : function() {
        var self = this;
        this.$root.postReq("/web/econtractCtl/findInfo", {id : this.id}).then(function(d){
          if(d.status==0){
            self.contract = d.data;
            console.log(self.contract);
          }
        });
      },
      sendmail:function(){
        var self = this;
        var email = this.form.mail;
        var regex = /^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,5}$/;
        if(!regex.test(email)){
          this.$alert('邮箱格式有误，请您重新填写', '提示', {
             confirmButtonText: '确定',
             callback: action => {}
           });
           return;
        }

        this.$root.postReq("/web/econtractCtl/sendContractEmail", {id : this.id, email : email}).then(function(d){
          console.log(d);
        });
        self.dialogFormVisible = false;
        this.$alert('请30秒后到邮箱查看', '提示', {
           confirmButtonText: '确定',
           callback: action => {}
         });
      }
  },
    vname:"gsb-econtractinfo"
}
