12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373 |
- //var bootstrap = function ($, learun) {
- $(function () {
- "use strict";
- var tabName = 'fj1';
- function GetTodayInOutPie(data) {
- var dom = document.getElementById(tabName + 'todayinoutpie');
- var myChart = echarts.init(dom, null, {
- renderer: 'canvas',
- useDirtyRect: false
- });
- var app = {};
- var option;
- option = {
- title: {
- text: data.total,
- textStyle: {
- color: '#1C3554',
- },
- subtext: '今日任务总数',
- subtextStyle: {
- color: '#5A5E66',
- },
- left: 'center',
- top: '37%'
- },
- tooltip: {
- trigger: 'item'
- },
- legend: {
- top: '1%',
- left: 'center'
- },
- series: [
- {
- name: '出入库统计',
- type: 'pie',
- radius: ['40%', '70%'],
- avoidLabelOverlap: false,
- itemStyle: {
- normal: {
- label: {
- show: false
- },
- labelLine: {
- show: false
- },
- color: function (colors) {
- var colorList = [
- '#9287e7',
- '#40A0FF',
- '#F7CA4D',
- '#23B89A',
- '#9287e7',
- '#40A0FF',
- '#F7CA4D',
- '#23B89A',
- ];
- return colorList[colors.dataIndex];
- }
- }
- },
- label: {
- show: false,
- position: 'center'
- },
- emphasis: {
- label: {
- show: true,
- fontSize: 40,
- fontWeight: 'bold'
- }
- },
- labelLine: {
- show: false
- },
- data: data.datas
- //[
- //{ value: 1048, name: '出库任务' },
- //{ value: 735, name: '入库任务' },
- //{ value: 580, name: '移库任务' }
- //]
- }
- ]
- };
- if (option && typeof option === 'object') {
- myChart.setOption(option);
- }
- window.addEventListener('resize', myChart.resize);
- }
- function Get7daysTaskBar(data) {
- var dom = document.getElementById(tabName + 'sevendaysTask');
- var myChart = echarts.init(dom, null, {
- renderer: 'canvas',
- useDirtyRect: false
- });
- var app = {};
- var option;
- const labelOption = {
- show: true,
- position: 'insideBottom',
- distance: 15,
- align: 'left',
- verticalAlign: 'middle',
- rotate: 90,
- formatter: '{c} {name|{a}}',
- fontSize: 16,
- rich: {
- name: {}
- }
- };
- option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- crossStyle: {
- color: '#999'
- }
- }
- },
- color: ['#40A0FF', '#23B89A', '#FF8541', '#9287e7'],
- //tooltip: {
- // trigger: 'axis',
- // axisPointer: {
- // type: 'shadow'
- // }
- //},
- legend: {
- left: '57%',//调整位置
- data: ['出库', '入库', '移库', '组盘']
- },
- xAxis: [
- {
- type: 'category',
- axisTick: { show: false },
- data: data.xAxis,// ['5-10', '5-11', '5-12', '5-13', '5-14', '5-15', '5-16'],
- }
- ],
- yAxis: [
- {
- /* interval: 50,*/
- axisLabel: {
- formatter: '{value}'
- },
- type: 'value'
- }
- ],
- series: [
- {
- name: '出库',
- type: 'bar',
- //label: labelOption,
- emphasis: {
- focus: 'series'
- },
- lineStyle: { // 设置线条的style等
- normal: {
- color: '#40A0FF', // 折线线条颜色:红色
- },
- },
- itemStyle: {
- normal: {
- label: {
- show: true,
- position: 'top',
- },
- //这里是颜色
- color: function (params) {
- //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- var colorList = ['#40A0FF'];
- return colorList[params.dataIndex]
- }
- }, // 移入当前的柱状图时改变颜色
- emphasis: {
- color: '#40A0FF',
- }
- },
- data: data.series[0].data//[22, 18, 19, 34, 29]
- },
- {
- name: '入库',
- type: 'bar',
- barGap: 0,
- //label: labelOption,
- emphasis: {
- focus: 'series'
- },
- lineStyle: { // 设置线条的style等
- normal: {
- color: '#23B89A', // 折线线条颜色:红色
- },
- },
- itemStyle: {
- normal: {
- label: {
- show: true,
- position: 'top',
- },
- //这里是颜色
- color: function (params) {
- //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- var colorList = ['#23B89A'];
- return colorList[params.dataIndex]
- }
- },
- emphasis: {
- color: '#23B89A',
- }
- },
- data: data.series[1].data//[32, 32, 30, 34, 39]
- },
- {
- name: '移库',
- type: 'bar',
- //label: labelOption,
- emphasis: {
- focus: 'series'
- },
- lineStyle: { // 设置线条的style等
- normal: {
- color: '#FF8541', // 折线线条颜色:红色
- },
- },
- itemStyle: {
- normal: {
- label: {
- show: true,
- position: 'top',
- },
- //这里是颜色
- color: function (params) {
- //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- var colorList = ['#FF8541'];
- return colorList[params.dataIndex]
- }
- },
- emphasis: {
- color: '#FF8541',
- }
- },
- data: data.series[2].data// [15, 23, 21, 15, 19]
- },
- {
- name: '组盘',
- type: 'bar',
- //label: labelOption,
- emphasis: {
- focus: 'series'
- },
- lineStyle: { // 设置线条的style等
- normal: {
- color: '#9287e7', // 折线线条颜色:红色
- },
- },
- itemStyle: {
- normal: {
- label: {
- show: true,
- position: 'top',
- },
- //这里是颜色
- color: function (params) {
- //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- var colorList = ['#9287e7'];
- return colorList[params.dataIndex]
- }
- },
- emphasis: {
- color: '#9287e7',
- }
- },
- data: data.series[3].data// [15, 23, 21, 15, 19]
- },
- ]
- };
- if (option && typeof option === 'object') {
- myChart.setOption(option);
- }
- }
- function GetWarehouseCellPie(data) {
- var chartDom = document.getElementById(tabName + 'WarehouseCell');
- var myChart = echarts.init(chartDom);
- var option;
- option = {
- tooltip: {
- trigger: 'item'
- },
- legend: {
- data: ['已使用', '空闲', '禁用', '锁定'],
- //orient: 'vertical',
- orient: 'horizontal',
- bottom: '-5',
- // left: 'center',
- // top: "50",
- //right: '-80%',
- textStyle: { color: "#000000" },//字体颜色
- //icon: "circle"//图例形状设置
- //orient: 'vertical',
- //right: 'right'
- //left: '77%',//调整位置
- },
- series: [
- {
- name: '货位使用情况',
- type: 'pie',
- radius: '60%',
- data: data
- //[{ value: 1048, name: '已使用' },
- //{ value: 735, name: '空闲' },
- //{ value: 580, name: '禁用' },
- //{ value: 484, name: '锁定' }]
- , itemStyle: {
- normal: {
- label: {
- show: true,
- formatter: '{b}:{c}({d}%)'
- },
- labelLine: {
- show: true
- },
- color: function (colors) {
- var colorList = [
- '#F4BD37', '#23B89A',
- '#D8E7FC',
- '#E46989',
- ];
- return colorList[colors.dataIndex];
- }
- }
- },
- label: {
- show: false,
- position: 'center'
- },
- emphasis: {
- label: {
- show: true,
- fontSize: 40,
- fontWeight: 'bold'
- },
- itemStyle: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- },
- labelLine: {
- show: false
- }
- }
- ]
- };
- option && myChart.setOption(option);
- }
- function GetTunnelWarehouseCellBar(data) {
- var dom = document.getElementById(tabName + 'TunnelWarehouseCell');
- var myChart = echarts.init(dom, null, {
- renderer: 'canvas',
- useDirtyRect: false
- });
- var app = {};
- var option;
- //https://blog.csdn.net/fu983531588/article/details/121338767
- //Echarts绘制横向柱状图(圆角+渐变) https://blog.csdn.net/weixin_43953710/article/details/106694317
- //https://blog.csdn.net/lilycheng1986/article/details/121853940
- //var data = [{ "qty": 16, "total": 1732 }, { "qty": 787, "total": 1732 }, { "qty": 841, "total": 1700 }];
- var barWidth = 20;
- //option = {
- // grid: {
- // top: '5%',
- // left: '25%',
- // right: '25%',
- // bottom: '0%',
- // containLabel: true // 显示范围包含坐标刻度
- // },
- // //grid: {
- // // top: '10px',
- // // left: '120px',
- // // bottom: '30px',
- // //},
- // xAxis: {
- // show: false
- // },
- // yAxis: {
- // type: 'category',
- // inverse: true, // 倒叙
- // axisLabel: {
- // margin: 0,
- // align: 'left',
- // formatter: (val) => {
- // return `${val}`;
- // }
- // },
- // axisLine: {
- // show: false // 轴线
- // },
- // axisTick: {
- // show: false // 刻度线
- // },
- // data: ['栏目1', '栏目2', '栏目3']
- // },
- // series: [
- // {
- // type: 'bar',
- // showBackground: true,
- // barWidth: 10,
- // barMaxWidth: 20,
- // barMinWidth: 5,
- // label: {
- // show: true,
- // position: 'left',
- // offset: [100, 0],
- // valueAnimation: true,
- // fontFamily: 'monospace',
- // fontSize: 12,
- // textStyle: {
- // //数值样式
- // color: "#1C3554",
- // fontSize: 12
- // },
- // formatter: function (params) {
- // return params.data.realValue + '/' + params.data.value;
- // },
- // // distance: -22
- // },
- // itemStyle: {
- // normal: {
- // barBorderRadius: [0, 20, 20, 0], //设置圆角方向[上,右,下,左]
- // //这里是颜色
- // color: function (params) {
- // //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- // var colorList = ['#40A0FF'];
- // return colorList[params.dataIndex]
- // }
- // }
- // },
- // data: data.map(function (item) {
- // return {
- // realValue: item.qty,
- // value: item.total,
- // };
- // }),
- // }
- // ]
- //};
- option = {
- //backgroundColor: 'black',
- grid: {
- top: '15%',
- left: '25%',
- right: '25%',
- bottom: '0%',
- containLabel: true // 显示范围包含坐标刻度
- },
- xAxis: {
- show: false,
- },
- yAxis: {
- data: data.map(item => item.tunnel),
- inverse: true,
- splitLine: {
- show: false,
- },
- axisLabel: {
- textStyle: { fontSize: '80%', color: '#5A5E66' },
- },
- axisLine: {
- show: false,
- },
- axisTick: false,
- },
- series: [
- {
- type: 'bar',
- barWidth: barWidth,
- barGap: '5%',
- barCategoryGap: '5%',/*多个并排柱子设置柱子之间的间距*/
- zlevel: 2,
- data: data.map(function (item) {
- return {
- value: item.qty
- };
- }),
- itemStyle: {
- normal: {
- barBorderRadius: [0, 20, 20, 0], //设置圆角方向[上,右,下,左]
- //这里是颜色
- color: function (params) {
- //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- var colorList = ['#40A0FF'];
- return colorList[params.dataIndex]
- }
- }
- }
- },
- {
- type: 'bar',
- barWidth: barWidth,
- distance: 15,// 标签距离柱条的距离
- barGap: '-100%',
- barCategoryGap: '5%',/*多个并排柱子设置柱子之间的间距*/
- data: data.map(function (item) {
- return {
- value: item.total,
- realValue: item.qty,
- total: item.total,
- };
- }),
- label: {
- normal: {
- show: true,
- precision: 1,
- position: 'right',
- offset: [10, 0],
- valueAnimation: true,
- fontFamily: 'monospace',
- fontSize: 12,
- textStyle: {
- //数值样式
- color: "#1C3554",
- fontSize: 12
- },
- formatter: function (params) {
- return params.data.realValue + '/' + params.data.total;
- },
- }
- },
- itemStyle: {
- borderRadius: [0, 20, 20, 0],
- normal: {
- barBorderRadius: [0, 20, 20, 0], //设置圆角方向[上,右,下,左]
- //这里是颜色
- color: function (params) {
- //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- var colorList = ['#E1E5E8'];
- return colorList[params.dataIndex]
- }
- }, // 移入当前的柱状图时改变颜色
- }
- },
- ],
- };
- if (option && typeof option === 'object') {
- myChart.setOption(option);
- }
- window.addEventListener('resize', myChart.resize);
- }
- function GettodaysHourTask(data) {
- var chartDom = document.getElementById(tabName + 'todaysHourTask');
- var myChart = echarts.init(chartDom, null, {
- renderer: 'canvas',
- useDirtyRect: false
- });
- var option;
- option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- label: {
- backgroundColor: '#6a7985'
- }
- }
- },
- legend: {
- left: '57%',//调整位置
- top: '30',
- data: ['出库', '入库', '移库', '组盘']
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '1%',
- containLabel: true
- },
- xAxis: [
- {
- //type: 'category',
- boundaryGap: false,
- data: data.xAxis,//['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23']
- }
- ],
- yAxis: [
- {
- axisLabel: {
- formatter: '{value}'
- },
- axisLine: {
- show: true
- },
- type: 'value'
- }
- ],
- series: [
- {
- name: '出库',
- type: 'line',
- //stack: 'Total',
- label: {
- show: true,
- position: 'top'
- },
- lineStyle: { // 设置线条的style等
- normal: {
- color: '#40A0FF', // 折线线条颜色:红色
- },
- },
- itemStyle: {
- normal: {
- //这里是颜色
- color: function (params) {
- //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- var colorList = ['#40A0FF'];
- return colorList[params.dataIndex]
- }
- }
- },
- areaStyle: {},
- emphasis: {
- focus: 'series'
- },
- data: data.series[0].data//[78, 93, 76, 55, 68, 89, 82]
- },
- {
- name: '入库',
- type: 'line',
- //stack: 'Total',
- label: {
- show: true,
- position: 'top'
- },
- areaStyle: {},
- lineStyle: { // 设置线条的style等
- normal: {
- color: '#23B89A', // 折线线条颜色:红色
- },
- },
- itemStyle: {
- normal: {
- //这里是颜色
- color: function (params) {
- //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- var colorList = ['#23B89A'];
- return colorList[params.dataIndex]
- }
- }
- },
- emphasis: {
- focus: 'series'
- },
- data: data.series[1].data//[38, 23, 36, 45, 58, 59, 62]
- }
- ,
- {
- name: '移库',
- type: 'line',
- //stack: 'Total',
- label: {
- show: true,
- position: 'top'
- },
- lineStyle: { // 设置线条的style等
- normal: {
- color: '#FF8541', // 折线线条颜色:红色
- },
- },
- areaStyle: {},
- itemStyle: {
- normal: {
- //这里是颜色
- color: function (params) {
- //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- var colorList = ['#FF8541'];
- return colorList[params.dataIndex]
- }
- }
- },
- emphasis: {
- focus: 'series'
- },
- data: data.series[2].data//[8, 3, 6, 5, 8, 9, 6]
- },
- {
- name: '组盘',
- type: 'line',
- //stack: 'Total',
- label: {
- show: true,
- position: 'top'
- },
- lineStyle: { // 设置线条的style等
- normal: {
- color: '#9287e7', // 折线线条颜色:红色
- },
- },
- areaStyle: {},
- itemStyle: {
- normal: {
- //这里是颜色
- color: function (params) {
- //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- var colorList = ['#9287e7'];
- return colorList[params.dataIndex]
- }
- }
- },
- emphasis: {
- focus: 'series'
- },
- data: data.series[3].data//[8, 3, 6, 5, 8, 9, 6]
- },
- ]
- };
- option && myChart.setOption(option);
- }
- function GetHourTask(data) {
- var chartDom = document.getElementById(tabName + 'HourTask');
- var myChart = echarts.init(chartDom, null, {
- renderer: 'canvas',
- useDirtyRect: false
- });
- var option;
- option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- label: {
- backgroundColor: '#6a7985'
- }
- }
- },
- legend: {
- left: '57%',//调整位置
- top: '30',
- data: ['出库', '入库', '移库', '组盘']
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '1%',
- containLabel: true
- },
- xAxis: [
- {
- //type: 'category',
- boundaryGap: false,
- data: data.xAxis,//['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23']
- }
- ],
- yAxis: [
- {
- axisLabel: {
- formatter: '{value}'
- },
- axisLine: {
- show: true
- },
- type: 'value'
- }
- ],
- series: [
- {
- name: '出库',
- type: 'line',
- //stack: 'Total',
- label: {
- show: true,
- position: 'top'
- },
- lineStyle: { // 设置线条的style等
- normal: {
- color: '#40A0FF', // 折线线条颜色:红色
- },
- },
- itemStyle: {
- normal: {
- //这里是颜色
- color: function (params) {
- //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- var colorList = ['#40A0FF'];
- return colorList[params.dataIndex]
- }
- }
- },
- areaStyle: {},
- emphasis: {
- focus: 'series'
- },
- data: data.series[0].data//[78, 93, 76, 55, 68, 89, 82]
- },
- {
- name: '入库',
- type: 'line',
- //stack: 'Total',
- label: {
- show: true,
- position: 'top'
- },
- areaStyle: {},
- lineStyle: { // 设置线条的style等
- normal: {
- color: '#23B89A', // 折线线条颜色:红色
- },
- },
- itemStyle: {
- normal: {
- //这里是颜色
- color: function (params) {
- //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- var colorList = ['#23B89A'];
- return colorList[params.dataIndex]
- }
- }
- },
- emphasis: {
- focus: 'series'
- },
- data: data.series[1].data//[38, 23, 36, 45, 58, 59, 62]
- }
- ,
- {
- name: '移库',
- type: 'line',
- //stack: 'Total',
- label: {
- show: true,
- position: 'top'
- },
- lineStyle: { // 设置线条的style等
- normal: {
- color: '#FF8541', // 折线线条颜色:红色
- },
- },
- areaStyle: {},
- itemStyle: {
- normal: {
- //这里是颜色
- color: function (params) {
- //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- var colorList = ['#FF8541'];
- return colorList[params.dataIndex]
- }
- }
- },
- emphasis: {
- focus: 'series'
- },
- data: data.series[2].data//[8, 3, 6, 5, 8, 9, 6]
- },
- {
- name: '组盘',
- type: 'line',
- //stack: 'Total',
- label: {
- show: true,
- position: 'top'
- },
- lineStyle: { // 设置线条的style等
- normal: {
- color: '#9287e7', // 折线线条颜色:红色
- },
- },
- areaStyle: {},
- itemStyle: {
- normal: {
- //这里是颜色
- color: function (params) {
- //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
- var colorList = ['#9287e7'];
- return colorList[params.dataIndex]
- }
- }
- },
- emphasis: {
- focus: 'series'
- },
- data: data.series[3].data//[8, 3, 6, 5, 8, 9, 6]
- },
- ]
- };
- option && myChart.setOption(option);
- }
- function GetTaskGoodsTypesData(data) {
- var dom = document.getElementById(tabName + 'BomType');
- var myChart = echarts.init(dom, null, {
- renderer: 'canvas',
- useDirtyRect: false
- });
- var option;
- option = {
- tooltip: {
- trigger: 'item',
- position: ['20%', '50%']
- },
- legend: {
- data: data.map(item => item.name),
- orient: 'vertical',
- top: "15",
- //right: '-80%',
- textStyle: { color: "#000000" },//字体颜色
- //icon: "circle"//图例形状设置
- //orient: 'vertical',
- //right: 'right'
- left: '66%',//调整位置
- tooltip: {
- show: true,
- trigger: 'item',//鼠标移动上去展示全称
- },
- formatter: function (params) {
- var val = "";
- if (!!params && params.length > 6) {
- val = params.substr(0, 12) + '...';
- return val;
- } else {
- return params;
- }
- },
- },
- series: [
- {
- name: '物料占比',
- type: 'pie',
- radius: ['30%', '60%'],
- avoidLabelOverlap: false,
- itemStyle: {
- normal: {
- label: {
- show: false
- },
- labelLine: {
- show: false
- },
- color: function (colors) {
- var colorList = [
- '#12D8E4',
- '#75B1FF',
- '#3383FF',
- '#FFCD7E',
- '#FF8A8A',
- '#23B89A',
- '#F4BD37',
- '#D8E7FC',
- '#E46989',
- ];
- return colorList[colors.dataIndex];
- }
- }
- },
- label: {
- show: false,
- position: 'center'
- },
- emphasis: {
- label: {
- show: true,
- fontSize: 40,
- fontWeight: 'bold'
- }
- },
- labelLine: {
- show: false
- },
- data: data
- // [
- // { value: 1048, name: '出库任务' },
- // { value: 735, name: '入库任务' },
- // { value: 580, name: '移库任务' }
- //]
- }
- ]
- };
- if (option && typeof option === 'object') {
- myChart.setOption(option);
- }
- window.addEventListener('resize', myChart.resize);
- }
- function init() {
- GetTodayTaskInOutPie(1);
- top.learun.httpAsyncGet(top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/Get7daysTaskBar?warehouse=' + tabName, function (res) {
- if (res.code > 0) {
- Get7daysTaskBar(res.data);
- }
- });
- top.learun.httpAsyncGet(top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/GettodaysHourTask?warehouse=' + tabName, function (res) {
- if (res.code > 0) {
- GettodaysHourTask(res.data);
- }
- });
- top.learun.httpAsyncGet(top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/GetHourTask?warehouse=' + tabName, function (res) {
- if (res.code > 0) {
- GetHourTask(res.data);
- }
- });
- top.learun.httpAsyncGet(top.$.rootUrl + '/' + Tenant + '/Report/GetLocationUsageReportList?queryJson=%7B%7D', function (res) {
- if (res.code > 0) {
- var datas = [];
- var WarehouseCellPie = [];
- let MaterilLocation = 0, SpareLocation = 0, StopLocation = 0, LockLocation = 0;
- for (var i = 0; i < res.data.length; i++) {
- if (tabName == "fj1") {
- if (res.data[i].Tunnel == '1') {
- datas.push({ tunnel: "一巷道", qty: res.data[i].MaterilLocation, total: res.data[i].AllLocationTotal });
- MaterilLocation += res.data[i].MaterilLocation;
- SpareLocation += res.data[i].SpareLocation;
- StopLocation += res.data[i].StopLocation;
- LockLocation += res.data[i].LockLocation;
- } else if (res.data[i].Tunnel == '2') {
- datas.push({ tunnel: "二巷道", qty: res.data[i].MaterilLocation, total: res.data[i].AllLocationTotal });
- MaterilLocation += res.data[i].MaterilLocation;
- SpareLocation += res.data[i].SpareLocation;
- StopLocation += res.data[i].StopLocation;
- LockLocation += res.data[i].LockLocation;
- }
- }
- else if (tabName == "fj2") {
- if (res.data[i].Tunnel == '3') {
- datas.push({ tunnel: "三巷道", qty: res.data[i].MaterilLocation, total: res.data[i].AllLocationTotal });
- MaterilLocation += res.data[i].MaterilLocation;
- SpareLocation += res.data[i].SpareLocation;
- StopLocation += res.data[i].StopLocation;
- LockLocation += res.data[i].LockLocation;
- } else if (res.data[i].Tunnel == '4') {
- datas.push({ tunnel: "四巷道", qty: res.data[i].MaterilLocation, total: res.data[i].AllLocationTotal });
- MaterilLocation += res.data[i].MaterilLocation;
- SpareLocation += res.data[i].SpareLocation;
- StopLocation += res.data[i].StopLocation;
- LockLocation += res.data[i].LockLocation;
- }
- }
- else if (tabName == "fj3") {
- if (res.data[i].Tunnel == '5') {
- datas.push({ tunnel: "五巷道", qty: res.data[i].MaterilLocation, total: res.data[i].AllLocationTotal });
- MaterilLocation += res.data[i].MaterilLocation;
- SpareLocation += res.data[i].SpareLocation;
- StopLocation += res.data[i].StopLocation;
- LockLocation += res.data[i].LockLocation;
- } else if (res.data[i].Tunnel == '6') {
- datas.push({ tunnel: "六巷道", qty: res.data[i].MaterilLocation, total: res.data[i].AllLocationTotal });
- MaterilLocation += res.data[i].MaterilLocation;
- SpareLocation += res.data[i].SpareLocation;
- StopLocation += res.data[i].StopLocation;
- LockLocation += res.data[i].LockLocation;
- }
- }
- else if (tabName == "fjall") {
- if (res.data[i].Tunnel == '1') {
- datas.push({ tunnel: "一巷道", qty: res.data[i].MaterilLocation, total: res.data[i].AllLocationTotal });
- MaterilLocation += res.data[i].MaterilLocation;
- SpareLocation += res.data[i].SpareLocation;
- StopLocation += res.data[i].StopLocation;
- LockLocation += res.data[i].LockLocation;
- } else if (res.data[i].Tunnel == '2') {
- datas.push({ tunnel: "二巷道", qty: res.data[i].MaterilLocation, total: res.data[i].AllLocationTotal });
- MaterilLocation += res.data[i].MaterilLocation;
- SpareLocation += res.data[i].SpareLocation;
- StopLocation += res.data[i].StopLocation;
- LockLocation += res.data[i].LockLocation;
- }
- else if (res.data[i].Tunnel == '3') {
- datas.push({ tunnel: "三巷道", qty: res.data[i].MaterilLocation, total: res.data[i].AllLocationTotal });
- MaterilLocation += res.data[i].MaterilLocation;
- SpareLocation += res.data[i].SpareLocation;
- StopLocation += res.data[i].StopLocation;
- LockLocation += res.data[i].LockLocation;
- } else if (res.data[i].Tunnel == '4') {
- datas.push({ tunnel: "四巷道", qty: res.data[i].MaterilLocation, total: res.data[i].AllLocationTotal });
- MaterilLocation += res.data[i].MaterilLocation;
- SpareLocation += res.data[i].SpareLocation;
- StopLocation += res.data[i].StopLocation;
- LockLocation += res.data[i].LockLocation;
- }
- else if (res.data[i].Tunnel == '5') {
- datas.push({ tunnel: "五巷道", qty: res.data[i].MaterilLocation, total: res.data[i].AllLocationTotal });
- MaterilLocation += res.data[i].MaterilLocation;
- SpareLocation += res.data[i].SpareLocation;
- StopLocation += res.data[i].StopLocation;
- LockLocation += res.data[i].LockLocation;
- } else if (res.data[i].Tunnel == '6') {
- datas.push({ tunnel: "六巷道", qty: res.data[i].MaterilLocation, total: res.data[i].AllLocationTotal });
- MaterilLocation += res.data[i].MaterilLocation;
- SpareLocation += res.data[i].SpareLocation;
- StopLocation += res.data[i].StopLocation;
- LockLocation += res.data[i].LockLocation;
- }
- }
- }
- //var data = [{ "qty": 16, "total": 1732 }, { "qty": 787, "total": 1732 }, { "qty": 841, "total": 1700 }];
- GetTunnelWarehouseCellBar(datas);
- WarehouseCellPie.push({ value: MaterilLocation, name: '已使用' });
- WarehouseCellPie.push({ value: SpareLocation, name: '空闲' });
- WarehouseCellPie.push({ value: StopLocation, name: '禁用' });
- WarehouseCellPie.push({ value: LockLocation, name: '锁定' });
- GetWarehouseCellPie(WarehouseCellPie);
- }
- });
- GetTaskGoodsTypes(1);
- }
- function GetTodayTaskInOutPie(data) {
- top.learun.httpAsyncGet(top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/GetTodayTaskInOutPie?bctime=' + data + '&warehouse=' + tabName, function (res) {
- if (res.code > 0) {
- var datas = [];
- for (var i = 0; i < res.data.tasks.length; i++) {
- if (res.data.tasks[i].name == '出库') {
- $("#" + tabName + "outtoday").text(res.data.tasks[i].value);
- datas.push({ value: res.data.tasks[i].value, name: "出库" });
- }
- else if (res.data.tasks[i].name == '入库') {
- $("#" + tabName + "intoday").text(res.data.tasks[i].value);
- datas.push({ value: res.data.tasks[i].value, name: "入库" });
- }
- else if (res.data.tasks[i].name == '移库') {
- $("#" + tabName + "movetoday").text(res.data.tasks[i].value);
- datas.push({ value: res.data.tasks[i].value, name: "移库" });
- }
- else if (res.data.tasks[i].name == '组盘') {
- $("#" + tabName + "SetPlate").text(res.data.tasks[i].value);
- datas.push({ value: res.data.tasks[i].value, name: "组盘" });
- }
- }
- GetTodayInOutPie({ total: res.data.total, datas: datas });
- }
- });
- }
- function GetTaskGoodsTypes(data) {
- top.learun.httpAsyncGet(top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/GetTaskGoodsTypes?warehouse=' + tabName + '&bctime=' + data, function (res) {
- if (res.code > 0) {
- GetTaskGoodsTypesData(res.data);
- }
- });
-
- }
- function GetDailyStatistics(data, begin, end) {
- let url = '';
- if (data) {
- url = top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/GetDailyStatistics?bctime=' + data + '&begintime=' + begin + '&endtime=' + end;
- }
- else {
- url = top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/GetDailyStatistics?begintime=' + begin + '&endtime=' + end;
- }
- top.learun.httpAsyncGet(url, function (res) {
- $("#btn_Search").removeAttr('disabled');
- if (res.code > 0) {
- //
- var orderhtml = "";
- var orderres = eval(res.data.rows);
- $.each(orderres, function (index, orderres) {
- orderhtml += "<div style='position:relative;width:100%;'>";
- orderhtml += "<label class='portal-panel-content-lable'>" + orderres.WarehouseName + "</label>";
- orderhtml += "<label class='portal-panel-content-lable'>" + orderres.TrussNorthQty + "</label>";
- orderhtml += "<label class='portal-panel-content-lable'>" + orderres.TrussSouthQty + "</label>";
- orderhtml += "<label class='portal-panel-content-lable'>" + orderres.CircularSouthQty + "</label>";
- orderhtml += "<label class='portal-panel-content-lable'>" + orderres.CircularNorthQty + "</label>";
- orderhtml += "<label class='portal-panel-content-lable'>" + orderres.DailySummary + "</label>";
- orderhtml += "<label class='portal-panel-content-lable'>" + orderres.FullNormalQty + "</label>";
- orderhtml += "<label class='portal-panel-content-lable'>" + orderres.EmptyAbnormalQty + "</label>";
- orderhtml += "<label class='portal-panel-content-lable'>" + orderres.EmptyAutomaticQty + "</label>";
- orderhtml += "<label class='portal-panel-content-lable'>" + orderres.EmptyWarehouseQty + "</label>";
- orderhtml += "</div>";
- });
- $("#dailylst").html(orderhtml);
- }
- });
- }
- function bind() {
- $('#dailybegin').val(YStartDate);
- $('#dailyend').val(YEndDate);
- $('.' + tabName + 'todaytask').on('click', function () {
- let bctime = $(this).attr("bctime");
- for (var i = 0; i < $("." + tabName + "todaytask").length; i++) {
- $($("." + tabName + "todaytask")[i]).removeClass("btn-primary");
- $($("." + tabName + "todaytask")[i]).addClass("btn-default");
- }
- $(this).removeClass("btn-default");
- $(this).addClass("btn-primary");
- GetTodayTaskInOutPie(bctime);
- });
- $('.' + tabName + 'todaytype').on('click', function () {
- let bctime = $(this).attr("bctime");
- for (var i = 0; i < $("." + tabName + "todaytype").length; i++) {
- $($("." + tabName + "todaytype")[i]).removeClass("btn-primary");
- $($("." + tabName + "todaytype")[i]).addClass("btn-default");
- }
- $(this).removeClass("btn-default");
- $(this).addClass("btn-primary");
- GetTaskGoodsTypes(bctime);
- });
- $('.fjdailytime').on('click', function () {
- let bctime = $(this).attr("bctime");
- for (var i = 0; i < $(".fjdailytime").length; i++) {
- $($(".fjdailytime")[i]).removeClass("btn-primary");
- $($(".fjdailytime")[i]).addClass("btn-default");
- }
- $(this).removeClass("btn-default");
- $(this).addClass("btn-primary");
- GetDailyStatistics(bctime, '', '');
- });
- //$('#lr_left_list a').click(function (e) {
- // $(this).tab('show');
- //})
- $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
- // 获取已激活的标签页的名称
- //tabName = $(e.target).text();
- var seltab = $(e.target).attr("tabvalue");
- tabName = "fj" + seltab;
- if (seltab == 'daily') {
- $('.' + tabName + 'time' + ':first')[0].click();
- return;
- }
-
- $('.' + tabName + 'todaytask').on('click', function () {
- let bctime = $(this).attr("bctime");
- for (var i = 0; i < $("." + tabName + "todaytask").length; i++) {
- $($("." + tabName + "todaytask")[i]).removeClass("btn-primary");
- $($("." + tabName + "todaytask")[i]).addClass("btn-default");
- }
- $(this).removeClass("btn-default");
- $(this).addClass("btn-primary");
- GetTodayTaskInOutPie(bctime);
- });
- $('.' + tabName + 'todaytype').on('click', function () {
- let bctime = $(this).attr("bctime");
- for (var i = 0; i < $("." + tabName + "todaytype").length; i++) {
- $($("." + tabName + "todaytype")[i]).removeClass("btn-primary");
- $($("." + tabName + "todaytype")[i]).addClass("btn-default");
- }
- $(this).removeClass("btn-default");
- $(this).addClass("btn-primary");
- GetTaskGoodsTypes(bctime);
- });
- init();
- $('.' + tabName + 'todaytask' + ':first')[0].click();
- $('.' + tabName + 'todaytype' + ':first')[0].click();
-
- });
- // 查询
- $('#btn_Search').on('click', function () {
- var begin = $('#dailybegin').val();
- var end = $('#dailyend').val();
- if (begin.length <=0) {
- alert('时间输入不能为空!');
- return;
- }
- if (end.length <= 0) {
- alert('时间输入不能为空!');
- return;
- }
- $("#btn_Search").attr('disabled',true);
- GetDailyStatistics(null, begin, end);
- //top.learun.httpAsyncGet(top.$.rootUrl + '/' + Tenant + '/AdminDesktopHome/GetDailyStatistics?begintime=' + begin + '&endtime=' + begin, function (res) {
- // if (res.code > 0) {
- // //
- // var orderhtml = "";
- // var orderres = eval(res.data.rows);
- // $.each(orderres, function (index, orderres) {
- // orderhtml += "<div style='position:relative;width:100%;'>";
- // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.WarehouseName + "</label>";
- // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.TrussNorthQty + "</label>";
- // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.TrussSouthQty + "</label>";
- // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.CircularSouthQty + "</label>";
- // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.CircularNorthQty + "</label>";
- // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.DailySummary + "</label>";
- // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.FullNormalQty + "</label>";
- // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.EmptyAbnormalQty + "</label>";
- // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.EmptyAutomaticQty + "</label>";
- // orderhtml += "<label class='portal-panel-content-lable'>" + orderres.EmptyWarehouseQty + "</label>";
-
- // orderhtml += "</div>";
- // });
- // $("#dailylst").html(orderhtml);
- // }
- //});
- });
- }
- bind();
- init();
- });
|