Browse Source

1、社区统计

slowslo 4 years ago
parent
commit
e5a6acf687

+ 5 - 2
src/api/community/agency.js

@@ -48,10 +48,13 @@ export const update = (row) => {
   })
 }
 
-export const dataStat = () => {
+export const dataStat = (agencyType) => {
   return request({
     url: '/api/cyzh-community/statistics/dataStat',
-    method: 'get'
+    method: 'get',
+    params:{
+      agencyType
+    }
   })
 }
 

+ 54 - 11
src/views/businessmng/agencymng/agency.vue

@@ -4,11 +4,16 @@
     <!--卡片数据展示-->
     <el-card style="margin-bottom: 20px">
       <el-tabs type="border-card">
-        <el-tab-pane label="园区数据统计">
+        <el-tab-pane label="社区数据统计" v-if="tenantType == 0">
           <div>
             <avue-data-box :option="communityStatistics"></avue-data-box>
           </div>
         </el-tab-pane>
+        <el-tab-pane label="园区数据统计" v-else>
+          <div>
+            <avue-data-box :option="parkStatistics"></avue-data-box>
+          </div>
+        </el-tab-pane>
       </el-tabs>
     </el-card>
 
@@ -39,7 +44,7 @@
         </el-button>
       </template>
     </avue-crud>
-    
+
      <agencymng ref="agencymng"></agencymng>
   </basic-container>
 </template>
@@ -89,15 +94,44 @@
           currentPage: 1,
           total: 0
         },
-        //数据展示
+        //社区数据展示
         communityStatistics: {
           span: 6,
           data: [{
-              title: '区数量',
+              title: '区数量',
               count: 0,
               icon: 'el-icon-office-building',
               color: 'rgb(49, 180, 141)',
             },
+            {
+              title: '小区数量',
+              count: 0,
+              icon: 'el-icon-school',
+              color: 'rgb(56, 161, 242)',
+            },
+            {
+              title: '楼栋数量',
+              count: 0,
+              icon: 'el-icon-s-home',
+              color: 'rgb(117, 56, 199)',
+            },
+            {
+              title: '住户数量',
+              count: 0,
+              icon: 'el-icon-user-solid',
+              color: 'rgb(143,119,0)',
+            },
+          ]
+        },
+        //园区数据展示
+        parkStatistics: {
+          span: 6,
+          data: [{
+            title: '园区数量',
+            count: 0,
+            icon: 'el-icon-office-building',
+            color: 'rgb(49, 180, 141)',
+          },
             {
               title: '楼宇数量',
               count: 0,
@@ -351,7 +385,7 @@
       };
     },
     computed: {
-      ...mapGetters(["permission"]),
+      ...mapGetters(["permission", "tenantType"]),
       permissionList() {
         return {
           addBtn: this.vaildData(this.permission.agencymng_add, false),
@@ -523,12 +557,21 @@
         this.onLoad(this.page, this.query);
       },
       onLoad(page, params = {}) {
-        dataStat().then(res => {
-          this.communityCount = res.data.data;
-          this.communityStatistics.data[0].count = this.communityCount.agencyCount;
-          this.communityStatistics.data[1].count = this.communityCount.buildingCount;
-          this.communityStatistics.data[2].count = this.communityCount.enterpriseCount;
-          this.communityStatistics.data[3].count = this.communityCount.staffCount;
+        let agencyType = this.tenantType == 0? 1:2;
+        dataStat(agencyType).then(res => {
+          if(this.tenantType == 0){
+            this.communityCount = res.data.data;
+            this.communityStatistics.data[0].count = this.communityCount.agencyCount;
+            this.communityStatistics.data[1].count = this.communityCount.buildingCount;
+            this.communityStatistics.data[2].count = this.communityCount.enterpriseCount;
+            this.communityStatistics.data[3].count = this.communityCount.houseUserCount;
+          }else{
+            this.parkCount = res.data.data;
+            this.parkStatistics.data[0].count = this.parkCount.agencyCount;
+            this.parkStatistics.data[1].count = this.parkCount.residentialCount;
+            this.parkStatistics.data[2].count = this.parkCount.buildingCount;
+            this.parkStatistics.data[3].count = this.parkCount.staffCount;
+          }
         });
         this.loading = true;
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {

+ 6 - 1
src/views/smartaccess/comps/menu-list.vue

@@ -40,6 +40,7 @@
 </template>
 
 <script>
+  import {mapGetters} from "vuex";
   export default {
     name: "menu-list",
     data() {
@@ -75,6 +76,9 @@
     created() {
       this.fetchStatus()
     },
+    computed: {
+      ...mapGetters(["tenantType"])
+    },
     methods: {
       reset() {
         this.searchForm = {
@@ -89,10 +93,11 @@
         if (this.menuIndex == 0) {
           //搜索常驻人员
           data = {
-            realName: this.searchForm.name,
+            // realName: this.searchForm.name,
             phone: this.searchForm.phone,
             idcard: this.searchForm.idCard
           }
+          this.tenantType == 0? data.name = this.searchForm.name : data.realName = this.searchForm.name;
         } else if (this.menuIndex == 1) {
           //拜访人员
           data = {