From 6d2cd8af63b855201fe04c2d5dea63650b699b5d Mon Sep 17 00:00:00 2001 From: jishenghua <752718920@qq.com> Date: Sat, 3 Feb 2024 21:25:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5=E7=9A=84?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=80=BB=E8=BE=91=EF=BC=8C=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jshERP-web/src/api/api.js | 12 ++++-- jshERP-web/src/views/dashboard/IndexChart.vue | 39 +++++++++++++++++-- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/jshERP-web/src/api/api.js b/jshERP-web/src/api/api.js index 32239730..3b6a2d20 100644 --- a/jshERP-web/src/api/api.js +++ b/jshERP-web/src/api/api.js @@ -1,8 +1,10 @@ import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage' //首页统计 -const getBuyAndSaleStatistics = (params)=>getAction("/depotHead/getBuyAndSaleStatistics",params); -const buyOrSalePrice = (params)=>getAction("/depotItem/buyOrSalePrice",params); +const getBuyAndSaleStatisticsByType = (params)=>getAction("/depotHead/getBuyAndSaleStatisticsByType",params); +const getBuyPrice = (params)=>getAction("/depotItem/getBuyPrice",params); +const getSalePrice = (params)=>getAction("/depotItem/getSalePrice",params); +const getRetailPrice = (params)=>getAction("/depotItem/getRetailPrice",params); //租户管理 const checkTenant = (params)=>getAction("/tenant/checkIsNameExist",params); const editTenant = (params)=>putAction("/tenant/update",params); @@ -113,8 +115,10 @@ const getBatchNumberList = (params)=>getAction("/depotItem/getBatchNumberList",p const findFinancialDetailByNumber = (params)=>getAction("/accountHead/getDetailByNumber",params); export { - getBuyAndSaleStatistics, - buyOrSalePrice, + getBuyAndSaleStatisticsByType, + getBuyPrice, + getSalePrice, + getRetailPrice, checkTenant, editTenant, addRole, diff --git a/jshERP-web/src/views/dashboard/IndexChart.vue b/jshERP-web/src/views/dashboard/IndexChart.vue index 898f3e1d..e7e52370 100644 --- a/jshERP-web/src/views/dashboard/IndexChart.vue +++ b/jshERP-web/src/views/dashboard/IndexChart.vue @@ -156,7 +156,7 @@ import LineChartMultid from '@/components/chart/LineChartMultid' import HeadInfo from '@/components/tools/HeadInfo.vue' import Trend from '@/components/Trend' - import { getBuyAndSaleStatistics, buyOrSalePrice, getPlatformConfigByKey } from '@/api/api' + import { getBuyAndSaleStatisticsByType, getBuyPrice, getSalePrice, getRetailPrice, getPlatformConfigByKey } from '@/api/api' import { handleIntroJs } from "@/utils/util" import { getAction,postAction } from '../../api/manage' import Vue from 'vue' @@ -213,15 +213,46 @@ }, methods: { initInfo () { - getBuyAndSaleStatistics().then((res)=>{ + getBuyAndSaleStatisticsByType({"type": "today"}).then((res)=>{ if(res.code === 200){ - this.statistics = res.data; + this.statistics.todayBuy = res.data.todayBuy; + this.statistics.todaySale = res.data.todaySale; + this.statistics.todayRetailSale = res.data.todayRetailSale; } }) - buyOrSalePrice().then(res=>{ + getBuyAndSaleStatisticsByType({"type": "month"}).then((res)=>{ + if(res.code === 200){ + this.statistics.monthBuy = res.data.monthBuy; + this.statistics.monthSale = res.data.monthSale; + this.statistics.monthRetailSale = res.data.monthRetailSale; + } + }) + getBuyAndSaleStatisticsByType({"type": "yesterday"}).then((res)=>{ + if(res.code === 200){ + this.statistics.yesterdayBuy = res.data.yesterdayBuy; + this.statistics.yesterdaySale = res.data.yesterdaySale; + this.statistics.yesterdayRetailSale = res.data.yesterdayRetailSale; + } + }) + getBuyAndSaleStatisticsByType({"type": "year"}).then((res)=>{ + if(res.code === 200){ + this.statistics.yearBuy = res.data.yearBuy; + this.statistics.yearSale = res.data.yearSale; + this.statistics.yearRetailSale = res.data.yearRetailSale; + } + }) + getBuyPrice().then(res=>{ if(res.code === 200){ this.buyPriceData = res.data.buyPriceList; + } + }) + getSalePrice().then(res=>{ + if(res.code === 200){ this.salePriceData = res.data.salePriceList; + } + }) + getRetailPrice().then(res=>{ + if(res.code === 200){ this.retailPriceData = res.data.retailPriceList; } })