addEmployee.ejs 4.3 KB
<!DOCTYPE html>
<!-- <html>
  <head>
    <title>employee</title>
     < include ../utils.ejs %>
  </head>
  <body class="import-employee">  -->
  <script id="employee-template" type="text/x-handlebars-template">
    <div class="layout-row row">
       <div class="col s12 m3">
                  <div class="row">
                      <div class="input-field col s12 required"  >
                          <label  class="active">成员姓名</label>
                          <input  class="form-control" type="text"   name="name"  placeholder="请填写真实姓名" >  
                      </div>
                  </div>
              </div>
              <div class="col s12 m3">
                  <div class="row">
                      <div class="input-field col s12 required"  >
                          <label >所属部门</label>
                          <select  class="form-control" name="organization"  placeholder="查看已有部门">
                            {{#each .}} 
                            <option value="{{uuid}}">{{basicInfo.name}}</option> 
                            {{/each}}
                          </select> 
                      </div>
                  </div>
              </div>
              <div class="col s12 m5">
                  <div class="row">
                      <div class="input-field col s12 required" >
                          <label class="active">手机号码</label>
                          <input class="form-control" type="text" name="mobile"  placeholder="作为验证身份依据请正确填写"> 
                      </div>
                  </div>
              </div>
              <div class="col m1">
                  <div class="row">
                      <div class="input-field col s12 " >
                           <!-- <i class="fa fa-close"></i> -->
                      </div>
                  </div>
              </div>
    </div>
</script>
<div class="add-employee-wrap " id="add-employee-wrap">
    <a class="fs-modal-btn circle" id="fs-modal-close-btn" onclick="closeModal()"> 
      <i class="iconfont iconfont-close"> </i>
      <span class="key-label">esc</span>
    </a>
    <div class="import-head"> 
        <div class="head-title center-align">
          <div class="head-title-wrap">
          <h5>邀请加入正式员工</h5>
          <p> 新的正式成员将自动添加到#企云在线<a href="#">编辑/添加</a></p>
          </div>
        </div> 
    </div>
    <div class="import-body">
        <div class="employee-body"> 
          <form action=""  id="employee-body-target"> 
          </form>
          <div class="add-row-btn blue-grey lighten-5">
              <a class="blue-text text-darken-2"><i class="fa fa-plus"></i>添加其他成员</a>
              <span class="import-btn right-align">想要整个团队邀请?<a href="/hr/importEmployee" class="blue-text text-darken-2">马上去邀请更多成员</a></span>
          </div>
          <div class="submit-btn card-panel teal lighten-2 center-align waves-effect waves-light">
            <a href="#">添加1个成员</a>
          </div>
        </div>
    </div>
</div>
    <script type="text/javascript">
    // $.post("/hr/addOrganization",{name:'研发'}, function(data){  
    //           console.log(data);
    //       });
      $(document).ready(function() {    
        $.post("/hr/getOrganization",{}, function(data){  
              $('#employee-body-target').append(
                Handlebars.compile($('#employee-template').html())(data.items)
              ); 
              if(data&&data.error){
                 
              }else if(data&&data.redirect){
                
              }
              $('#add-employee-wrap').addClass('bounceInUp');
          });

        $('.submit-btn').click(function(e){
             e.preventDefault();
              var  _form = $("#employee-body-target");
              var parmas = _form.serializeJSON(); 
              $.post("/hr/doAddEmployee", parmas , function(data){
                  console.log(data);
              });
        });

      });
      function closeModal(){
         $('#add-employee-wrap').removeClass('bounceInUp');
         setTimeout(function(){
            $("#add-employee-wrap").remove();
            document.location.href="/chat/#";
         },400);
      }
    </script>
<!--   </body> -->
<!-- </html> -->