Bläddra i källkod

refactor(api): 优化获取去年同季度数据接口并添加新参数

- 在 getLastQuarterYoY2 函数中添加 isCurrent 参数,用于区分当前季度和去年同季度
- 优化 visualization 组件中的 getTaxTop10 方法,使用新参数获取更准确的数据
- 修复去年同季度数据为0 或空时的处理逻辑,提高数据准确性
nahida 1 år sedan
förälder
incheckning
f12b9d31b5
2 ändrade filer med 6 tillägg och 8 borttagningar
  1. 3 2
      src/api/buscmonitoring/index.js
  2. 3 6
      src/views/visualization/index.vue

+ 3 - 2
src/api/buscmonitoring/index.js

@@ -33,12 +33,13 @@ export const getYearTotalData2 = ()=>{
   })
 }
 
-export const getLastQuarterYoY2 = (quarter)=>{
+export const getLastQuarterYoY2 = (quarter,isCurrent)=>{
   return request({
     url:'/crmEnterpriseTaxPaymentInfo/getListByQuarterYoY',
     method:'get',
     params:{
-      quarter
+      quarter,
+      isCurrent
     }
   })
 }

+ 3 - 6
src/views/visualization/index.vue

@@ -251,13 +251,10 @@ const specialQuarter2 = computed(() => {
 const RanKingData = ref([]);
 const rankImgIconArr = [one, two, three, four, five, six, seven, eight, nine, ten];
 const getTaxTop10 = async () => {
-  let res = await getLastQuarterYoY2(specialQuarter.value.quarter);
-  // console.log(specialQuarter.value,111111111);
-  // console.log(specialQuarter2.value,1222222222222);
-  // console.log(res, 7777);
+  let res = await getLastQuarterYoY2(specialQuarter.value.quarter,false);
   if (res.code == 200) {
-    if (res.data[0].lastQuarterCurrentTotal == 0) {
-      res = await getLastQuarterYoY2(specialQuarter2.value.quarter);
+    if (res.data[0].lastQuarterCurrentTotal == 0 || res.data[0].lastQuarterCurrentTotal == null) {
+      res = await getLastQuarterYoY2(specialQuarter2.value.quarter,false);
     }
     res.data = res.data.slice(0, 10);
     if(!specialQuarter.value.isPassYear && !specialQuarter2.value.isPassYear){