101 lines
4.2 KiB
HTML
101 lines
4.2 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 id="submitdictb" class="easyui-linkbutton" iconCls="fa-floppy-o" onclick="submitdictf()">保存</a>
|
|
<a class="easyui-linkbutton" iconCls="fa-close" onclick="javascript:$('#dd').dialog('close')">取消</a>
|
|
</div>
|
|
</div>
|
|
<div data-options="region:'center'" style="width:100%;height:100%;padding:5px 15px;">
|
|
<form method="post" id="dicff">
|
|
<div style="margin-bottom:10px">
|
|
<input id="dickeyid" name="dickeyid" type="hidden" style="width:90%;"
|
|
data-options="label:'字典ID'"></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input id="dickeyname" name="dickeyname" style="width:90%;height:40px"
|
|
data-options="label:'项目值',multiline:true,required:true"></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<select id="dicparent" name="dicparent" style="width:90%" data-options="label:'所属字典',required:true"
|
|
editable="false">
|
|
</select>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input id="dickeydetail" name="detail" style="width:90%;height:60px"
|
|
data-options="label:'描述',multiline:true"></input></div>
|
|
|
|
</form>
|
|
</div>
|
|
<script>
|
|
$('#dickeyname').textbox();
|
|
$('#dickeydetail').textbox();
|
|
$('#dicparent').combotree({
|
|
url: 'dicchandle?a=tree',
|
|
loadFilter: function (rows) {
|
|
return convert(rows);
|
|
},
|
|
});
|
|
|
|
//获取dialog传值
|
|
var x = getQueryParam('dicparent')
|
|
if (x == 0) { }
|
|
else {
|
|
$('#dicparent').combotree('setValue', x);
|
|
}
|
|
|
|
var a = GetQueryString('a');
|
|
//提交操作
|
|
if (a == 'adddicth') {
|
|
var x = getQueryParam('dicparent')
|
|
if (x == 0) { }
|
|
else { $('#dicparent').combotree('setValue', x) }
|
|
}
|
|
else {
|
|
$('#dicparent').combotree('setValue', getQueryParam('dicparent'))
|
|
$('#dickeydetail').textbox('setValue', getQueryParam('detail'));
|
|
//console.log(getQueryParam('detail'));
|
|
$('#dickeyname').textbox('setValue', getQueryParam('dickeyname'));
|
|
$('#dickeyid').attr('value', getQueryParam('dickeyid'));
|
|
}
|
|
function submitdictf() {
|
|
|
|
// $('#dicff').form('submit', {
|
|
// url: 'dicthandle',
|
|
// onSubmit: function () {
|
|
// return $(this).form('validate');
|
|
// },
|
|
// success: function (result) {
|
|
// var result = eval('(' + result + ')');
|
|
// if (result.code == 1) {
|
|
// $("#dictable").datagrid('reload'); $("#dd").dialog("close");
|
|
// } else {
|
|
// $.messager.alert('提示', '失败!');
|
|
// }
|
|
// $('#submitdictb').linkbutton('enable');
|
|
// }
|
|
// });
|
|
$.ajax({
|
|
type: "POST",
|
|
url: 'dicthandle',
|
|
data: JSON.stringify($('#dicff').serializeJSON()),
|
|
datatype: "json",
|
|
processData: false,
|
|
contentType: "application/json;charset=utf-8",
|
|
beforeSend: function () {
|
|
var bo = $('#dicff').form('validate')
|
|
if (bo == false) {
|
|
return bo
|
|
} else {
|
|
$('#submitdictb').linkbutton('disable');
|
|
}
|
|
},
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$("#dictable").datagrid('reload'); $("#dd").dialog("close");
|
|
} else { $.messager.alert('提示', '失败,该选项不可编辑!'); }
|
|
$('#submitdictb').linkbutton('enable');
|
|
},
|
|
});
|
|
}
|
|
</script>
|
|
</div> |