Przeglądaj źródła

feat(digitalDoor): 新增人员查询功能

- 添加人员查询页面和相关组件
- 实现地址选择和户类型选择功能
- 添加户籍地和居住地选择- 优化数字门牌首页菜单
梦辉 5 dni temu
rodzic
commit
19fd4fbfd9

+ 41 - 0
src/api/digitalDoor.js

@@ -0,0 +1,41 @@
+import { myFetch} from "@/utils/fetch";
+
+/**
+ * 获取街道数据
+ * /system/wg/getStreetInfo
+ */
+export function getStreetInfo (data) {
+    return myFetch('/system/wg/getStreetInfo', 'get', data, 'json');
+}
+
+/**
+ * 获取网格数据
+ * /system/wg/getGridInfo
+ */
+export function getGridInfo (data) {
+    return myFetch('/system/wg/getGridInfo', 'get', data, 'json');
+}
+
+/**
+ * 获取小区
+ * /house/bt/getGardenHouseInfo
+ */
+export function getGardenHouseInfo (data) {
+    return myFetch('/house/bt/getGardenHouseInfo', 'get', data, 'json');
+}
+
+/**
+ * 获取单元
+ * /house/bt/getUnitHouseInfo
+ */
+export function getUnitHouseInfo (data) {
+    return myFetch('/house/bt/getUnitHouseInfo', 'get', data, 'json');
+}
+
+/**
+ * 字典接口
+ * /common/getInfo
+ */
+export function getDicInfo (data) {
+    return myFetch('/common/getInfo', 'get', data, 'json');
+}

+ 6 - 0
src/pages.json

@@ -294,6 +294,12 @@
           "style": {
             "navigationBarTitleText": "综合查询"
           }
+        },
+        {
+          "path": "pages/digitalDoor/personManagement/index",
+          "style": {
+            "navigationBarTitleText": "人员查询"
+          }
         }
       ]
     }

+ 343 - 0
src/pages/components/addressSelect/index.vue

@@ -0,0 +1,343 @@
+<script>
+
+import {getGardenHouseInfo, getGridInfo, getStreetInfo, getUnitHouseInfo} from "@/api/digitalDoor";
+
+export default {
+  data() {
+    return {
+      form: {},
+      streetDialogShow: false,
+      streetList: [],
+      communityList: [],
+      communityDialogShow: false,
+      gridList: [],
+      gridDialogShow: false,
+      gardenDialogShow: false,
+      gardenList: [],
+      buildingDialogShow: false,
+      buildingList: [],
+      unitDialogShow: false,
+      unitList: [],
+      roomDialogShow:false,
+      roomList: [],
+    }
+  },
+  methods: {
+    handleStreetSelect(item) {
+      this.form.streetName = item.streetName
+    },
+
+    /**
+     * 街道
+     */
+    handleLinkStreet() {
+      this.streetDialogShow = true
+      this.getStreetList()
+    },
+    async getStreetList() {
+      try {
+        const res = await getStreetInfo()
+        if (res.code !== 0) {
+          this.list = []
+        } else {
+          this.handleGetStreetInfo(res.data.children)
+        }
+        this.list = res.data
+      } catch (e) {
+        console.log(e)
+      }
+    },
+    handleGetStreetInfo(streetResData) {
+      const deptList = JSON.parse(localStorage.getItem('userInfo')).userInfo.deptIdList || []
+      //只保留当前用户所属部门的街道
+      // 如果有奉化区的区权限,就显示全部街道
+      if (deptList.includes('330213') && deptList.length === 1) {
+        this.streetList = streetResData
+      } else {
+        // 找出授权街道代码
+        let authStreetCode = null
+        if (deptList.length >= 2) {
+          authStreetCode = deptList[1]
+        }
+
+
+        this.streetList = []
+
+        //筛选出授权的街道
+        if (authStreetCode) {
+          this.streetList = streetResData.filter(item => item.code === authStreetCode)
+        }
+        if (!authStreetCode && deptList && deptList.length > 0) {
+          this.streetList = streetResData
+        }
+
+        if (this.streetList.length === 1) {
+          this.handleGetCommunityList(this.streetList[0].code)
+        }
+      }
+    },
+    handleGetCommunityList(fatherCode) {
+      const deptList = JSON.parse(localStorage.getItem('userInfo')).deptIdList || []
+      this.communityList = null
+      this.streetList.forEach(item => {
+        //只保留当前用户所属部门的社区
+        if (item.code === fatherCode) {
+          this.communityList = item.children
+        }
+      })
+
+      //是否限制村社一级
+      let limitCommunityFlag = deptList.length >= 3
+
+      // 找出授权代码
+      if (limitCommunityFlag) {
+        let authCommunityCode = deptList[2]
+        if (authCommunityCode) {
+          this.communityList = this.communityList.filter(item => item.code === authCommunityCode)
+        }
+      }
+    },
+    handleStreetClick(item) {
+      this.streetDialogShow = false
+      this.form.streetName = item.label
+      this.form.streetId = item.code
+    },
+
+    /**
+     * 所属村社
+     */
+    handleLinkCommunity() {
+      this.communityDialogShow = true
+      this.handleGetCommunityList(this.form.streetCode)
+    },
+    handleCommunityClick(item) {
+      this.communityDialogShow = false
+      this.form.communityName = item.label
+      this.form.communityId = item.code
+    },
+
+    /**
+     * 网格
+     */
+    handleLinkGrid() {
+      this.gridDialogShow = true
+      this.getGridList()
+    },
+    async getGridList() {
+      try {
+        getGridInfo({
+          communityCode: this.form.communityCode
+        })
+            .then(res => {
+              if (res.code !== 0) {
+                this.gridList = []
+              } else {
+                this.gridList = res.data
+              }
+            })
+            .catch(err => {
+              console.log(err)
+            })
+      } catch (e) {
+        console.log(e)
+      }
+    },
+    handleGridClick(item) {
+      this.gridDialogShow = false
+      this.form.gridName = item.label
+      this.form.grid = item.code
+    },
+    /**
+     * 小区
+     */
+    handleLinkGarden() {
+      this.gardenDialogShow = true
+      this.getGardenList()
+    },
+    getGardenList() {
+      try {
+        getGardenHouseInfo({
+          districtId: '330213',
+          streetId:this.form.streetCode,
+          communityCode: this.form.communityCode,
+        })
+            .then(res => {
+              if (res.code !== 0) {
+                this.gardenList = []
+              } else {
+                this.gardenList = res.data
+              }
+            })
+      } catch (e) {
+        console.log(e)
+      }
+    },
+    handleGardenClick(item) {
+      this.gardenDialogShow = false
+      this.form.gardenName = item.label
+      this.form.gardenId = item.code
+    },
+    /**
+     * 幢号
+     */
+    handleLinkBuilding() {
+      this.buildingDialogShow = true
+      this.getBuildingList()
+    },
+    getBuildingList() {
+      try {
+        getUnitHouseInfo({
+          districtId: '330213',
+          streetId: this.form.streetCode,
+          gardenCode: this.form.gardenCode,
+          communityCode: this.form.communityCode
+        })
+            .then(res => {
+              if (res.code !== 0) {
+                this.buildingList = []
+              } else {
+                this.buildingList = res.data
+              }
+            })
+            .catch(err => {
+              console.log(err)
+            })
+      } catch (e) {
+        console.log(e)
+      }
+    },
+    handleBuildingClick(item) {
+      this.buildingDialogShow = false
+      this.form.buildingName = item.label
+      this.form.buildingId = item.code
+    },
+    handleUnitClick(item) {
+      this.unitDialogShow = false
+      this.form.unitName = item.label
+      this.form.unitId = item.code
+    },
+    handleRoomClick(item) {
+      this.roomDialogShow = false
+      this.form.roomName = item.label
+      this.form.room = item.code
+    }
+  }
+}
+</script>
+
+<template>
+  <view>
+    <van-form>
+      <view class="box">
+        <view class="title">所属范围</view>
+        <view class="content">
+          <van-field v-model="form.streetName" label="所属镇街"
+                     readonly
+                     @click="handleLinkStreet"
+                     is-link
+                     placeholder="请输入所属镇街"/>
+          <van-popup v-model="streetDialogShow"
+                     position="bottom"
+                     :style="{ height: '35%' }"
+          >
+            <van-list finished-text="没有更多了">
+              <van-cell v-for="item in streetList" :key="item.code" :title="item.label"
+                        @click="handleStreetClick(item)"/>
+            </van-list>
+          </van-popup>
+          <!--所属村社-->
+          <van-field v-model="form.communityName" label="所属村社"
+                     readonly
+                     @click="handleLinkCommunity"
+                     is-link
+                     placeholder="请输入所属村社"/>
+          <van-popup v-model="communityDialogShow"
+                     position="bottom"
+                     :style="{ height: '35%' }"
+          >
+
+            <van-list finished-text="没有更多了">
+              <van-cell v-for="item in communityList" :key="item.code" :title="item.label"
+                        @click="handleCommunityClick(item)"/>
+            </van-list>
+          </van-popup>
+          <!--所属网格-->
+          <van-field v-model="form.gridName" label="所属网格"
+                     readonly
+                     @click="handleLinkGrid"
+                     is-link
+                     placeholder="请输入所属网格"/>
+          <van-popup v-model="gridDialogShow"
+                     position="bottom"
+
+                     :style="{ height: '35%' }"
+          >
+            <van-list finished-text="没有更多了">
+              <van-cell v-for="item in gridList" :key="item.code" :title="item.label"
+                        @click="handleGridClick(item)"/>
+            </van-list>
+          </van-popup>
+          <!--所属小区-->
+          <van-field v-model="form.gardenName" label="所属小区"
+                     readonly
+                     @click="handleLinkGarden"
+                     is-link
+                     placeholder="请输入所属小区"/>
+          <van-popup v-model="gardenDialogShow"
+                     position="bottom"
+                     :style="{ height: '35%' }"
+          >
+            <van-list finished-text="没有更多了">
+              <van-cell v-for="item in gardenList" :key="item.code" :title="item.lable"
+                        @click="handleGardenClick(item)"/>
+            </van-list>
+          </van-popup>
+          <!--幢号-->
+          <van-field v-model="form.buildingName" label="幢号"
+                     is-link
+                     placeholder="请输入幢号"/>
+          <van-popup v-model="buildingDialogShow"
+                     position="bottom"
+                     @click="handleLinkBuilding"
+                     :style="{ height: '35%' }"
+          >
+            <van-list finished-text="没有更多了">
+              <van-cell v-for="item in buildingList" :key="item.code" :title="item.label"
+                        @click="handleBuildingClick(item)"/>
+            </van-list>
+          </van-popup>
+          <!--单元-->
+          <van-field v-model="form.unitName" label="单元"
+                     is-link
+                     placeholder="请输入单元"/>
+          <van-popup v-model="unitDialogShow"
+                     position="bottom"
+                     :style="{ height: '35%' }"
+          >
+            <van-list finished-text="没有更多了">
+              <van-cell v-for="item in unitList" :key="item.code" :title="item.label"
+                        @click="handleUnitClick(item)"/>
+            </van-list>
+          </van-popup>
+          <!--房号-->
+          <van-field v-model="form.roomName" label="房号"
+                     is-link
+                     placeholder="请输入房号"/>
+          <van-popup v-model="roomDialogShow"
+                     position="bottom"
+                     :style="{ height: '35%' }"
+          >
+            <van-list finished-text="没有更多了">
+              <van-cell v-for="item in roomList" :key="item.code" :title="item.label"
+                        @click="handleRoomClick(item)"/>
+            </van-list>
+          </van-popup>
+        </view>
+      </view>
+    </van-form>
+  </view>
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 2 - 1
src/pages/digitalDoorIndex/index.vue

@@ -16,7 +16,8 @@ export default {
         },
         {
           text: '人员管理',
-          icon: PersonImg
+          icon: PersonImg,
+          url: '/subPages/pages/digitalDoor/personManagement/index'
         },
         {
           text: '房屋管理',

+ 97 - 0
src/subPages/pages/digitalDoor/personManagement/index.vue

@@ -0,0 +1,97 @@
+<script>
+import AddressSelect from '@/pages/components/addressSelect/index'
+import {getDicInfo} from "@/api/digitalDoor";
+export default {
+  components: {
+    AddressSelect
+  },
+  data() {
+    return {
+      form:{},
+      householdRegistrationTypeDialogShow: false,
+      householdRegistrationTypeList: [],
+      domicileDialogShow:false,
+      residenceDialogShow:false
+    }
+  },
+  onLoad() {
+    // field: account_type  type_code: piat_000 户类型
+    getDicInfo({field: "account_type", typeCode: "piat_000"})
+        .then(res => {
+          this.householdRegistrationTypeList = res.data
+        })
+        .catch(err => {
+          console.log(err)
+        })
+  },
+  methods: {
+    handleHouseholdRegistrationTypeClick(item){
+      this.householdRegistrationTypeDialogShow = false
+      this.form.householdRegistrationTypeName = item.remark
+      this.form.householdRegistrationType = item.value
+    },
+    handleDomicileClick(item){
+      this.domicileDialogShow = false
+      this.form.domicile = item
+    },
+    handleResidenceClick(item) {
+      this.domicileDialogShow = false
+      this.form.domicile = item
+    }
+
+  }
+}
+</script>
+
+<template>
+  <view>
+    <AddressSelect title="所属范围"></AddressSelect>
+    <view class="box">
+      <view class="title">
+        <text>管理地</text>
+      </view>
+      <view class="content">
+        <van-field v-model="form.householdRegistrationTypeName"
+                   @click="householdRegistrationTypeDialogShow = true"
+                   label="户类型"
+                   is-link placeholder="请选择" />
+        <van-popup v-model="householdRegistrationTypeDialogShow" position="bottom" :style="{ height: '35%' }">
+          <van-list>
+            <van-cell v-for="(item,index) in householdRegistrationTypeList"
+                      :key="index" :title="item.remark"
+                      @click="handleHouseholdRegistrationTypeClick(item)"></van-cell>
+          </van-list>
+        </van-popup>
+        <!--户籍地-->
+        <van-field v-model="form.domicile"
+                    label="户籍地"
+                   is-link
+                   @click="domicileDialogShow = true"
+                    placeholder="请输入户籍地" />
+        <van-popup v-model="domicileDialogShow" position="bottom" :style="{ height: '35%' }">
+          <van-list>
+            <van-cell title="在" @click="handleDomicileClick('在')"></van-cell>
+            <van-cell title="不在" @click="handleDomicileClick('不在')"></van-cell>
+          </van-list>
+        </van-popup>
+        <!--居住地-->
+        <van-field v-model="form.residence"
+                   label="居住地"
+                   is-link
+                   @click="residenceDialogShow = true"
+                   placeholder="请输入居住地" />
+        <van-popup v-model="residenceDialogShow" position="bottom" :style="{ height: '35%' }">
+          <van-list>
+            <van-cell title="在" @click="handleResidenceClick('在')"></van-cell>
+            <van-cell title="不在" @click="handleResidenceClick('不在')"></van-cell>
+          </van-list>
+        </van-popup>
+
+      </view>
+    </view>
+  </view>
+</template>
+
+<style scoped lang="scss">
+
+</style>