This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
EDT/admin/kh_md_add.htm
wsh5485 7e47ce238b chore: 添加多个图片和资源文件
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
2025-06-15 13:04:37 +08:00

314 lines
9.1 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_no').autocomplete("./?_m=ajax_autocomplete&_a=kh", {
dataType: "json",//数据格式
max: 100, //列表里的条目数
minChars: 0, //自动完成激活之前填入的最小字符
width: 200, //提示的宽度,溢出隐藏
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.no,result:row.no
};
});
}
},
formatItem: function(row,i,max) {
//提示的显示内容及格式设置
return row.no;
},
formatMatch: function(row, i, max) {
return row.no;
},
formatResult: function(row) {
return row.no;
}
}).result(function(event,row,formatted){
$('#s_no').value=row.no;
ajax_get_kh_md(row.id);
});
});
function ajax_get_kh_md(id){
if(id>0){
var obj1=document.getElementById("item_dpj");
var obj2=document.getElementById("item_color_size");
obj1.innerHTML=obj2.innerHTML="数据获取中...";
layui.use(['form','layer'],function(){
var form = layui.form,
$ = layui.jquery;
var layer = layui.layer;
var url="./?_m=kh_md&_a=get_size&id="+id;
$.ajax({
url:url,
contentType: "application/json",
method: 'GET',
success: function (res) {
var json_data=$.parseJSON(res);
if(json_data.code==1){
html1="("+json_data.price+")";
$("#item_dpj").html(html1);
html1='';
html1+='<table border="0" cellpadding="4" cellspacing="1" style="line-height: 20px;">'
var arr1=json_data.data;
for(var i=0;i<arr1.length;i++){
html1+='<tr>';
html1+='<td><input type="checkbox" name="color_bx[]" value="'+arr1[i].color_bx+'" lay-skin="primary" title="'+arr1[i].color_bx_title+'"></td>';
html1+='<td><div style="margin-top: 10px;"><span style="line-height:18px;padding: 0 10px;">'+arr1[i].bx+'</span></div></td>';
var arr2=arr1[i].size.split(",");
for(var j=0;j<arr2.length;j++){
var arr3=arr2[j].split("|");
html1+='<td><input type="checkbox" name="size_'+arr1[i].color_bx+'[]" value="'+arr3[0]+'" lay-skin="primary" title="'+arr3[1]+'"></td>';
}
html1+='</tr>';
}
html1+='</table>';
$("#item_color_size").html(html1);
form.render();
}else{
//保存失败
layer.msg("保存失败!");
}
}
});
});
}else{
return;
}
}
</script>
</head>
<body>
<form class="layui-form">
<input type="hidden" id="id" name="id" value=0>
<input type="hidden" id="kh" name="kh" 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_dj">
</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-block"><input type="text" class="layui-input" id="s_no" name="s_no" placeholder="" value="" lay-verify="required" style="width:190px;"></div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-form-item" id="item_mdj">
<label class="layui-form-label" id="lang_mdj">买断价格</label>
<div class="layui-input-block">
<input type="text" class="layui-input" id="price" name="price" lay-verify="required" placeholder="" value="" style="width:90px;display:inline;">
<span id="item_dpj" style="color:red;"></span>
</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" id="lang_mdj">颜色和尺码</label>
<div class="layui-input-block" id="item_color_size">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">&nbsp;</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>
</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;
//
//取得url传递参数
var kh=get_url_param("kh");
var id=get_url_param("id");
var url="./?_m=kh_md&_a=add&id="+id+"&kh="+kh;
//
$.ajax(
{
url:url,
contentType: "application/json",
method: 'POST',
success: function (res) {
var json_data=$.parseJSON(res);
$("#kh").val(kh);
$("#id").val(id);
//----------------初始化
$("#s_no").val(json_data.s_no);
$("#price").val(json_data.price);
if(json_data.s_show_dj=='y'){
html1='<label class="layui-form-label" id="lang_dj">店铺等级</label>';
html1+='<div class="layui-input-block" style="width:190px;"><select name="dj"><option value="">-'+json_data.select_dj.title+'-</option>';
var op=json_data.select_dj.op;
for(var j=0;j<op.length;j++){
html1+='<option value="'+op[j].no+'"';
if(op[j].no==json_data.select_dj.value)
html1+='selected';
html1+='>'+op[j].title+'</option>';
}
html1+='</select></div>';
$("#item_dj").html(html1);
}
if(json_data.dpj!=""){
html1="("+json_data.dpj+")";
$("#item_dpj").html(html1);
}
html1='';
html1+='<table border="0" cellpadding="4" cellspacing="1" style="line-height: 20px;">'
var arr1=json_data.data;
for(var i=0;i<arr1.length;i++){
var str_check="";
if(arr1[i].color_bx_sign=='y'){
str_check=" checked ";
}
html1+='<tr>';
html1+='<td><input type="checkbox" name="color_bx[]" value="'+arr1[i].color_bx+'" lay-skin="primary" title="'+arr1[i].color_bx_title+'" '+str_check+'></td>';
html1+='<td><div style="margin-top: 10px;"><span style="line-height:18px;padding: 0 10px;">'+arr1[i].bx+'</span></div></td>';
var arr2=arr1[i].size.split(",");
for(var j=0;j<arr2.length;j++){
var arr3=arr2[j].split("|");
var str_check2="";
if(arr3[2]=='y'){
str_check2=" checked ";
}
html1+='<td><input type="checkbox" name="size_'+arr1[i].color_bx+'[]" value="'+arr3[0]+'" lay-skin="primary" title="'+arr3[1]+'" '+str_check2+'></td>';
}
html1+='</tr>';
}
html1+='</table>';
$("#item_color_size").html(html1);
//
form.render();
},
error: function () {
layui.layer.msg("与服务器通信失败!");
}
}
);
//重置
$("#form1_reset").click(function(){
var url="kh_md_add.htm?id="+id+"&kh="+kh;
window.location.href=url;
})
//提交
form.on("submit(form1_submit)",function(data){
//弹出loading
var index = layer.msg('数据提交中,请稍候',{icon: 16,time:false,shade:0.8});
//提交
var url="./?_m=kh_md&_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>