878e56db by wang

init

1 parent 59572968
......@@ -75,6 +75,7 @@
<button class="btn radius size-M">请选择 <i class="Hui-iconfont">&#xe6d5;</i></button>\
<ul class="dropDown-menu menu radius box-shadow">\
'+str+'\
<li><a href="javascript:edit('+data+');">编辑</a></li>\
<li><a href="javascript:reset('+data+');">重置密码</a></li>\
</ul></span>';
}
......
......@@ -19,7 +19,7 @@
</div>
<div class="form-group col-sm-4 col-md-2">
<label>身份证号码</label>
<input type="text" class="form-control input-text" name="" value="">
<input type="text" class="form-control input-text" name="idcard" value="">
</div>
</div>
<div class="row cl">
......@@ -92,7 +92,7 @@
name:data['name'],
username:data['username'],
telephone:data['phone'],
// phone:data['phone'],
idcard:data['idcard'],
password:data['password'],
roleIds:rolesid,
// roles:data['roles'],
......
......@@ -3,28 +3,29 @@
<body>
<div class="panel panel-default">
<div class="panel-body">
<form action="system/user/update" id="edit">
<div class="row cl">
<div class="form-group col-sm-4 col-md-2">
<label>用户名</label>
<input type="text" class="form-control input-text" value="">
<input type="text" class="form-control input-text" name="username" value="">
</div>
<div class="form-group col-sm-4 col-md-2">
<label>真实姓名</label>
<input type="text" class="form-control input-text" value="">
<input type="text" class="form-control input-text" name="name" value="">
</div>
<div class="form-group col-sm-4 col-md-2">
<label>手机号</label>
<input type="text" class="form-control input-text" value="">
<input type="text" class="form-control input-text" name="phone" value="">
</div>
<div class="form-group col-sm-4 col-md-2">
<label>身份证号码</label>
<input type="text" class="form-control input-text" value="">
<input type="text" class="form-control input-text" name="idcard" value="">
</div>
</div>
<div class="row cl">
<div class="form-group col-sm-4 col-md-2">
<label>所属网点</label>
<select class="select" size="5" multiple>
<select class="select" size="5" name="children" multiple>
<option selected value>请选择</option>
<option value>请选择</option>
<option value>请选择</option>
......@@ -34,7 +35,7 @@
</div>
<div class="form-group col-sm-4 col-md-2">
<label>角色</label>
<select class="select" size="5" multiple>
<select class="select" size="5" name="roles" multiple>
<option selected value>请选择</option>
<option value>请选择</option>
<option value>请选择</option>
......@@ -43,6 +44,7 @@
</select>
</div>
</div>
</form>
</div>
</div>
......@@ -64,7 +66,60 @@
}
function save() {
window.parent.msg('修改成功');
var targetUrl = $("#edit").attr("action");
var data = $("#edit").serializeJson();
var newData = {};
var rolesid = [];
if(data['roles'].length == 1){
rolesid.push(data['roles']);
}else{
rolesid = data['roles'];
}
newData = {
// newData['HrVO'] = {
name:data['name'],
username:data['username'],
telephone:data['phone'],
idcard:data['idcard'],
password:data['password'],
roleIds:rolesid,
// roles:data['roles'],
departmentId:data['children']
};
// newData['DepartmentVO'] = {
// children:data['children']
// departmentId:data['children']
// };
// console.log(JSON.stringify(newData));
// return false;
$.ajax({
type: 'post',
url: apiBaseUrl + targetUrl,
cache: false,
data: JSON.stringify(newData),
dataType: 'json',
contentType: "application/json; charset=UTF-8",
success: function (data) {
// console.log(data);
if (data.msg) {
layer.alert(data.msg);
} else if (data.code != 0) {
layer.alert('操作失败');
} else {
layer.msg('操作成功');
}
if (data.code) {
setTimeout(function () {
window.parent.reload();
layer_close();
}, 500);
}
},
error: function () {
layer.alert("操作失败")
}
})
// window.parent.msg('修改成功');
layer_close();
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!