From fda716cd036010f1f6bfbd12227388b35fad3428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Wed, 8 Jul 2020 00:22:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erp_web/home.html | 102 +++++++++++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 42 deletions(-) diff --git a/erp_web/home.html b/erp_web/home.html index 71392ec9..2c33021a 100644 --- a/erp_web/home.html +++ b/erp_web/home.html @@ -123,41 +123,53 @@ }).find('.box-header, .nav-tabs').css('cursor', 'move'); $(function () { - $.ajax({ - type: "get", - url: "/depotHead/getBuyAndSaleStatistics", - dataType: "json", - success: function (res) { - if(res && res.code === 200) { - if(res.data) { - $("#todaySale").text((res.data.todaySale).toFixed(2)); - $("#thisMonthSale").text((res.data.thisMonthSale).toFixed(2)); - $("#thisMonthBuy").text((res.data.thisMonthBuy).toFixed(2)); + var loginName = sessionStorage.getItem("loginName"); + if(loginName!="admin") { + $.ajax({ + type: "get", + url: "/depotHead/getBuyAndSaleStatistics", + dataType: "json", + success: function (res) { + if (res && res.code === 200) { + if (res.data) { + $("#todaySale").text((res.data.todaySale).toFixed(2)); + $("#thisMonthSale").text((res.data.thisMonthSale).toFixed(2)); + $("#thisMonthBuy").text((res.data.thisMonthBuy).toFixed(2)); + } } - } - }, - error:function(res){ + }, + error: function (res) { - } - }); + } + }); + } else { + $("#todaySale").text("--"); + $("#thisMonthSale").text("--"); + $("#thisMonthBuy").text("--"); + } }); $(function () { - $.ajax({ - type: "get", - url: "/account/getStatistics", - dataType: "json", - success: function (res) { - if (res && res.code === 200) { - if(res.data) { - $("#thisMonthAmount").text((res.data.allMonthAmount-0).toFixed(2)); + var loginName = sessionStorage.getItem("loginName"); + if(loginName!="admin") { + $.ajax({ + type: "get", + url: "/account/getStatistics", + dataType: "json", + success: function (res) { + if (res && res.code === 200) { + if(res.data) { + $("#thisMonthAmount").text((res.data.allMonthAmount-0).toFixed(2)); + } } - } - }, - error:function(res){ + }, + error:function(res){ - } - }); + } + }); + } else { + $("#thisMonthAmount").text("--"); + } }); function getChartObj(titleName, categories, seriesData) { @@ -184,21 +196,27 @@ return chartObj; } $(function () { - $.ajax({ - type: "get", - url: "/depotItem/buyOrSalePrice", - dataType: "json", - success: function (res) { - if(res && res.code === 200) { - var data = res.data; - Highcharts.chart('buyIn', getChartObj("最近6个月采购数据", res.data.monthList, res.data.buyPriceList)); - Highcharts.chart('saleOut', getChartObj("最近6个月销售数据", res.data.monthList, res.data.salePriceList)); - } - }, - error:function(res){ + var loginName = sessionStorage.getItem("loginName"); + if(loginName!="admin") { + $.ajax({ + type: "get", + url: "/depotItem/buyOrSalePrice", + dataType: "json", + success: function (res) { + if (res && res.code === 200) { + var data = res.data; + Highcharts.chart('buyIn', getChartObj("最近6个月采购数据", res.data.monthList, res.data.buyPriceList)); + Highcharts.chart('saleOut', getChartObj("最近6个月销售数据", res.data.monthList, res.data.salePriceList)); + } + }, + error: function (res) { - } - }); + } + }); + } else { + Highcharts.chart('buyIn', getChartObj("最近6个月采购数据", [], [])); + Highcharts.chart('saleOut', getChartObj("最近6个月销售数据", [], [])); + } }); \ No newline at end of file