safesite/safesite/templates/safecertadd.html

112 lines
4.9 KiB
HTML

<div class="easyui-layout" style="width:100%;height:100%;">
<div id='southdiv' data-options="region:'south'" style="height:50px;text-align:center;padding:5px">
<a href="javascript:void(0)" iconCls="fa-check" class="easyui-linkbutton" onclick="aqzssubmitForm()"
id="submitb">提交</a>
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">取消</a>
</div>
<div data-options="region:'center'" style="height:100%;padding:15px 15px;">
<form id="aqzsff" method="post" name="aqzsff" enctype="multipart/form-data">
<div style="margin-bottom:5px">
<input id="aqzsry" class="easyui-textbox" style="width:480px" data-options="label:'员工',prompt:'请选择'" required=true
editable=false>
<input type="hidden" id="userid" name="userid" />
<a id="chooseaqzsry" class='easyui-linkbutton' onclick="chooseaqzsry()" style="width:auto">选择</a>
</div>
<div style="margin-bottom:5px">
<input id="zglx" class="easyui-textbox" name="zglx" style="width:480px" data-options="
label:'资格类型'," required=true>
</div>
<div style="margin-bottom:5px">
<input id="fzjg" class="easyui-textbox" name="fzjg" style="width:480px" data-options="
label:'发证机关'," required=true>
</div>
<div style="margin-bottom:5px">
<input id="dwlx" class="easyui-textbox" name="dwlx" style="width:480px" data-options="
label:'单位类型'," required=true>
</div>
<div style="margin-bottom:5px">
<input id="yfsrq" class="easyui-datebox" name="yfsrq" style="width:480px" data-options="
label:'应复审'," required=true editable=false>
</div>
<div style="margin-bottom:5px">
<input id="yxqkssj" class="easyui-datebox" name="yxqkssj" style="width:480px" data-options="
label:'有效期开始'," required=true editable=false>
</div>
<div style="margin-bottom:5px">
<input id="yxqjssj" class="easyui-datebox" name="yxqjssj" style="width:480px" data-options="
label:'有效期结束'," required=true editable=false>
</div>
</div>
</form>
</div>
</div>
<script>
function aqzssubmitForm() {
var aqzsdata = $('#aqzsff').serializeJSON();
$.ajax({
type: "POST",
url: 'api/safecert?a=add',
data: JSON.stringify(aqzsdata),
datatype: "json",
processData: false,
contentType: "application/json;charset=utf-8",//这是原因
beforeSend: function () {
var bo = $('#aqzsff').form('validate')
if (bo == false) {
return bo
} else {
$('#submitb').linkbutton('disable');
}
loading('联网查询中,请稍等。。')
},
success: function (data) {
if (data.code == 1) {
$('#aqzstable').datagrid('reload');
$("#dd").dialog("close");
} else { $.messager.alert('提示', '相关信息错误或查询无证!'); }
$('#submitb').linkbutton('enable');
removeLoading()
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
// $("#p_test").innerHTML = "there is something wrong!";
// alert(XMLHttpRequest.status);
// alert(XMLHttpRequest.readyState);
// alert(textStatus);
removeLoading()
$('#submitb').linkbutton('enable');
}
});
}
function chooseaqzsry() {
var myh = screen.availHeight * 0.5;
$('#userdd').dialog({
maximizable: true,
title: '选择人员',
width: 700,
height: myh,
closed: false,
cache: false,
href: 'getuserf?a=aqzsry',
modal: true,
border: false,
});
$('#userdd').window('center');
}
function aaa(x) {
if (x == "aqzsry") {
userid = top.$('#in').val()
$('#userid').val(userid)
$.get("api/user?a=detail&userid=" + userid, function (result) {
if (result.userprofile__realname != null) {
$('#realname').setValue(result.userprofile__realname)
}
if (result.userprofile__cardnum != null) {
$('#cardnum').setValue(result.userprofile__cardnum)
}
});
$('#user').attr('value', top.$('#in').val());
$('#aqzsry').textbox('setValue', top.$('#in').attr('show'));
}
}
</script>