58 lines
2.5 KiB
HTML
58 lines
2.5 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="submitb" class="easyui-linkbutton" iconCls="fa-floppy-o" onclick="submitform()">保存</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="qyff">
|
|
<div style="margin-bottom:10px">
|
|
<input id="qyname" name="name" style="width:90%;"
|
|
data-options="label:'区域名',required:true" class="easyui-textbox"></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input id="qyorder" name="order" style="width:90%" data-options="label:'排序'" class="easyui-numberbox">
|
|
</input>
|
|
</div>
|
|
</form>
|
|
<div class="labeldiv">区域二维码</div>
|
|
<img id="qrcode" height=240px width=240px>
|
|
</div>
|
|
<script>
|
|
var id = {{id}}
|
|
$.get('api/area?a=detail&id='+id,function(res){
|
|
console.log(res)
|
|
$('#qyname').textbox('setValue',res.name);
|
|
$('#qyorder').textbox('setValue',res.order)
|
|
$('#qrcode').attr('src',res.qrcode)
|
|
})
|
|
function submitform() {
|
|
var data = $('#qyff').serializeJSON()
|
|
data['id'] = id
|
|
$.ajax({
|
|
type: "POST",
|
|
url: 'api/area?a=edit',
|
|
data: JSON.stringify(data),
|
|
datatype: "json",
|
|
processData: false,
|
|
contentType: "application/json;charset=utf-8",
|
|
beforeSend: function () {
|
|
var bo = $('#qyff').form('validate')
|
|
if (bo == false) {
|
|
return bo
|
|
} else {
|
|
$('#submitb').linkbutton('disable');
|
|
}
|
|
},
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$("#qylblist").datagrid('reload');
|
|
$("#dd").dialog("close");
|
|
} else { $.messager.alert('提示', '失败,该选项不可编辑!'); }
|
|
$('#submitb').linkbutton('enable');
|
|
},
|
|
});
|
|
}
|
|
</script>
|
|
</div> |