d5d89aa8 by yangjianbin

init

1 parent f1cef09e
...@@ -7,15 +7,15 @@ ...@@ -7,15 +7,15 @@
7 <div class="row cl"> 7 <div class="row cl">
8 <div class="form-group col-sm-4 col-md-2"> 8 <div class="form-group col-sm-4 col-md-2">
9 <label>用户名</label> 9 <label>用户名</label>
10 <input type="text" class="form-control input-text" name="HrVO.username" value=""> 10 <input type="text" class="form-control input-text" name="username" value="">
11 </div> 11 </div>
12 <div class="form-group col-sm-4 col-md-2"> 12 <div class="form-group col-sm-4 col-md-2">
13 <label>真实姓名</label> 13 <label>真实姓名</label>
14 <input type="text" class="form-control input-text" name="HrVO.name" value=""> 14 <input type="text" class="form-control input-text" name="name" value="">
15 </div> 15 </div>
16 <div class="form-group col-sm-4 col-md-2"> 16 <div class="form-group col-sm-4 col-md-2">
17 <label>手机号</label> 17 <label>手机号</label>
18 <input type="text" class="form-control input-text" name="HrVO.phone" value=""> 18 <input type="text" class="form-control input-text" name="phone" value="">
19 </div> 19 </div>
20 <div class="form-group col-sm-4 col-md-2"> 20 <div class="form-group col-sm-4 col-md-2">
21 <label>身份证号码</label> 21 <label>身份证号码</label>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
25 <div class="row cl"> 25 <div class="row cl">
26 <div class="form-group col-sm-4 col-md-2"> 26 <div class="form-group col-sm-4 col-md-2">
27 <label>设置密码</label> 27 <label>设置密码</label>
28 <input type="text" class="form-control input-text" value="" name="HrVO.password" id="password"> 28 <input type="text" class="form-control input-text" value="" name="password" id="password">
29 </div> 29 </div>
30 <div class="form-group col-sm-4 col-md-2 pt-25"> 30 <div class="form-group col-sm-4 col-md-2 pt-25">
31 <button class="btn btn-primary" onclick="random()">随机生成密码</button> 31 <button class="btn btn-primary" onclick="random()">随机生成密码</button>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
34 <div class="row cl"> 34 <div class="row cl">
35 <div class="form-group col-sm-4 col-md-2"> 35 <div class="form-group col-sm-4 col-md-2">
36 <label>所属网点</label> 36 <label>所属网点</label>
37 <select class="select" name="DepartmentVO.children" size="5" multiple> 37 <select class="select" name="children" size="5" multiple>
38 <option selected value>请选择</option> 38 <option selected value>请选择</option>
39 <?php foreach ($this->session->departments as $k => $v): ?> 39 <?php foreach ($this->session->departments as $k => $v): ?>
40 <option value="<?= $v->id ?>"><?= $v->name ?></option> 40 <option value="<?= $v->id ?>"><?= $v->name ?></option>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
48 </div> 48 </div>
49 <div class="form-group col-sm-4 col-md-2"> 49 <div class="form-group col-sm-4 col-md-2">
50 <label>角色</label> 50 <label>角色</label>
51 <select class="select" size="5" name="HrVO.roles" multiple> 51 <select class="select" size="5" name="roles" multiple>
52 <option selected value>请选择</option> 52 <option selected value>请选择</option>
53 <?php foreach ($this->session->role as $k => $v): ?> 53 <?php foreach ($this->session->role as $k => $v): ?>
54 <option value="<?= $v->id ?>"><?= $v->nameZh ?></option> 54 <option value="<?= $v->id ?>"><?= $v->nameZh ?></option>
...@@ -80,11 +80,23 @@ ...@@ -80,11 +80,23 @@
80 function saveStaff() { 80 function saveStaff() {
81 var targetUrl = $("#add").attr("action"); 81 var targetUrl = $("#add").attr("action");
82 var data = $("#add").serializeJson(); 82 var data = $("#add").serializeJson();
83 var newData = {};
84 newData['HrVO'] = {
85 name:data['name'],
86 username:data['username'],
87 phone:data['phone'],
88 password:data['password'],
89 roles:data['roles']
90 };
91 newData['DepartmentVO'] = {
92 children:data['children']
93 };
94
83 $.ajax({ 95 $.ajax({
84 type: 'post', 96 type: 'post',
85 url: apiBaseUrl + targetUrl, 97 url: apiBaseUrl + targetUrl,
86 cache: false, 98 cache: false,
87 data: JSON.stringify(data), 99 data: JSON.stringify(newData),
88 dataType: 'json', 100 dataType: 'json',
89 contentType: "application/json; charset=UTF-8", 101 contentType: "application/json; charset=UTF-8",
90 success: function (data) { 102 success: function (data) {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!