| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508 |
- <!--
- * @Title:
- * @Description: 危险区登记人员清单
- * @Author: swp
- * @Date: 2022-08-24 10:49:21
- * @LastEditors:
- * @LastEditTime: 2022-08-24 10:49:21
- -->
- <template>
- <view>
- <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
- @clickLeft="toBack">
- <view class="nav-title">
- <text>{{title}}</text>
- </view>
- </uni-nav-bar>
- <uni-collapse @change="searchAreaStatus">
- <uni-collapse-item :show-animation="true" :open="true">
- <template v-slot:title>
- <view class="view-flex-block-center" style="height: 40px;width: 100%;">
- <view class="view-flex-inline-center">
- <text v-if="showSearch" style="color: coral;">点击收起查询区</text>
- <text v-else style="color: coral;">点击展开查询区</text>
- </view>
- </view>
- </template>
- </uni-collapse-item>
- </uni-collapse>
- <view v-if="showSearch" class="search-block">
- <view style="padding-left: 10px;padding-right: 10px;margin-top: 10px;">
- <view v-if="permission.admin">
- <uni-data-select v-model="cityRegionValue" :localdata="cityRegionData" @change="cityRegionChange"
- placeholder="请选择盟市"></uni-data-select>
- </view>
- <view v-if="permission.admin || permission.orgAdmin" style="margin-top: 10px;">
- <uni-data-select v-model="districtRegionValue" :localdata="districtRegionData"
- @change="districtRegionChange" placeholder="请选择区旗县"></uni-data-select>
- </view>
- <view v-if="permission.admin || permission.orgAdmin || permission.qiAdmin" style="margin-top: 10px;">
- <uni-data-select v-model="townRegionValue" :localdata="townRegionData" @change="townRegionChange"
- placeholder="请选择乡镇"></uni-data-select>
- </view>
- <view style="margin-top: 10px;">
- <uni-data-select v-model="countryRegionValue" :localdata="countryRegionData"
- @change="countryRegionChange" placeholder="请选择村"></uni-data-select>
- </view>
- <view style="margin-top: 10px;">
- <uni-data-select v-model="dangerAreaValue" :localdata="dangerAreaData" @change="dangerAreaChange"
- placeholder="请选择危险区"></uni-data-select>
- </view>
- </view>
- <view class="rtu-code" style="margin-top: 10px;">
- <uni-easyinput :styles="inputStyles" @input="personNameValInput" prefixIcon="search"
- v-model="personNameVal" placeholder="请录入户主名称">
- </uni-easyinput>
- </view>
- <view class="submit-btn">
- <button type="default" @click="search">查 询</button>
- </view>
- </view>
- <view class="container">
- <uni-list>
- <uni-list-item v-for="item in list" :key="item.id">
- <template v-slot:body>
- <view class="list-item-block">
- <view class="line">
- <text class="text">户主姓名:</text>
- <text class="content">{{item.personName}}</text>
- </view>
- <view class="line">
- <text class="text">手机号:</text>
- <text class="content">{{item.personId}}</text>
- </view>
- <view class="line">
- <text class="text">危险区:</text>
- <text class="content">{{item.dangerAreaName}}</text>
- </view>
- <view class="line">
- <text class="text">行政区:</text>
- <text class="content">{{item.fullAadName}}</text>
- </view>
- <view class="line">
- <text class="text">住址经纬度:</text>
- <text class="content">{{item.longitude}},{{item.latitude}}</text>
- </view>
- <view class="line">
- <text class="text">住址:</text>
- <text class="content">{{item.address}}</text>
- </view>
- <view class="item-button-group" style="padding-right: 10px;">
- <view class="item-button mid-size" @click="onResetLocationClick(item)">
- <view class="items-line">
- <uni-icons class="input-uni-icon" type="location" size="18" color="coral" />
- <text class="button-text">定位补录</text>
- </view>
- </view>
- <view class="item-button mid-size" @click="onOpenFamilyListClick(item)">
- <view class="items-line">
- <uni-icons class="input-uni-icon" type="staff" size="18" color="coral" />
- <text class="button-text">家庭成员表</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- </uni-list-item>
- </uni-list>
- <uni-group>
- <view class="pagination-block">
- <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
- @change="pageChange" />
- </view>
- </uni-group>
- </view>
- </view>
- </template>
- <script>
- import {
- role
- } from "@/api/role.js";
- import http from '@/http/api.js';
- export default {
- components: {},
- data() {
- return {
- title: '登记人员清单',
- permission: {
- 'admin': false,
- 'orgAdmin': false,
- 'qiAdmin': false,
- 'companyAdmin': false,
- 'companyServciePerson': false,
- 'yjServicePerson': false
- },
- showSearch: true,
- cityRegionValue: '',
- cityRegionData: [],
- districtRegionValue: '',
- districtRegionData: [],
- townRegionValue: '',
- townRegionData: [],
- countryRegionValue: '',
- countryRegionData: [],
- dangerAreaValue: '',
- dangerAreaData: [],
- pageSize: 10,
- pageCurrent: 1,
- total: 0,
- list: [],
- query: {},
- personNameVal: '',
- inputStyles: {
- color: '#808080',
- borderColor: '#d3d3d3'
- },
- triggered: false
- }
- },
- computed: {
- },
- onLoad(option) {
- if (this.userInfo.role_name === role.admin) {
- this.permission.admin = true;
- } else if (this.userInfo.role_name === role.orgAdmin) {
- this.permission.orgAdmin = true;
- } else if (this.userInfo.role_name === role.qiAdmin) {
- this.permission.qiAdmin = true;
- } else if (this.userInfo.role_name === role.companyAdmin) {
- this.permission.companyAdmin = true;
- } else if (this.userInfo.role_name === role.companyServciePerson) {
- this.permission.companyServciePerson = true;
- } else if (this.userInfo.role_name === role.yjServicePerson) {
- this.permission.yjServicePerson = true;
- }
- // if (this.subSystem == 1) {
- // this.title = "管理工作台";
- // this.getRegionTree();
- // } else if (this.subSystem == 2) {
- // this.title = "实时监测预警";
- // this.getCityRegion({});
- // this.$nextTick(() => {
- // this.getYjPage({});
- // })
- // }
- this.query = {};
- this.query['isHouseholder'] = 1;
- if (this.permission.admin) {
- this.getCityRegion({});
- } else if (this.permission.orgAdmin) {
- this.getDistrictRegion({});
- } else if (this.permission.qiAdmin || this.permission.yjServicePerson) {
- this.getTownRegion({});
- }
- this.getPage();
- },
- onShow() {
- },
- methods: {
- toBack() {
- uni.navigateBack({
- delta: 1
- })
- },
- pageChange(e) {
- this.pageCurrent = e.current;
- let params = {};
- if (this.dangerAreaValue != '' && this.dangerAreaValue.length > 0) {
- params['dangerAreaPid'] = this.dangerAreaValue;
- }
- if (this.personNameVal != '' && this.personNameVal.length > 0) {
- params['personName'] = this.personNameVal;
- }
- this.getPage(params)
- },
- searchAreaStatus(e) {
- if (e.length > 0) {
- this.showSearch = true;
- } else {
- this.showSearch = false;
- }
- },
- cityRegionChange(e) {
- this.cityRegionValue = e;
- this.districtRegionData = [];
- this.districtRegionValue = '';
- this.townRegionData = [];
- this.townRegionValue = '';
- this.countryRegionData = [];
- this.countryRegionValue = '';
- this.dangerAreaData = [];
- this.dangerAreaValue = '';
- let p = {
- 'parentCode': this.cityRegionValue
- }
- this.getDistrictRegion(p);
- this.pageCurrent = 1;
- this.list = [];
- this.query['dangerAreaCode'] = this.cityRegionValue;
- this.getPage({});
- },
- districtRegionChange(e) {
- if (e == undefined || e == null || e == '') {
- this.districtRegionValue = '';
- this.townRegionData = [];
- this.townRegionValue = '';
- this.countryRegionData = [];
- this.countryRegionValue = '';
- this.dangerAreaData = [];
- this.dangerAreaValue = '';
- this.pageCurrent = 1;
- this.list = [];
- if (this.permission.admin) {
- this.query['dangerAreaCode'] = this.cityRegionValue;
- } else {
- this.query = {};
- }
- this.getPage({});
- } else {
- this.districtRegionValue = e;
- this.townRegionData = [];
- this.townRegionValue = '';
- this.countryRegionData = [];
- this.countryRegionValue = '';
- this.dangerAreaData = [];
- this.dangerAreaValue = '';
- let p = {
- 'parentCode': this.districtRegionValue
- }
- this.getTownRegion(p);
- this.pageCurrent = 1;
- this.list = [];
- this.query['dangerAreaCode'] = this.districtRegionValue;
- this.getPage({});
- }
- },
- townRegionChange(e) {
- if (e == undefined || e == null || e == '') {
- this.townRegionValue = '';
- this.countryRegionData = [];
- this.countryRegionValue = '';
- this.dangerAreaData = [];
- this.dangerAreaValue = '';
- this.pageCurrent = 1;
- this.list = [];
- if (this.permission.admin || this.permission.orgAdmin) {
- this.query['dangerAreaCode'] = this.districtRegionValue;
- } else {
- this.query = {};
- }
- this.getPage({});
- } else {
- this.townRegionValue = e;
- this.countryRegionData = [];
- this.countryRegionValue = '';
- this.dangerAreaData = [];
- this.dangerAreaValue = '';
- let p = {
- 'parentCode': this.townRegionValue
- }
- this.getCountryRegion(p);
- this.pageCurrent = 1;
- this.list = [];
- this.query['dangerAreaCode'] = this.townRegionValue;
- this.getPage({});
- }
- },
- countryRegionChange(e) {
- if (e == undefined || e == null || e == '') {
- this.countryRegionValue = '';
- this.dangerAreaValue = '';
- this.dangerAreaData = [];
- this.dangerAreaValue = '';
- this.pageCurrent = 1;
- this.list = [];
- this.query['dangerAreaCode'] = this.townRegionValue;
- this.getPage({});
- } else {
- this.countryRegionValue = e;
- this.dangerAreaValue = '';
- this.dangerAreaData = [];
- this.dangerAreaValue = '';
- this.getDangerAreaList({
- 'adcd': this.countryRegionValue
- })
- this.pageCurrent = 1;
- this.list = [];
- this.query['dangerAreaCode'] = this.countryRegionValue;
- this.getPage({});
- }
- },
- dangerAreaChange(e) {
- if (e == undefined || e == null || e == '') {
- this.dangerAreaValue = '';
- this.pageCurrent = 1;
- this.list = [];
- this.getPage({});
- } else {
- this.dangerAreaValue = e;
- this.pageCurrent = 1;
- this.list = [];
- this.getPage({
- dangerAreaPid: this.dangerAreaValue
- });
- }
- },
- getCityRegion(params = {}) {
- let that = this;
- http.request({
- url: '/galaxy-business/baseinfo/region/whole/yj/list',
- method: 'GET',
- data: params,
- }).then(res => {
- that.cityRegionData = res.data.map(item => {
- return {
- value: item.adcd,
- text: item.adnm,
- }
- })
- }).catch(err => {
- console.log(err)
- })
- },
- getDistrictRegion(params = {}) {
- let that = this;
- http.request({
- url: '/galaxy-business/baseinfo/region/whole/yj/list',
- method: 'GET',
- data: params,
- }).then(res => {
- that.districtRegionData = res.data.map(item => {
- return {
- value: item.adcd,
- text: item.adnm,
- }
- })
- }).catch(err => {
- console.log(err)
- })
- },
- getTownRegion(params = {}) {
- let that = this;
- http.request({
- url: '/galaxy-business/baseinfo/region/whole/yj/list',
- method: 'GET',
- data: params,
- }).then(res => {
- that.townRegionData = res.data.map(item => {
- return {
- value: item.adcd,
- text: item.adnm,
- }
- })
- }).catch(err => {
- console.log(err)
- })
- },
- getCountryRegion(params = {}) {
- let that = this;
- http.request({
- url: '/galaxy-business/baseinfo/region/whole/yj/list',
- method: 'GET',
- data: params,
- }).then(res => {
- that.countryRegionData = res.data.map(item => {
- return {
- value: item.adcd,
- text: item.adnm,
- }
- })
- }).catch(err => {
- console.log(err)
- })
- },
- getDangerAreaList(params = {}) {
- let postData = Object.assign(params, this.query);
- let that = this;
- http.request({
- url: '/galaxy-business/map/dangerarea/select',
- method: 'GET',
- data: postData,
- }).then(res => {
- that.dangerAreaData = res.data.map(item => {
- return {
- value: item.dangerAreaPid,
- text: item.dangerAreaName,
- }
- })
- }).catch(err => {
- console.log(err)
- })
- },
- personNameValInput(e) {
- if (e == null || e == '' || e.length == 0) {
- this.personNameVal = '';
- this.pageCurrent = 1;
- let params = {};
- if (this.dangerAreaValue != '' && this.dangerAreaValue.length > 0) {
- params['dangerAreaPid'] = this.dangerAreaValue;
- }
- this.getPage(params);
- }
- },
- search() {
- this.pageCurrent = 1;
- let params = {};
- if (this.dangerAreaValue != '' && this.dangerAreaValue.length > 0) {
- params['dangerAreaPid'] = this.dangerAreaValue;
- }
- if (this.personNameVal != '' && this.personNameVal.length > 0) {
- params['personName'] = this.personNameVal;
- }
- this.getPage(params);
- },
- onResetLocationClick(item) {
- var url = '/pages/yjxt/resident/dangerarearesidentlocation?type=2&id=' + item.id + '&lng=' + item
- .longitude +
- '&lat=' + item.latitude + '&add=' + item.address;
- uni.navigateTo({
- url: url
- })
- },
- onOpenFamilyListClick(item) {
- var url = '/pages/yjxt/resident/dangerarearesidentfamilylist?personId=' + item.personId;
- uni.navigateTo({
- url: url
- })
- },
- getPage(params = {}) {
- const current = this.pageCurrent;
- const size = this.pageSize;
- let postData = Object.assign(params, this.query);
- http.request({
- url: '/galaxy-business/yj/resident/page',
- method: 'GET',
- params: {
- current,
- size,
- },
- data: postData,
- }).then(res => {
- if (res.data.records != null) {
- // that.list = res.data.records.map(item => {
- // let id = item.personId.replace(/^(\d{6})\d+(\d{4})$/, '$1******$2')
- // return {
- // ...item,
- // 'pId': id
- // }
- // })
- this.list = res.data.records;
- }
- this.total = res.data.total;
- }).catch(err => {
- console.log(err)
- }).finally(() => {
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- </style>
|