| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278 |
- //科室切换
- $(function() {
- $(".bottomBtns1").click(function() {
- $(this).addClass('active').siblings().removeClass('active');
- var dataIndex = $(this).attr('data-index');
- administrative(dataIndex);
- });
- $(".bottomBtns2").click(function() {
- $(this).addClass('active').siblings().removeClass('active');
- var dataIndex = $(this).attr('data-index');
- distribution(dataIndex);
- });
- });
- //科室数量
- function administrative(dataIndex) {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "distributionapi/api/distributionappchart/getdepartmentwocount",
- async: true,
- dataType: 'json',
- data: {
- datetype: dataIndex,
- projectid:$("#projectID").text()
- },
- success: function(data) {
- if(data.state.toLowerCase() == 'success') {
-
- // 用电量
- $('#departmentsCount').highcharts({
- chart: {
- type: 'column',
- backgroundColor: 'transparent',
- marginRight: 25,
- marginTop: 25
- },
- title: false,
- credits: {
- enabled: false // 禁用版权信息
- },
- exporting: {
- enabled: false
- }, //隐藏导出图片
- legend: {
- enabled: false
- },
- xAxis: {
- categories: (function() {
- var xAxised = [];
- var dpartLength=data.data.list_dep;
- var dapLe;
- if (dpartLength.length<5) {
- dapLe=dpartLength.length;
- }else{
- dapLe=5;
- }
- for(var i = 0; i < dapLe; i++) {
- xAxised.push(dpartLength[i].departmentname)
- }
- return xAxised
- })(),
- crosshair: true,
- title: {
- text: "科室",
- align: 'high',
- offset: 0,
- x: 25,
- y: 8,
- style: {
- color: '#266cf8'
- }
- },
- lineColor: "#45599d",
- tickColor: 'transparent',
- labels: {
- style: {
- color: '#fff'
- }
- }
- },
- yAxis: {
- min: 0,
- title: {
- text: '数量',
- align: 'high',
- offset: 0,
- rotation: 0,
- y: -10,
- x: -10,
- style: {
- color: '#266cf8'
- },
- },
- gridLineDashStyle: 'longdash', //图表内网格线样式
- gridLineColor: '#242f5d', //图表内网格线颜色
- labels: {
- style: {
- color: '#fff'
- },
- step: 1
- },
- lineColor: '#45599d',
- lineWidth: 1
- },
- plotOptions: {
- column: {
- borderWidth: 0,
- pointWidth: 15 //柱子之间的距离值
- }
- },
- series: [{
- name: '数量',
- data: (function() {
- var seriesData = [];
- var dpartLength=data.data.list_dep
- var dapLe;
- if (dpartLength.length<5) {
- dapLe=dpartLength.length;
- }else{
- dapLe=5;
- }
- for(var i = 0; i < dapLe; i++) {
- seriesData.push(dpartLength[i].departmentwonum)
- }
-
- // console.log(seriesData)
- return seriesData.map(s => +s)
- })(),
- color: "#7787ff",
- dataLabels: {
- enabled: true,
- format: '{y}',
- style: {
- color: '#fff'
- }
- }
- }]
- });
- }
- }
- });
- }
- //配送物品前五
- function distribution(dataIndex){
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "distributionapi/api/distributionappchart/getgoodswocount",
- async: true,
- dataType: 'json',
- data: {
- datetype: dataIndex,
- projectid:$("#projectID").text()
- },
- success: function(data) {
- if(data.state.toLowerCase() == 'success') {
- // 用电量
- $('#distribCount').highcharts({
- chart: {
- type: 'bar',
- backgroundColor: 'transparent',
- marginRight: 25,
- marginTop: 25
- },
- title: false,
- credits: {
- enabled: false // 禁用版权信息
- },
- exporting: {
- enabled: false
- }, //隐藏导出图片
- legend: {
- enabled: false
- },
- xAxis: {
- categories: (function() {
- var xAxised = [];
- var dpartLength=data.data.list_goods
- if(dpartLength.length > 3){
- for(var i = 0; i < 5; i++) {
- xAxised.push(dpartLength[i].goodsname)
- }
- }
- return xAxised
- })(),
- crosshair: true,
- title: {
- text: "科室",
- align: 'high',
- offset: 10,
- x: 10,
- y: -20,
- style: {
- color: '#266cf8'
- }
- },
- lineColor: "#45599d",
- tickColor: 'transparent',
- labels: {
- style: {
- color: '#fff'
- }
- }
- },
- yAxis: {
- min: 0,
- title: {
- text: '数量',
- align: 'high',
- offset: 0,
- rotation: 0,
- y: -10,
- x: -10,
- style: {
- color: '#266cf8'
- },
- },
- gridLineDashStyle: 'longdash', //图表内网格线样式
- gridLineColor: '#242f5d', //图表内网格线颜色
- labels: {
- style: {
- color: '#fff'
- },
- step: 1
- },
- lineColor: '#45599d',
- lineWidth: 0
- },
-
- plotOptions: {
- bar: {
- borderWidth: 0,
- pointWidth: 15 //柱子之间的距离值
- }
- },
- series: [{
- name: '数量',
- data: (function() {
- var seriesData = [];
- var dpartLength=data.data.list_goods
- if(dpartLength.length > 3){
- for(var i = 0; i < 5; i++) {
- seriesData.push(dpartLength[i].goodswonum)
- }
- }
- return seriesData.map(s => +s)
- })(),
- color: "#8782f4",
-
- dataLabels: {
- enabled: true,
- format: '{y}',
- style: {
- color: '#fff'
- }
- }
- }]
- });
- }
- }
- });
-
- }
|