新增材质重量栏目
Цей коміт міститься в:
@@ -10,7 +10,7 @@
|
|||||||
<where>
|
<where>
|
||||||
1=1
|
1=1
|
||||||
<if test="content != null and content != ''">
|
<if test="content != null and content != ''">
|
||||||
and title like '%${content}%' or content like '%${content}%'
|
and (title like '%${content}%' or content like '%${content}%')
|
||||||
</if>
|
</if>
|
||||||
<if test="type != null and type != ''">
|
<if test="type != null and type != ''">
|
||||||
and `type` = #{type}
|
and `type` = #{type}
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||||
|
pageEncoding="UTF-8" %>
|
||||||
|
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>添加产品须知</title>
|
||||||
|
<%@include file="/views/common.jsp" %>
|
||||||
|
<style>
|
||||||
|
.layui-input, .layui-input-inline {
|
||||||
|
width: 350px
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="layui-input-block layui-form" style="margin-top: 30px">
|
||||||
|
<form class="layui-form " action="">
|
||||||
|
<input type="hidden" name="id" id="id">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label">产品名称</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" name="title" placeholder="请输入产品名称" class="layui-input" lay-verify="required"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label">备注</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" name="memo" placeholder="请输入备注" class="layui-input"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label">厚度</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<textarea type="text" name="content" placeholder="请输入厚度" class="layui-textarea" lay-verify="required" style="width: 300px;"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" name="type" class="layui-input" value="3">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<button class="layui-btn" lay-submit="" lay-filter="enadd">确认添加</button>
|
||||||
|
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
layui.use(['form', 'layer'], function () {
|
||||||
|
var $ = layui.$,
|
||||||
|
form = layui.form,
|
||||||
|
layer = layui.layer;
|
||||||
|
|
||||||
|
//监听提交
|
||||||
|
form.on('submit(enadd)', function (data) {
|
||||||
|
let id = document.getElementsByName("id")[0].value;
|
||||||
|
|
||||||
|
let url = id == "" ? '${path}/addStandard' : '${path}/updateStandard';
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
dataType: 'json',
|
||||||
|
data: $(data.form).serialize(),
|
||||||
|
type: 'post',
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 200) {
|
||||||
|
layer.msg('录入成功!', {
|
||||||
|
icon: 6,
|
||||||
|
offset: "auto",
|
||||||
|
time: 2000
|
||||||
|
});//提示框
|
||||||
|
} else {
|
||||||
|
layer.msg('录入失败!', {
|
||||||
|
icon: 5,
|
||||||
|
offset: "auto",
|
||||||
|
time: 2000
|
||||||
|
});//提示框
|
||||||
|
}
|
||||||
|
setTimeout(function () {
|
||||||
|
var index = parent.layer.getFrameIndex(window.name);//获取窗口索引
|
||||||
|
parent.layer.close(index);//关闭弹出层
|
||||||
|
parent.layui.table.reload("informationTableAll"); //重新加载页面表格
|
||||||
|
}, 2100);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,181 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||||
|
pageEncoding="UTF-8" %>
|
||||||
|
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>产品厚度列表</title>
|
||||||
|
<%@include file="/views/common.jsp" %>
|
||||||
|
<style type="text/css">
|
||||||
|
.layui-table-cell {
|
||||||
|
height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layui-table td, .layui-table th, .layui-table-header, .layui-table-page, .layui-table-tool, .layui-table-total, .layui-table-view {
|
||||||
|
border-color: #6666;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ztree * {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edge .layui-edge {
|
||||||
|
right: 35px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<script type="text/html" id="toolbarDemo">
|
||||||
|
<div class="layui-btn-container demoTable">
|
||||||
|
<button class="layui-btn layui-btn-sm" lay-event="add">
|
||||||
|
<i class="layui-icon layui-icon-add-circle-fine" style="font-size:20px;font-weight:bold"></i> 新增内容
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
<script type="text/html" id="barDemo">
|
||||||
|
<a class="layui-btn layui-btn-xs" lay-event="view">
|
||||||
|
<i class="layui-icon layui-icon-view" style="color:white;font-size:20px"></i>复制
|
||||||
|
</a>
|
||||||
|
<a class="layui-btn layui-btn-xs" lay-event="edit">
|
||||||
|
<i class="layui-icon layui-icon-edit" style="color:white;font-size:20px"></i>修改
|
||||||
|
</a>
|
||||||
|
</script>
|
||||||
|
<body>
|
||||||
|
<br>
|
||||||
|
<form class="layui-form" action="">
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label">内容</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" id="content" name="content" placeholder="请输入内容" autocomplete="off" class="layui-input">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<button class="layui-btn" id="searchBtn" lay-submit lay-filter="formDemo" style="margin-left: 15px">
|
||||||
|
<i class="layui-icon layui-icon-search"></i> 查询
|
||||||
|
</button>
|
||||||
|
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<table class="layui-hide" id="informationTable" lay-filter="informationTable"></table>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
layui.use(['element', 'table', 'laydate', 'form'], function () {
|
||||||
|
var $ = layui.jquery;
|
||||||
|
var table = layui.table;
|
||||||
|
var laydate = layui.laydate;
|
||||||
|
var element = layui.element;
|
||||||
|
var form = layui.form;
|
||||||
|
|
||||||
|
// 生成表格
|
||||||
|
table.render({
|
||||||
|
elem: '#informationTable',
|
||||||
|
url: '../../../../getStandard',
|
||||||
|
toolbar: '#toolbarDemo',
|
||||||
|
title: '用户表',// 导出文件名
|
||||||
|
id: 'informationTableAll',
|
||||||
|
// 开启分页
|
||||||
|
// page : true,
|
||||||
|
page: {
|
||||||
|
layout: ['count', 'prev', 'page', 'next', 'skip', 'limit']
|
||||||
|
},
|
||||||
|
limits: [10, 30, 50, 80, 100, 999],
|
||||||
|
/*request : {
|
||||||
|
'limitName' : 'pageSize' // 分页每页条数默认字段改为pageSize
|
||||||
|
},*/
|
||||||
|
where: {
|
||||||
|
content: '', type: 3
|
||||||
|
},
|
||||||
|
cellMinWidth: 80, // 全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
||||||
|
cols: [[{
|
||||||
|
field: 'title',
|
||||||
|
title: '产品',
|
||||||
|
}, {
|
||||||
|
field: 'content',
|
||||||
|
title: '厚度',
|
||||||
|
}, {
|
||||||
|
field: 'memo',
|
||||||
|
title: '备注',
|
||||||
|
}, {
|
||||||
|
fixed: 'right',
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
width: 150,
|
||||||
|
toolbar: '#barDemo'
|
||||||
|
}]],
|
||||||
|
parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
|
||||||
|
return {
|
||||||
|
"code": 0, //解析接口状态
|
||||||
|
"msg": "", //解析提示文本
|
||||||
|
"count": res.data.list.total,//解析数据长度
|
||||||
|
"data": res.data.list.list//解析数据列表
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//点击查询按钮,重载表格
|
||||||
|
$('#searchBtn').on('click', function () {
|
||||||
|
table.reload('informationTableAll', {
|
||||||
|
method: 'get',
|
||||||
|
where: {
|
||||||
|
content: $("#content").val()
|
||||||
|
},
|
||||||
|
page: {
|
||||||
|
curr: 1
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
table.on('toolbar(informationTable)', function (obj) {
|
||||||
|
switch (obj.event) {
|
||||||
|
case 'add':
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: "添加产品",
|
||||||
|
fix: false, //不固定
|
||||||
|
maxmin: true,
|
||||||
|
skin: 'layui-layer-molv',
|
||||||
|
area: ['45%', '70%'],
|
||||||
|
content: './addThickness.jsp',
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
});
|
||||||
|
table.on('tool(informationTable)', function (obj) {
|
||||||
|
let data1 = obj.data;
|
||||||
|
if (obj.event === 'edit') {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: "修改产品",
|
||||||
|
area: ['45%', '70%'],
|
||||||
|
skin: 'layui-layer-molv',
|
||||||
|
content: './addThickness.jsp',
|
||||||
|
success: function (layero, index) {
|
||||||
|
var body = layer.getChildFrame('body', index);
|
||||||
|
body.find('#id').val(data1.id);
|
||||||
|
body.find('input[name="title"]').val(data1.title);
|
||||||
|
body.find('textarea[name="content"]').val(data1.content);
|
||||||
|
|
||||||
|
layui.form.render();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (obj.event === 'view') {
|
||||||
|
// 在此处输入 layer 的任意代码
|
||||||
|
navigator.clipboard.writeText(data.content);
|
||||||
|
layer.msg('复制成功!', {icon: 6, offset: 'auto', time: 1000});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||||
|
pageEncoding="UTF-8" %>
|
||||||
|
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>产品知识列表</title>
|
||||||
|
<%@include file="/views/common.jsp" %>
|
||||||
|
<style type="text/css">
|
||||||
|
.layui-table-cell {
|
||||||
|
height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layui-table td, .layui-table th, .layui-table-header, .layui-table-page, .layui-table-tool, .layui-table-total, .layui-table-view {
|
||||||
|
border-color: #6666;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ztree * {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edge .layui-edge {
|
||||||
|
right: 35px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<script type="text/html" id="toolbarDemo">
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<script type="text/html" id="barDemo">
|
||||||
|
<a class="layui-btn layui-btn-xs" lay-event="view">
|
||||||
|
<i class="layui-icon layui-icon-view" style="color:white;font-size:20px"></i>复制
|
||||||
|
</a>
|
||||||
|
</script>
|
||||||
|
<body>
|
||||||
|
<br>
|
||||||
|
<form class="layui-form" action="">
|
||||||
|
<div class="layui-inline">
|
||||||
|
<label class="layui-form-label">内容</label>
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<input type="text" id="content" name="content" placeholder="请输入内容" autocomplete="off" class="layui-input">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<div class="layui-input-inline">
|
||||||
|
<button class="layui-btn" id="searchBtn" lay-submit lay-filter="formDemo" style="margin-left: 15px">
|
||||||
|
<i class="layui-icon layui-icon-search"></i> 查询
|
||||||
|
</button>
|
||||||
|
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<table class="layui-hide" id="informationTable" lay-filter="informationTable"></table>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
layui.use(['element', 'table', 'laydate', 'form'], function () {
|
||||||
|
var $ = layui.jquery;
|
||||||
|
var table = layui.table;
|
||||||
|
var laydate = layui.laydate;
|
||||||
|
var element = layui.element;
|
||||||
|
var form = layui.form;
|
||||||
|
|
||||||
|
// 生成表格
|
||||||
|
table.render({
|
||||||
|
elem: '#informationTable',
|
||||||
|
url: '../../../../getStandard',
|
||||||
|
toolbar: '#toolbarDemo',
|
||||||
|
title: '用户表',// 导出文件名
|
||||||
|
id: 'informationTableAll',
|
||||||
|
// 开启分页
|
||||||
|
// page : true,
|
||||||
|
page: {
|
||||||
|
layout: ['count', 'prev', 'page', 'next', 'skip', 'limit']
|
||||||
|
},
|
||||||
|
limits: [10, 30, 50, 80, 100, 999],
|
||||||
|
/*request : {
|
||||||
|
'limitName' : 'pageSize' // 分页每页条数默认字段改为pageSize
|
||||||
|
},*/
|
||||||
|
where: {
|
||||||
|
content: '', type: 3
|
||||||
|
},
|
||||||
|
cellMinWidth: 80, // 全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
||||||
|
cols: [[{
|
||||||
|
field: 'title',
|
||||||
|
title: '产品',
|
||||||
|
}, {
|
||||||
|
field: 'content',
|
||||||
|
title: '厚度',
|
||||||
|
}, {
|
||||||
|
field: 'memo',
|
||||||
|
title: '备注',
|
||||||
|
}, {
|
||||||
|
fixed: 'right',
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
width: 150,
|
||||||
|
toolbar: '#barDemo'
|
||||||
|
}]],
|
||||||
|
parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
|
||||||
|
return {
|
||||||
|
"code": 0, //解析接口状态
|
||||||
|
"msg": "", //解析提示文本
|
||||||
|
"count": res.data.list.total,//解析数据长度
|
||||||
|
"data": res.data.list.list//解析数据列表
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//点击查询按钮,重载表格
|
||||||
|
$('#searchBtn').on('click', function () {
|
||||||
|
table.reload('informationTableAll', {
|
||||||
|
method: 'get',
|
||||||
|
where: {
|
||||||
|
content: $("#content").val()
|
||||||
|
},
|
||||||
|
page: {
|
||||||
|
curr: 1
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
table.on('toolbar(informationTable)', function (obj) {
|
||||||
|
switch (obj.event) {
|
||||||
|
case 'add':
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: "添加文件名",
|
||||||
|
fix: false, //不固定
|
||||||
|
maxmin: true,
|
||||||
|
skin: 'layui-layer-molv',
|
||||||
|
area: ['45%', '70%'],
|
||||||
|
content: './addThickness.jsp',
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
});
|
||||||
|
table.on('tool(informationTable)', function (obj) {
|
||||||
|
let data1 = obj.data;
|
||||||
|
if (obj.event === 'edit') {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: "修改文件名",
|
||||||
|
area: ['45%', '70%'],
|
||||||
|
skin: 'layui-layer-molv',
|
||||||
|
content: './addThickness.jsp',
|
||||||
|
success: function (layero, index) {
|
||||||
|
var body = layer.getChildFrame('body', index);
|
||||||
|
body.find('#id').val(data1.id);
|
||||||
|
body.find('input[name="title"]').val(data1.title);
|
||||||
|
body.find('input[name="memo"]').val(data1.memo);
|
||||||
|
body.find('textarea[name="content"]').val(data1.content);
|
||||||
|
|
||||||
|
layui.form.render();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (obj.event === 'view') {
|
||||||
|
// 在此处输入 layer 的任意代码
|
||||||
|
navigator.clipboard.writeText(data.content);
|
||||||
|
layer.msg('复制成功!', {icon: 6, offset: 'auto', time: 1000});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Посилання в новій задачі
Заблокувати користувача