| | |
| | | @PostMapping("loc/pie/charts") |
| | | public R dsa(){ |
| | | Map<String,Object> map=new HashMap<String, Object>(); |
| | | List<ChartBean> list = new ArrayList<ChartBean>(); |
| | | |
| | | |
| | | LocChartPie locUseRate = reportQueryMapper.getLocUseRate(); |
| | | List<ChartBean> lists = lists(locUseRate); |
| | | map.put("rows",lists); |
| | | return R.ok(map); |
| | | } |
| | | @PostMapping("loc/pieA/charts") |
| | | public R dsaA(){ |
| | | Map<String,Object> map=new HashMap<String, Object>(); |
| | | |
| | | |
| | | LocChartPie locUseRate = reportQueryMapper.getLocUseRateA(); |
| | | List<ChartBean> lists = lists(locUseRate); |
| | | map.put("rows",lists); |
| | | return R.ok(map); |
| | | } |
| | | @PostMapping("loc/pieB/charts") |
| | | public R dsaB(){ |
| | | Map<String,Object> map=new HashMap<String, Object>(); |
| | | |
| | | |
| | | LocChartPie locUseRate = reportQueryMapper.getLocUseRateB(); |
| | | List<ChartBean> lists = lists(locUseRate); |
| | | map.put("rows",lists); |
| | | return R.ok(map); |
| | | } |
| | | @PostMapping("loc/pieC/charts") |
| | | public R dsaC(){ |
| | | Map<String,Object> map=new HashMap<String, Object>(); |
| | | |
| | | |
| | | LocChartPie locUseRate = reportQueryMapper.getLocUseRateC(); |
| | | List<ChartBean> lists = lists(locUseRate); |
| | | map.put("rows",lists); |
| | | return R.ok(map); |
| | | } |
| | | @PostMapping("loc/pieD/charts") |
| | | public R dsaD(){ |
| | | Map<String,Object> map=new HashMap<String, Object>(); |
| | | |
| | | |
| | | LocChartPie locUseRate = reportQueryMapper.getLocUseRateD(); |
| | | List<ChartBean> lists = lists(locUseRate); |
| | | map.put("rows",lists); |
| | | return R.ok(map); |
| | | } |
| | | @PostMapping("loc/pieE/charts") |
| | | public R dsaE(){ |
| | | Map<String,Object> map=new HashMap<String, Object>(); |
| | | |
| | | |
| | | LocChartPie locUseRate = reportQueryMapper.getLocUseRateE(); |
| | | List<ChartBean> lists = lists(locUseRate); |
| | | map.put("rows",lists); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | public List<ChartBean> lists(LocChartPie locUseRate){ |
| | | List<ChartBean> list = new ArrayList<ChartBean>(); |
| | | if(locUseRate!=null) { |
| | | ChartBean fqty = new ChartBean(); |
| | | fqty.setName("在库库位"); |
| | |
| | | oqty.setY(locUseRate.getOqty()); |
| | | list.add(oqty); |
| | | |
| | | ChartBean uqty = new ChartBean(); |
| | | uqty.setName("使用库位"); |
| | | uqty.setY(locUseRate.getUqty()); |
| | | list.add(uqty); |
| | | // ChartBean uqty = new ChartBean(); |
| | | // uqty.setName("使用库位"); |
| | | // uqty.setY(locUseRate.getUqty()); |
| | | // list.add(uqty); |
| | | |
| | | ChartBean xqty = new ChartBean(); |
| | | xqty.setName("禁用库位"); |
| | | xqty.setY(locUseRate.getXqty()); |
| | | list.add(xqty); |
| | | }else { |
| | | return null; |
| | | } |
| | | map.put("rows",list); |
| | | return R.ok(map); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("locIo/line/charts") |
| | | public R locIoLineCharts(){ |
| | | Map<String,Object> map=new HashMap<String, Object>(); |
| | |
| | | } |
| | | return R.ok().add(stockStatis); |
| | | } |
| | | @RequestMapping(value = "/locDetl/ownerStatis/auth") |
| | | @ManagerAuth |
| | | public R statis2(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param) { |
| | | |
| | | Object owner = param.get("owner"); |
| | | if (!Cools.isEmpty(owner)){ |
| | | LocOwner owner1 = locOwnerService.selectOne(new EntityWrapper<LocOwner>().like("owner", owner.toString())); |
| | | |
| | | param.put("owner",owner1.getId()); |
| | | }else { |
| | | param.remove("owner"); |
| | | } |
| | | |
| | | Page<LocDetlAll> stockStatis = locDetlService.getOwnerStatisAll(toPage(curr, limit, param, LocDetlAll.class)); |
| | | for (LocDetlAll locDetlAll : stockStatis.getRecords()) { |
| | | Mat mat = matService.selectByMatnr(locDetlAll.getMatnr()); |
| | | if (mat != null) { |
| | | locDetlAll.sync(mat); |
| | | } |
| | | } |
| | | return R.ok().add(stockStatis); |
| | | } |
| | | |
| | | @Autowired |
| | | private LocDetlMapper LocDetlMapper; |
| | |
| | | |
| | | Integer getStockStatisCountAll(Map<String, Object> map); |
| | | |
| | | List<LocDetlAll> getOwnerStatisAll(Map<String, Object> map); |
| | | |
| | | Integer getOwnerStatisAllCount(Map<String, Object> map); |
| | | |
| | | List<LocDetl> getStockStatisExcel(); |
| | | |
| | | @Select("select sum(a.anfme) as sum from asr_loc_detl a left join asr_loc_mast b on a.loc_no = b.loc_no where b.loc_sts = 'F' and a.matnr = #{matnr}") |
| | |
| | | //饼状图 |
| | | @Select("select * from asr_loc_use_view") |
| | | public LocChartPie getLocUseRate(); |
| | | @Select("select * from asr_loc_A_use_view") |
| | | public LocChartPie getLocUseRateA(); |
| | | @Select("select * from asr_loc_B_use_view") |
| | | public LocChartPie getLocUseRateB(); |
| | | @Select("select * from asr_loc_C_use_view") |
| | | public LocChartPie getLocUseRateC(); |
| | | @Select("select * from asr_loc_D_use_view") |
| | | public LocChartPie getLocUseRateD(); |
| | | @Select("select * from asr_loc_E_use_view") |
| | | public LocChartPie getLocUseRateE(); |
| | | |
| | | //立库数据 |
| | | @Select("select * from asr_loc_use_view_L") |
| | |
| | | |
| | | Page<LocDetl> getStockStatis(Page<LocDetl> page); |
| | | Page<LocDetlAll> getStockStatisAll(Page<LocDetlAll> page); |
| | | Page<LocDetlAll> getOwnerStatisAll(Page<LocDetlAll> page); |
| | | |
| | | Double sumAll(); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Page<LocDetlAll> getOwnerStatisAll(Page<LocDetlAll> page) { |
| | | page.setRecords(baseMapper.getOwnerStatisAll(page.getCondition())); |
| | | page.setTotal(baseMapper.getOwnerStatisAllCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public Double sumAll() { |
| | | return this.baseMapper.sumAll(); |
| | | } |
| | |
| | | <if test="crnNo!=null and crnNo!='' "> |
| | | and b.crn_no=#{crnNo} |
| | | </if> |
| | | <if test="owner !=null and owner!='' "> |
| | | and a.owner = #{owner} |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="getStockOutPage" resultMap="BaseResultMap"> |
| | |
| | | ) b |
| | | </select> |
| | | |
| | | <select id="getOwnerStatisAll" resultType="com.zy.asrs.entity.result.LocDetlAll"> |
| | | select t.* from |
| | | ( |
| | | select |
| | | ROW_NUMBER() over (order by sum(1) desc) as row |
| | | , sum(anfme) as anfme |
| | | ,owner |
| | | from asr_loc_detl_all a |
| | | where 1=1 |
| | | <include refid="stockOutCondition"></include> |
| | | group by a.owner |
| | | ) t |
| | | where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | | <select id="getOwnerStatisAllCount" parameterType="java.util.Map" resultType="java.lang.Integer"> |
| | | select count(1) as count from |
| | | ( |
| | | select |
| | | ROW_NUMBER() over (order by sum(1) desc) as row |
| | | , sum(anfme) as anfme |
| | | ,owner |
| | | from asr_loc_detl_all a |
| | | where 1=1 |
| | | <include refid="stockOutCondition"></include> |
| | | group by a.owner |
| | | ) t |
| | | </select> |
| | | |
| | | <select id="sumAll" resultType="java.lang.Double"> |
| | | SELECT SUM(anfme) FROM asr_loc_detl_all |
| | | </select> |
New file |
| | |
| | | var pageCurr; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'anfme', align: 'center',title: '库存数量', style: 'font-weight: bold'} |
| | | ]; |
| | | arrRemove(detlCols, "field", "anfme") |
| | | arrRemove(detlCols, "field", "zpallet") |
| | | arrRemove(detlCols, "field", "batch") |
| | | arrRemove(detlCols, "field", "model") |
| | | arrRemove(detlCols, "field", "weight") |
| | | cols.push.apply(cols, detlCols); |
| | | // cols.push({field: 'anfme', align: 'center',title: '数量', style: 'font-weight: bold'} |
| | | // ) |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#locDetlStatis', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/locDetl/ownerStatis/auth', |
| | | page: true, |
| | | limit: 20, |
| | | limits: [20, 30, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {field: 'anfme', align: 'center',title: '库存数量', style: 'font-weight: bold'}, |
| | | {field: 'owner$', align: 'center',title: '货主', hide: false} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | form.on('checkbox(tableCheckbox)', function (data) { |
| | | var _index = $(data.elem).attr('table-index')||0; |
| | | if(data.elem.checked){ |
| | | res.data[_index][data.value] = 'Y'; |
| | | }else{ |
| | | res.data[_index][data.value] = 'N'; |
| | | } |
| | | }); |
| | | /** |
| | | * 显示库存总数量 |
| | | */ |
| | | $.ajax({ |
| | | url: baseUrl+"/locDetl/count", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | $("#countNum").text(res.data + '个'); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(locDetlStatis)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: 1 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(locDetlStatis)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | case 'exportAll': |
| | | layer.closeAll(); |
| | | layer.load(1, {shade: [0.1,'#fff']}); |
| | | location.href = baseUrl + "/locDetl/statis/export"; |
| | | layer.closeAll('loading'); |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'locDetl': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/locDetl/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(locDetlStatis)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 详情 |
| | | case 'detail': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'locDetl_detail.html', |
| | | success: function(layero, index){ |
| | | setFormVal(layer.getChildFrame('#detail', index), data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } |
| | | }); |
| | | break; |
| | | |
| | | } |
| | | }); |
| | | |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | layDate.render({ |
| | | elem: '#modiTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#appeTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function detailScreen(index) { |
| | | var detail = layer.getChildFrame('#data-detail', index); |
| | | var height = detail.height()+60; |
| | | if (height > ($(window).height()*0.9)) { |
| | | height = ($(window).height()*0.8); |
| | | } |
| | | layer.style(index, { |
| | | // top: (($(window).height()-height)/3)+"px", |
| | | height: height+'px' |
| | | }); |
| | | } |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
| | |
| | | <!--报表数据--> |
| | | <div class="home-elem charts-contain"> |
| | | <div class="chart-elem"> |
| | | <div id="pie"></div> |
| | | <div class="layui-tab layui-tab-card" style="width: 100%"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">总计</li> |
| | | <li>A区</li> |
| | | <li>B区</li> |
| | | <li>C区</li> |
| | | <li>D区</li> |
| | | <li>E区</li> |
| | | </ul> |
| | | <div class="layui-tab-content"> |
| | | <div class="layui-tab-item layui-show" id="pie" style="width: 95%"></div> |
| | | <div class="layui-tab-item" id="pie2" style="width: 95%"></div> |
| | | <div class="layui-tab-item" id="pie3" style="width: 95%"></div> |
| | | <div class="layui-tab-item" id="pie4" style="width: 95%"></div> |
| | | <div class="layui-tab-item" id="pie5" style="width: 95%"></div> |
| | | <div class="layui-tab-item" id="pie6" style="width: 95%"></div> |
| | | </div> |
| | | </div> |
| | | <!-- <div id="pie"></div>--> |
| | | </div> |
| | | <div class="chart-elem"> |
| | | <div id="line"></div> |
| | |
| | | </body> |
| | | <script> |
| | | pieCharts(); |
| | | pieACharts(); |
| | | pieBCharts(); |
| | | pieCCharts(); |
| | | pieDCharts(); |
| | | pieECharts(); |
| | | lineCharts(); |
| | | layui.use('element', function(){ |
| | | var element = layui.element; |
| | | |
| | | //一些事件触发 |
| | | element.on('tab(demo)', function(data){ |
| | | console.log(data); |
| | | }); |
| | | }); |
| | | // 饼图 |
| | | function pieCharts(){ |
| | | $.ajax({ |
| | |
| | | }); |
| | | } |
| | | |
| | | function pieACharts(){ |
| | | $.ajax({ |
| | | url:baseUrl+'/console/loc/pieA/charts', |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | dataType: 'json', |
| | | contentType: 'application/json;charset=UTF-8', |
| | | crossDomain: true, |
| | | method: 'POST', |
| | | success:function(res){ |
| | | var data = res.data; |
| | | var dataPie=eval(data.rows); |
| | | var chart = { |
| | | plotBackgroundColor: null, |
| | | plotBorderWidth: null, |
| | | plotShadow: false |
| | | }; |
| | | var title = { |
| | | text: '库位使用比例', |
| | | margin:1, |
| | | style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, |
| | | y: 5 |
| | | }; |
| | | var tooltip = { |
| | | pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' |
| | | }; |
| | | var plotOptions = { |
| | | pie: { |
| | | allowPointSelect: true, |
| | | cursor: 'pointer', |
| | | dataLabels: { |
| | | enabled: true, |
| | | format: '<b>{point.name}</b>: {point.percentage:.1f} %', |
| | | style: { |
| | | color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | var series= [{ |
| | | type: 'pie', |
| | | name: '库位占比', |
| | | data: dataPie |
| | | }]; |
| | | var loading = { |
| | | hideDuration: 3, |
| | | showDuration: 3 |
| | | }; |
| | | var json = {}; |
| | | json.chart = chart; |
| | | json.title = title; |
| | | json.tooltip = tooltip; |
| | | json.series = series; |
| | | json.plotOptions = plotOptions; |
| | | json.loading = loading; |
| | | json.credits = {enabled: false}; |
| | | $('#pie2').highcharts(json); |
| | | |
| | | }, |
| | | error:function(){ |
| | | } |
| | | }); |
| | | } |
| | | function pieBCharts(){ |
| | | $.ajax({ |
| | | url:baseUrl+'/console/loc/pieB/charts', |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | dataType: 'json', |
| | | contentType: 'application/json;charset=UTF-8', |
| | | crossDomain: true, |
| | | method: 'POST', |
| | | success:function(res){ |
| | | var data = res.data; |
| | | var dataPie=eval(data.rows); |
| | | var chart = { |
| | | plotBackgroundColor: null, |
| | | plotBorderWidth: null, |
| | | plotShadow: false |
| | | }; |
| | | var title = { |
| | | text: '库位使用比例', |
| | | margin:1, |
| | | style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, |
| | | y: 5 |
| | | }; |
| | | var tooltip = { |
| | | pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' |
| | | }; |
| | | var plotOptions = { |
| | | pie: { |
| | | allowPointSelect: true, |
| | | cursor: 'pointer', |
| | | dataLabels: { |
| | | enabled: true, |
| | | format: '<b>{point.name}</b>: {point.percentage:.1f} %', |
| | | style: { |
| | | color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | var series= [{ |
| | | type: 'pie', |
| | | name: '库位占比', |
| | | data: dataPie |
| | | }]; |
| | | var loading = { |
| | | hideDuration: 3, |
| | | showDuration: 3 |
| | | }; |
| | | var json = {}; |
| | | json.chart = chart; |
| | | json.title = title; |
| | | json.tooltip = tooltip; |
| | | json.series = series; |
| | | json.plotOptions = plotOptions; |
| | | json.loading = loading; |
| | | json.credits = {enabled: false}; |
| | | $('#pie3').highcharts(json); |
| | | |
| | | }, |
| | | error:function(){ |
| | | } |
| | | }); |
| | | } |
| | | function pieCCharts(){ |
| | | $.ajax({ |
| | | url:baseUrl+'/console/loc/pieC/charts', |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | dataType: 'json', |
| | | contentType: 'application/json;charset=UTF-8', |
| | | crossDomain: true, |
| | | method: 'POST', |
| | | success:function(res){ |
| | | var data = res.data; |
| | | var dataPie=eval(data.rows); |
| | | var chart = { |
| | | plotBackgroundColor: null, |
| | | plotBorderWidth: null, |
| | | plotShadow: false |
| | | }; |
| | | var title = { |
| | | text: '库位使用比例', |
| | | margin:1, |
| | | style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, |
| | | y: 5 |
| | | }; |
| | | var tooltip = { |
| | | pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' |
| | | }; |
| | | var plotOptions = { |
| | | pie: { |
| | | allowPointSelect: true, |
| | | cursor: 'pointer', |
| | | dataLabels: { |
| | | enabled: true, |
| | | format: '<b>{point.name}</b>: {point.percentage:.1f} %', |
| | | style: { |
| | | color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | var series= [{ |
| | | type: 'pie', |
| | | name: '库位占比', |
| | | data: dataPie |
| | | }]; |
| | | var loading = { |
| | | hideDuration: 3, |
| | | showDuration: 3 |
| | | }; |
| | | var json = {}; |
| | | json.chart = chart; |
| | | json.title = title; |
| | | json.tooltip = tooltip; |
| | | json.series = series; |
| | | json.plotOptions = plotOptions; |
| | | json.loading = loading; |
| | | json.credits = {enabled: false}; |
| | | $('#pie4').highcharts(json); |
| | | |
| | | }, |
| | | error:function(){ |
| | | } |
| | | }); |
| | | } |
| | | function pieDCharts(){ |
| | | $.ajax({ |
| | | url:baseUrl+'/console/loc/pieD/charts', |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | dataType: 'json', |
| | | contentType: 'application/json;charset=UTF-8', |
| | | crossDomain: true, |
| | | method: 'POST', |
| | | success:function(res){ |
| | | var data = res.data; |
| | | var dataPie=eval(data.rows); |
| | | var chart = { |
| | | plotBackgroundColor: null, |
| | | plotBorderWidth: null, |
| | | plotShadow: false |
| | | }; |
| | | var title = { |
| | | text: '库位使用比例', |
| | | margin:1, |
| | | style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, |
| | | y: 5 |
| | | }; |
| | | var tooltip = { |
| | | pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' |
| | | }; |
| | | var plotOptions = { |
| | | pie: { |
| | | allowPointSelect: true, |
| | | cursor: 'pointer', |
| | | dataLabels: { |
| | | enabled: true, |
| | | format: '<b>{point.name}</b>: {point.percentage:.1f} %', |
| | | style: { |
| | | color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | var series= [{ |
| | | type: 'pie', |
| | | name: '库位占比', |
| | | data: dataPie |
| | | }]; |
| | | var loading = { |
| | | hideDuration: 3, |
| | | showDuration: 3 |
| | | }; |
| | | var json = {}; |
| | | json.chart = chart; |
| | | json.title = title; |
| | | json.tooltip = tooltip; |
| | | json.series = series; |
| | | json.plotOptions = plotOptions; |
| | | json.loading = loading; |
| | | json.credits = {enabled: false}; |
| | | $('#pie5').highcharts(json); |
| | | |
| | | }, |
| | | error:function(){ |
| | | } |
| | | }); |
| | | } |
| | | function pieECharts(){ |
| | | $.ajax({ |
| | | url:baseUrl+'/console/loc/pieE/charts', |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | dataType: 'json', |
| | | contentType: 'application/json;charset=UTF-8', |
| | | crossDomain: true, |
| | | method: 'POST', |
| | | success:function(res){ |
| | | var data = res.data; |
| | | var dataPie=eval(data.rows); |
| | | var chart = { |
| | | plotBackgroundColor: null, |
| | | plotBorderWidth: null, |
| | | plotShadow: false |
| | | }; |
| | | var title = { |
| | | text: '库位使用比例', |
| | | margin:1, |
| | | style: {fontSize: '18px',color: '#777',fontWeight: 'bold'}, |
| | | y: 5 |
| | | }; |
| | | var tooltip = { |
| | | pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' |
| | | }; |
| | | var plotOptions = { |
| | | pie: { |
| | | allowPointSelect: true, |
| | | cursor: 'pointer', |
| | | dataLabels: { |
| | | enabled: true, |
| | | format: '<b>{point.name}</b>: {point.percentage:.1f} %', |
| | | style: { |
| | | color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | var series= [{ |
| | | type: 'pie', |
| | | name: '库位占比', |
| | | data: dataPie |
| | | }]; |
| | | var loading = { |
| | | hideDuration: 3, |
| | | showDuration: 3 |
| | | }; |
| | | var json = {}; |
| | | json.chart = chart; |
| | | json.title = title; |
| | | json.tooltip = tooltip; |
| | | json.series = series; |
| | | json.plotOptions = plotOptions; |
| | | json.loading = loading; |
| | | json.credits = {enabled: false}; |
| | | $('#pie6').highcharts(json); |
| | | |
| | | }, |
| | | error:function(){ |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 折线图 |
| | | function lineCharts() { |
| | | $.ajax({ |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <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="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 搜索栏 --> |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="owner" placeholder="货主" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索 |
| | | </button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置 |
| | | </button> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <!-- 表格 --> |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="locDetlStatis" lay-filter="locDetlStatis"></table> |
| | | </div> |
| | | <script type="text/html" id="toolbar"> |
| | | |
| | | |
| | | </script> |
| | | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/locDetlStatis/ownerStatis.js" charset="utf-8"></script> |
| | | |
| | | </body> |
| | | </html> |
| | | |