You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
210 lines
8.4 KiB
210 lines
8.4 KiB
<!DOCTYPE html>
|
|
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>layui</title>
|
|
<meta name="renderer" content="webkit">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
|
|
<link rel="stylesheet" href="/static/css/public.css" media="all">
|
|
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
|
|
|
|
</head>
|
|
<body>
|
|
<div class="layuimini-container">
|
|
<div class="layuimini-main">
|
|
<input id="id" th:value="${id}" style="display:none;">
|
|
<input id="display" th:value="${display}" style="display:none;">
|
|
<a id="refresh" href="javascript:" data-refresh="刷新"><i class="fa fa-refresh"></i></a>
|
|
|
|
<fieldset class="table-search-fieldset">
|
|
<legend>基本信息</legend>
|
|
<div style="margin: 10px 10px 10px 10px">
|
|
<form class="layui-form layui-form-pane" action="">
|
|
<div class="layui-form-item">
|
|
<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)"
|
|
autocomplete="off" class="layui-input">
|
|
<input type="text" name="gid" id="gid" placeholder="请输入组合名称"
|
|
th:value="${record.getId()}" style="display:none;"
|
|
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="applyRemark" id="applyRemark" placeholder="请输入备注说明"
|
|
th:value="${record.getRemark()}" onblur="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
|
|
autocomplete="off" class="layui-input">
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
</fieldset>
|
|
|
|
<ul class="flow-default" id="LAY_group"></ul>
|
|
</div>
|
|
</div>
|
|
|
|
<a id="returnTop" style="display:none;" class="layui-return-top" href="#top"><i class="fa fa-level-up"></i></a>
|
|
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
|
|
<script src="/static/lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
|
|
<script src="/static/js/Customize/public.js"></script>
|
|
<script>
|
|
// 用于通过编码查询物料
|
|
function selectMaterialByCode(obj) {
|
|
}
|
|
|
|
// 用于点击搜索按钮
|
|
function selectMaterial(obj) {
|
|
}
|
|
|
|
// 用于修改组合名称
|
|
function editGroupName(obj) {
|
|
}
|
|
|
|
// 用于修改组合备注
|
|
function editGroupRemark(obj) {
|
|
}
|
|
|
|
// 用于创建二维码
|
|
function createQrCode(obj) {
|
|
}
|
|
|
|
layui.use(['form', 'flow'], function () {
|
|
var $ = layui.jquery,
|
|
form = layui.form,
|
|
flow = layui.flow;
|
|
// 加载表格
|
|
|
|
let takingPre = 0;
|
|
let size = 8;
|
|
let id = $("#id").val();
|
|
flow.load({
|
|
elem: '#LAY_group' //流加载容器
|
|
, done: function (page, next) { //执行下一页的回调
|
|
let result;
|
|
let lis = [];
|
|
|
|
$.get('/group/findGroupInfo?page=' + page + '&size=' + size + '&gid=' + id, function (res) {
|
|
result = res.data;
|
|
lis.push("<div class='clearfix'>");
|
|
for (let i = 0; i < result.length; i++) {
|
|
|
|
let brandItem = '<p>' + "物料品牌:" + result[i].brand + '</p>';
|
|
if (result[i].brand === "") {
|
|
brandItem = "";
|
|
}
|
|
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail('
|
|
+ result[i].mid + ')"><div class="layui-card-header"><h2>' + result[i].mname + '</h2></div>');
|
|
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #999;font-size: 15px;">'
|
|
+ '<p style="font-size: large">' + "物料编码:" + result[i].mcode + '</p>'
|
|
+ '<p>' + "物料型号:" + result[i].version + '</p>'
|
|
+ brandItem
|
|
+ '<p>' + "包含数量:" + result[i].quantity + ":" + result[i].showUnit + '</p>'
|
|
+ '<p style="text-align: right">' + "创建时间:" + result[i].showCreateTime + '</p>'
|
|
+ '</div></div></li>');
|
|
}
|
|
lis.push('</div>');
|
|
takingPre += result.length;
|
|
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
|
|
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
|
|
next(lis.join(''), takingPre < res.count);
|
|
});
|
|
}
|
|
});
|
|
|
|
|
|
// 用于修改组合名称
|
|
editGroupName = function (obj) {
|
|
let display = $("#display").val();
|
|
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),
|
|
contentType: "application/json;charset=utf-8",
|
|
success: function (data) {
|
|
if (data.status >= 300) {
|
|
layer.msg(data.statusInfo.message);//失败的表情
|
|
|
|
} else {
|
|
|
|
}
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
};
|
|
|
|
// 用于修改组合备注
|
|
editGroupRemark = function (obj) {
|
|
let gid = $("#gid").val();
|
|
let applyRemark = obj.value;
|
|
let req = {};
|
|
req.id = gid;
|
|
req.applyRemark = applyRemark;
|
|
$.ajax({
|
|
url: '/group/editGroupInfo',
|
|
dataType: "json",
|
|
type: "post",
|
|
data: JSON.stringify(req),
|
|
contentType: "application/json;charset=utf-8",
|
|
success: function (data) {
|
|
if (data.status >= 300) {
|
|
layer.msg(data.statusInfo.message);//失败的表情
|
|
|
|
} else {
|
|
|
|
}
|
|
}
|
|
|
|
});
|
|
};
|
|
|
|
showDetail = function (obj) {
|
|
layer.open({
|
|
type: 2,
|
|
title: "物料明细",
|
|
skin: 'layui-layer-rim',
|
|
maxmin: true,
|
|
shadeClose: true, //点击遮罩关闭层
|
|
area: ['100%', '100%'],
|
|
move: '.layui-layer-title',
|
|
fixed: false,
|
|
content: '/materialForGroup?mid=' + obj + '&gid=' + id,
|
|
end: function () {
|
|
}
|
|
});
|
|
}
|
|
$('body').on('click', '[data-refresh]', function () {
|
|
location.reload();
|
|
})
|
|
|
|
})
|
|
</script>
|
|
</body>
|
|
</html>
|