123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062 |
- //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'],
- //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]
- }
- ]
- };
- if (option && typeof option === 'object') {
- myChart.setOption(option);
- }
- }
- function GetWarehouseCellPie(data) {
- var chartDom = document.getElementById('fj1WarehouseCell');
- 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 = [
- '#D4A800', '#258E3C',
- '#CC0000',
- '#6A5ACD',
- ];
- 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]
- }
- ]
- };
- 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]
- }
- ]
- };
- 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;
- res.data.sort((a, b) => a.Sort - b.Sort)
- MaterilLocation += res.data[0].MaterilLocation;
- SpareLocation += res.data[0].SpareLocation;
- StopLocation += res.data[0].StopLocation;
- LockLocation += res.data[0].LockLocation;
- datas.push({ tunnel: '桁架一', qty: res.data[1].MaterilLocation, total: res.data[1].AllLocationTotal });
- datas.push({ tunnel: '桁架二', qty: res.data[2].MaterilLocation, total: res.data[2].AllLocationTotal });
- datas.push({ tunnel: '桁架三', qty: res.data[3].MaterilLocation, total: res.data[3].AllLocationTotal });
-
- //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();
- });
|