addEmployee.ejs
4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!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> -->