init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,327 @@
|
||||
<!--[1.6.48]-->
|
||||
|
||||
<style>
|
||||
.goods_title {
|
||||
font-size: 14px;
|
||||
box-sizing: border-box;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
.goods_title_inner {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-left: 2px solid #232b42;
|
||||
box-sizing: border-box;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.goods_edit {
|
||||
box-sizing: border-box;
|
||||
padding: 10px 20px 10px 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.goods_edit_select {
|
||||
width: 230px;
|
||||
height: 35px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
background: white;
|
||||
margin-right: 20px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.goods_edit_select > select {
|
||||
display: block;
|
||||
border: none;
|
||||
outline: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 0 10px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.gA_inner {
|
||||
box-sizing: border-box;
|
||||
padding: 10px 100px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 580px;
|
||||
}
|
||||
|
||||
.gA_inner_left {
|
||||
width: 100px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.gA_inner_right {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.gA_inner_right > input {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
border: 1px solid #CCCCCC;
|
||||
border-radius: 5px;
|
||||
box-sizing: border-box;
|
||||
padding: 0 5px;
|
||||
}
|
||||
</style>
|
||||
<div class="goodsBox">
|
||||
<div class="goods_title">
|
||||
<div class="goods_title_inner">
|
||||
商品标签 <span style="color:#009688">(标签只能该店使用,用作小程序标签打印)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="goods_edit">
|
||||
<form id="select_serach">
|
||||
<div>
|
||||
<input type="text" name="text" id="keyword" class="goods_edit_select" placeholder="请输入要查询的标签名或序号">
|
||||
</div>
|
||||
</form>
|
||||
<div class="layui-btn " id="serach_icon" style="margin-left: -10px;
|
||||
" data-type="reload">搜索
|
||||
</div>
|
||||
<if condition="$authArr['labelSet'] eq true">
|
||||
<div class="layui-btn " id="newlyIncreased">新增</div>
|
||||
</if>
|
||||
<if condition="$authArr['unboundGoods'] eq true">
|
||||
<div class="layui-btn " id="bindGoods">未绑定标签商品</div>
|
||||
</if>
|
||||
</div>
|
||||
<div class="goods_table" style="margin-left: 30px">
|
||||
<table class="layui-hide" id="test" lay-filter="demo"></table>
|
||||
<script type="text/html" id="barDemo">
|
||||
<if condition="$authArr['labelSet'] eq true">
|
||||
<a class="layui-btn layui-btn-xs" lay-event="change">编辑</a>
|
||||
</if>
|
||||
<if condition="$authArr['deleteLabel'] eq true">
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
</if>
|
||||
</script>
|
||||
</div>
|
||||
<div class="goodsAlert" style="display: none">
|
||||
<form id="create_cate">
|
||||
<input type="hidden" name="id" id="label_id" value="">
|
||||
<div class="gA_inner">
|
||||
<div class="gA_inner_left">标签名称:</div>
|
||||
<div class="gA_inner_right">
|
||||
<input type="text" name="label_name" id="label_name" value="" placeholder="请填写标签名称"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gA_inner">
|
||||
<div class="gA_inner_left">序号:</div>
|
||||
<div class="gA_inner_right">
|
||||
<input type="text" name="sort" id="sort" value="" placeholder="列表将按照序号从大到小顺序排列 "/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var rest = function () {
|
||||
document.getElementById("create_cate").reset();
|
||||
}
|
||||
layui.use('table', function () {
|
||||
var table = layui.table;
|
||||
//展示已知数据
|
||||
table.render({
|
||||
elem: '#test',
|
||||
url: "{:U('GoodsLabel/labelList')}",
|
||||
method: 'post',
|
||||
width: 700,
|
||||
cols: [
|
||||
[ //标题栏
|
||||
{
|
||||
field: 'key',
|
||||
title: '序号',
|
||||
width: 60
|
||||
}, {
|
||||
field: 'label_name',
|
||||
title: '标签名称',
|
||||
}, {
|
||||
field: 'sort',
|
||||
title: '排序',
|
||||
sort: true,
|
||||
}, {
|
||||
field: 'addtime',
|
||||
title: '创建时间'
|
||||
}, {
|
||||
fixed: 'right',
|
||||
title: '操作',
|
||||
width: 150,
|
||||
align: 'center',
|
||||
toolbar: '#barDemo'
|
||||
}
|
||||
]
|
||||
],
|
||||
id: 'couponReload',
|
||||
page: {
|
||||
layout: ['count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
|
||||
}, //是否开启分页
|
||||
});
|
||||
|
||||
$("#serach_icon").click(function () {
|
||||
var keyword = $("#keyword").val();
|
||||
table.reload('couponReload', {
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
, where: {
|
||||
keyword: keyword
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
//监听工具条
|
||||
table.on('tool(demo)', function (obj) {
|
||||
var data = obj.data;
|
||||
var id = data.id;
|
||||
if (obj.event === 'change') {
|
||||
rest();
|
||||
$("#label_id").val(data.id);
|
||||
$("#label_name").val(data.label_name);
|
||||
$("#sort").val(data.sort);
|
||||
layer.open({
|
||||
type: 1,
|
||||
shade: false,
|
||||
content: $('.goodsAlert'),
|
||||
title: "修改标签",
|
||||
area: '650px',
|
||||
btn: ['修改', '取消'],
|
||||
btnAlign: 'c',
|
||||
yes: function () {
|
||||
var label_name = $("#label_name").val();
|
||||
var sort = $("#sort").val();
|
||||
if (label_name == '') {
|
||||
layer.tips("请填写标签名称", "#label_name");
|
||||
return false;
|
||||
}
|
||||
if (sort == '') {
|
||||
layer.tips("请填写序号", "#sort");
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "{:U('GoodsLabel/labelSet')}",
|
||||
type: "POST",
|
||||
data: $("#create_cate").serialize(),
|
||||
success: function (data) {
|
||||
if (data.status == 1) {
|
||||
top.layer.msg(data.msg, {
|
||||
icon: 1,
|
||||
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
||||
}, function () {
|
||||
table.reload('couponReload');
|
||||
});
|
||||
layer.closeAll();
|
||||
|
||||
} else if (data.status == 2) {
|
||||
layer.tips(data.msg, "#label_name");
|
||||
} else if (data.status == 3) {
|
||||
layer.tips(data.msg, "#sort");
|
||||
} else {
|
||||
top.layer.msg("添加失败", {time: 2000})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
} else if (obj.event === 'del') {
|
||||
var id = data.id;
|
||||
layer.confirm('确认删除该标签吗?', function (index) {
|
||||
$.ajax({
|
||||
url: "{:U('GoodsLabel/deleteLabel')}",
|
||||
type: "POST",
|
||||
data: {id: id},
|
||||
success: function (data) {
|
||||
if (data.status == 1) {
|
||||
top.layer.msg(data.msg, {
|
||||
icon: 1,
|
||||
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
||||
}, function () {
|
||||
obj.del();
|
||||
layer.close(index);
|
||||
table.reload('couponReload');
|
||||
});
|
||||
} else {
|
||||
top.layer.msg(data.msg, {time: 2000})
|
||||
layer.close(index);
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
layui.use('layer', function () {
|
||||
var layer = layui.layer;
|
||||
$("#newlyIncreased").click(function () {
|
||||
rest();
|
||||
layer.open({
|
||||
type: 1,
|
||||
shade: false,
|
||||
content: $('.goodsAlert'),
|
||||
title: "添加标签",
|
||||
area: '650px',
|
||||
btn: ['保存', '取消'],
|
||||
btnAlign: 'c',
|
||||
yes: function () {
|
||||
var label_name = $("#label_name").val();
|
||||
var sort = $("#sort").val();
|
||||
if (label_name == '') {
|
||||
layer.tips("请填写标签名称", "#label_name");
|
||||
return false;
|
||||
}
|
||||
if (sort == '') {
|
||||
layer.tips("请填写序号", "#sort");
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "{:U('GoodsLabel/labelSet')}",
|
||||
type: "POST",
|
||||
data: $("#create_cate").serialize(),
|
||||
success: function (data) {
|
||||
if (data.status == 1) {
|
||||
top.layer.msg(data.msg, {
|
||||
icon: 1,
|
||||
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
||||
}, function () {
|
||||
table.reload('couponReload');
|
||||
layer.closeAll();
|
||||
});
|
||||
} else if (data.status == 2) {
|
||||
layer.tips(data.msg, "#label_name");
|
||||
} else if (data.status == 3) {
|
||||
layer.tips(data.msg, "#sort");
|
||||
} else {
|
||||
top.layer.msg("添加失败", {time: 2000})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
/**
|
||||
* 打开新页面
|
||||
*/
|
||||
$("#bindGoods").click(function () {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: "未绑定标签商品<span style='color:#009688;font-weight: bold'>(该部分仅显示未绑定标签的商品)</span>",
|
||||
content: "{:U('GoodsLabel/unboundGoods')}",
|
||||
area: ['750px', '700px'],
|
||||
end: function () {
|
||||
table.reload('couponReload');
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,192 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>商品标签</title>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/layui/css/layui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Retail/css/myscroll.css"/>
|
||||
|
||||
<style>
|
||||
.goods_title {
|
||||
font-size: 14px;
|
||||
box-sizing: border-box;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
.goods_title_inner {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-left: 2px solid #232b42;
|
||||
box-sizing: border-box;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.goods_edit {
|
||||
box-sizing: border-box;
|
||||
padding: 10px 20px 10px 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.goods_edit_select {
|
||||
width: 230px;
|
||||
height: 35px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
background: white;
|
||||
margin-right: 20px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.goods_edit_select > select {
|
||||
display: block;
|
||||
border: none;
|
||||
outline: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 0 10px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.layui-btn-quxiao {
|
||||
background-color: #bbb;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="goodsBox">
|
||||
<div class="goods_edit">
|
||||
<div class="goods_edit_select">
|
||||
<select name="goods_class_id" id="good_class_id">
|
||||
<option value="0">选择分类查询商品</option>
|
||||
<volist name="cate" id="vo">
|
||||
<option value="{$vo.id}">{$vo.class_name}</option>
|
||||
</volist>
|
||||
</select>
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" id="searchBtn">搜索</button>
|
||||
</div>
|
||||
<div class="goods_table" style="margin-left: 30px">
|
||||
<table class="layui-hide" id="test" lay-filter="demo"></table>
|
||||
<div style="width: 100%;text-align: center" class="demoTable">
|
||||
<form id="select_serach">
|
||||
<div class="goods_edit_select">
|
||||
<select name="label_id" id="label_id">
|
||||
<option value="0">选择标签(批量绑定标签)</option>
|
||||
<volist name="list" id="vo">
|
||||
<option value="{$vo.id}">{$vo.label_name}</option>
|
||||
</volist>
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
<button type="button" class="layui-btn bind" data-type="getCheckData">绑定</button>
|
||||
<button type="button" class="layui-btn layui-btn-quxiao" id="cancel">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="__PUBLIC__/jquery/js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
|
||||
<script type="text/javascript">
|
||||
var rest = function () {
|
||||
document.getElementById("create_cate").reset();
|
||||
}
|
||||
layui.use('table', function () {
|
||||
var table = layui.table;
|
||||
//监听表格复选框选择
|
||||
|
||||
//展示已知数据
|
||||
table.render({
|
||||
elem: '#test',
|
||||
url: "{:U('GoodsLabel/goodsList')}",
|
||||
width: 699,
|
||||
height:'full-185',
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
type: 'checkbox'
|
||||
},{
|
||||
field:'key',
|
||||
title:'序号'
|
||||
},{
|
||||
field: 'goods_name',
|
||||
title: '商品名称名称',
|
||||
}, {
|
||||
field: 'goods_class_name',
|
||||
title: '分类名称'
|
||||
}, {
|
||||
field: 'statusName',
|
||||
title: '状态'
|
||||
}
|
||||
]
|
||||
],
|
||||
id: 'couponReload',
|
||||
// page: {
|
||||
// layout: ['count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
|
||||
// }, //是否开启分页
|
||||
page:true
|
||||
});
|
||||
|
||||
var $ = layui.$, active = {
|
||||
getCheckData: function(){ //获取选中数据
|
||||
var checkStatus = table.checkStatus('couponReload')
|
||||
,data = checkStatus.data;
|
||||
// console.log(data[0].id);return
|
||||
var ids = '';
|
||||
for (var i=0;i<data.length;i++){
|
||||
ids += data[i].id+','
|
||||
}
|
||||
if (ids==''){
|
||||
layer.msg("请选择要绑定商品",{time:2000});
|
||||
return;
|
||||
}else {
|
||||
var label_id = $("#label_id").val();
|
||||
$.ajax({
|
||||
url:"{:U('GoodsLabel/bindGoods')}",
|
||||
type:"POST",
|
||||
data:{
|
||||
ids:ids,
|
||||
labelid:label_id
|
||||
},
|
||||
success:function (res) {
|
||||
if (res.status==1){
|
||||
top.layer.msg(res.msg,{time:2000})
|
||||
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
||||
parent.layer.close(index); //再执行关闭
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
$(".bind").click(function () {
|
||||
var label_id = $("#label_id").val();
|
||||
if (label_id==0){
|
||||
layer.tips("请先选择标签","#label_id")
|
||||
return
|
||||
} else {
|
||||
var type = $(this).data('type');
|
||||
active[type] ? active[type].call(this) : '';
|
||||
}
|
||||
})
|
||||
$(".layui-btn-quxiao").click(function () {
|
||||
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
||||
parent.layer.close(index); //再执行关闭
|
||||
})
|
||||
|
||||
$("#searchBtn").click(function () {
|
||||
var keyword = $("#good_class_id").val();
|
||||
table.reload('couponReload', {
|
||||
where: {
|
||||
keyword: keyword
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
</html>
|
||||
在新工单中引用
屏蔽一个用户