7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
296 lines
8.2 KiB
HTML
296 lines
8.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(){
|
|
$('#s_dp_from').autocomplete("./?_m=ajax_autocomplete&_a=client", {
|
|
dataType: "json",//数据格式
|
|
max: 100, //列表里的条目数
|
|
minChars: 0, //自动完成激活之前填入的最小字符
|
|
width: 300, //提示的宽度,溢出隐藏
|
|
scrollHeight: 300, //提示的高度,溢出显示滚动条
|
|
matchContains: true, //包含匹配,就是data参数里的数据,是否只要包含文本框里的数据就显示
|
|
autoFill: false, //自动填充
|
|
multiple:false,
|
|
multipleSeparator:',',
|
|
parse: function (data) {
|
|
if (!data || data == null || data == "") {
|
|
alert("无数据");
|
|
return {};
|
|
}else{
|
|
return $.map(data.data, function (row) {
|
|
return {
|
|
data:row,value:row.username,result:row.username
|
|
};
|
|
});
|
|
}
|
|
},
|
|
formatItem: function(row,i,max) {
|
|
//提示的显示内容及格式设置
|
|
var xs="";
|
|
xs=row.title+"("+row.username+")";
|
|
return xs;
|
|
},
|
|
formatMatch: function(row, i, max) {
|
|
return row.username;
|
|
},
|
|
formatResult: function(row) {
|
|
return row.username;
|
|
}
|
|
}).result(function(event,row,formatted){
|
|
$('#s_dp_from').value=row.username;
|
|
//$('#s_from_cid').value=row.id;
|
|
$("#s_from_cid").val(row.id);
|
|
//showcs(row.username);
|
|
});
|
|
});
|
|
|
|
$(function(){
|
|
$('#s_dp_to').autocomplete("./?_m=ajax_autocomplete&_a=client", {
|
|
dataType: "json",//数据格式
|
|
max: 100, //列表里的条目数
|
|
minChars: 0, //自动完成激活之前填入的最小字符
|
|
width: 300, //提示的宽度,溢出隐藏
|
|
scrollHeight: 300, //提示的高度,溢出显示滚动条
|
|
matchContains: true, //包含匹配,就是data参数里的数据,是否只要包含文本框里的数据就显示
|
|
autoFill: false, //自动填充
|
|
multiple:false,
|
|
multipleSeparator:',',
|
|
parse: function (data) {
|
|
if (!data || data == null || data == "") {
|
|
alert("无数据");
|
|
return {};
|
|
}else{
|
|
return $.map(data.data, function (row) {
|
|
return {
|
|
data:row,value:row.username,result:row.username
|
|
};
|
|
});
|
|
}
|
|
},
|
|
formatItem: function(row,i,max) {
|
|
//提示的显示内容及格式设置
|
|
var xs="";
|
|
xs=row.title+"("+row.username+")";
|
|
return xs;
|
|
},
|
|
formatMatch: function(row, i, max) {
|
|
return row.username;
|
|
},
|
|
formatResult: function(row) {
|
|
return row.username;
|
|
}
|
|
}).result(function(event,row,formatted){
|
|
$('#s_dp_to').value=row.username;
|
|
//$('#s_to_cid').value=row.id;
|
|
$("#s_to_cid").val(row.id);
|
|
//showcs(row.username);
|
|
});
|
|
});
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
<form class="layui-form">
|
|
<input type="hidden" id="id" name="id" value=0>
|
|
<input type="hidden" id="s_from_cid" name="s_from_cid" value=0>
|
|
<input type="hidden" id="s_to_cid" name="s_to_cid" value=0>
|
|
<div >
|
|
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">来自</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" id="s_dp_from" name="s_dp_from" class="layui-input" >
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">送往</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" id="s_dp_to" name="s_dp_to" class="layui-input" >
|
|
<input type="checkbox" id="qf" name="qf" lay-skin="primary" title="包含下级客户 (留空发给所有客户)" />
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">已读</label>
|
|
<div class="layui-input-inline">
|
|
<input type="checkbox" id="is_read" name="is_read" lay-skin="switch" lay-text="是|否" checked>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">内容</label>
|
|
<div class="layui-input-inline">
|
|
<div class="layui-input-inline"><textarea name="text" id="text" style="border:1px solid #e6e6e6;width:300px;" rows=3></textarea></div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">发送时间</label>
|
|
<div class="layui-input-inline"><input type="text" class="layui-input" name="add_date" id="lay_date"></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 layer = parent.layer;
|
|
//alert(parent.layer);
|
|
//
|
|
$("#id").val(get_url_param("id"));
|
|
var id=$("#id").val();
|
|
//alert(id);
|
|
var url="./?_m=msg&_a=add&id="+id;
|
|
//
|
|
$.ajax(
|
|
{
|
|
url:url,
|
|
contentType: "application/json",
|
|
method: 'POST',
|
|
success: function (res) {
|
|
var str=$.parseJSON(res);
|
|
$("#s_dp_from").val(str.s_dp_from);
|
|
$("#s_from_cid").val(str.s_from_cid);
|
|
$("#s_dp_to").val(str.s_dp_to);
|
|
$("#s_to_cid").val(str.s_to_cid);
|
|
if(str.qf=="y"){
|
|
$("#qf").prop('checked',true);
|
|
}else{
|
|
$("#qf").prop('checked',false);
|
|
}
|
|
if(str.is_read=="y"){
|
|
$("#is_read").prop('checked',true);
|
|
}else{
|
|
$("#is_read").prop('checked',false);
|
|
}
|
|
|
|
$("#text").val(str.text);
|
|
|
|
//添加时间
|
|
laydate.render({
|
|
elem: '#lay_date',
|
|
type: 'datetime',
|
|
value: str.add_date
|
|
});
|
|
|
|
form.render();
|
|
|
|
},
|
|
error: function () {
|
|
layui.layer.msg("与服务器通信失败!");
|
|
}
|
|
}
|
|
);
|
|
//重置
|
|
$("#form1_reset").click(function(){
|
|
var id=$("#id").val();
|
|
var url="msg_add.htm?id="+id;
|
|
window.location.href=url;
|
|
})
|
|
/*$("#form1_submit").click(function(){
|
|
var _t=$("#_t").val();
|
|
if(_t=="8"){
|
|
$(".layui-colorpicker-trigger-span").each(function(){
|
|
var stra=colorRGB2Hex($(this).attr("style"));
|
|
var tmp=$("#_v").val();
|
|
if(tmp){
|
|
var tmp1=tmp+"_"+stra;
|
|
}else{
|
|
var tmp1=stra;
|
|
}
|
|
$("#_v").val(tmp1);
|
|
})
|
|
}
|
|
//alert($("#_v").val());
|
|
})*/
|
|
//提交
|
|
form.on("submit(form1_submit)",function(data){
|
|
|
|
|
|
//弹出loading
|
|
var index = layer.msg('数据提交中,请稍候',{icon: 16,time:false,shade:0.8});
|
|
//提交
|
|
var url="./?_m=msg&_a=save_add";
|
|
|
|
var post_data=data.field;
|
|
//console.log($("#_v").val())
|
|
//alert(JSON.stringify(post_data));
|
|
$.ajax({
|
|
url:url,
|
|
contentType: "application/json",
|
|
method: 'GET',
|
|
//data:{"a":"a","id":$("#id").val(),"_t":$("#_t").val(),"_v":$("#_v").val(),"_k":$("#_k").val()},
|
|
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("保存成功!");
|
|
layer.closeAll("iframe");
|
|
//刷新父页面
|
|
parent.location.reload();
|
|
}else{
|
|
//保存失败
|
|
layer.close(index);
|
|
layer.msg("保存失败!("+json_data.msg+")");
|
|
}
|
|
}
|
|
})
|
|
return false;
|
|
})
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |