소스 검색

fixed:修改行政处罚的来源与官网一样 将可视化的部分写活

nahida 1 년 전
부모
커밋
8f0740c6e0
3개의 변경된 파일65개의 추가작업 그리고 40개의 파일을 삭제
  1. 8 0
      src/api/visualization/index.js
  2. 2 2
      src/components/baseEcharts/index.vue
  3. 55 38
      src/views/visualization/index.vue

+ 8 - 0
src/api/visualization/index.js

@@ -124,6 +124,14 @@ export function getAdministrativeSanction(query) {
     params: query
   })
 }
+// 查询行政处罚
+export function getAllAdministrativeSanction(query) {
+  return request({
+    url: '/crmAdministrativePenalty/getList',
+    method: 'get',
+    params: query
+  })
+}
 // 查询行政强制执行
 export function getAdministrativeEnforcement(query) {
   return request({

+ 2 - 2
src/components/baseEcharts/index.vue

@@ -74,12 +74,12 @@ const myEchartData = () => {
         },
         series: [
             {
-                name: '2023',
+                name: (new Date().getFullYear()-1).toString(),
                 type: 'bar',
                 data: props.ArrOneData
             },
             {
-                name: '2024',
+                name: (new Date().getFullYear()).toString(),
                 type: 'bar',
                 data: props.ArrTwoData
             }

+ 55 - 38
src/views/visualization/index.vue

@@ -102,7 +102,6 @@
         </div>
 
 
-
         <div class="rightIndustryComplianceBox">
           <div class="RICBTitle">企业经营合规</div>
           <div class="RICBTContent">
@@ -171,7 +170,7 @@ import sumUsingNumberTwo from '@/assets/visualizationimg/twopack.png';
 import sumUsingNumberthree from '@/assets/visualizationimg/threepick.png';
 import {
   getAdministrativeEnforcement,
-  getAdministrativeSanction,
+  getAllAdministrativeSanction,
   getBusinessAdnormalities,
   getClassificationValueData,
   getCreditScoreList,
@@ -223,17 +222,17 @@ const getCurrentQuarter = () => {
   return Math.ceil(month / 3);
 };
 const specialQuarter = computed(() => {
-  let a = getCurrentQuarter()-1;
-  if(a == 0){
+  let a = getCurrentQuarter() - 1;
+  if (a == 0) {
     a = 4
   }
   return a;
 })
 const specialQuarter2 = computed(() => {
-  let a = getCurrentQuarter()-2;
-  if(a == 0){
+  let a = getCurrentQuarter() - 2;
+  if (a == 0) {
     a = 4
-  }else if(a == -1){
+  } else if (a == -1) {
     a = 3
   }
   return a;
@@ -242,9 +241,9 @@ const RanKingData = ref([]);
 const rankImgIconArr = [one, two, three, four, five, six, seven, eight, nine, ten];
 const getTaxTop10 = async () => {
   let res = await getLastQuarterYoY2(specialQuarter.value);
-  console.log(res,7777);
+  console.log(res, 7777);
   if (res.code == 200) {
-    if(res.data[0].lastQuarterCurrentTotal == 0){
+    if (res.data[0].lastQuarterCurrentTotal == 0) {
       res = await getLastQuarterYoY2(specialQuarter2.value);
     }
     res.data = res.data.slice(0, 10);
@@ -485,30 +484,30 @@ const quarterToAmountMap = {
 
 function obtaingetTrossDomesticProduct() {
   getTrossDomesticProduct(queryParams.value).then((res) => {
-    const state2023Array = res.reduce((container, item)=>{
-      if(item.annualAmount == lastYear.value){
-        container[0] += item.firstQuarterAmount*1;
-        container[1] += item.secondQuarterAmount*1;
-        container[2] += item.thirdQuarterAmount*1;
-        container[3] += item.fourthQuarterAmount*1;
+    const state2023Array = res.reduce((container, item) => {
+      if (item.annualAmount == lastYear.value) {
+        container[0] += item.firstQuarterAmount * 1;
+        container[1] += item.secondQuarterAmount * 1;
+        container[2] += item.thirdQuarterAmount * 1;
+        container[3] += item.fourthQuarterAmount * 1;
         container[4] = container[0] + container[1] + container[2] + container[3];
       }
       return container;
-    },[0,0,0,0,0])
-    const state2024Array = res.reduce((container, item)=>{
-      if(item.annualAmount == currentYear.value){
-        container[0] += item.firstQuarterAmount*1;
-        container[1] += item.secondQuarterAmount*1;
-        container[2] += item.thirdQuarterAmount*1;
-        container[3] += item.fourthQuarterAmount*1;
+    }, [0, 0, 0, 0, 0])
+    const state2024Array = res.reduce((container, item) => {
+      if (item.annualAmount == currentYear.value) {
+        container[0] += item.firstQuarterAmount * 1;
+        container[1] += item.secondQuarterAmount * 1;
+        container[2] += item.thirdQuarterAmount * 1;
+        container[3] += item.fourthQuarterAmount * 1;
         container[4] = container[0] + container[1] + container[2] + container[3];
       }
       return container;
-    },[0,0,0,0,0])
-    const name = ['第一季度', '第二季度', '第三季度', '第四季度','年度'];
+    }, [0, 0, 0, 0, 0])
+    const name = ['第一季度', '第二季度', '第三季度', '第四季度', '年度'];
     NamechartData.value = name;
-    ArrOneData.value = state2023Array.map(q=>q.toFixed(2))
-    ArrTwoData.value = state2024Array.map(q=>q.toFixed(2))
+    ArrOneData.value = state2023Array.map(q => q.toFixed(2))
+    ArrTwoData.value = state2024Array.map(q => q.toFixed(2))
     // res.forEach(item => {
     //   if (item.annualAmount == lastYear.value) {
     //     if (quarterToAmountMap.hasOwnProperty(previousQuarter.value)) {
@@ -587,7 +586,7 @@ function obtaingetXiaoxiangCaiyinLoan() {
     // res.data.forEach(item => {
     //   state1Array.push(item.currentLoanBalance);
     // })
-    const a = res.data.map(q=>{
+    const a = res.data.map(q => {
       return Number(q.loanAmount);
     });
     // console.log("xxdd", res)
@@ -634,7 +633,7 @@ function obtaingetHuiyuanLoan() {
 }
 
 
-const business = [{
+const business = reactive([{
   title: '园区纳税企业',
   value: 96,
   ratio: '80.67%',
@@ -646,28 +645,31 @@ const business = [{
   ratio: '',
   state: 0,
   img: parktwo
-}]
+}])
 
 /** 查询社保 */
 function obtaingetSocialSecurity() {
   getSocialSecurity().then((res) => {
-    res.data = res.data.filter(q=>q.remarks.includes(currentYear.value));
+    res.data = res.data.filter(q => q.remarks.includes(currentYear.value));
     business[1].value = res.data.length;
     business[1].ratio = (res.data.length / companyNumber.value * 100).toFixed(2) + '%';
   })
   getTaxes().then((res) => {
     let result;
     let a;
-    if(res){
-      a = res.filter(q=>{
-        return  q.annualAmount == currentYear.value
+    if (res) {
+      a = res.filter(q => {
+        return q.annualAmount == currentYear.value
       })
-      if(a.length>0){
-        result = a.length/companyNumber.value*100;
+      if (a.length > 0) {
+        result = a.length / companyNumber.value * 100;
+      } else {
+        result = 0;
       }
     }
     business[0].value = a.length
-    business[0].ratio = result.toFixed(2)+'%'
+    business[0].ratio = result.toFixed(2) + '%'
+
   })
 }
 
@@ -745,7 +747,23 @@ const hyhgData = ref([])
 
 /** 查询行业合规 */
 function obtaingetAdministrativeSanction() {
-  getAdministrativeSanction(queryParams.value).then((res) => {
+  // getAdministrativeSanction(queryParams.value).then((res) => {
+  //   hyhgData.value = [{
+  //     name: '企业数量',
+  //     value: companyNumber.value
+  //   }, {
+  //     name: '行政处罚',
+  //     value: (([...new Set(res.data)].length / companyNumber.value) * 100).toFixed(2) + '%'
+  //   }, {
+  //     name: '被处罚企业数',
+  //     value: [...new Set(res.data)].length
+  //   }, {
+  //     name: '行政处罚条数',
+  //     value: res.data.length
+  //   }]
+  //   // 企业数量 被处罚企业数  行政处罚条数
+  // })
+  getAllAdministrativeSanction().then(res => {
     hyhgData.value = [{
       name: '企业数量',
       value: companyNumber.value
@@ -759,7 +777,6 @@ function obtaingetAdministrativeSanction() {
       name: '行政处罚条数',
       value: res.data.length
     }]
-    // 企业数量 被处罚企业数  行政处罚条数
   })
 }