7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
234 lines
7.2 KiB
HTML
234 lines
7.2 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>
|
|
<!-- 自动完成 -->
|
|
<script src="js/autocomplete/jquery-1.4.4.min.js"></script>
|
|
<script src="js/autocomplete/jquery.autocomplete.js"></script>
|
|
<link rel="stylesheet" href="js/autocomplete/jquery.autocomplete.css">
|
|
<!-- /自动完成 -->
|
|
<script type="text/javascript">
|
|
function autocomp(thisid){
|
|
$('#'+thisid).autocomplete("./?_m=ajax_autocomplete&_a=kh_color2", {
|
|
dataType: "json",//数据格式
|
|
max: 100, //列表里的条目数
|
|
minChars: 0, //自动完成激活之前填入的最小字符
|
|
width: 300, //提示的宽度,溢出隐藏
|
|
scrollHeight: 300, //提示的高度,溢出显示滚动条
|
|
matchContains: true, //包含匹配,就是data参数里的数据,是否只要包含文本框里的数据就显示
|
|
autoFill: false, //自动填充
|
|
parse: function (data) {
|
|
if (!data || data == null || data == "") {
|
|
alert("无数据");
|
|
return {};
|
|
}else{
|
|
return $.map(data.data, function (row) {
|
|
return {
|
|
data:row,value:row.t1,result:row.id
|
|
};
|
|
});
|
|
}
|
|
},
|
|
formatItem: function(row,i,max) {
|
|
//提示的显示内容及格式设置
|
|
return row.t1;
|
|
},
|
|
formatMatch: function(row, i, max) {
|
|
return row.id+row.t1;
|
|
},
|
|
formatResult: function(row) {
|
|
return row.t1;
|
|
}
|
|
}).result(function(event,row,formatted){
|
|
$('#'+thisid).value=row.id;
|
|
});
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<form class="layui-form">
|
|
<input type="hidden" id="zsh" name="zsh" value=0>
|
|
<input type="hidden" id="tid" name="tid" value=0>
|
|
<input type="hidden" id="old_zsh" name="old_zsh" value=0>
|
|
<div style="padding:10px;">
|
|
<div class="layui-row">
|
|
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
|
|
<div class="layui-form-item" id="item_zsh">
|
|
|
|
</div>
|
|
</div>
|
|
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
|
|
<div class="layui-form-item" id="item_title">
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<span id="div_keyword_text"></span>
|
|
<div class="layui-row">
|
|
<div class="layui-col-xs12 layui-col-md12">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">图片地址</label>
|
|
<div class="layui-input-inline" style="width:90px;line-height:40px;">attachments/</div>
|
|
<div class="layui-input-inline"><input type="text" class="layui-input" id="pic" name="pic" placeholder="" value=""></div>
|
|
<div class="layui-input-inline" style="width:60px;line-height:30px;"><a href="javascript:" class="layui-btn"onclick="open_window()">浏览</a></div>
|
|
<div class="layui-input-inline" style="line-height:40px;">(如:dp/2013/big/1.jpg)</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-form-item layui-form-text">
|
|
<label class="layui-form-label">同步款号</label>
|
|
<div class="layui-input-block" id="div_keyword_select">
|
|
|
|
</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>
|
|
</div>
|
|
</form>
|
|
<script>
|
|
function open_window(){
|
|
layui.use(['form','layer','element'],function(){
|
|
var form = layui.form,
|
|
$ = layui.jquery;
|
|
var element = layui.element;
|
|
var layer = layui.layer;
|
|
var index = layui.layer.open({
|
|
title : "选择图片",
|
|
area: ['800px', '500px'],
|
|
type : 2,
|
|
content : "kh_tb_add_pic.htm",
|
|
success : function(layero, index){
|
|
|
|
}
|
|
});
|
|
})
|
|
}
|
|
layui.use(['form','layer','laydate','element'],function(){
|
|
var form = layui.form,
|
|
laydate = layui.laydate,
|
|
$ = layui.jquery;
|
|
var element = layui.element;
|
|
var layer = layui.layer;
|
|
//取得url传递参数
|
|
var zsh=get_url_param("zsh");
|
|
var tid=get_url_param("tid");
|
|
$("#zsh").val(zsh);
|
|
$("#tid").val(tid);
|
|
var url="./?_m=kh_tb&_a=add&tid="+tid+"&zsh="+zsh;
|
|
//
|
|
$.ajax(
|
|
{
|
|
url:url,
|
|
contentType: "application/json",
|
|
method: 'POST',
|
|
success: function (res) {
|
|
var id=$("#zsh").val();
|
|
var this_tid=$("#tid").val();
|
|
var json_data=$.parseJSON(res);
|
|
|
|
|
|
//展示号
|
|
var html1="";
|
|
html1+='<label class="layui-form-label" id="lang_zsh">展示号</label>';
|
|
html1+='<div class="layui-input-inline"><input type="text" class="layui-input" id="zsh" name="zsh" lay-verify="required" placeholder="请输入展示号" value="'+json_data.zsh+'"></div>';
|
|
$("#item_zsh").append(html1);
|
|
|
|
|
|
//
|
|
var html1="";
|
|
html1+='<label class="layui-form-label">名称</label>';
|
|
html1+='<div class="layui-input-inline"><input type="text" class="layui-input" id="title" name="title" placeholder="请输入名称" value="'+json_data.title+'" lay-verify="required"></div>';
|
|
$("#item_title").append(html1);
|
|
|
|
|
|
var html1='';
|
|
for(var i=0;i<json_data.select_ks.length;i++){
|
|
html1+='<div class="layui-col-xs6 layui-col-sm6 layui-col-md6"><div class="layui-form-item"><label class="layui-form-label" style="width:30px;">'+json_data.select_ks[i].k1+'.</label><div class="layui-input-inline"><input style="width: 190px;" type="text" class="layui-input" id="'+json_data.select_ks[i].k2+'" name="'+json_data.select_ks[i].k2+'" placeholder="" value="'+json_data.select_ks[i].k3+'"></div></div></div>';
|
|
}
|
|
$("#div_keyword_select").append(html1);
|
|
$("#pic").val(json_data.pic);
|
|
$("#old_zsh").val(json_data.old_zsh);
|
|
for(var i=0;i<json_data.select_ks.length;i++){
|
|
$("#"+json_data.select_ks[i].k2).on("click",autocomp(json_data.select_ks[i].k2));
|
|
}
|
|
form.render();
|
|
},
|
|
error: function () {
|
|
layui.layer.msg("与服务器通信失败!");
|
|
}
|
|
}
|
|
);
|
|
|
|
//提交
|
|
form.on("submit(form1_submit)",function(data){
|
|
//弹出loading
|
|
var index = layer.msg('数据提交中,请稍候',{icon: 16,time:false,shade:0.8});
|
|
//提交
|
|
var url="./?_m=kh_tb&_a=save_add";
|
|
var post_data=data.field;
|
|
//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> |