Browse Source

修改移动端功能页面

lwx_dev
erdanergou 3 years ago
parent
commit
74b0e6b25f
  1. 155
      src/main/resources/templates/pages/self/userAuthorityMenus.html
  2. 6
      target/classes/templates/pages/depository/table-in_mobile.html
  3. 48
      target/classes/templates/pages/depository/table-out.html

155
src/main/resources/templates/pages/self/userAuthorityMenus.html

@ -12,7 +12,7 @@
</head>
<body>
<style>
.layui-colla-content:before,.layui-colla-content:after{
.layui-colla-content:before, .layui-colla-content:after {
content: "";
display: block;
clear: both;
@ -28,15 +28,14 @@
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
layui.use(['layer', 'miniTab', 'echarts','element'], function () {
layui.use(['layer', 'miniTab', 'echarts', 'element'], function () {
var $ = layui.jquery,
layer = layui.layer,
element = layui.element,
miniTab = layui.miniTab;
miniTab.listen();
$(function () {
/*$(function () {
$.ajax({
url: "/index/menus",
type: 'get',
@ -52,7 +51,7 @@
let resultChild = '<div class="layui-collapse"> ' +
'<div class="layui-colla-item">' +
'<h2 class="layui-colla-title">' + menuInfoElement.title + '</h2>' +
'<div class="layui-colla-content" >';
'<div class="layui-colla-content layui-show" >';
resultChild += menuItem;
resultChild += '</div></div></div>';
menuItem = resultChild;
@ -97,7 +96,7 @@
let resultChild = '<div class="layui-collapse"> ' +
'<div class="layui-colla-item">' +
'<h2 class="layui-colla-title">' + data.title + '</h2>' +
'<div class="layui-colla-content" >';
'<div class="layui-colla-content layui-show" >';
for (let i = 0; i < childList.length; i++) {
let childMenuList = createChildMenuList(childList[i]);
resultChild += childMenuList;
@ -115,6 +114,150 @@
result = childItem_out + childItem_a + childItem_i + childItem_cite;
}
return result;
}*/
$(function () {
$.ajax({
url: "/index/menus",
type: 'get',
dataType: 'json',
contentType: "application/json;charset=utf-8",
success: function (data) {
let menuInfo = data.menuInfo;
for (let i = 0; i < menuInfo.length; i++) {
let menuInfoElement = menuInfo[i];
if (menuInfoElement.href === '') {
let menuItem = createMenuList(menuInfoElement);
if (menuInfoElement.title.indexOf("辅助管理") !== -1) {
let resultChild = '<div class="layui-collapse"> ' +
'<div class="layui-colla-item">' +
'<h2 class="layui-colla-title">' + menuInfoElement.title + '</h2>' +
'<div class="layui-colla-content layui-show" >';
resultChild += menuItem;
resultChild += '</div></div></div>';
menuItem = resultChild;
}
$("#layuimini-authority").append(menuItem);
element.render();
}
}
}
})
});
// 用于构造菜单列表
function createMenuList(data) {
// 获取子菜单
let childList = data.child;
// 如果存在子菜单
if (childList.length > 0) {
// 循环子菜单
// 定义结果
let result = '';
// 设置添加</div>标志
let addEndDiv = true;
// 设置刷新标志
let flush = false;
// 定义暂存结果
let tempItem = '';
for (let i = 0; i < childList.length; i++) {
// 遍历子菜单
let childListElement = childList[i];
if (childListElement.href.indexOf("my_") !== -1) {
// 如果是我的任务,我的申请跳过
continue;
}
if (childListElement.title === "申请提交") {
// 如果是申请提交,直接添加</div>并完成本次循环
result += createChildMenuList(childListElement, result);
result += '</div></div></div>';
continue;
}
if (childListElement.title.indexOf("入") !== -1 || childListElement.title.indexOf("出") !== -1) {
// 如果是出入库管理
tempItem = createChildMenuList(childListElement, tempItem);
// 暂时不需要添加结尾div
addEndDiv = false;
} else {
// 如果不是,根据刷新标志判断是否添加结尾div
addEndDiv = !flush;
}
if (addEndDiv) {
// 如果需要添加
if (tempItem !== "") {
// 如果暂存项目不为空
tempItem += '</div></div></div>';
}
// 将暂存结果添加到结果中
result += tempItem;
// 将暂存设置为空
tempItem = '';
// 设置刷新标志为真
flush = true;
}
if (flush) {
// 设置添加结尾div标志为假
addEndDiv = false;
if (data.title === "辅助管理") {
// 如果是辅助管理菜单
tempItem += createChildMenuList(childListElement, tempItem);
} else {
// 如果不是辅助管理菜单
tempItem = createChildMenuList(childListElement, tempItem);
}
if (i === childList.length - 1) {
// 如果到结尾
result += (tempItem + '</div></div></div>');
}
}
}
return result;
}
}
// 用于构造子菜单列表
function createChildMenuList(data, result) {
// 获取当前子菜单
let childList = data.child;
// 定义返回结果
// 如果存在子菜单
if (childList !== undefined && childList !== null && childList.length > 0) {
let title = '';
if(data.title.indexOf("入") !== -1 || data.title.indexOf("出") !== -1){
title = "出入库管理";
}else if(data.title.indexOf("申请提交") !== -1){
title = "申请提交"
}else{
title = "仓库管理";
}
let resultChild = '<div class="layui-collapse"> ' +
'<div class="layui-colla-item">' +
'<h2 class="layui-colla-title">' + title + '</h2>' +
'<div class="layui-colla-content layui-show" >';
if (result.indexOf("layui-collapse") === -1) {
result += resultChild;
}
for (let i = 0; i < childList.length; i++) {
let childMenuList = createChildMenuList(childList[i], result);
result += childMenuList;
}
return result;
} else {
// 如果不存在子菜单
// 构造标签
let childItem_out = '<div class="layuimini-authority-content-item layuimini-qiuck-module">';
let childItem_a = '<a href="javascript:;" layuimini-content-href="' + data.href + '" data-title="' + data.title + '" data-icon="' + data.icon + '">';
let childItem_i = '<i class="' + data.icon + '"></i>';
let childItem_cite = ' <cite>' + data.title + '</cite></a></div>';
return childItem_out + childItem_a + childItem_i + childItem_cite;
}
}

6
target/classes/templates/pages/depository/table-in_mobile.html

@ -8,10 +8,13 @@
<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">
<a href="javascript:" data-refresh="刷新"><i class="fa fa-refresh"></i></a>
<div class="layuimini-main">
<div class="layui-collapse">
<div class="layui-colla-item">
<h2 class="layui-colla-title">搜索</h2>
@ -97,10 +100,11 @@
}
layui.use(['form', 'flow', 'laydate'], function () {
layui.use(['form', 'flow', 'laydate','miniAdmin'], function () {
var $ = layui.jquery,
form = layui.form,
flow = layui.flow,
miniAdmin = layui.miniAdmin;
laydate = layui.laydate;
let takingPre = 0;

48
target/classes/templates/pages/depository/table-out.html

@ -78,7 +78,7 @@
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 添加</button>
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete"
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete" id="delete"
th:style="'display:'+${display}"> 删除
</button>
</div>
@ -165,6 +165,39 @@
});
};
let cols = [
{type: "checkbox", width: 50},
{title: '申请编码', width: 150, templet: '#applicationOutCode'},
{field: 'mname', width: 150, title: '物料名称'},
{field: 'mcode', width: 150, title: '存货编码'},
{field: 'quantity', width: 150, title: '数量', sort: true},
{field: 'depositoryName', width: 150, title: '仓库名称'},
{field: 'state', width: 150, title: '流程状态'},
{
field: 'pass', title: '是否完成出库', minWidth: 120, templet: function (d) {
if (d.pass === 1) {
return "是";
} else {
return "否";
}
}
},
{field: 'applicantName', width: 150, title: '申请人'},
{field: 'applicantTime', width: 200, title: '申请时间', sort: true},
{
field: 'istransfer', title: '是否为转移申请', minWidth: 120, templet: function (d) {
if (d.istransfer === 1) {
return "是";
} else if (d.istransfer === 2) {
return "否";
}
}
},
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
];
let flagForReload = true;
//日期
laydate.render({
elem: '#startDate'
@ -206,7 +239,6 @@
{field: 'mname', width: 150, title: '物料名称'},
{field: 'mcode', width: 150, title: '存货编码'},
{field: 'quantity', width: 150, title: '数量', sort: true},
{field: 'price', title: '金额', minWidth: 150, sort: true},
{field: 'depositoryName', width: 150, title: '仓库名称'},
{field: 'state', width: 150, title: '流程状态'},
{
@ -236,7 +268,17 @@
limit: 10,
page: true,
skin: 'line',
done: function () {
done: function (res, curr, count) {
let display = $("#delete").css("display");
if(display !== "none"){
if (flagForReload) {
flagForReload = false;
let col = {field: 'price', title: '金额', minWidth: 150, sort: true};
cols.splice(6, 0, col);
table.reload('currentTableId', {cols: [cols]});
}
}
}
});

Loading…
Cancel
Save