<!DOCTYPE html>
|
<html>
|
|
<head>
|
<meta charset="utf-8">
|
<title>layuiAdmin 控制台主页一</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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
|
<style type="text/css">
|
html,
|
body {
|
height: 100%;
|
}
|
|
.ceshi {
|
display: flex;
|
justify-content: space-around;
|
}
|
|
.acls {
|
display: inline-block;
|
width: 125px;
|
height: 60px;
|
}
|
</style>
|
</head>
|
|
<body>
|
<div class="layui-fluid" style="padding: 10px;height: 97%;">
|
<div class="layui-row layui-col-space15" style="height: 100%;">
|
<div class="layui-col-md8" style="height: 100%;">
|
<!-- <div class="layui-card" style="height: 30%;">
|
<div class="layui-card-header">快捷方式</div>
|
<div class="layui-card-body">
|
|
<div class="layui-carousel layadmin-carousel layadmin-shortcut">
|
<div id="">
|
<ul class="ceshi">
|
style="float: left;margin-left: 10%;"
|
<li id="approvalBtn">
|
<div>
|
<a class="acls" lay-href="InfoSearchManage/ReportDayList.html">
|
<i style="font-size: 30px;" class="layui-icon layui-icon-console"></i>
|
<cite style="font-size: 20px;">出入库日报</cite>
|
</a>
|
</div>
|
|
<li id="approvalBtnmonth">
|
<div>
|
<a class="acls" lay-href="InfoSearchManage/ReportMonthList.html">
|
<i style="font-size: 30px;" class="layui-icon layui-icon-console"></i>
|
<cite style="font-size: 20px;">出入库月报</cite>
|
</a>
|
</div>
|
|
<li id="approvalBtnyear">
|
<div>
|
<a class="acls" lay-href="InfoSearchManage/ReportYearList.html">
|
<i style="font-size: 30px;" class="layui-icon layui-icon-console"></i>
|
<cite style="font-size: 20px;">出入库年报</cite>
|
</a>
|
</div>
|
<li id="approvalBtnSearch">
|
<div>
|
<a class="acls" lay-href="StockManage/StockSlotList.html">
|
<i style="font-size: 30px;" class="layui-icon layui-icon-log"></i>
|
<cite style="font-size: 20px;">库存查询</cite>
|
</a>
|
</div>-->
|
<!-- <li id="approvalBtnlow">
|
<div style="float: left;margin-left: 10%;">
|
<a lay-href="StockManage/LowStockSlotList.html">
|
<i style="font-size: 30px;"
|
class="layui-icon layui-icon-engine"></i>
|
<cite style="font-size: 20px;">低库存预警</cite>
|
</a>
|
</div>
|
-->
|
<!-- <li id="approvalBtnhight">
|
<div style="float: left;margin-left: 10%;">
|
<a lay-href="StockManage/ExpireStockSlotList.html">
|
<i style="font-size: 30px;"
|
class="layui-icon layui-icon-engine"></i>
|
<cite style="font-size: 20px;">超期预警</cite>
|
</a>
|
</div>
|
|
|
</ul>-->
|
<!-- <br><br><br><br> -->
|
<!-- style="float: left;margin-left: 5%;" -->
|
<!-- <ul class="ceshi">
|
<li id="approvalBtnImportB">
|
<div>
|
<a class="acls" lay-href="ImportManage/ImportBillList.html">
|
<i style="font-size: 30px;"
|
class="layui-icon layui-icon-template-1"></i>
|
<cite style="font-size: 20px;">入库单管理</cite>
|
</a>
|
</div>
|
|
<li id="approvalBtnImportO">
|
<div>
|
<a class="acls" lay-href="ImportManage/ImportOrderList.html">
|
<i style="font-size: 30px;" class="layui-icon layui-icon-cols"></i>
|
<cite style="font-size: 20px;">入库流水管理</cite>
|
</a>
|
</div>
|
|
<li id="approvalBtnExportB">
|
<div>
|
<a class="acls" lay-href="ExportManage/ExportBillList.html">
|
<i style="font-size: 30px;"
|
class="layui-icon layui-icon-template-1"></i>
|
<cite style="font-size: 20px;">出库单管理</cite>
|
</a>
|
</div>
|
|
<li id="approvalBtnExportO">
|
<div>
|
<a class="acls" lay-href="ExportManage/ExportOrderList.html">
|
<i style="font-size: 30px;" class="layui-icon layui-icon-cols"></i>
|
<cite style="font-size: 20px;">出库流水管理</cite>
|
</a>
|
</div>
|
|
</ul>
|
</div>
|
|
|
</div>
|
|
</div>
|
</div>
|
<div class="layui-col-md20" style="height: 30%;margin-bottom: 15px;padding: 2px;">
|
|
</div> -->
|
|
<!-- <div class="layui-col-md12" style="height: 70%;padding: 2px;">
|
|
</div> -->
|
<!-- 左 -->
|
<div class="layui-card" style="height: 40%;">
|
<div class="layui-card-header">每日单据(周)</div>
|
<div class="layui-card-body" style="padding: 0;height: 90%;">
|
<!-- <div class="layui-carousel layadmin-carousel layadmin-dataview">
|
|
</div> -->
|
<!-- 柱状 -->
|
<div id="zhuOrder" style="width: 100%; height: 100%; display: flex; align-items: center;justify-content: center;">
|
</div>
|
</div>
|
</div>
|
|
<div class="layui-card" style="height: 60%;">
|
<div class="layui-card-header">每日任务(周)</div>
|
<div class="layui-card-body" style="padding: 0;height: 90%;">
|
<!-- 柱状 -->
|
<div id="zhu" style="width: 100%; height: 100%; display: flex; align-items: center;justify-content: center;">
|
</div>
|
<!-- 线状 -->
|
<!-- <div>
|
<i class="layui-icon layui-icon-loading1 layadmin-loading"></i>
|
<div style="background-color: blue;width: 100%;height: 100%;"></div>
|
<div id="xian" style="width: 1080px; height: 322px; margin: 0;">
|
</div>
|
|
</div> -->
|
</div>
|
</div>
|
</div>
|
|
<!-- 右 -->
|
<div class="layui-col-md4" style="height: 100%;">
|
|
<div class="layui-card" style="height: 40%;">
|
<div class="layui-card-header">储位占比</div>
|
<div class="layui-card-body">
|
<div class="layui-carousel layadmin-carousel layadmin-backlog">
|
<ul class="layui-row layui-col-space10">
|
<li class="layui-col-xs6">
|
<a class="layadmin-backlog-body">
|
<h4>总储位</h4>
|
<p><cite id="EmptyLocat">0</cite></p>
|
</a>
|
</li>
|
<li class="layui-col-xs6">
|
<a class="layadmin-backlog-body">
|
<h4>空托盘</h4>
|
<p><cite id="HaveLocat">0</cite></p>
|
</a>
|
</li>
|
<li class="layui-col-xs6">
|
<a class="layadmin-backlog-body">
|
<h4>空储位</h4>
|
<p><cite id="AsnLocat">0</cite></p>
|
</a>
|
</li>
|
<li class="layui-col-xs6">
|
<a class="layadmin-backlog-body">
|
<h4>有物品</h4>
|
<p><cite id="SoLocat">0</cite></p>
|
</a>
|
</li>
|
<li class="layui-col-xs6">
|
<a class="layadmin-backlog-body">
|
<h4>入库中</h4>
|
<p><cite id="EnterLocat">0</cite></p>
|
</a>
|
</li>
|
<li class="layui-col-xs6">
|
<a class="layadmin-backlog-body">
|
<h4>出库中</h4>
|
<p><cite id="OutLocat">0</cite></p>
|
</a>
|
</li>
|
</ul>
|
</div>
|
</div>
|
</div>
|
|
<div class="layui-card" style="height: 60%;">
|
<div class="layui-card-header">储位占比图</div>
|
<div class="layui-card-body" style="padding: 0;height: 90%;">
|
<!-- 储位状态占比饼图 -->
|
<div id="yuan" style="width: 100%; height: 100%;display: flex; align-items: center;justify-content: center;">
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<script src="../../layuiadmin/layui/layui.js?t=1"></script>
|
<script src="../../layuiadmin/layui/layui.js?t=1"></script>
|
<script src="../../js/jquery-3.5.1.min.js"></script>
|
<script src="../../js/jquery.cookie.js"></script>
|
<script src="../../js/public.js"></script>
|
<script>
|
|
layui.config({
|
base: '../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
|
index: 'lib/index', //主入口模块
|
|
});
|
layui.extend({
|
echarts:'{/}../../layuiadmin/echarts/echars' // {/}的意思即代表采用自有路径,即不跟随 base 路径
|
})
|
layui.use(['index', 'console', 'table', 'laypage', 'layer', 'echarts'], function () {
|
var table = layui.table,
|
form = layui.form,
|
laypage = layui.laypage,
|
layer = layui.layer,
|
echarts = layui.echarts;
|
|
//获取储位占用量
|
sendData(IP + "/IndexEchar/LocatInventoryA", {}, 'post', function (res) {
|
if (res.code == 0) { //成功
|
var list = res.data;
|
console.log(list);
|
res.data.forEach(item => {
|
//总储位
|
if(item.LocatStatus == '99')
|
{
|
$("#EmptyLocat").html(item.LocatNum);
|
console.log(0,item.LocatNum)
|
}
|
//空托盘
|
else if(item.LocatStatus == '9')
|
{
|
$("#HaveLocat").html(item.LocatNum);
|
console.log(1,item.LocatNum)
|
}
|
//空储位
|
else if(item.LocatStatus == '0')
|
{
|
$("#AsnLocat").html(item.LocatNum);
|
console.log(2,item.LocatNum)
|
}
|
//有物品
|
else if(item.LocatStatus == '1')
|
{
|
$("#SoLocat").html(item.LocatNum);
|
console.log(3,item.LocatNum)
|
}
|
//入库中
|
else if(item.LocatStatus == '2')
|
{
|
$("#EnterLocat").html(item.LocatNum);
|
console.log(4,item.LocatNum)
|
}
|
//出库中
|
else if(item.LocatStatus == '3')
|
{
|
$("#OutLocat").html(item.LocatNum);
|
console.log(5,item.LocatNum)
|
}
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
});
|
|
|
//获取储位占比图
|
sendData(IP + "/Sys/GetStorageProportion?WareHouseNo=" + 'W01', {}, 'get', function (res) {
|
if (res.code == 0) {
|
//$("#ASoNum").html(res.data.ASoTaskNum);
|
//$("#SoNum").html(res.data.SoTaskNum);
|
|
var LayerName = res.data[0].warehouseNo;
|
|
var list = res.data;
|
//0:空储位 1:有物品 2:入库中 3:出库中 4:移入中 5:移出中 6: 损坏\屏蔽
|
var key = ['空储位', '有物品', '入库中', '出库中', '损坏\屏蔽'];
|
// var value = [];
|
// var a = 0;
|
// for (var i = 0; i < key.length; i++) {
|
|
// if (a < list.length) {
|
// if (i == list[a].Status) {
|
// value.push(list[a].StatusNum)
|
// a = a + 1;
|
// }
|
// }
|
// else {
|
// value.push(0)
|
// }
|
// }
|
var value = [0,0,0,0,0,0,0];
|
list.forEach(item => {
|
value[item.Status] = item.StatusNum;
|
});
|
|
this.chartLine1 = echarts.init(document.getElementById("yuan"));
|
var option2 = {
|
color: [
|
'#5470c6', //空储位
|
'#91cc75', //有物品
|
'#ffdc60', //入库中
|
'#ee6666', //出库中
|
// '#ffff7f', //移入中
|
// '#ee23ee' //移出中
|
'#808080', //损坏屏蔽
|
],
|
title: {
|
text: LayerName,
|
left: 'center',
|
//top: '15.5%'
|
},
|
tooltip: {
|
trigger: 'item',
|
formatter: '{a} <br/>{b} : {c} ({d}%)'
|
//formatter: '{a} <br/>{b} ({d}%)'
|
},
|
legend: {
|
// 点击隐藏\显示
|
orient: 'vertical',
|
left: 'left'
|
},
|
series: [{
|
name: '储位数量及占比',
|
type: 'pie',
|
radius: '79%',
|
data:
|
[
|
{ value: value[0], name: key[0] },
|
{ value: value[1], name: key[1] },
|
{ value: value[2], name: key[2] },
|
{ value: value[3], name: key[3] },
|
// { value: value[4], name: key[4] },
|
// { value: value[5], name: key[5] },
|
{ value: value[6], name: key[4] }, //损坏\屏蔽
|
],
|
// emphasis: {
|
// itemStyle: {
|
// shadowBlur: 10,
|
// shadowOffsetX: 0,
|
// shadowColor: 'rgba(255, 0, 0, 0.5)'
|
// }
|
// }
|
}],
|
};
|
|
this.chartLine1.setOption(option2);
|
|
} else {
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000
|
}, function () { })
|
}
|
});
|
|
//获取任务量(柱状)
|
sendData(IP + "/IndexEchar/DailyInventory", {}, 'post', function (res) {
|
if (res.code == 0) {
|
|
var list = res.data;
|
//入库任务 1:出库任务 2:盘点任务
|
var key = [];
|
this.chartLine2 = echarts.init(document.getElementById("zhu"));
|
//占比
|
var roarylist = key;
|
//各任务状态数量
|
var status0 = []; //入库任务
|
var status1 = []; //出库任务
|
var status2 = []; //盘点任务
|
//获取
|
//总
|
for (var i = 0; i < list.length; i++) {
|
status0.push(list[i].ASoTaskNum)
|
status1.push(list[i].SoTaskNum)
|
status2.push(list[i].CheckTaskNum)
|
key.push(list[i].TaskDay)
|
}
|
// console.log("0:",status0,"1:",status1,"2:",status2);
|
option2 = {
|
tooltip: {
|
trigger: 'axis',
|
axisPointer: {
|
type: 'shadow'
|
}
|
},
|
legend: {
|
data: key
|
},
|
xAxis: [
|
{
|
type: 'category',
|
axisTick: { show: false },
|
data: roarylist
|
}
|
],
|
yAxis: [
|
{
|
type: 'value'
|
}
|
],
|
series: [
|
{
|
name: '入库任务',
|
type: 'bar',
|
barGap: 0,
|
color: '#5470c6',
|
//label: labelOption,
|
emphasis: {
|
focus: 'series'
|
},
|
data: status0
|
},
|
{
|
name: '出库任务',
|
type: 'bar',
|
color: '#91cc75',
|
//label: labelOption,
|
emphasis: {
|
focus: 'series'
|
},
|
data: status1
|
},
|
{
|
name: '盘点任务',
|
type: 'bar',
|
color: '#ffdc60',
|
//label: labelOption,
|
emphasis: {
|
focus: 'series'
|
},
|
data: status2
|
},
|
]
|
};
|
|
this.chartLine2.setOption(option2);
|
|
} else {
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000
|
}, function () { })
|
}
|
});
|
|
|
//获取单据量(柱状)
|
sendData(IP + "/IndexEchar/DailyReceipts", {}, 'post', function (res) {
|
if (res.code == 0) {
|
|
var list = res.data;
|
//入库单量 1:出库单量
|
var key = [];
|
this.chartLine2 = echarts.init(document.getElementById("zhuOrder"));
|
//占比
|
var roarylist = key;
|
//各单据数量
|
var status0 = []; //入库单量
|
var status1 = []; //出库单量
|
//获取
|
//总
|
for (var i = 0; i < list.length; i++) {
|
status0.push(list[i].ASoTaskNum)
|
status1.push(list[i].SoTaskNum)
|
key.push(list[i].TaskDay)
|
}
|
// console.log("0:",status0,"1:",status1,"2:",status2);
|
option2 = {
|
tooltip: {
|
trigger: 'axis',
|
axisPointer: {
|
type: 'shadow'
|
}
|
},
|
legend: {
|
data: key
|
},
|
xAxis: [
|
{
|
type: 'category',
|
axisTick: { show: false },
|
data: roarylist
|
}
|
],
|
yAxis: [
|
{
|
type: 'value'
|
}
|
],
|
series: [
|
{
|
name: '入库单量',
|
type: 'bar',
|
barGap: 0,
|
color: '#5470c6',
|
//label: labelOption,
|
emphasis: {
|
focus: 'series'
|
},
|
data: status0
|
},
|
{
|
name: '出库单量',
|
type: 'bar',
|
color: '#91cc75',
|
//label: labelOption,
|
emphasis: {
|
focus: 'series'
|
},
|
data: status1
|
},
|
]
|
};
|
|
this.chartLine2.setOption(option2);
|
|
} else {
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000
|
}, function () { })
|
}
|
});
|
|
//获取任务量(线状)
|
// sendData(IP + "/IndexEchar/DailyInventory", {}, 'post', function (res) {
|
// if (res.code == 0) {
|
|
// var list = res.data;
|
// //入库任务 1:出库任务 2:盘点任务
|
// var key = [];
|
// this.chartLine3 = echarts.init(document.getElementById("xian"));
|
// //占比
|
// var roarylist = key;
|
// //各任务状态数量
|
// var status0 = []; //入库任务
|
// var status1 = []; //出库任务
|
// var status2 = []; //盘点任务
|
// //获取
|
// //总
|
// for (var i = 0; i < list.length; i++) {
|
// status0.push(list[i].ASoTaskNum)
|
// status1.push(list[i].SoTaskNum)
|
// status2.push(list[i].CheckTaskNum)
|
// key.push(list[i].TaskDay)
|
// }
|
// // console.log("0:",status0,"1:",status1,"2:",status2);
|
// option3 = {
|
// tooltip: {
|
// trigger: 'axis',
|
// axisPointer: {
|
// type: 'shadow'
|
// }
|
// },
|
// legend: {
|
// data: key
|
// },
|
// xAxis: [
|
// {
|
// type: 'category',
|
// axisTick: { show: false },
|
// data: roarylist
|
// }
|
// ],
|
// yAxis: [
|
// {
|
// type: 'value'
|
// }
|
// ],
|
// series: [
|
// {
|
// name: '入库任务',
|
// type: 'line',
|
// barGap: 0,
|
// color: '#5470c6',
|
// //label: labelOption,
|
// emphasis: {
|
// focus: 'series'
|
// },
|
// data: status0
|
// },
|
// {
|
// name: '出库任务',
|
// type: 'line',
|
// color: '#91cc75',
|
// //label: labelOption,
|
// emphasis: {
|
// focus: 'series'
|
// },
|
// data: status1
|
// },
|
// {
|
// name: '盘点任务',
|
// type: 'line',
|
// color: '#ffdc60',
|
// //label: labelOption,
|
// emphasis: {
|
// focus: 'series'
|
// },
|
// data: status2
|
// },
|
// ]
|
// };
|
|
// this.chartLine3.setOption(option3);
|
|
// } else {
|
// layer.msg(res.msg, {
|
// icon: 2,
|
// time: 2000
|
// }, function () { })
|
// }
|
// });
|
|
// sendData(IP + "/IndexEchar/GetCheckTask", param, 'post', function (res) {
|
// if (res.code == 0) { //成功
|
// $("#checkTask").append(res.data);
|
// } else { //不成功
|
// layer.msg(res.msg, {
|
// icon: 2,
|
// time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
// }, function () { });
|
// }
|
// });
|
// sendData(IP + "/IndexEchar/GetImportTask", param, 'post', function (res) {
|
// if (res.code == 0) { //成功
|
// $("#importTask").append(res.data);
|
// } else { //不成功
|
// layer.msg(res.msg, {
|
// icon: 2,
|
// time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
// }, function () { });
|
// }
|
// });
|
// sendData(IP + "/IndexEchar/GetExportTask", param, 'post', function (res) {
|
// if (res.code == 0) { //成功
|
// $("#exportTask").append(res.data);
|
// } else { //不成功
|
// layer.msg(res.msg, {
|
// icon: 2,
|
// time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
// }, function () { });
|
// }
|
// });
|
// sendData(IP + "/IndexEchar/GetMoveTask", param, 'post', function (res) {
|
// if (res.code == 0) { //成功
|
// $("#moveTask").append(res.data);
|
// } else { //不成功
|
// layer.msg(res.msg, {
|
// icon: 2,
|
// time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
// }, function () { });
|
// }
|
// });
|
|
// var key = []
|
// var value = []
|
// sendData(IP + "/IndexEchar/GoodListEchar", param, 'post', function (res) {
|
// if (res.code == 0) { //成功
|
// var goodList = res.data;
|
|
// for (var i in goodList) {
|
// key.push(i)
|
// value.push(goodList[i])
|
// }
|
// console.log(key);
|
// console.log(value);
|
// } else { //不成功
|
// layer.msg(res.msg, {
|
// icon: 2,
|
// time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
// }, function () { });
|
// }
|
// var echars2 = echarts.init(document.getElementById("echar"));
|
|
// var option2 = {
|
// title: {
|
// text: '物品类型占比',
|
// x: 'center',
|
// textStyle: {
|
// fontSize: 20,
|
// }
|
// },
|
// tooltip: {
|
// trigger: 'item',
|
// formatter: "{a} <br/>{b} : {c} ({d}%)"
|
// },
|
// legend: {
|
// orient: 'vertical',
|
// x: 'left',
|
// left: 'left',
|
// top: 10,
|
// itemWidth: 30,
|
|
// formatter: '{name}',
|
// data: ['成品', '辅料', '化学品', '废料'],
|
// calculble: true,
|
// },
|
|
// series: [{
|
// name: '物品占比',
|
// type: 'pie',
|
// radius: '70%', //饼图的半径大小
|
// center: ['50%', '60%'], //饼图的位置
|
// label: { //饼图图形上的文本标签
|
// normal: {
|
// show: true,
|
// labelLine: true,
|
// position: 'inner', //标签的位置
|
// textStyle: {
|
// fontWeight: 300,
|
// fontSize: 16 //文字的字体大小
|
// },
|
// formatter: '{d}%'
|
|
|
// }
|
// },
|
// // emphasis: {
|
// // itemStyle: {
|
// // shadowBlur: 10,
|
// // shadowOffsetX: 0,
|
// // shadowColor: 'rgba(0, 0, 0, 0.5)'
|
// // }
|
// // },
|
// data: [{
|
// value: value[0],
|
// name: key[0]
|
// },
|
// {
|
// value: value[1],
|
// name: key[1]
|
// },
|
// {
|
// value: value[2],
|
// name: key[2]
|
// },
|
// {
|
// value: value[3],
|
// name: key[3]
|
// }
|
// ]
|
// }]
|
// };
|
// echars2.setOption(option2);
|
// });
|
|
// $(window).resize(function () {
|
// //alert(1);
|
// this.echars2.resize();
|
// });
|
|
// $(function () {
|
// $("#approvalBtn").hide();
|
// });
|
// $(function () {
|
// $("#approvalBtnmonth").hide();
|
// });
|
// $(function () {
|
// $("#approvalBtnyear").hide();
|
// });
|
// $(function () {
|
// $("#approvalBtnlow").hide();
|
// });
|
// $(function () {
|
// $("#approvalBtnhight").hide();
|
// });
|
// $(function () {
|
// $("#approvalBtnImportB").hide();
|
// });
|
// $(function () {
|
// $("#approvalBtnImportO").hide();
|
// });
|
// $(function () {
|
// $("#approvalBtnExportB").hide();
|
// });
|
// $(function () {
|
// $("#approvalBtnExportO").hide();
|
// });
|
// $(function () {
|
// $("#approvalBtnSearch").hide();
|
// });
|
|
var element = layui.element;
|
var houseId = 0;
|
var param = {
|
Id: $.cookie('userId')
|
}
|
var xml = '';
|
|
function getchiled(data, mainId) {
|
if (data) {
|
var list = data.filter(item => item.ParentId == mainId);
|
if (list) {
|
for (var i = 0; i < list.length; i++) {
|
var id = list[i].Id;
|
//查询有无子菜单
|
var count = data.filter(item => item.ParentId == id).length;
|
if (count > 0) {
|
xml = xml +
|
'<dd>' +
|
'<a href="javascript:;">' + list[i].Name + '</a>' +
|
'<dl class="layui-nav-child">';
|
getchiled(data, id);
|
xml = xml +
|
'</dl></dd>';
|
} else {
|
xml = xml +
|
'<dd>' +
|
'<a lay-href="' + list[i].Url + '">' + list[i].Name + '</a>' +
|
'</dd>';
|
}
|
}
|
}
|
}
|
}
|
var menuList;
|
/*sendData(IP + "/Menu/GetPermission", param, 'post', function (res) {
|
|
if (res.code == 1) { //成功
|
var list = res.data.filter(item => item.Layer == 0);
|
if (list) {
|
for (var i = 0; i < list.length; i++) {
|
xml = xml +
|
'<li class="layui-nav-item">' +
|
'<a href="javascript:;" lay-tips=' + list[i].Icon +
|
' lay-direction="2">' +
|
// '<i class="layui-icon ' + list[i].Icon + '"></i>' +
|
'<span class="iconfont ' + list[i].Icon + '"></span>' +
|
'<cite>' + list[i].Name + '</cite>' +
|
'</a>';
|
var id = list[i].Id;
|
//查询有无子菜单
|
var count = res.data.filter(item => item.ParentId == id).length;
|
if (count > 0) {
|
xml = xml +
|
'<dl class="layui-nav-child">';
|
getchiled(res.data, id);
|
xml = xml +
|
'</dl>';
|
}
|
xml = xml +
|
'</li>'
|
}
|
}
|
|
|
$("#LAY-system-side-menu").append(xml);
|
element.render("#leftmenu");
|
for (var k = 0; k < res.data.length; k++) {
|
if (res.data[k].ModuleId == "f1dc303849b0421a94a8d4a80d770480") {
|
$(function () {
|
//document.getElementById("orgList1").style.display="none";
|
//document.getElementById("orgLists").style.display="none";
|
$("#approvalBtn").show();
|
});
|
}
|
if (res.data[k].ModuleId == "f1dc303849b0421a94a8d4a80d770439") {
|
$(function () {
|
//document.getElementById("orgList1").style.display="none";
|
//document.getElementById("orgLists").style.display="none";
|
$("#approvalBtnmonth").show();
|
});
|
}
|
if (res.data[k].ModuleId == "f1dc303849b0421a94a8d4a80d770435") {
|
$(function () {
|
//document.getElementById("orgList1").style.display="none";
|
//document.getElementById("orgLists").style.display="none";
|
$("#approvalBtnyear").show();
|
});
|
}
|
if (res.data[k].ModuleId == "f1dc303849b0421a94a8d4a80d770432") {
|
$(function () {
|
//document.getElementById("orgList1").style.display="none";
|
//document.getElementById("orgLists").style.display="none";
|
$("#approvalBtnlow").show();
|
});
|
}
|
if (res.data[k].ModuleId == "2a6685601f464907b67be1131e5be2d8") {
|
$(function () {
|
//document.getElementById("orgList1").style.display="none";
|
//document.getElementById("orgLists").style.display="none";
|
$("#approvalBtnhight").show();
|
});
|
}
|
if (res.data[k].ModuleId == "a69a67e8a03543a4acc2f67f9f99f8f7") {
|
$(function () {
|
//document.getElementById("orgList1").style.display="none";
|
//document.getElementById("orgLists").style.display="none";
|
$("#approvalBtnImportB").show();
|
});
|
}
|
if (res.data[k].ModuleId == "ffc1a121f9e84696bf62fce353037f8e") {
|
$(function () {
|
//document.getElementById("orgList1").style.display="none";
|
//document.getElementById("orgLists").style.display="none";
|
$("#approvalBtnImportO").show();
|
});
|
}
|
if (res.data[k].ModuleId == "eadf832e2d2f48edb97100401e588bce") {
|
$(function () {
|
//document.getElementById("orgList1").style.display="none";
|
//document.getElementById("orgLists").style.display="none";
|
$("#approvalBtnExportB").show();
|
});
|
}
|
if (res.data[k].ModuleId == "bc24bc958bc14a4c8e1dd5c2d8c4f851") {
|
$(function () {
|
//document.getElementById("orgList1").style.display="none";
|
//document.getElementById("orgLists").style.display="none";
|
$("#approvalBtnExportO").show();
|
});
|
}
|
if (res.data[k].ModuleId == "b51312ec97724a0198e7cb9e1c1efeca") {
|
$(function () {
|
//document.getElementById("orgList1").style.display="none";
|
//document.getElementById("orgLists").style.display="none";
|
$("#approvalBtnSearch").show();
|
});
|
}
|
// else{
|
// $("#approvalBtn").css({"display": "none"});
|
// }
|
}
|
} else { //不成功
|
layer.msg('获取信息失败', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
//回调
|
});
|
}
|
});*/
|
|
})
|
</script>
|
</body>
|
|
</html>
|