107 lines
4.9 KiB
HTML
107 lines
4.9 KiB
HTML
<div class="easyui-layout" style="width:100%;height:100%">
|
|
<div id='southdiv' data-options="region:'south'" style="width:100%;height:50px;padding:5px">
|
|
<div style="text-align:center;padding:2px">
|
|
<a iconCls="fa-check" class="easyui-linkbutton" onclick="submitFormu()" id="submitform">确定</a>
|
|
<a iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">取消</a>
|
|
</div>
|
|
</div>
|
|
<div data-options="region:'center'" style="width:100%;height:100%;padding:5px 15px;">
|
|
<form method="post" id="puffuser">
|
|
<div style="margin-bottom:5px">
|
|
<input id="userid" name="userid" type="hidden" style="width:90%;" data-options="label:'用户ID'"></input></div>
|
|
<div style="margin-bottom:5px">
|
|
<input id="empid" class="easyui-textbox" name="empid" style="width:90%" data-options="label:'工号'"></input></div>
|
|
<div style="margin-bottom:5px">
|
|
<input id="name" class="easyui-textbox" name="name" style="width:90%" data-options="label:'姓名',required:true"></input></div>
|
|
<div style="margin-bottom:5px">
|
|
<input id="username" class="easyui-textbox" name="username" style="width:90%" data-options="label:'账户',required:true"></input></div>
|
|
<div style="margin-bottom:5px">
|
|
<input id="password" class="easyui-textbox" name="password" style="width:90%" data-options="label:'密码',required:true"></input></div>
|
|
<div style="margin-bottom:5px">
|
|
<input id="ubelongpart" class="easyui-combotree" name="ubelongpart" style="width:90%"
|
|
data-options="
|
|
label:'所属部门',
|
|
required:true,
|
|
url: 'parthandle?a=tree',
|
|
loadFilter: function (rows) {
|
|
return convert(rows);
|
|
},
|
|
"
|
|
editable="false">
|
|
</select></div>
|
|
<!-- onBeforeSelect: function (node) {
|
|
var tree = $(this).tree;
|
|
var isLeaf = tree('isLeaf', node.target);
|
|
if (!isLeaf) {
|
|
$('#ubelongpart').treegrid('unselect');
|
|
}
|
|
} -->
|
|
<!-- <div style="margin-bottom:5px">
|
|
<input id="group" class="easyui-combobox" name="group" style="width:90%"
|
|
data-options="
|
|
label:'岗位',
|
|
url: 'grouphandle?a=list2',
|
|
multiple:true,
|
|
valueField:'groupid',
|
|
textField:'groupname',
|
|
loadFilter: function (data) {
|
|
return data.rows;
|
|
}
|
|
"
|
|
editable="false">
|
|
</select></div> -->
|
|
</form>
|
|
</div>
|
|
<script>
|
|
var a = GetQueryString('a');
|
|
if (a == 'edituserh') {
|
|
userid = GetQueryString('userid');
|
|
$.ajax({
|
|
type: "GET",
|
|
url: 'getuser?userid=' + userid,
|
|
datatype: "json",
|
|
beforeSend: function () { },
|
|
success: function (data) {
|
|
$('#userid').attr('value', data.userid);
|
|
$('#empid').textbox('setValue', data.empid);
|
|
$('#name').textbox('setValue', data.name);
|
|
$('#username').textbox('setValue', data.username);
|
|
$('#password').textbox('disable');
|
|
$('#ubelongpart').combotree('setValue', data.ubelongpart__partid);
|
|
}
|
|
});
|
|
}
|
|
else{
|
|
$('#iselse').prop("checked", true);
|
|
}
|
|
function submitFormu() {
|
|
var form = new FormData(document.getElementById("puffuser"));
|
|
console.log(form)
|
|
$.ajax({
|
|
type: "POST",
|
|
url: 'userhandle?a=add',
|
|
data: form,
|
|
datatype: "json",
|
|
processData: false,
|
|
contentType: false,
|
|
beforeSend: function () {
|
|
var bo = $('#puffuser').form('validate')
|
|
if (bo == false) {
|
|
return bo
|
|
} else {
|
|
$('#submitbu').linkbutton('disable');
|
|
}
|
|
},
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$('#usertable').datagrid('reload');
|
|
$("#dd").dialog("close");
|
|
} else { $.messager.alert('提示', '账户已存在!'); }
|
|
$('#submitbu').linkbutton('enable');
|
|
},
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
|
</div> |