7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
155 lines
4.3 KiB
HTML
155 lines
4.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="renderer" content="webkit">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
<title>图表添加-e订通后台</title>
|
|
<link rel="stylesheet" href="layuiadmin/layui/css/layui.css">
|
|
<link rel="stylesheet" href="index.css">
|
|
<style>
|
|
table.mytable {
|
|
font-family: verdana,arial,sans-serif;
|
|
font-size:11px;
|
|
color:#333333;
|
|
border-width: 1px;
|
|
border-color: #e2e2e2;
|
|
border-collapse: collapse;
|
|
}
|
|
table.mytable th {
|
|
border-width: 1px;
|
|
padding: 8px;
|
|
border-style: solid;
|
|
border-color: #e2e2e2;
|
|
background-color: #f2f2f2;
|
|
}
|
|
table.mytable td {
|
|
border-width: 1px;
|
|
padding: 8px;
|
|
border-style: solid;
|
|
border-color: #e2e2e2;
|
|
background-color: #ffffff;
|
|
}
|
|
</style>
|
|
<script src="layuiadmin/layui/layui.js"></script>
|
|
<script src="js/function.js"></script>
|
|
</head>
|
|
<body>
|
|
<form class="layui-form">
|
|
<div style="padding:10px;">
|
|
<div class="layui-row">
|
|
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label" id="lang_xh">标题一</label>
|
|
<div class="layui-input-inline"><input type="text" class="layui-input" id="title" name="title" lay-verify="required" placeholder="请输入标题一" value=""></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-row">
|
|
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">标题二</label>
|
|
<div class="layui-input-inline"><input type="text" class="layui-input" id="title2" name="title2" placeholder="" value=""></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-row">
|
|
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">图表类型</label>
|
|
<div class="layui-input-inline"><select id="tbcate" name="tbcate"></select></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label"> </label>
|
|
<div class="layui-input-inline" style="width:200px"><button id="form1_submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="form1_submit" style="font-weight:bold;width:200px;"> 保 存 </button></div>
|
|
<div class="layui-input-inline" style="width:100px"><button id="form1_reset" class="layui-btn" type="button" style="font-weight:bold;width:100px;"> 重 置 </button></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<script>
|
|
layui.use(['form','layer','laydate','element'],function(){
|
|
var form = layui.form,
|
|
laydate = layui.laydate,
|
|
$ = layui.jquery;
|
|
var element = layui.element;
|
|
var layer = layui.layer;
|
|
//
|
|
var id=get_url_param("id");
|
|
var url="./?_m=zdb&_a=add&id="+id;
|
|
//
|
|
$.ajax(
|
|
{
|
|
url:url,
|
|
contentType: "application/json",
|
|
method: 'POST',
|
|
success: function (res) {
|
|
var json_data=$.parseJSON(res);
|
|
//
|
|
var html1="<option value=''>请选择</option>";
|
|
$.each(json_data.tbcate_list.op,function(index_op,item1){
|
|
html1+="<option value='"+item1.no+"'>"+item1.title+"</option>";
|
|
})
|
|
$("#tbcate").html(html1);
|
|
|
|
form.render();
|
|
},
|
|
error: function () {
|
|
layui.layer.msg("与服务器通信失败!");
|
|
}
|
|
}
|
|
);
|
|
|
|
//重置
|
|
$("#form1_reset").click(function(){
|
|
var url="zdb_add.htm?id="+id;
|
|
window.location.href=url;
|
|
})
|
|
//提交
|
|
form.on("submit(form1_submit)",function(data){
|
|
var post_data=data.field;
|
|
if(post_data.tbcate==""){
|
|
layer.msg("保存失败!(请选择图表类型)");
|
|
return false;
|
|
}
|
|
|
|
//弹出loading
|
|
var index = layer.msg('数据提交中,请稍候',{icon: 16,time:false,shade:0.8});
|
|
|
|
//提交
|
|
var url="./?_m=zdb&_a=save_add";
|
|
|
|
//alert(JSON.stringify(post_data));
|
|
$.ajax({
|
|
url:url,
|
|
contentType: "application/json",
|
|
method: 'GET',
|
|
data:post_data,
|
|
success: function (res) {
|
|
//alert(res);//调试模式
|
|
//layer.close(index);//调试模式
|
|
var json_data=$.parseJSON(res);
|
|
if(json_data.code==1){
|
|
//保存成功
|
|
layer.close(index);
|
|
layer.msg("保存成功!");
|
|
parent.layer.closeAll("iframe");
|
|
//刷新父页面
|
|
parent.tableIns.reload();
|
|
}else{
|
|
//保存失败
|
|
layer.close(index);
|
|
layer.msg("保存失败!("+json_data.msg+")");
|
|
}
|
|
}
|
|
})
|
|
return false;
|
|
})
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |