refactor(api): 重构安全系统菜单结构并优化相关功能

- 调整菜单结构,合并相似功能模块
- 新增工程物料统计功能
- 优化采购发货流程,移除不必要的验证- 更新UI样式,调整侧边栏宽度
This commit is contained in:
syruan 2025-05-25 12:44:28 +08:00
parent 41039bb22d
commit 1cbf2e49f3
8 changed files with 579 additions and 62 deletions

View File

@ -16,9 +16,9 @@
"target": "_self",
"child": [
{
"title": "系统管理",
"title": "安全系统基础管理",
"href": "",
"icon": "fa fa-book",
"icon": "fa fa-cog",
"target": "_self",
"child": [
{
@ -28,36 +28,10 @@
"target": "_self"
},
{
"title": "审核人员配置",
"href": "page/system/audit_user_set_list.html",
"icon": "fa fa-shield",
"target": "_self"
}
]
},
{
"title": "基础管理",
"href": "",
"icon": "fa fa-cog",
"target": "_self",
"child": [
{
"title": "类型管理",
"title": "安全用品物资类型",
"href": "page/aq_basic/type_list.html",
"icon": "fa fa-asterisk",
"target": "_self"
},
{
"title": "供应商管理",
"href": "page/aq_basic/supplier_list.html",
"icon": "fa fa-university",
"target": "_self"
},
{
"title": "框架合同",
"href": "page/aq_basic/framework_contract_list.html",
"icon": "fa fa-file-o",
"target": "_self"
}
]
},
@ -80,27 +54,39 @@
"target": "_self"
},
{
"title": "采购发货",
"title": "调拨 / 发货",
"href": "page/aq_demand_plan/send_out_list.html",
"icon": "fa fa-shield",
"target": "_self"
},
{
"title": "计划审核人员配置",
"href": "page/system/audit_user_set_list.html",
"icon": "fa fa-shield",
"target": "_self"
}
]
},
{
"title": "库存管理",
"title": "安全用品库存管理",
"href": "",
"icon": "fa fa-th",
"target": "_self",
"child": [
{
"title": "库存统计",
"title": "工程领退台账",
"href": "page/aq_inventory/project_material_statistics.html",
"icon": "fa fa-th-large",
"target": "_self"
},
{
"title": "安全用品库存统计",
"href": "page/aq_inventory/inventory_count_list.html",
"icon": "fa fa-th-large",
"target": "_self"
},
{
"title": "库存盘点",
"title": "安全用品库存盘点",
"href": "page/aq_inventory/inventory_take_stock.html",
"icon": "fa fa-th-large",
"target": "_self"
@ -108,19 +94,19 @@
]
},
{
"title": "退料管理",
"title": "安全用品退料",
"href": "",
"icon": "fa fa-th",
"target": "_self",
"child": [
{
"title": "退料清点",
"title": "安全用品退料清点",
"href": "page/aq_back_material/back_material_list.html",
"icon": "fa fa-th-large",
"target": "_self"
},
{
"title": "退料检验",
"title": "安全用品退料检验",
"href": "page/aq_back_material/back_check.html",
"icon": "fa fa-th-large",
"target": "_self"
@ -128,11 +114,23 @@
]
},
{
"title": "结算管理",
"title": "供应商管理",
"href": "",
"icon": "fa fa-th",
"target": "_self",
"child": [
{
"title": "安全用品供应商",
"href": "page/aq_basic/supplier_list.html",
"icon": "fa fa-university",
"target": "_self"
},
{
"title": "供应商框架合同",
"href": "page/aq_basic/framework_contract_list.html",
"icon": "fa fa-file-o",
"target": "_self"
},
{
"title": "供应商结算统计",
"href": "page/aq_settlement/settlement_list.html",

97
css/custom-sidebar.css Normal file
View File

@ -0,0 +1,97 @@
/* 自定义侧边栏宽度样式 */
/* 修改左侧菜单宽度为250px */
.layui-side {
width: 232px !important;
}
.layui-layout-admin .layui-side {
width: 232px !important;
}
/* 修改菜单容器和列表的宽度 */
.layuimini-menu-left {
width: 232px !important;
}
.layuimini-menu-left > ul {
width: 232px !important;
}
.layuimini-menu-left .layui-nav {
width: 232px !important;
}
.layuimini-menu-left .layui-nav-item {
width: 232px !important;
}
/* 修改子菜单的宽度 */
.layuimini-menu-left .layui-nav-child {
width: 232px !important;
}
.layuimini-menu-left .layui-nav-child dd {
width: 232px !important;
}
/* 调整主体内容区域的左边距 */
.layui-body {
left: 232px !important;
}
.layui-layout-admin .layui-body {
left: 232px !important;
}
/* 调整logo区域宽度 */
.layui-layout-admin .layui-logo {
width: 232px !important;
}
/* 调整底部区域的左边距 */
.layui-layout-admin .layui-footer {
left: 232px !important;
}
/* 调整layuimini相关样式 */
.layui-layout-left {
left: 232px !important;
}
.layuimini-tool {
left: 255px !important;
}
/* 调整侧边栏滚动区域 */
.layui-side-scroll {
width: 240px !important;
}
/* 响应式设计调整 */
@media screen and (min-width: 1025px) {
.layuimini-mini .layui-layout-admin .layui-body {
left: 60px !important;
}
.layuimini-mini .layui-side {
width: 60px !important;
}
/* 缩放状态下的菜单宽度 */
.layuimini-mini .layuimini-menu-left {
width: 60px !important;
}
.layuimini-mini .layuimini-menu-left > ul {
width: 60px !important;
}
}
/* 手机端适配 */
@media screen and (max-width: 1024px) {
.layuimini-all .layui-layout-admin .layuimini-menu-left,
.layuimini-all .layui-header .layuimini-logo {
left: -250px !important;
}
}

View File

@ -59,7 +59,7 @@
}
.layui-layout-left {
left: 295px !important;
left: 345px !important;
}
.layui-nav.layui-layout-left.layuimini-header-menu.layuimini-pc-show {
@ -99,7 +99,7 @@
.layuimini-tool {
position: absolute !important;
top: 0;
left: 235px;
left: 285px;
width: 60px;
height: 100%;
line-height: 60px;
@ -795,7 +795,7 @@
/**菜单缩放*/
.layuimini-mini .layuimini-menu-left .layui-nav-more,.layuimini-mini .layuimini-menu-left .layui-nav-child{
display: none;!important;
display: none !important;
}
}

View File

@ -155,16 +155,7 @@ function beforeSubmitApply() {
if (!l.supId) {
return layer.msg('序号为' + (i + 1) + '的数据,未选择供应商', { icon: 7 });
}
if (!l.ccDay) {
return layer.msg('序号为' + (i + 1) + '的数据,未选择出厂日期', { icon: 7 });
}
if (!l.jyDay) {
return layer.msg('序号为' + (i + 1) + '的数据,未选择检验日期', { icon: 7 });
}
}
// if (parseInt(o.needNum) < (cgNum + lkNum)) { // 采购量 大于需求量
// return layer.msg('序号为' + (i + 1) + '的数据,采购量和利库量不能大于需要量', { icon: 7 });
// }
}
openIframeByParamObj("quickAddForm", "采购发货确认", "./send_out_confirm.html", "92%", "92%", dataList);
}

View File

@ -1,4 +1,3 @@
function setBaseTable(results) {
let html = "";
if (results && results.length > 0) {
@ -45,15 +44,14 @@ function setFormInput(value, type, id) {
setSelectData(id) +
'</select>';
} else if (type === 4) { // 出厂日期
html += '<input class="layui-input cjDate cjDate' + id + '" modelId=' + id + ' name="cjDate" readonly lay-verify="required">';
html += '<input class="layui-input cjDate cjDate' + id + '" modelId=' + id + ' name="cjDate" readonly>';
} else if (type === 5) { // 检验日期
html += '<input class="layui-input jyDate jyDate' + id + '" modelId=' + id + ' name="jyDate" readonly lay-verify="required">';
html += '<input class="layui-input jyDate jyDate' + id + '" modelId=' + id + ' name="jyDate" readonly>';
} else if (type === 6) { // 备注
html += '<input class="layui-input remark' + id + '" modelId=' + id + ' placeholder="请输入备注" name="remark" value="' + setNullValue(value) + '" maxLength="60" lay-affix="clear"></input>';
}
html += '</div></form>';
return html;
}
function setSelectData(modelId) {

View File

@ -0,0 +1,290 @@
let form, table;
let tableIns;
let pageNum = 1; // 定义分页
layui.use(["form", "table"], function () {
form = layui.form;
table = layui.table;
initTable();
getStatistics();
});
// 数据概览
function getStatistics() {
let encryptedData = {};
let url = dataUrl + 'backstage/projectMaterial/getStatistics?encryptedData=' + encodeURIComponent(JSON.stringify(encryptedData));
ajaxRequest(url, "GET", null, true, function () {
}, function (result) {
if (result.code === 200) {
setNum(result.data);
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
// 数据概览赋值
function setNum(obj) {
$('#num').html(parseInt(obj.projectCount || 0));
$('#num2').html(parseInt(obj.totalPurchaseCount || 0));
$('#num3').html(parseInt(obj.totalOutCount || 0));
$('#num4').html(parseInt(obj.totalShortageCount || 0));
}
}
// 查询/重置
function queryTable(type) {
if (type === 1) {
let projectName = $('#projectName').val();
let flag = checkValue(projectName);
if (flag) {
$('#projectName').val('');
return layer.msg('工程名称查询包含特殊字符,请重新输入', { icon: 2 });
}
let useUnit = $('#useUnit').val();
let flag2 = checkValue(useUnit);
if (flag2) {
$('#useUnit').val('');
return layer.msg('领用单位查询包含特殊字符,请重新输入', { icon: 2 });
}
reloadTable(1);
} else if (type === 2) {
$('#projectName').val('');
$('#useUnit').val('');
$('#isShortage').val('');
layui.form.render();
reloadTable(1);
}
}
// 刷新页面数据
function reloadData() {
reloadTable(1);
getStatistics();
}
// 重载表格
function reloadTable(pageNum) {
table.reload("currentTableId", {
where: {
encryptedData: JSON.stringify({
'proName': $('#projectName').val(),
'isShortage': $('#isShortage').val()
}),
},
},
);
}
// 初始化表格
function initTable() {
tableIns = table.render({
elem: "#currentTableId",
id: 'currentTableId',
headers: {
authorization: sessionStorage.getItem("gz-token"),
},
// height: "full-300",
url: dataUrl + "backstage/inventoryCount/queryLedgerListByProjectAndModel",
where: {
encryptedData: JSON.stringify({
'proName': $('#projectName').val(),
'leaseUnit': $('#useUnit').val(),
'isShortage': $('#isShortage').val()
}),
},
request: {
pageName: 'pageNum',
limitName: 'pageSize'
},
parseData: function (res) { // res 即为原始返回的数据
if(res.code === 401){
closeWindowOpen();
}
return {
"code": 0, // 解析接口状态
"msg": '获取成功', // 解析提示文本
"count": res.total, // 解析数据长度
"data": res.list // 解析数据列表
};
},
cols: [
[
{
width: '5%',
title: "序号",
align: "center",
templet: function (d) {
return d.LAY_NUM;
},
},
{
field: "proName",
width: '10%',
title: "工程名称",
unresize: true,
align: "center",
sort: true,
},
{
field: "type",
width: '10%',
title: "物资类型",
unresize: true,
align: "center",
sort: true,
},
{
field: "name",
width: '10%',
title: "物资名称",
unresize: true,
align: "center",
sort: true,
},
{
field: "model",
width: '10%',
title: "规格型号",
unresize: true,
align: "center",
sort: true,
},
{
field: "unit",
width: '6%',
title: "单位",
unresize: true,
align: "center",
sort: true,
},
{
field: "needNum",
width: '8%',
title: "需用量",
unresize: true,
align: "center",
sort: true,
templet: function (d) {
return d.totalCg || 0;
},
},
{
field: "totalCg",
width: '8%',
title: "采购量",
unresize: true,
align: "center",
sort: true,
templet: function (d) {
return d.totalCg || 0;
},
},
{
field: "totalLk",
title: "利库量",
width: '8%',
unresize: true,
align: "center",
sort: true,
templet: function (d) {
return d.totalLk || 0;
},
},
{
field: "totalCk",
width: '8%',
title: "出库总量",
unresize: true,
align: "center",
sort: true,
templet: function (d) {
return d.totalCk || 0;
},
},
{
field: "totalBack",
width: '8%',
title: "退还数量",
unresize: true,
align: "center",
sort: true,
templet: function (d) {
return d.totalBack || 0;
},
},
{
field: "totalDiff",
width: '8%',
title: "差缺量",
unresize: true,
align: "center",
sort: true,
templet: function (d) {
let totalDiff = d.totalDiff || 0;
if (totalDiff > 0) {
return '<span style="background-color: #f56c6c; color: #fff; border-radius: 5px; padding: 2px 5px;">' + totalDiff + '</span>';
}
return totalDiff;
},
},
],
],
limits: [10, 20, 30, 50, 100],
limit: 50,
page: false,
done: function (res, curr, count) {
pageNum = tableIns.config.page.curr;
table.resize("currentTableId");
},
});
}
// 查看详情
function viewDetail(id) {
layer.msg('查看工程物料详情功能待开发', { icon: 1 });
// 这里可以添加查看详情的逻辑,比如打开新窗口或弹窗显示详细信息
// openIframe('工程物料详情', 'page/aq_inventory/project_material_detail.html?id=' + id);
}
// 导出Excel
function exportExcel() {
let projectName = $('#projectName').val();
let isShortage = $('#isShortage').val();
let params = {
'proName': projectName,
'isShortage': isShortage
};
let encryptedData = JSON.stringify(params);
let url = dataUrl + 'backstage/inventoryCount/exportLedgerListByProjectAndModel?encryptedData=' + encodeURIComponent(encryptedData);
// 创建隐藏的下载链接
let link = document.createElement('a');
link.href = url;
link.download = '工程物料统计_' + new Date().getTime() + '.xlsx';
link.style.display = 'none';
// 添加授权头并下载
fetch(url, {
method: 'GET',
headers: {
'authorization': sessionStorage.getItem("gz-token")
}
}).then(response => {
if (response.ok) {
return response.blob();
}
throw new Error('导出失败');
}).then(blob => {
let downloadUrl = window.URL.createObjectURL(blob);
link.href = downloadUrl;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(downloadUrl);
layer.msg('导出成功', { icon: 1 });
}).catch(error => {
layer.msg('导出失败:' + error.message, { icon: 2 });
});
}

View File

@ -53,17 +53,17 @@
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label required" style="width: 60px !important;">收货地址</label>
<label class="layui-form-label" style="width: 60px !important;">收货地址</label>
<div class="layui-input-inline" style="width: 400px !important;">
<input class="layui-input" name="address" id="address" autocomplete="off"
lay-verify="required" maxlength="30" lay-affix="clear">
maxlength="30" lay-affix="clear">
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label required" style="width: 100px !important;">备注</label>
<label class="layui-form-label" style="width: 100px !important;">备注</label>
<div class="layui-input-inline" style="width: 764px;">
<textarea placeholder="请输入备注" lay-verify="required" id="remark" name="remark"
<textarea placeholder="请输入备注" id="remark" name="remark"
class="layui-textarea" maxLength="255" lay-affix="clear"></textarea>
</div>
</div>
@ -78,9 +78,8 @@
<img src="../../../images/add.png">
</div>
<div class="layout" style="flex-direction: column;margin-left: 2px;">
<p style="color: red;">提示最多上传5个附件</p>
<p style="color: red;">支持格式:jpg、png、jpeg</p>
<p style="color: red;">doc、docx、pdf、xlsx、xls</p>
<p style="color: red;">必传项:请上传出门条</p>
<p style="color: red;">可选项: 领料单、装卸货照片、车牌号</p>
</div>
</blockquote>
</div>
@ -151,8 +150,8 @@
<th style="width: 6%" class="center"><span style="color: red;">*</span>采购量</th>
<th style="width: 6%" class="center"><span style="color: red;">*</span>利库量</th>
<th style="width: 15%" class="center"><span style="color: red;">*</span>供应商</th>
<th style="width: 9%" class="center"><span style="color: red;">*</span>出厂日期</th>
<th style="width: 9%" class="center"><span style="color: red;">*</span>检验日期</th>
<th style="width: 9%" class="center">出厂日期</th>
<th style="width: 9%" class="center">检验日期</th>
<th style="width: 10%" class="center">备注</th>
</tr>
</thead>

View File

@ -0,0 +1,144 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>工程物料统计</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="../../lib/layui-v2.9.18/layui/css/layui.css" media="all">
<link rel="stylesheet" href="../../css/font.css" media="all">
<link rel="stylesheet" href="../../css/public.css" media="all">
<link rel="stylesheet" href="../../css/demandPlan/delivery_list.css" media="all">
</head>
<style>
#data-overview {
width: 100%;
height: 80px;
justify-content: space-around;
}
.table-box {
height: calc(100% - 280px);
}
.unit-class {
margin: 10px 0 0 10px !important;
color: #666;
}
</style>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<fieldset class="table-search-fieldset" style="display: none">
<legend>数据概览</legend>
<div id="data-overview" class="layout">
<div class="data-detail">
<div class="layout" style="justify-content: space-between;">
<div class="layout num-title">
<p>工程总数</p>
<div class="layout">
<p class="num-style" id="num">0</p>
<p class="unit-class"></p>
</div>
</div>
<div>
<img src="../../images/accessory/three.png">
</div>
</div>
</div>
<div class="data-detail">
<div class="layout" style="justify-content: space-between;">
<div class="layout num-title">
<p>总采购数量</p>
<div class="layout">
<p class="num-style" id="num2">0</p>
<p class="unit-class"></p>
</div>
</div>
<div>
<img src="../../images/accessory/four.png">
</div>
</div>
</div>
<div class="data-detail">
<div class="layout" style="justify-content: space-between;">
<div class="layout num-title">
<p>总出库数量</p>
<div class="layout">
<p class="num-style" id="num3">0</p>
<p class="unit-class"></p>
</div>
</div>
<div>
<img src="../../images/accessory/five.png">
</div>
</div>
</div>
<div class="data-detail">
<div class="layout" style="justify-content: space-between;">
<div class="layout num-title">
<p>总差缺量</p>
<div class="layout">
<p class="num-style" id="num4">0</p>
<p class="unit-class"></p>
</div>
</div>
<div>
<img src="../../images/accessory/two.png">
</div>
</div>
</div>
</div>
</fieldset>
<fieldset class="table-search-fieldset">
<legend>搜索信息</legend>
<div style="margin: 10px 10px 10px 10px">
<form class="layui-form layui-form-pane" action="#" onsubmit="return false;">
<div class="layui-form-item">
<div class="layui-inline">
<div class="layui-input-inline" style="width: 200px;">
<input type="text" name="projectName" id="projectName" autocomplete="off"
class="layui-input" lay-affix="clear" placeholder="输入工程名称" maxlength="30">
</div>
</div>
<div class="layui-inline">
<div class="layui-input-inline">
<select id="isShortage">
<option value="">请选择差缺状态</option>
<option value="1">有差缺</option>
<option value="2">无差缺</option>
</select>
</div>
</div>
<div class="layui-inline">
<button class="layui-btn layui-bg-blue" onclick="queryTable(1)">
<i class="layui-icon"></i> 搜 索
</button>
<button class="layui-btn layui-btn-primary" onclick="queryTable(2)" style="display: none">
<i class="layui-icon layui-icon-refresh"></i> 重 置
</button>
<button class="layui-btn layui-btn-primary" onclick="exportExcel()">
<i class="layui-icon layui-icon-download-circle"></i> 导出
</button>
</div>
</div>
</form>
</div>
</fieldset>
<div class="table-box" table-responsive style="z-index: 1;">
<table class="layui-hide" id="currentTableId" lay-filter="currentTableId2"></table>
</div>
</div>
</div>
<script src="../../lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="../../js/public.js" charset="utf-8"></script>
<script src="../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
<script src="../../js/aq_inventory/project_material_statistics.js" charset="utf-8"></script>
<script src="../../js/openIframe.js" charset="utf-8"></script>
</body>
</html>