|
|
|
@ -15,16 +15,19 @@ |
|
|
|
border-radius: 5px; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
.top-panel > .layui-card-body{ |
|
|
|
|
|
|
|
.top-panel > .layui-card-body { |
|
|
|
height: 60px; |
|
|
|
} |
|
|
|
.top-panel-number{ |
|
|
|
line-height:60px; |
|
|
|
|
|
|
|
.top-panel-number { |
|
|
|
line-height: 60px; |
|
|
|
font-size: 30px; |
|
|
|
border-right:1px solid #eceff9; |
|
|
|
border-right: 1px solid #eceff9; |
|
|
|
} |
|
|
|
.top-panel-tips{ |
|
|
|
line-height:30px; |
|
|
|
|
|
|
|
.top-panel-tips { |
|
|
|
line-height: 30px; |
|
|
|
font-size: 12px |
|
|
|
} |
|
|
|
</style> |
|
|
|
@ -38,7 +41,7 @@ |
|
|
|
<button class="layui-btn" lay-submit lay-filter="thisWeek"> |
|
|
|
 本周  |
|
|
|
</button> |
|
|
|
<button class="layui-btn" lay-submit lay-filter="lastWeek" > |
|
|
|
<button class="layui-btn" lay-submit lay-filter="lastWeek"> |
|
|
|
 上周  |
|
|
|
</button> |
|
|
|
<div id="echarts-records" style="background-color:#ffffff;min-height:400px;padding: 10px"></div> |
|
|
|
@ -66,7 +69,7 @@ |
|
|
|
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script> |
|
|
|
<script> |
|
|
|
layui.use(['layer', 'echarts'], function () { |
|
|
|
var $ = layui.jquery, |
|
|
|
var $ = layui.jquery, |
|
|
|
layer = layui.layer, |
|
|
|
echarts = layui.echarts, |
|
|
|
form = layui.form; |
|
|
|
@ -184,8 +187,7 @@ |
|
|
|
tooltip: {}, |
|
|
|
dataset: { |
|
|
|
dimensions: [], |
|
|
|
source: [ |
|
|
|
] |
|
|
|
source: [] |
|
|
|
}, |
|
|
|
xAxis: {type: 'category'}, |
|
|
|
yAxis: {}, |
|
|
|
@ -208,41 +210,39 @@ |
|
|
|
showContent: false |
|
|
|
}, |
|
|
|
dataset: { |
|
|
|
source: [ |
|
|
|
] |
|
|
|
source: [] |
|
|
|
}, |
|
|
|
xAxis: {type: 'category'}, |
|
|
|
yAxis: {gridIndex: 0}, |
|
|
|
grid: {top: '55%'}, |
|
|
|
series: [ |
|
|
|
] |
|
|
|
series: [] |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
//动态加载相关数据 |
|
|
|
$.ajax({ |
|
|
|
url:'/repository/layui/echart_back?type=0', |
|
|
|
type:'get', |
|
|
|
async:true, |
|
|
|
url: '/repository/layui/echart_back?type=0', |
|
|
|
type: 'get', |
|
|
|
async: true, |
|
|
|
dataType: "json", |
|
|
|
complete:function (XHR,TS){ |
|
|
|
if(XHR.status != 200){ |
|
|
|
complete: function (XHR, TS) { |
|
|
|
if (XHR.status != 200) { |
|
|
|
layer.alert("系统繁忙,稍后重试"); |
|
|
|
} |
|
|
|
}, |
|
|
|
beforeSend: function () { |
|
|
|
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
|
|
|
}, |
|
|
|
success:function (result){ |
|
|
|
success: function (result) { |
|
|
|
layer.close(this.layerIndex); |
|
|
|
if(result.code == 0){ |
|
|
|
if (result.code == 0) { |
|
|
|
echartsRecords.setOption(optionRecords); |
|
|
|
echartsPies.setOption(optionPies); |
|
|
|
echartsDataset.setOption(optionDataset); |
|
|
|
echartsMap.setOption(optionMap); |
|
|
|
|
|
|
|
// 折线图 |
|
|
|
var optionRecordsSeries=[]; |
|
|
|
var optionRecordsSeries = []; |
|
|
|
// 饼状图 |
|
|
|
var optionPiesSeries = { |
|
|
|
name: '昨日占比', |
|
|
|
@ -257,42 +257,43 @@ |
|
|
|
shadowColor: 'rgba(0, 0, 0, 0.5)' |
|
|
|
} |
|
|
|
}, |
|
|
|
data:[] |
|
|
|
data: [] |
|
|
|
}; |
|
|
|
// 柱状图 |
|
|
|
optionDataset = { |
|
|
|
legend: {}, |
|
|
|
tooltip: {}, |
|
|
|
dataset: { |
|
|
|
dimensions:[], |
|
|
|
source:[] |
|
|
|
dimensions: [], |
|
|
|
source: [] |
|
|
|
}, |
|
|
|
series:[] |
|
|
|
series: [] |
|
|
|
}; |
|
|
|
for (let i = 0; i < result.data.depository_name.length; i++) { |
|
|
|
optionRecordsSeries.push({ |
|
|
|
name: result.data.depository_name[i], |
|
|
|
type: 'line', |
|
|
|
stack: '金额', |
|
|
|
data:result.data.depository_data.ThisWeekInventory[result.data.depository_name[i]], |
|
|
|
data: result.data.depository_data.ThisWeekInventory[result.data.depository_name[i]], |
|
|
|
areaStyle: {} |
|
|
|
}); |
|
|
|
optionPiesSeries.data.push({ |
|
|
|
value:result.data.depository_data.todayInventory[result.data.depository_name[i]],name:result.data.depository_name[i] |
|
|
|
value: result.data.depository_data.todayInventory[result.data.depository_name[i].split(",")[0]], |
|
|
|
name: result.data.depository_name[i] |
|
|
|
}) |
|
|
|
} |
|
|
|
var dimensions = result.data.depository_data.sourceListByMonth[result.data.depository_data.sourceListByMonth.length - 1] |
|
|
|
var dimensions = result.data.depository_data.sourceListByMonth[result.data.depository_data.sourceListByMonth.length - 1]; |
|
|
|
optionDataset.dataset.dimensions = dimensions; |
|
|
|
for (let i = result.data.depository_data.sourceListByMonth.length - 2; i >= 0; i--) { |
|
|
|
optionDataset.dataset.source.push(result.data.depository_data.sourceListByMonth[i]) |
|
|
|
} |
|
|
|
for (let i = 0; i < dimensions.length - 1; i++) { |
|
|
|
optionDataset.series.push({type:'bar'}) |
|
|
|
optionDataset.series.push({type: 'bar'}) |
|
|
|
} |
|
|
|
|
|
|
|
for (let i = 0; i < result.data.depository_data.MapInventory.mapDataList.length ; i++) { |
|
|
|
optionMap.dataset.source.push(result.data.depository_data.MapInventory.mapDataList[i]) |
|
|
|
if(i < result.data.depository_data.MapInventory.mapDataList.length - 1) { |
|
|
|
for (let i = 0; i < result.data.depository_data.MapInventory.mapDataList.length; i++) { |
|
|
|
optionMap.dataset.source.push(result.data.depository_data.MapInventory.mapDataList[i]); |
|
|
|
if (i < result.data.depository_data.MapInventory.mapDataList.length - 1) { |
|
|
|
optionMap.series.push({type: 'line', smooth: true, seriesLayoutBy: 'row'}) |
|
|
|
} |
|
|
|
|
|
|
|
@ -305,12 +306,12 @@ |
|
|
|
radius: '30%', |
|
|
|
center: ['50%', '25%'], |
|
|
|
label: { |
|
|
|
formatter: '{b}: {@'+month+'月} ({d}%)' |
|
|
|
formatter: '{b}: {@' + month + '月} ({d}%)' |
|
|
|
}, |
|
|
|
encode: { |
|
|
|
itemName: 'product', |
|
|
|
value: month+'月', |
|
|
|
tooltip: month+'月' |
|
|
|
value: month + '月', |
|
|
|
tooltip: month + '月' |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
@ -388,12 +389,12 @@ |
|
|
|
|
|
|
|
form.on('submit(thisWeek)', function () { |
|
|
|
$.ajax({ |
|
|
|
url:'/repository/layui/echart_back_thisWeek?type=0', |
|
|
|
type:'get', |
|
|
|
async:true, |
|
|
|
url: '/repository/layui/echart_back_thisWeek?type=0', |
|
|
|
type: 'get', |
|
|
|
async: true, |
|
|
|
dataType: "json", |
|
|
|
complete:function (XHR,TS){ |
|
|
|
if(XHR.status != 200){ |
|
|
|
complete: function (XHR, TS) { |
|
|
|
if (XHR.status != 200) { |
|
|
|
layer.alert("系统繁忙,稍后重试"); |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -404,13 +405,13 @@ |
|
|
|
layer.close(this.layerIndex); |
|
|
|
echartsRecords.setOption(optionRecords); |
|
|
|
// 折线图 |
|
|
|
var optionRecordsSeries=[]; |
|
|
|
var optionRecordsSeries = []; |
|
|
|
for (let i = 0; i < result.depository_name.length; i++) { |
|
|
|
optionRecordsSeries.push({ |
|
|
|
name: result.depository_name[i], |
|
|
|
type: 'line', |
|
|
|
stack: '金额', |
|
|
|
data:result.ThisWeekInventory[result.depository_name[i]], |
|
|
|
data: result.ThisWeekInventory[result.depository_name[i]], |
|
|
|
areaStyle: {} |
|
|
|
}); |
|
|
|
} |
|
|
|
@ -462,12 +463,12 @@ |
|
|
|
|
|
|
|
form.on('submit(lastWeek)', function () { |
|
|
|
$.ajax({ |
|
|
|
url:'/repository/layui/echart_back_lastWeek?type=0', |
|
|
|
type:'get', |
|
|
|
async:true, |
|
|
|
url: '/repository/layui/echart_back_lastWeek?type=0', |
|
|
|
type: 'get', |
|
|
|
async: true, |
|
|
|
dataType: "json", |
|
|
|
complete:function (XHR,TS){ |
|
|
|
if(XHR.status != 200){ |
|
|
|
complete: function (XHR, TS) { |
|
|
|
if (XHR.status != 200) { |
|
|
|
layer.alert("系统繁忙,稍后重试"); |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -478,13 +479,13 @@ |
|
|
|
layer.close(this.layerIndex); |
|
|
|
echartsRecords.setOption(optionRecords); |
|
|
|
// 折线图 |
|
|
|
var optionRecordsSeries=[]; |
|
|
|
var optionRecordsSeries = []; |
|
|
|
for (let i = 0; i < result.depository_name.length; i++) { |
|
|
|
optionRecordsSeries.push({ |
|
|
|
name: result.depository_name[i], |
|
|
|
type: 'line', |
|
|
|
stack: '金额', |
|
|
|
data:result.BeforeInventory[result.depository_name[i]], |
|
|
|
data: result.BeforeInventory[result.depository_name[i]], |
|
|
|
areaStyle: {} |
|
|
|
}); |
|
|
|
} |
|
|
|
|