7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
326 lines
11 KiB
HTML
326 lines
11 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="shortcut icon" type="image/x-icon" href="../favicon.ico" />
|
|
<link rel="stylesheet" href="layuiadmin/layui/css/layui.css">
|
|
<link rel="stylesheet" href="index.css">
|
|
<style>
|
|
.search{width:100%;text-align:left;background-color:#ffffff;height:59px;line-height:59px;}
|
|
.kh_list-container{background:#fff;border:1px solid #e5e5e5;padding-bottom:0px;border-radius:8px;-moz-border-radius:8px;-webkit-border-radius:8px;overflow:hidden;}
|
|
.kh_list-container:hover{border:1px solid #e8e8e8;}
|
|
.kh_list-container .img{height:300px;line-height:300px;width:400px;z-index:1;overflow:hidden;cursor:pointer;}
|
|
.kh_info{height:40px;line-height:40px;background-color:#f5f5f5;text-align:center;color:#595959;font-size:16px;font-weight:bold;}
|
|
.kh_info .zsh{}
|
|
.kh_info .dph{}
|
|
</style>
|
|
<script src="layuiadmin/layui/layui.js"></script>
|
|
<script src="js/function.js"></script>
|
|
<!-- universal -->
|
|
<script src="js/universal/universal.js"></script>
|
|
<link rel="stylesheet" href="js/universal/universal.css">
|
|
</head>
|
|
<body>
|
|
<!--搜索-->
|
|
<form class="layui-form" name="form1_search" id="form1_search" method="get" action="cl.htm">
|
|
<div class="search">
|
|
<div class="layui-input-inline" style="width:10px;"></div>
|
|
<span id="select_single"></span>
|
|
<div class="layui-input-inline" style="width:120px;"><input type="text" id="s_keyword" name="s_keyword" placeholder="款号/圆牌号" class="layui-input" style="border-radius:10px 10px 10px 10px;"></div>
|
|
<div class="layui-input-inline" style="width:80px;" id="div_clh"><input type="text" id="s_title" name="s_title" placeholder="陈列号" class="layui-input" style="border-radius:10px 10px 10px 10px;"></div>
|
|
<div class="layui-input-inline" style="width:10px;"></div>
|
|
</div>
|
|
<!--隐藏的提交按钮-->
|
|
<div style="position:absolute;top:0px;left:0px;width:0px;height:0px;">
|
|
<button lay-submit lay-filter="form1_submit" id="form1_submit" class="layui-btn layui-btn-submit" style="width:0px;height:0px;"></button>
|
|
</div>
|
|
</form>
|
|
<!--图片列表-->
|
|
<div class="layui-row u-list" id="edt_kh_content"></div>
|
|
<script>
|
|
//更新已订数据
|
|
function update_yd(){
|
|
layui.use('form', function(){
|
|
var $=layui.jquery;
|
|
var form = layui.form;
|
|
//获取预设数据
|
|
var url="./?_m=dk&_a=get_wcl&khid=";
|
|
$.ajax(
|
|
{
|
|
url:url,
|
|
contentType: "application/json",
|
|
method: 'POST',
|
|
success: function (res) {
|
|
var json_data=$.parseJSON(res);
|
|
//更新父窗口数据
|
|
window.parent.update_yd_param(json_data.zb_client_show,json_data.order_jsje,json_data.order_num,json_data.zb_je,json_data.wcl_je,json_data.zb_js,json_data.wcl_js);
|
|
},
|
|
error: function () {
|
|
//
|
|
}
|
|
}
|
|
);
|
|
});
|
|
}
|
|
//自由陈列打开
|
|
function zycl_single(zsh){
|
|
layui.use('layer', function(){
|
|
var url1="zycl.htm";
|
|
var layer = parent.layer;
|
|
index_zycl = layer.open({
|
|
type: 2,
|
|
title: '',
|
|
content: url1+'?zsh='+zsh,
|
|
offset: 'b',
|
|
closeBtn:0,
|
|
anim: 2,
|
|
id: "cl_single"
|
|
});
|
|
layer.full(index_zycl);
|
|
});
|
|
}
|
|
function zycl_btn_click(zsh,thistype){
|
|
layui.use('layer', function(){
|
|
var $ = layui.$
|
|
var layer = parent.layer;
|
|
if(thistype=="copy"){
|
|
layer.confirm("确定复制该陈列吗?", {btn: ['确定', '取消'], title: "提示"}, function () {
|
|
url1="./?_m=zycl&_a=copy&zsh="+zsh;
|
|
$.ajax(
|
|
{
|
|
url:url1,
|
|
contentType: "application/json",
|
|
method: 'post',
|
|
success: function (res) {
|
|
var res=$.parseJSON(res);
|
|
if(res.cate=="copyok"){
|
|
parent.layui.layer.msg("复制成功!");
|
|
}
|
|
},
|
|
error: function () {
|
|
parent.layui.layer.msg("与服务器通信失败!");
|
|
}
|
|
}
|
|
);
|
|
|
|
});
|
|
}else if(thistype=="del"){
|
|
layer.confirm("确定删除该陈列吗?", {btn: ['确定', '取消'], title: "提示"}, function () {
|
|
url1="./?_m=zycl&_a=del&zsh="+zsh;
|
|
$.ajax(
|
|
{
|
|
url:url1,
|
|
contentType: "application/json",
|
|
method: 'post',
|
|
success: function (res) {
|
|
var res=$.parseJSON(res);
|
|
if(res.cate=="delok"){
|
|
parent.layui.layer.msg("删除成功!");
|
|
parent.frames["layadmin-iframe"].location.reload();
|
|
}
|
|
},
|
|
error: function () {
|
|
parent.layui.layer.msg("与服务器通信失败!");
|
|
}
|
|
}
|
|
);
|
|
});
|
|
}else if(thistype=="edit"){
|
|
zycl_single(zsh);
|
|
}
|
|
});
|
|
|
|
}
|
|
//是否手机端
|
|
var is_mobile="n";
|
|
var index_dk_single="";
|
|
//陈列详情
|
|
function cl_single(zsh){
|
|
layui.use('layer', function(){
|
|
var layer = parent.layer;
|
|
index_dk_single = layer.open({
|
|
type: 2,
|
|
title: '',
|
|
content: 'cl_single.htm?zsh='+zsh,
|
|
offset: 'b',
|
|
closeBtn:0,
|
|
anim: 2
|
|
});
|
|
layer.full(index_dk_single);
|
|
});
|
|
}
|
|
//取得瀑布流单款html
|
|
function get_list_html(data1,zycl,content_set){
|
|
var html1='';
|
|
html1+='<div class="u-list-item layui-col-lg4 layui-col-md6 layui-col-sm6 layui-col-xs12"><div class="kh_list-container" id="kh_'+data1.id+'">';
|
|
//---------------图片
|
|
html1+='<div class="img" onclick="cl_single('+data1.zsh+');" style="background-color:'+content_set+';"><img src="'+data1.pic+'" width="'+data1.pic_w+'" height="'+data1.pic_h+'" watermark></div>';
|
|
//kh_info
|
|
html1+='<div class="kh_info">';
|
|
//---------------展示号
|
|
html1+='<span class="zsh">'+data1.zsh+' . </span>';
|
|
//---------------搭配号
|
|
html1+='<span class="dph">'+data1.title+'</span>';
|
|
if(zycl=="y"){
|
|
if(data1.is_my_cl=="n"){
|
|
html1+='<span><a href="javascript:void(0);" class="layui-btn layui-btn-normal layui-btn-sm" onclick="zycl_btn_click(\''+data1.zsh+'\',\'copy\')">复制</a></span>';
|
|
}else{
|
|
html1+='<span><a href="javascript:void(0);" class="layui-btn layui-btn-normal layui-btn-sm" onclick="zycl_btn_click(\''+data1.zsh+'\',\'edit\')">修改</a> </span>';
|
|
html1+='<span><a href="javascript:void(0);" class="layui-btn layui-btn-danger layui-btn-sm" onclick="zycl_btn_click(\''+data1.zsh+'\',\'del\')">删除</a></span>';
|
|
}
|
|
}
|
|
html1+='</div>';
|
|
//----kh_info
|
|
html1+='</div></div>';
|
|
return html1;
|
|
}
|
|
//
|
|
layui.config({
|
|
base: './layuiadmin/'
|
|
}).extend({
|
|
index: 'lib/index'
|
|
}).use(['index', 'user','flow'], function(){
|
|
var $ = layui.$
|
|
,setter = layui.setter
|
|
,admin = layui.admin
|
|
,form = layui.form;
|
|
var rate = layui.rate;
|
|
//取得url传递参数
|
|
var query_str=location.search.substring(1);
|
|
if(query_str)
|
|
query_str="&"+query_str;
|
|
var page=1;
|
|
//流加载
|
|
var flow = layui.flow;
|
|
//选项数组
|
|
flow.load({
|
|
elem: '#edt_kh_content'
|
|
,scrollElem:'#edt_kh_content'
|
|
,end:'<div style=\'width:100%;height:30px;line-height:30px;clear:both;\'>加载完成了</div>'
|
|
,done: function(page, next){
|
|
var lis = [];
|
|
var url1='./?_m=cl&page='+page+query_str;
|
|
//alert(url1);
|
|
$.get(url1,function(res){
|
|
json_data=$.parseJSON(res);
|
|
console.log(json_data, "初始")
|
|
if(json_data.code==0){
|
|
//------------------本页返回的错误信息
|
|
layer.msg(json_data.msg);
|
|
}else if(json_data.code==1){
|
|
//------------------系统错误
|
|
var msg=json_data.msg;
|
|
var url1="error.htm?msg="+json_data.msg+"&btn_title="+json_data.btn_title+"&btn_url="+json_data.btn_url;
|
|
window.parent.location.href=url1;
|
|
}else if(json_data.code==2){
|
|
//------------------重新登录
|
|
url1="login.htm?error_msg="+json_data.msg;
|
|
window.parent.location.href=url1;
|
|
}else{
|
|
//
|
|
var data1=json_data.select_dz;
|
|
//定制选项
|
|
var html1="";
|
|
for(var i=0;i<data1.length;i++){
|
|
if(data1[i].no=="s_type"){
|
|
if(json_data.sys_zycl=="y"){
|
|
html1+='<div class="layui-input-inline" style="width:100px;"><select name="'+data1[i].no+'" lay-filter="select_single"><option value="">-'+data1[i].title+'-</option>';
|
|
var op=data1[i].op;
|
|
for(var j=0;j<op.length;j++){
|
|
html1+='<option value="'+op[j].no+'"';
|
|
if(op[j].no==data1[i].value)
|
|
html1+=' selected';
|
|
html1+='>'+op[j].title+'</option>';
|
|
}
|
|
html1+='</select></div> ';
|
|
}
|
|
}else{
|
|
html1+='<div class="layui-input-inline" style="width:100px;"><select name="'+data1[i].no+'" lay-filter="select_single"><option value="">-'+data1[i].title+'-</option>';
|
|
var op=data1[i].op;
|
|
for(var j=0;j<op.length;j++){
|
|
html1+='<option value="'+op[j].no+'"';
|
|
if(op[j].no==data1[i].value)
|
|
html1+=' selected';
|
|
html1+='>'+op[j].title+'</option>';
|
|
}
|
|
html1+='</select></div> ';
|
|
}
|
|
}
|
|
$("#select_single").html(html1);
|
|
//圆牌号或款号
|
|
var s_keyword="";
|
|
if(json_data.s_keyword)
|
|
s_keyword=json_data.s_keyword;
|
|
$("#s_keyword").val(s_keyword);
|
|
//搭配号
|
|
var s_title="";
|
|
if(json_data.s_title)
|
|
s_title=json_data.s_title;
|
|
$("#s_title").val(s_title);
|
|
//自由陈列
|
|
if(json_data.sys_zycl=="y" && json_data.page <= 1){
|
|
var html1='';
|
|
html1+='<div class="layui-input-inline"><a href="javascript:void(0);" onclick="zycl_single(0)"><img src="images/button_zycl.png" style="width:80px;height:30px;" border="0" watermark></a></div>';
|
|
var elem = $(html1)
|
|
USetWatermark({
|
|
el: elem,
|
|
is_sy: json_data.is_sy,
|
|
text: json_data.username,
|
|
mode: "outer"
|
|
})
|
|
$("#div_clh").after(html1);
|
|
}
|
|
//加载图片列表
|
|
var data=json_data.content_list;
|
|
var html1='';
|
|
for(var i=0;i<data.length;i++){
|
|
html1=get_list_html(data[i],json_data.sys_zycl,json_data.content_set);
|
|
var elem = $(html1)
|
|
USetWatermark({
|
|
el: elem,
|
|
is_sy: json_data.is_sy,
|
|
text: json_data.username,
|
|
mode: "outer"
|
|
})
|
|
lis.push(elem[0].outerHTML)
|
|
}
|
|
next(lis.join(''), page<json_data.total_page);
|
|
// 限制图片宽度防止超出父元素尺寸
|
|
$(".kh_list-container .img").css("max-width", $(".kh_list-container").width())
|
|
$(".kh_list-container .img img").css("max-width", $(".kh_list-container").width())
|
|
//
|
|
total_page=json_data.total_page;
|
|
form.render();
|
|
}
|
|
});
|
|
}
|
|
});
|
|
//
|
|
form.on('select(select_single)', function(data){
|
|
$("#form1_submit").click();
|
|
});
|
|
//提交
|
|
form.on("submit(form1_submit)",function(data){
|
|
$("#form1_submit").focus();
|
|
return true;
|
|
});
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$("#edt_kh_content").height($("#LAY_app_body", parent.document).height()-60)
|
|
//监听屏幕旋转
|
|
// resize和orientationchange的不同:
|
|
// resize: 监听尺寸变化,orientationchange:监听移动端横竖屏切换
|
|
// orientationchange:宽高为切换前宽高,需延时才能获取切换后的宽高
|
|
$(window).on("orientationchange", function() {
|
|
if(index_dk_single)
|
|
parent.layer.full(index_dk_single)
|
|
setTimeout(function() {
|
|
$("#edt_kh_content").height($("#LAY_app_body", parent.document).height() - 60)
|
|
}, 100)
|
|
})
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |