|
|
|
@ -25,9 +25,11 @@ |
|
|
|
<div class="layui-inline"> |
|
|
|
<label class="layui-form-label">组合名称</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<input type="text" name="gname" id="gname" placeholder="请输入组合名称" th:value="${record.getGname()}" onblur="editGroupName(this)" |
|
|
|
<input type="text" name="gname" id="gname" placeholder="请输入组合名称" |
|
|
|
th:value="${record.getGname()}" onchange="editGroupName(this)" |
|
|
|
autocomplete="off" class="layui-input"> |
|
|
|
<input type="text" name="gid" id="gid" placeholder="请输入组合名称" th:value="${record.getId()}" style="display:none;" |
|
|
|
<input type="text" name="gid" id="gid" placeholder="请输入组合名称" th:value="${record.getId()}" |
|
|
|
style="display:none;" |
|
|
|
autocomplete="off" class="layui-input"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -35,14 +37,16 @@ |
|
|
|
<div class="layui-inline"> |
|
|
|
<label class="layui-form-label">备注说明</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<input type="text" name="applyRemark" id="applyRemark" placeholder="请输入备注说明" th:value="${record.getRemark()}" onblur="editGroupRemark(this)" |
|
|
|
<input type="text" name="applyRemark" id="applyRemark" placeholder="请输入备注说明" |
|
|
|
th:value="${record.getRemark()}" onchange="editGroupRemark(this)" |
|
|
|
autocomplete="off" class="layui-input"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="layui-inline"> |
|
|
|
<label class="layui-form-label">组合编码</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<input type="text" name="gcode" id="gcode" placeholder="请输入组合编码" th:value="${record.getCode()}" readonly |
|
|
|
<input type="text" name="gcode" id="gcode" placeholder="请输入组合编码" |
|
|
|
th:value="${record.getCode()}" readonly |
|
|
|
autocomplete="off" class="layui-input"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -51,7 +55,8 @@ |
|
|
|
<div class="layui-form-item" style="display: none"> |
|
|
|
<label class="layui-form-label">二维码</label> |
|
|
|
<div class="layui-input-inline"> |
|
|
|
<input id="createCode" type="button" class="layui-btn layui-btn-radius layui-btn-normal" onclick="createQrCode()" value="生成二维码"/> |
|
|
|
<input id="createCode" type="button" class="layui-btn layui-btn-radius layui-btn-normal" |
|
|
|
onclick="createQrCode()" value="生成二维码"/> |
|
|
|
<img id="qrCode" style="display:none;"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -62,16 +67,22 @@ |
|
|
|
|
|
|
|
<script id="toolbarDemo" type="text/html"> |
|
|
|
<div class="layui-btn-container"> |
|
|
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add" th:style="'display:'+${display}">添加</button> |
|
|
|
<button class="layui-btn layui-btn-danger layui-btn-sm data-delet-btn" lay-event="delete" id="display" th:style="'display:'+${display}">删除</button> |
|
|
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add" |
|
|
|
th:style="'display:'+${display}">添加 |
|
|
|
</button> |
|
|
|
<button class="layui-btn layui-btn-danger layui-btn-sm data-delet-btn" lay-event="delete" id="display" |
|
|
|
th:style="'display:'+${display}">删除 |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</script> |
|
|
|
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<script type="text/html" id="currentTableBar"> |
|
|
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="detail" th:style="'display:'+${display}">详情</a> |
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete" th:style="'display:'+${display}">删除</a> |
|
|
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="detail" |
|
|
|
th:style="'display:'+${display}">详情</a> |
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete" |
|
|
|
th:style="'display:'+${display}">删除</a> |
|
|
|
</script> |
|
|
|
|
|
|
|
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script> |
|
|
|
@ -79,16 +90,22 @@ |
|
|
|
// 用于通过编码查询物料 |
|
|
|
function selectMaterialByCode(obj) { |
|
|
|
} |
|
|
|
|
|
|
|
// 用于点击搜索按钮 |
|
|
|
function selectMaterial(obj) { |
|
|
|
} |
|
|
|
|
|
|
|
// 用于修改组合名称 |
|
|
|
function editGroupName(obj){} |
|
|
|
function editGroupName(obj) { |
|
|
|
} |
|
|
|
|
|
|
|
// 用于修改组合备注 |
|
|
|
function editGroupRemark(obj){} |
|
|
|
function editGroupRemark(obj) { |
|
|
|
} |
|
|
|
|
|
|
|
// 用于创建二维码 |
|
|
|
function createQrCode(obj){} |
|
|
|
function createQrCode(obj) { |
|
|
|
} |
|
|
|
|
|
|
|
layui.use(['form', 'table'], function () { |
|
|
|
var $ = layui.jquery, |
|
|
|
@ -113,7 +130,7 @@ |
|
|
|
pageName: 'page', //页码的参数名称,默认:page |
|
|
|
limitName: 'size' //每页数据量的参数名,默认:limit |
|
|
|
}, |
|
|
|
where: {gid:id}, |
|
|
|
where: {gid: id}, |
|
|
|
response: { |
|
|
|
statusName: 'status' //规定数据状态的字段名称,默认:code |
|
|
|
, statusCode: 200 //规定成功的状态码,默认:0 |
|
|
|
@ -160,29 +177,28 @@ |
|
|
|
area: ['100%', '100%'], |
|
|
|
move: '.layui-layer-title', |
|
|
|
fixed: false, |
|
|
|
content: '/materialForGroup?mid='+data.mid+'&gid='+id, |
|
|
|
end:function () { |
|
|
|
content: '/materialForGroup?mid=' + data.mid + '&gid=' + id, |
|
|
|
end: function () { |
|
|
|
table.reload('currentTableId', { |
|
|
|
url: '/group/findGroupInfo', |
|
|
|
page: { |
|
|
|
curr: 1 |
|
|
|
}, |
|
|
|
where:{ |
|
|
|
gid:id |
|
|
|
where: { |
|
|
|
gid: id |
|
|
|
} |
|
|
|
}, 'data'); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
else if (obj.event === 'delete') { |
|
|
|
} else if (obj.event === 'delete') { |
|
|
|
var req = {}; |
|
|
|
req.id = data.id; |
|
|
|
layer.confirm('真的删除么', {icon: 2, title: '提示'}, function (index) { |
|
|
|
$.ajax({ |
|
|
|
url:"/group/delMaterialForGroup", |
|
|
|
type:"post", |
|
|
|
dataType:"json", |
|
|
|
data:JSON.stringify(req), |
|
|
|
url: "/group/delMaterialForGroup", |
|
|
|
type: "post", |
|
|
|
dataType: "json", |
|
|
|
data: JSON.stringify(req), |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
success: function (data) { |
|
|
|
layer.close(this.layerIndex); |
|
|
|
@ -200,8 +216,8 @@ |
|
|
|
page: { |
|
|
|
curr: 1 |
|
|
|
}, |
|
|
|
where:{ |
|
|
|
gid:id |
|
|
|
where: { |
|
|
|
gid: id |
|
|
|
} |
|
|
|
}, 'data'); |
|
|
|
return false; |
|
|
|
@ -226,21 +242,20 @@ |
|
|
|
area: ['100%', '100%'], |
|
|
|
move: '.layui-layer-title', |
|
|
|
fixed: false, |
|
|
|
content: '/group_add?gid='+id, |
|
|
|
end:function () { |
|
|
|
content: '/group_add?gid=' + id, |
|
|
|
end: function () { |
|
|
|
table.reload('currentTableId', { |
|
|
|
url: '/group/findGroupInfo', |
|
|
|
page: { |
|
|
|
curr: 1 |
|
|
|
}, |
|
|
|
where:{ |
|
|
|
gid:id |
|
|
|
where: { |
|
|
|
gid: id |
|
|
|
} |
|
|
|
}, 'data'); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
else if(obj.event === 'delete'){ |
|
|
|
} else if (obj.event === 'delete') { |
|
|
|
var checkStatus = table.checkStatus('currentTableId') |
|
|
|
, data = checkStatus.data; |
|
|
|
var req = {}; |
|
|
|
@ -248,13 +263,13 @@ |
|
|
|
for (i = 0, len = data.length; i < len; i++) { |
|
|
|
req.ids[i] = data[i].id; |
|
|
|
} |
|
|
|
if(req.ids.length > 0){ |
|
|
|
if (req.ids.length > 0) { |
|
|
|
layer.confirm('真的删除么', {icon: 2, title: '提示'}, function (index) { |
|
|
|
$.ajax({ |
|
|
|
url:"/group/delMaterialForGroup", |
|
|
|
type:"post", |
|
|
|
dataType:"json", |
|
|
|
data:JSON.stringify(req), |
|
|
|
url: "/group/delMaterialForGroup", |
|
|
|
type: "post", |
|
|
|
dataType: "json", |
|
|
|
data: JSON.stringify(req), |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
success: function (data) { |
|
|
|
layer.close(this.layerIndex); |
|
|
|
@ -272,8 +287,8 @@ |
|
|
|
page: { |
|
|
|
curr: 1 |
|
|
|
}, |
|
|
|
where:{ |
|
|
|
gid:id |
|
|
|
where: { |
|
|
|
gid: id |
|
|
|
} |
|
|
|
}, 'data'); |
|
|
|
return false; |
|
|
|
@ -281,7 +296,7 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
layer.msg("未选中记录,请确认!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
@ -293,17 +308,17 @@ |
|
|
|
// 用于修改组合名称 |
|
|
|
editGroupName = function (obj) { |
|
|
|
let display = $("#display").css("display"); |
|
|
|
if(display !== "none"){ |
|
|
|
if (display !== "none") { |
|
|
|
let gid = $("#gid").val(); |
|
|
|
let gname = obj.value; |
|
|
|
let req = {}; |
|
|
|
req.id = gid; |
|
|
|
req.gname = gname; |
|
|
|
$.ajax({ |
|
|
|
url:'/group/editGroupInfo', |
|
|
|
dataType:"json", |
|
|
|
type:"post", |
|
|
|
data:JSON.stringify(req), |
|
|
|
url: '/group/editGroupInfo', |
|
|
|
dataType: "json", |
|
|
|
type: "post", |
|
|
|
data: JSON.stringify(req), |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
success: function (data) { |
|
|
|
if (data.status >= 300) { |
|
|
|
@ -321,16 +336,18 @@ |
|
|
|
|
|
|
|
// 用于修改组合备注 |
|
|
|
editGroupRemark = function (obj) { |
|
|
|
let display = $("#display").css("display"); |
|
|
|
if (display !== "none") { |
|
|
|
let gid = $("#gid").val(); |
|
|
|
let applyRemark = obj.value; |
|
|
|
let req = {}; |
|
|
|
req.id = gid; |
|
|
|
req.remark = applyRemark; |
|
|
|
$.ajax({ |
|
|
|
url:'/group/editGroupInfo', |
|
|
|
dataType:"json", |
|
|
|
type:"post", |
|
|
|
data:JSON.stringify(req), |
|
|
|
url: '/group/editGroupInfo', |
|
|
|
dataType: "json", |
|
|
|
type: "post", |
|
|
|
data: JSON.stringify(req), |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
success: function (data) { |
|
|
|
if (data.status >= 300) { |
|
|
|
@ -342,6 +359,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
// 用于创建二维码 |
|
|
|
|