Browse Source

Merge branch 'feature/codeMove'

# Conflicts:
#	public/goOut.xls
master
zhangyuan 3 years ago
parent
commit
15dba80550
  1. 65
      package-lock.json
  2. 3
      package.json
  3. BIN
      public/fang.xlsx
  4. BIN
      public/goOut.xls
  5. 2
      src/i18n/zh-CN.js
  6. 15
      src/main.js
  7. 7
      src/mixins/view-module.js
  8. 105
      src/views/modules/personroom/echarts.vue
  9. 573
      src/views/modules/personroom/epidemicbuildingunit-add-or-update.vue
  10. 236
      src/views/modules/personroom/epidemicbuildingunit.vue
  11. 560
      src/views/modules/personroom/epidemicplotbuilding-add-or-update.vue
  12. 408
      src/views/modules/personroom/epidemicplotbuilding-add-or-update_new.vue
  13. 311
      src/views/modules/personroom/epidemicplotbuilding.vue
  14. 557
      src/views/modules/personroom/epidemicplotcoordinate-add-or-update.vue
  15. 148
      src/views/modules/personroom/epidemicplotcoordinate.vue
  16. 809
      src/views/modules/personroom/epidemicreportuserinfo-add-or-update.vue
  17. 357
      src/views/modules/personroom/epidemicreportuserinfo-ds.vue
  18. 356
      src/views/modules/personroom/epidemicreportuserinfo.vue
  19. 349
      src/views/modules/personroom/epidemicreportuserinfoDetail.vue
  20. 171
      src/views/modules/personroom/plotbinding.vue

65
package-lock.json

@ -2098,7 +2098,7 @@
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz",
"resolved": "https://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz?cache=0&sync_timestamp=1562592096220&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fisarray%2Fdownload%2Fisarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"readable-stream": {
@ -2707,6 +2707,16 @@
"integrity": "sha1-wteA9T1Fu6gxeokC1M7q86Y4WxQ=",
"dev": true
},
"bindings": {
"version": "1.5.0",
"resolved": "https://registry.npmmirror.com/bindings/-/bindings-1.5.0.tgz",
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
"dev": true,
"optional": true,
"requires": {
"file-uri-to-path": "1.0.0"
}
},
"block-stream": {
"version": "0.0.9",
"resolved": "https://registry.npm.taobao.org/block-stream/download/block-stream-0.0.9.tgz",
@ -4687,7 +4697,7 @@
},
"echarts": {
"version": "4.9.0",
"resolved": "https://registry.nlark.com/echarts/download/echarts-4.9.0.tgz?cache=0&sync_timestamp=1623167264935&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fecharts%2Fdownload%2Fecharts-4.9.0.tgz",
"resolved": "https://registry.npm.taobao.org/echarts/download/echarts-4.9.0.tgz?cache=0&sync_timestamp=1605024616494&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fecharts%2Fdownload%2Fecharts-4.9.0.tgz",
"integrity": "sha1-qbm6oD8Doqcx5jQMVb77V6nhNH0=",
"requires": {
"zrender": "4.3.2"
@ -5788,6 +5798,13 @@
"schema-utils": "^0.4.5"
}
},
"file-uri-to-path": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
"dev": true,
"optional": true
},
"filename-regex": {
"version": "2.0.1",
"resolved": "http://r.cnpmjs.org/filename-regex/download/filename-regex-2.0.1.tgz",
@ -6751,7 +6768,7 @@
},
"gauge": {
"version": "2.7.4",
"resolved": "https://registry.nlark.com/gauge/download/gauge-2.7.4.tgz?cache=0&sync_timestamp=1627307755867&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fgauge%2Fdownload%2Fgauge-2.7.4.tgz",
"resolved": "https://registry.npm.taobao.org/gauge/download/gauge-2.7.4.tgz",
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
"requires": {
"aproba": "^1.0.3",
@ -8451,7 +8468,7 @@
},
"in-publish": {
"version": "2.0.1",
"resolved": "https://registry.npm.taobao.org/in-publish/download/in-publish-2.0.1.tgz",
"resolved": "https://registry.npm.taobao.org/in-publish/download/in-publish-2.0.1.tgz?cache=0&sync_timestamp=1584389407092&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fin-publish%2Fdownload%2Fin-publish-2.0.1.tgz",
"integrity": "sha1-lIsaU1yAMFYc6lIvc/ePS+NX4Aw="
},
"indent-string": {
@ -10576,7 +10593,7 @@
},
"npmlog": {
"version": "4.1.2",
"resolved": "https://registry.nlark.com/npmlog/download/npmlog-4.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fnpmlog%2Fdownload%2Fnpmlog-4.1.2.tgz",
"resolved": "https://registry.npm.taobao.org/npmlog/download/npmlog-4.1.2.tgz",
"integrity": "sha1-CKfyqL9zRgR3mp76StXMcXq7lUs=",
"requires": {
"are-we-there-yet": "~1.1.2",
@ -13322,7 +13339,7 @@
},
"psl": {
"version": "1.8.0",
"resolved": "https://registry.npm.taobao.org/psl/download/psl-1.8.0.tgz?cache=0&sync_timestamp=1585143522654&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpsl%2Fdownload%2Fpsl-1.8.0.tgz",
"resolved": "https://registry.npm.taobao.org/psl/download/psl-1.8.0.tgz?cache=0&sync_timestamp=1585142991033&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpsl%2Fdownload%2Fpsl-1.8.0.tgz",
"integrity": "sha1-kyb4vPsBOtzABf3/BWrM4CDlHCQ="
},
"public-encrypt": {
@ -14757,7 +14774,7 @@
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz",
"resolved": "https://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz?cache=0&sync_timestamp=1562592096220&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fisarray%2Fdownload%2Fisarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"readable-stream": {
@ -16313,6 +16330,21 @@
"resolved": "http://r.cnpmjs.org/upper-case/download/upper-case-1.1.3.tgz",
"integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg="
},
"uppercamelcase": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/uppercamelcase/-/uppercamelcase-1.1.0.tgz",
"integrity": "sha512-C7YEMvhgrvTEKEEVqA7LXNID/1TvvIwYZqNIKLquS6y/MGSkRQAav9LnTTILlC1RqUM8eTVBOe1U/fnB652PRA==",
"requires": {
"camelcase": "^1.2.1"
},
"dependencies": {
"camelcase": {
"version": "1.2.1",
"resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-1.2.1.tgz",
"integrity": "sha512-wzLkDa4K/mzI1OSITC+DUyjgIl/ETNHE9QvYgy6J6Jvqyyz4C0Xfd+lQhb19sX2jMpZV4IssUn0VDVmglV+s4g=="
}
}
},
"uri-js": {
"version": "4.2.2",
"resolved": "http://r.cnpmjs.org/uri-js/download/uri-js-4.2.2.tgz",
@ -16574,6 +16606,14 @@
"resolved": "http://r.cnpmjs.org/vue/download/vue-2.5.17.tgz",
"integrity": "sha1-D4eJrXGL5oyhhyYpgy7VM1icato="
},
"vue-amap": {
"version": "0.5.10",
"resolved": "https://registry.npmmirror.com/vue-amap/-/vue-amap-0.5.10.tgz",
"integrity": "sha512-9ViNCev1vx32+zZ5RvF/TmUZNbwL9QrdA2/OnD2GlXMfQBkJy7D08Vb7379t6guqnopDPtWJ8K6gg72h9+4GUg==",
"requires": {
"uppercamelcase": "^1.1.0"
}
},
"vue-eslint-parser": {
"version": "2.0.3",
"resolved": "http://r.cnpmjs.org/vue-eslint-parser/download/vue-eslint-parser-2.0.3.tgz",
@ -17654,6 +17694,8 @@
"dev": true,
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1",
"node-pre-gyp": "*"
},
"dependencies": {
@ -18399,6 +18441,13 @@
"brace-expansion": "^1.1.7"
}
},
"nan": {
"version": "2.16.0",
"resolved": "https://registry.npmmirror.com/nan/-/nan-2.16.0.tgz",
"integrity": "sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA==",
"dev": true,
"optional": true
},
"negotiator": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
@ -19227,7 +19276,7 @@
},
"zrender": {
"version": "4.3.2",
"resolved": "https://registry.nlark.com/zrender/download/zrender-4.3.2.tgz",
"resolved": "https://registry.npm.taobao.org/zrender/download/zrender-4.3.2.tgz",
"integrity": "sha1-7HQy+UFcgsc1hLa3uMR+GwFiCcY="
}
}

3
package.json

@ -28,13 +28,14 @@
"js-cookie": "^2.2.0",
"jsonp": "^0.2.1",
"lodash": "^4.17.11",
"node-sass": "^4.14.1",
"node-sass": "^4.12.0",
"qs": "^6.5.2",
"quill": "^1.3.7",
"sass-loader": "^7.1.0",
"screenfull": "^3.3.3",
"svg-sprite-loader": "^4.2.1",
"vue": "^2.5.17",
"vue-amap": "^0.5.10",
"vue-i18n": "^8.1.0",
"vue-quill-editor": "^3.0.6",
"vue-router": "^3.0.1",

BIN
public/fang.xlsx

Binary file not shown.

BIN
public/goOut.xls

Binary file not shown.

2
src/i18n/zh-CN.js

@ -396,6 +396,6 @@ t.user.gender2 = '保密'
t.user.roleIdList = '角色配置'
t.user.validate = {}
t.user.validate.comfirmPassword = '确认密码与密码输入不一致'
t.exportTemplate = '下载导入模板'
t.exportTemplate1 = '批量导入模板'
export default t

15
src/main.js

@ -13,6 +13,7 @@ import cloneDeep from 'lodash/cloneDeep'
import '@/element-ui/theme/cascader-new.css'
import '@/style/index.scss'
import echarts from 'echarts'
import VueAMap from 'vue-amap'
Vue.prototype.$echarts = echarts
Vue.config.productionTip = false
@ -22,6 +23,20 @@ Vue.use(Element, {
i18n: (key, value) => i18n.t(key, value)
})
Vue.use(VueAMap);
VueAMap.initAMapApiLoader({
key: '8c9df3d6ee9d1fc94a4512c31d4e1645',
plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor','AMap.Geocoder','AMap.Geolocation'],
// 默认高德 sdk 版本为 1.4.4
v: '1.4.15'
});
window._AMapSecurityConfig = {
securityJsCode: '511808c54b0c896f4cf346a5d710e300',
}
// 挂载全局
Vue.prototype.$http = http
Vue.prototype.$hasPermission = hasPermission

7
src/mixins/view-module.js

@ -144,6 +144,11 @@ export default {
...this.dataForm
})
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportMoudle}?${params}`
}
},
// 查询分页,重置1
getDataListSearch () {
this.page = 1
this.getDataList()
},
}
}

105
src/views/modules/personroom/echarts.vue

@ -0,0 +1,105 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div>
<el-form>
<el-form-item label="乡镇" prop="outStreet" label-width="80px" v-if="$hasPermission('sys:epidemicreportuserinfo:townsSearch')">
<el-select v-model="outStreet" placeholder="乡镇" @change="selectModel($event)" clearable>
<el-option v-for="item in outStreetArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
</el-form>
<div style="text-align: center" v-if="$hasPermission('sys:epidemicreportuserinfo:townsSearch')">
<h2>{{ title }}人员出入情况</h2>
</div>
<div style="text-align: center" v-else>
<h2>人员出入情况</h2>
</div>
<!-- <div id="myChart" :style="{width: '1000px', height: '300px'}"></div>-->
<chart ref="chart1" :style="{width: '1000px', height: '300px'}" :options="orgOptions" :auto-resize="true"></chart>
</div>
</el-card>
</template>
<script>
export default {
name: "hellowEcharts",
data() {
return {
title: "平阴县",
outStreet:'',
outStreetArr:[],
barName:'',
peopleNumber : [1,2,3],
orgOptions:{}
}
},
created: function () {
this.getDailyTypeArrInfo()
this.getPeopleNumber("");
},
mounted() {
// this.drawLine();
this.orgOptions = {
tooltip: {},
xAxis: {
type: 'category',
data: ["外地人数", "返乡人数", "现住外地人数"]
},
yAxis: {
type: 'value'
},
series: [{
data: [0, 0, 0],
type: 'bar',
name:"人员情况",
label: {
show: true,
position: 'top',
color: 'rgba(20, 101, 230, 1)'
},
}]
}
},
methods: {
// (4)
getDailyTypeArrInfo () {
this.$http.get(`epidemicreportuserinfo/selectStreet/4`).then(({ data: res }) => {
this.outStreetArr = res
}).catch(() => {})
},
//
selectModel (event) {
if (event == ''){
this.title = '平阴县'
this.barName = '平阴县'
this.getPeopleNumber(event);
}
this.outStreetArr.find((item) => {
if (item.dictValue === event) {
this.title = item.dictName
this.barName = item.dictName
this.outStreet = item.dictValue
this.getPeopleNumber(item.dictValue)
}
})
},
getPeopleNumber(item){
if (item == ""){
item = 0
}
this.$http.get(`select/getPeopleNumber/`+item).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.orgOptions.series[0].data = res.data
console.log(res.data)
}).catch(() => {})
}
}
}
</script>
<style scoped>
</style>

573
src/views/modules/personroom/epidemicbuildingunit-add-or-update.vue

@ -0,0 +1,573 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '140px' : '100px'">
<div>房屋信息</div>
<el-row>
<el-col :span="8">
<el-form-item label="所在镇街" prop="streetId">
<el-select v-model="dataForm.streetId" @change="selectModel($event)" placeholder="请选择">
<el-option
v-for="item in streetArr"
:key="item.deptId"
:label="item.name"
:value="item.deptId"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="所在村居"
prop="communityId">
<el-select v-model="dataForm.communityId" @change="selectGrid($event)"
placeholder="请选择"
>
<el-option v-for="item in communitys"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="所在网格"
prop="gridId">
<el-select v-model="dataForm.gridId" @change="selectPlot($event)"
placeholder="请选择"
>
<el-option v-for="item in grids"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="所在街/路" prop="roadName">
<el-input v-model="dataForm.roadName" placeholder="如:某某路几号"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="所在小区" prop="plotId">
<el-select v-model="dataForm.plotId" @change="selectBuilding($event)" placeholder="请选择">
<el-option
v-for="item in plotArr"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="楼栋" prop="buildingId">
<el-select v-model="dataForm.buildingId" clearable placeholder="请选择">
<el-option
v-for="item in buildingArr"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单元" prop="unit">
<el-input v-model="dataForm.unit" placeholder="单元"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="门牌号" prop="roomNo">
<el-input v-model="dataForm.roomNo" placeholder="门牌号"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="房屋类型" prop="roomType">
<el-select v-model="dataForm.roomType" placeholder="请选择" clearable >
<el-option v-for="item in roomTypeArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="房屋用途" prop="roomUse">
<el-select v-model="dataForm.roomUse" placeholder="请选择" clearable >
<el-option v-for="item in roomUseArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="房屋现状" prop="roomStatus">
<el-select v-model="dataForm.roomStatus" placeholder="请选择" clearable >
<el-option v-for="item in roomStatusArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="居住情况" prop="livingStatus">
<el-select v-model="dataForm.livingStatus" placeholder="请选择" clearable @change="selectLivingStatus($event)">
<el-option v-for="item in livingStatusArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<div v-if="dataForm.owners.length > 0">房主信息</div>
<div v-for="(item, index) in dataForm.owners" :key="index">
<el-row>
<el-col :span="10">
<el-form-item label="身份证号">
<el-input @blur="blurIdCard(item.idCard, index)" v-model="item.idCard" placeholder="身份证号"></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="房主姓名">
<el-input v-model="item.ownerName" placeholder="房主姓名"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="联系电话">
<el-input v-model="item.mobile" placeholder="联系电话"></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="现住址">
<el-input v-model="item.address" placeholder="现住址"></el-input>
</el-form-item>
</el-col>
<el-col v-if="index === 0" :span="4">
<div @click="addOwners" class="add-owners">
<i class="el-icon-circle-plus-outline"></i>
</div>
</el-col>
</el-row>
</div>
<div>出租信息</div>
<el-row>
<el-col :span="12">
<el-form-item label="是否出租" prop="isRental">
<el-select v-model="dataForm.isRental" @change="selectYn($event)" placeholder="请选择" clearable >
<el-option v-for="item in yNArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-show="dataForm.isRental==='0'" label="出租用途" prop="rentalPurpose">
<el-select v-model="dataForm.rentalPurpose" placeholder="请选择" clearable >
<el-option v-for="item in rentalPurposeArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item v-show="dataForm.isRental==='0'" label="承租人姓名" prop="lesseeName">
<el-input v-model="dataForm.lesseeName" placeholder="承租人姓名"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-show="dataForm.isRental==='0'" label="承租人电话" prop="lesseeMobile">
<el-input v-model="dataForm.lesseeMobile" placeholder="承租人电话"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label-width="130px" v-show="dataForm.isRental==='0'" label="承租人身份证号" prop="lesseeIdCard">
<el-input v-model="dataForm.lesseeIdCard" placeholder="承租人身份证号"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item v-show="dataForm.isRental==='0'" label="承租单位" prop="lesseeUnit">
<el-input v-model="dataForm.lesseeUnit" placeholder="承租单位"></el-input>
</el-form-item>
</el-col>
<el-col :span="12"></el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item v-show="dataForm.isRental==='0'" label="承租日期" prop="lesseeDate">
<el-date-picker
v-model="dataForm.lesseeDate"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
style="width: 200px"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-show="dataForm.isRental==='0'" label="承租期限" prop="lesseeTime">
<el-input v-model="dataForm.lesseeTime" placeholder="承租期限" style="width: 200px"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
buildingArr: [],
roomTypeArr: [],
roomUseArr: [],
rentalPurposeArr: [],
yNArr: [],
roomStatusArr: [],
livingStatusArr: [],
dataForm: {
id: '',
buildingId: '',
unit: '',
roomNo: '',
roadName: '',
roomType: '',
roomUse: '',
owners: [{
ownerName: '',
idCard: '',
mobile: '',
address: ''
}],
isRental: '1',
rentalPurpose: '',
lesseeName: '',
lesseeIdCard: '',
lesseeMobile: '',
lesseeUnit: '',
lesseeTime: '',
lesseeDate: '',
plotId: '',
streetId: '',
communityId: '',
gridId: '',
streetName: '',
communityName: '',
gridName: '',
roomStatus: '',
livingStatus: ''
},
streetArr: [],
communitys: [],
plotArr: [],
grids: []
}
},
computed: {
dataRule () {
return {
gridId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
streetId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
communityId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
ownerName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
idCard: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
mobile: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
roomNo: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
roomType: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.getOptions()
this.getDailyTypeArrInfo()
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
this.dataForm.owners = [{
ownerName: '',
idCard: '',
mobile: '',
address: ''
}]
this.dataForm.streetName = ''
this.dataForm.communityName = ''
this.dataForm.gridName = ''
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo () {
this.$http.get(`/custom/epidemicbuildingunit/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
this.queryComm(this.dataForm.streetId)
this.queryGrid(this.dataForm.communityId)
this.queryPlot()
if (this.dataForm.plotId != null) {
this.queryBuilding()
}
}).catch(() => {})
},
queryComm (event) {
this.$http.get(`sys/dept/deptInfo?deptPid=${event}`).then(({ data: res }) => {
this.communitys = res.data
}).catch(() => {})
},
queryGrid (event) {
this.$http.get(`sys/dept/deptInfo?deptPid=${event}`).then(({ data: res }) => {
this.grids = res.data
}).catch(() => {})
},
queryPlot () {
this.$http
.get(`/custom/epidemicplotcoordinate/getPlotOption?streetId=${this.dataForm.streetId}&communityId=${this.dataForm.communityId}&gridId=${this.dataForm.gridId}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.plotArr = res.data
})
},
queryBuilding () {
this.$http
.get(`/custom/epidemicplotbuilding/getBuildingOption?plotId=${this.dataForm.plotId}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.buildingArr = res.data
})
.catch(() => {})
},
// (4)
getDailyTypeArrInfo () {
this.$http.get(`sys/dept/deptInfo?tags=street_party`).then(({ data: res }) => {
this.streetArr = res.data
}).catch(() => {})
},
selectYn (event) {
if (event === '1') {
this.dataForm.rentalPurpose = ''
this.dataForm.lesseeName = ''
this.dataForm.lesseeIdCard = ''
this.dataForm.lesseeMobile = ''
this.dataForm.lesseeUnit = ''
this.dataForm.lesseeTime = ''
this.dataForm.lesseeDate = null
}
},
selectModel (event) {
this.dataForm.communityId = ''
this.streetArr.find((item) => {
if (item.deptId === event) {
this.dataForm.streetId = item.deptId
this.dataForm.streetName = item.name
this.queryComm(event)
}
})
},
selectGrid (event) {
this.dataForm.gridId = ''
this.communitys.find((item) => {
if (item.deptId === event) {
this.dataForm.communityId = item.deptId
this.dataForm.communityName = item.name
this.queryGrid(event)
}
})
},
selectPlot (event) {
this.dataForm.plotId = ''
this.grids.find((item) => {
if (item.deptId === event) {
this.dataForm.gridId = item.deptId
this.dataForm.gridName = item.name
this.queryPlot()
}
})
},
selectBuilding (event) {
this.dataForm.buildingId = ''
this.plotArr.find((item) => {
if (item.dictValue === event) {
this.dataForm.plotId = item.dictValue
this.queryBuilding()
}
})
},
selectLivingStatus (event) {
console.log(event)
},
getOptions () {
// this.$http
// .get(`/epidemicplotbuilding/getBuildingOption?plotId=${this.dataForm.plotId}`)
// .then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.buildingArr = res.data
// })
// .catch(() => {})
this.$http.get(`/sys/dict/listSimple/room_type`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.roomTypeArr = res.data
}).catch(() => {})
this.$http.get(`/sys/dict/listSimple/room_use`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.roomUseArr = res.data
}).catch(() => {})
this.$http.get(`/sys/dict/listSimple/rental_purpose`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.rentalPurposeArr = res.data
}).catch(() => {})
this.$http.get(`/sys/dict/listSimple/epmet_y_n`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.yNArr = res.data
}).catch(() => {})
//
this.$http.get(`/sys/dict/listSimple/house_status`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.roomStatusArr = res.data
}).catch(() => {})
//
this.$http.get(`/sys/dict/listSimple/house_purpose`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.livingStatusArr = res.data
}).catch(() => {})
},
//
addOwners () {
var nowOwners = this.dataForm.owners[this.dataForm.owners.length - 1]
if (!nowOwners.ownerName) {
return this.$message.error('请填写房主姓名')
} else if (!nowOwners.mobile) {
return this.$message.error('请填写联系电话')
} else if (!nowOwners.idCard) {
return this.$message.error('请填写身份证号')
}
this.dataForm.owners.push({
ownerName: '',
idCard: '',
mobile: '',
address: ''
})
},
blurIdCard (idCard, index) {
this.$http.get(`custom/epidemicuserinfo/getOwner?idCard=${idCard}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
if (res.data) {
this.$set(this.dataForm.owners[index], 'ownerName', res.data.ownerName)
this.$set(this.dataForm.owners[index], 'mobile', res.data.mobile)
this.$set(this.dataForm.owners[index], 'address', res.data.address)
} else {
this.$set(this.dataForm.owners[index], 'ownerName', '')
this.$set(this.dataForm.owners[index], 'mobile', '')
this.$set(this.dataForm.owners[index], 'address', '')
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
var nowOwners = this.dataForm.owners[0]
if (!nowOwners.ownerName) {
return this.$message.error('请填写房主姓名')
} else if (!nowOwners.mobile) {
return this.$message.error('请填写联系电话')
} else if (!nowOwners.idCard) {
return this.$message.error('请填写身份证号')
}
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/custom/epidemicbuildingunit/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>
<style scoped>
.add-owners{
width: 100%;
height: 40px;
padding: 0 20px;
box-sizing: border-box;
display: flex;
align-items: center;
}
.add-owners i{
width: 30px;
height: 30px;
font-size: 30px;
}
</style>

236
src/views/modules/personroom/epidemicbuildingunit.vue

@ -0,0 +1,236 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-__epidemicbuildingunit}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label="房间号" prop="roomNo">
<el-input v-model="dataForm.roomNo" placeholder="房间号" clearable></el-input>
</el-form-item>
<el-form-item label="房屋类型" prop="roomType">
<el-select v-model="dataForm.roomType" placeholder="房屋类型" clearable >
<el-option v-for="item in roomTypeArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
<el-form-item label="房主姓名" prop="ownerName">
<el-input v-model="dataForm.ownerName" placeholder="房主姓名" clearable></el-input>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input v-model="dataForm.mobile" placeholder="手机号" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('dev:room:update')" type="danger" @click="updateOwner()">更新关系</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission(':epidemicbuildingunit:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary">
<a :href="`https://epdc-yushan.elinkservice.cn/epdc-admin/fang.xlsx`"
target="_blank"
download="人房信息表.xlsx"
style="color: #ffffff">{{ $t('exportTemplate') }}</a>
</el-button>
</el-form-item>
<el-form-item label="导入网格"
label-width="90px">
<el-cascader v-model="deptIdListUpload"
ref="deptTree"
:options="options"
:props="{ checkStrictly: false }"
clearable>
</el-cascader>
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="beforeImportUser">导入</el-button>
</el-form-item>
<el-form-item>
<el-upload ref="upload"
:action="uploadUrl"
:limit="1"
:on-success='uploadSuccess'
:on-error='errorExceed'>
<el-button id="importBut"
style="display: none"
type="primary">导入</el-button>
</el-upload>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="roomNo" label="门牌号" header-align="center" align="center"></el-table-column>
<el-table-column prop="roomType" label="房屋类型" :formatter="roomTypeFormat" header-align="center" align="center"></el-table-column>
<el-table-column prop="streetName" label="所在镇街" header-align="center" align="center"></el-table-column>
<el-table-column prop="communityName" label="社区/村庄" header-align="center" align="center"></el-table-column>
<el-table-column prop="gridName" label="网格名称" header-align="center" align="center"></el-table-column>
<el-table-column prop="plotName" label="所在小区" header-align="center" align="center"></el-table-column>
<el-table-column prop="buildingName" label="楼栋" header-align="center" align="center"></el-table-column>
<el-table-column prop="unit" label="单元" header-align="center" align="center"></el-table-column>
<el-table-column prop="roomUse" label="房屋用途" :formatter="roomUseFormat" header-align="center" align="center"></el-table-column>
<!-- <el-table-column prop="ownerName" label="房主姓名" header-align="center" align="center"></el-table-column>
<el-table-column prop="idCard" label="身份证号" header-align="center" align="center"></el-table-column>
<el-table-column prop="mobile" label="手机号" header-align="center" align="center"></el-table-column> -->
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './epidemicbuildingunit-add-or-update'
import Cookies from "js-cookie";
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/custom/epidemicbuildingunit/page',
getDataListIsPage: true,
deleteURL: '/custom/epidemicbuildingunit',
deleteIsBatch: true
},
options: [],
deptIdListUpload: [],
roomTypeArr: [],
roomUseArr: [],
dataForm: {
id: ''
}
}
},
components: {
AddOrUpdate
},
watch: {
'deptIdListUpload': function (val) {
if (val.length > 0) {
this.gridIdImport = val[val.length - 1]
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/custom/epidemicbuildingunit/importHouse?token=
${Cookies.get('token')}&gridId=` + val[val.length - 1]
} else {
this.gridIdImport = ''
}
}
},
created: function () {
this.getOptions()
},
methods: {
getOptions () {
this.$http
.get(`/sys/user/deptOptions/getByLoginUser`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
})
.catch(() => { })
this.$http.get(`/sys/dict/listSimple/room_type`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.roomTypeArr = res.data
}).catch(() => {})
this.$http.get(`/sys/dict/listSimple/room_use`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.roomUseArr = res.data
}).catch(() => {})
},
updateOwner () {
this.$http.get(`/custom/epidemicbuildingunit/updateOwner`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
}).catch(() => {})
},
roomTypeFormat (row, column) {
if (row.roomType) {
let dict = this.roomTypeArr.filter(item => item.dictValue === row.roomType)[0]
if (dict) {
return dict.dictName
}
}
return ''
},
roomUseFormat (row, column) {
if (row.roomUse) {
let dict = this.roomUseArr.filter(item => item.dictValue === row.roomUse)[0]
if (dict) {
return dict.dictName
}
}
return ''
},
uploadSuccess (response, file, fileList) {
this.uploeadLoeading = false
this.$refs.upload.clearFiles()
if (response.code !== 0 || (response.data !== null && response.data.length > 0)) {
this.errordataList = response.data
if (this.errordataList != null && this.errordataList.length > 0) {
this.faultDataVisible = true
} else {
this.$message.error(response.msg)
}
this.getDataList()
return
}
this.$message({
message: '导入成功',
type: 'success',
duration: 1000,
onClose: () => {
this.getDataList()
}
})
},
errorExceed (file, fileList) {
this.uploeadLoeading = false
this.$message.error('上传失败请重试')
},
beforeImportUser () {
//
if (this.gridIdImport === '') {
document.getElementById('importBut').click()
return false
}
//
let selectGird = this.$refs['deptTree'].getCheckedNodes()[0].label
this.$confirm(`确定将用户导入到${selectGird}?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
document.getElementById('importBut').click()
}).catch(() => { })
}
}
}
</script>

560
src/views/modules/personroom/epidemicplotbuilding-add-or-update.vue

@ -0,0 +1,560 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '140px' : '130px'">
<!-- <el-form-item label="小区.村ID" prop="plotId">
<el-input v-model="dataForm.plotId" placeholder="小区.村ID"></el-input>
</el-form-item> -->
<el-row>
<el-col :span="12">
<el-form-item label="所在镇街"
prop="streetId">
<el-select v-model="dataForm.streetId"
placeholder="请选择"
@change="selectModel($event)"
clearable
>
<el-option v-for="item in streetArr"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所在村居"
prop="communityId">
<el-select v-model="dataForm.communityId"
placeholder="请选择"
@change="selectPlot($event)"
clearable
>
<el-option v-for="item in communitys"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="网格名称"
prop="gridId">
<el-select v-model="dataForm.gridId"
placeholder="请选择"
@change="selectGrid($event)"
clearable
>
<el-option v-for="item in grids"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所在小区" prop="plotId">
<el-select v-model="dataForm.plotId" clearable placeholder="请选择">
<el-option
v-for="item in plotArr"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="小区性质" prop="plotNature">
<el-select v-model="dataForm.plotNature" clearable placeholder="小区性质">
<el-option v-for="item in plotNatureList" :key="item.dictValue" :label="item.dictName" :value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="楼栋状态" prop="buildingState">
<el-select v-model="dataForm.buildingState" clearable placeholder="楼栋状态">
<el-option v-for="item in buildingStateList" :key="item.dictValue" :label="item.dictName" :value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="楼栋编码" prop="buildingCode">
<el-input v-model="dataForm.buildingCode" placeholder="楼栋编码" maxlength="22" show-word-limit></el-input>
</el-form-item>
<el-col :span="16">
<el-form-item label="楼栋名称" prop="buildingName">
<el-input v-model="dataForm.buildingName" placeholder="如:(某小区)几号楼、某某大厦A等"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="楼栋类型" prop="buildingType">
<el-select v-model="dataForm.buildingType" placeholder="请选择" clearable >
<el-option v-for="item in buildingTypeArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="经度" prop="buildingLongitude">
<el-input disabled v-model="dataForm.buildingLongitude" placeholder="经度"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="纬度" prop="buildingLatitude">
<el-input disabled v-model="dataForm.buildingLatitude" placeholder="纬度"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row v-show="wgsShow">
<el-col :span="12">
<el-form-item label="WGS-84经度" prop="buildingLongitudeDsf">
<el-input disabled v-model="dataForm.buildingLongitudeDsf" placeholder="WGS-84经度"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="WGS-84纬度" prop="buildingLatitudeDsf">
<el-input disabled v-model="dataForm.buildingLatitudeDsf" placeholder="WGS-84纬度"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="楼栋地址" prop="buildingAddress">
<el-input disabled v-model="dataForm.buildingAddress" placeholder="点击下面地图获取地址"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="地址检索" prop="mapPlotName">
<el-amap-search-box class="search-box" :search-option="amap.searchOption" :on-search-result="onSearchResult">
</el-amap-search-box>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="amap-wrapper">
<el-amap class="amap-box" :vid="'amap-vue'" :center="amap.mapInfo.lnglat" :zoom="amap.zoom" :events="amap.events" :amap-manager="amap.amapManager" :plugin="amap.plugin">
<!-- 点标记在地图上显示的位置默认为地图中心点 -->
<el-amap-marker :position="amap.mapInfo.lnglat"></el-amap-marker>
</el-amap>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="地上楼层数" prop="floorNum">
<el-input-number style="width: 80%" v-model="dataForm.floorNum" controls-position="right" :min="1" :max="999" label="楼层数"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="地上单元数" prop="roomNum">
<el-input-number style="width: 80%" v-model="dataForm.roomNum" controls-position="right" :min="1" :max="999" label="房间数"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="地上总户数" prop="householdNum">
<el-input-number style="width: 80%" v-model="dataForm.householdNum" controls-position="right" :min="0" :max="999" label="住户数"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="楼栋总人数" prop="buildingUserTotal">
<el-input-number style="width: 80%" v-model="dataForm.buildingUserTotal" controls-position="right" :min="0" :max="999" label="楼栋总人数"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="地下楼层数" prop="undergroundLayerNum">
<el-input-number style="width: 80%" v-model="dataForm.undergroundLayerNum" controls-position="right" :min="0" :max="999" label="地下楼层数"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="地下房间数" prop="undergroundRoomNum">
<el-input-number style="width: 80%" v-model="dataForm.undergroundRoomNum" controls-position="right" :min="0" :max="999" label="地下房间数"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="楼长姓名" prop="assisantName">
<el-input v-model="dataForm.assisantName" placeholder="楼长姓名"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="楼长电话" prop="assisantMobile">
<el-input v-model="dataForm.assisantMobile" placeholder="楼长电话"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="物业公司" prop="propertyName">
<el-input v-model="dataForm.propertyName" placeholder="物业公司"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物业联系人" prop="propertyUser">
<el-input v-model="dataForm.propertyUser" placeholder="物业联系人"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="物业联系电话" prop="propertyMobile">
<el-input v-model="dataForm.propertyMobile" placeholder="物业联系电话"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="房屋面积m²" prop="buildingArea">
<el-input v-model="dataForm.buildingArea" placeholder="房屋面积m²"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="供水供电供热单位" prop="serviceSupplyUnit">
<el-input v-model="dataForm.serviceSupplyUnit" placeholder="供水供电供热单位"></el-input>
</el-form-item>
<el-form-item label="消防器材位置" prop="fireControlPosition">
<el-input v-model="dataForm.fireControlPosition" placeholder="消防器材位置"></el-input>
</el-form-item>
<el-form-item label="应急物资位置" prop="emergencyPosition">
<el-input v-model="dataForm.emergencyPosition" placeholder="应急物资位置"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import { AMapManager } from 'vue-amap'
const amapManager = new AMapManager()
export default {
data () {
return {
wgsShow: false,
visible: false,
streetArr: [],
communitys: [],
grids: [],
plotArr: [],
buildingTypeArr: [],
plotNatureList: [],
buildingStateList: [],
dataForm: {
id: '',
plotId: '',
buildingName: '',
buildingType: '',
floorNum: '',
roomNum: '',
householdNum: '',
communityName: '',
communityId: '',
gridId: '',
gridName: '',
streetName: '',
streetId: '',
buildingLongitude: '',
buildingLatitude: '',
buildingLongitudeDsf: '',
buildingLatitudeDsf: '',
buildingCode:'',
buildingState: '',
buildingArea: '',
buildingAddress: '',
assisantName: '',
assisantMobile: '',
propertyName: '',
propertyUser: '',
propertyMobile: '',
plotNature: '',
buildingUserTotal: '',
undergroundLayerNum: '',
undergroundRoomNum: '',
serviceSupplyUnit: '',
fireControlPosition: '',
emergencyPosition: ''
},
amap: {
mapInfo: {
address: '', //
lng: 0,
lat: 0,
lnglat: [116.459176,36.289432]
},
events: {
click: (e) => {
this.amap.mapInfo.lng = e.lnglat.lng;
this.amap.mapInfo.lat = e.lnglat.lat;
this.amap.mapInfo.lnglat = [e.lnglat.lng, e.lnglat.lat];
this.getFormattedAddress();
}
},
zoom: 16,
amapManager,
searchOption: {
city: "济南市",
citylimit: false,
},
plugin: [
{
// pName
pName: 'MapType',
defaultType: 0
},
{
// pName
pName: 'Autocomplete'
}
]
}
}
},
watch: {
'amap.mapInfo.lnglat' : {
handler(newVal, oldVal) {
this.dataForm.buildingLongitude = newVal[0]
this.dataForm.buildingLatitude = newVal[1]
this.getFormattedAddress()
}
},
'dataForm.buildingLongitude' : {
handler(newVal, oldVal) {
this.amap.mapInfo.lnglat = [this.dataForm.buildingLongitude,this.dataForm.buildingLatitude]
}
}
},
computed: {
dataRule () {
return {
streetId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
communityId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
gridId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
plotId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
buildingName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
buildingCode: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ min: 22, max: 22, message: '楼栋编码必须为22位', trigger: 'blur' }
],
buildingLongitude: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
buildingLatitude: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.wgsShow = false
this.getDictInfo()
this.getDailyTypeArrInfo()
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
if(this.dataForm.id != '' && this.dataForm.id != undefined) {
this.wgsShow = true;
this.getFormattedAddress()
}
},
//
getDictInfo(){
//
this.$http.get(`/sys/dict/listSimple/building_state`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.buildingStateList = res.data
}).catch(() => {})
//
this.$http.get(`/sys/dict/listSimple/plot_nature`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.plotNatureList = res.data
}).catch(() => {})
},
//
getInfo () {
this.$http.get(`/custom/epidemicplotbuilding/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
this.queryComm(this.dataForm.streetId)
this.queryGrid(this.dataForm.communityId)
this.getOptions(this.dataForm.gridId)
}).catch(() => {})
},
// (4)
getDailyTypeArrInfo () {
this.$http.get(`sys/dept/deptInfo?tags=street_party`).then(({ data: res }) => {
this.streetArr = res.data
}).catch(() => {})
},
selectModel (event) {
this.dataForm.communityName = ''
this.dataForm.communityId = ''
this.communitys = []
this.dataForm.gridName = ''
this.dataForm.gridId = ''
this.grids = []
this.dataForm.plotId = ''
this.plotArr = []
this.streetArr.find((item) => {
if (item.deptId === event) {
this.dataForm.streetId = item.deptId
this.dataForm.streetName = item.name
this.queryComm(event)
}
})
},
queryComm (event) {
this.$http.get(`sys/dept/deptInfo?deptPid=${event}`).then(({ data: res }) => {
this.communitys = res.data
}).catch(() => {})
},
selectGrid (event) {
this.dataForm.plotId = ''
this.plotArr = []
this.grids.find((item) => {
if (item.deptId === event) {
this.dataForm.gridId = item.deptId
this.dataForm.gridName = item.name
this.getOptions(this.dataForm.gridId)
}
})
},
selectPlot (event) {
this.dataForm.gridName = ''
this.dataForm.gridId = ''
this.grids = []
this.dataForm.plotId = ''
this.plotArr = []
this.communitys.find((item) => {
if (item.deptId === event) {
this.dataForm.communityId = item.deptId
this.dataForm.communityName = item.name
this.queryGrid(event)
}
})
},
queryGrid (event) {
this.$http.get(`sys/dept/deptInfo?deptPid=${event}`).then(({ data: res }) => {
this.grids = res.data
}).catch(() => {})
},
getOptions (gridId) {
//
this.$http.get(`/custom/epidemicplotcoordinate/getPlotOption?gridId=${gridId}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.plotArr = res.data
})
.catch(() => {})
//
this.$http.get(`/sys/dict/listSimple/building_type`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.buildingTypeArr = res.data
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/custom/epidemicplotbuilding/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false }),
getFormattedAddress() {
AMap.plugin('AMap.Geocoder', () => {
let GeocoderOptions = { city: '全国' }
let geocoder = new AMap.Geocoder(GeocoderOptions)
geocoder.getAddress(this.amap.mapInfo.lnglat, (status, result) => {
console.log('通过经纬度拿到的地址', result)
if (status === 'complete' && result.info === 'OK') {
this.amap.mapInfo.address = result.regeocode.formattedAddress
this.dataForm.buildingAddress = this.amap.mapInfo.address
} else {
this.amap.mapInfo.address = '无法获取地址';
}
})
})
},
//
onSearchResult(pois){
console.log(pois)
this.input = document.querySelector('.search-box-wrapper input').value
console.log(this.input)
this.amap.mapInfo.lnglat = [pois[0].lng,pois[0].lat] //
this.amap.markers = []; //
this.amap.markers.push([pois[0].lng,pois[0].lat]) //
console.log(this.markers);
}
}
}
</script>
<style>
.amap-wrapper {
width: 100%;
height: 300px;
padding-left: 45px;
margin-bottom: 22px;
}
</style>

408
src/views/modules/personroom/epidemicplotbuilding-add-or-update_new.vue

@ -0,0 +1,408 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '140px' : '100px'">
<!-- <el-form-item label="小区.村ID" prop="plotId">
<el-input v-model="dataForm.plotId" placeholder="小区.村ID"></el-input>
</el-form-item> -->
<el-row>
<el-col :span="12">
<el-form-item label="所在镇街"
prop="streetId">
<el-select v-model="dataForm.streetId"
placeholder="请选择"
@change="selectModel($event)"
clearable
>
<el-option v-for="item in streetArr"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所在村居"
prop="communityId">
<el-select v-model="dataForm.communityId"
placeholder="请选择"
@change="selectPlot($event)"
clearable
>
<el-option v-for="item in communitys"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="网格名称"
prop="gridId">
<el-select v-model="dataForm.gridId"
placeholder="请选择"
@change="selectGrid($event)"
clearable
>
<el-option v-for="item in grids"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所在小区" prop="plotId">
<el-select v-model="dataForm.plotId" clearable placeholder="请选择">
<el-option
v-for="item in plotArr"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16">
<el-form-item label-width="130px" label="楼栋名称/编号" prop="buildingName">
<el-input v-model="dataForm.buildingName" placeholder="如:(某小区)几号楼、某某大厦A等"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="楼栋类型" prop="buildingType">
<el-select v-model="dataForm.buildingType" placeholder="请选择" clearable >
<el-option v-for="item in buildingTypeArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="楼栋层数" prop="floorNum">
<el-input-number style="width: 80%" v-model="dataForm.floorNum" controls-position="right" :min="1" :max="999" label="楼层数"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单元数" prop="roomNum">
<el-input-number style="width: 80%" v-model="dataForm.roomNum" controls-position="right" :min="1" :max="999" label="房间数"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="住户数" prop="householdNum">
<el-input-number style="width: 80%" v-model="dataForm.householdNum" controls-position="right" :min="0" :max="999" label="住户数"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="经度" prop="longitude">
<el-input disabled v-model="amap.mapInfo.lng" placeholder="经度"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="纬度" prop="latitude">
<el-input disabled v-model="amap.mapInfo.lat" placeholder="纬度"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="楼栋地址" prop="mapPlotName">
<el-input disabled v-model="amap.mapInfo.address" placeholder="点击下面地图获取地址"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="地址检索" prop="mapPlotName">
<el-amap-search-box class="search-box" :search-option="amap.searchOption" :on-search-result="onSearchResult">
</el-amap-search-box>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="amap-wrapper">
<el-amap class="amap-box" :vid="'amap-vue'" :center="amap.mapInfo.lnglat" :zoom="amap.zoom" :events="amap.events" :amap-manager="amap.amapManager" :plugin="amap.plugin">
<!-- 点标记在地图上显示的位置默认为地图中心点 -->
<el-amap-marker :position="amap.mapInfo.lnglat"></el-amap-marker>
</el-amap>
</div>
</el-col>
</el-row>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import { AMapManager } from 'vue-amap'
const amapManager = new AMapManager()
export default {
data () {
return {
visible: false,
streetArr: [],
communitys: [],
grids: [],
plotArr: [],
buildingTypeArr: [],
dataForm: {
id: '',
plotId: '',
buildingName: '',
buildingType: '',
floorNum: '',
roomNum: '',
householdNum: '',
communityName: '',
communityId: '',
gridId: '',
gridName: '',
streetName: '',
streetId: ''
},
amap: {
mapInfo: {
address: '', //
lng: 0,
lat: 0,
lnglat: [116.459176,36.289432]
},
events: {
click: (e) => {
this.amap.mapInfo.lng = e.lnglat.lng;
this.amap.mapInfo.lat = e.lnglat.lat;
this.amap.mapInfo.lnglat = [e.lnglat.lng, e.lnglat.lat];
this.getFormattedAddress();
}
},
zoom: 16,
amapManager,
searchOption: {
city: "济南市",
citylimit: false,
},
plugin: [
{
// pName
pName: 'MapType',
defaultType: 0
},
{
// pName
pName: 'Autocomplete'
}
]
}
}
},
watch: {
'amap.mapInfo.lnglat' : {
handler(newVal, oldVal) {
this.amap.mapInfo.lng = newVal[0]
this.amap.mapInfo.lat = newVal[1]
this.getFormattedAddress()
}
}
},
computed: {
dataRule () {
return {
streetId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
communityId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
gridId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
buildingName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
buildingType: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
floorNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
roomNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
// this.getOptions()
this.getDailyTypeArrInfo()
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo () {
this.$http.get(`/epidemicplotbuilding/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
this.queryComm(this.dataForm.streetId)
this.queryGrid(this.dataForm.communityId)
this.getOptions(this.dataForm.gridId)
}).catch(() => {})
},
// (4)
getDailyTypeArrInfo () {
this.$http.get(`sys/dept/deptInfo?tags=street_party`).then(({ data: res }) => {
this.streetArr = res.data
}).catch(() => {})
},
selectModel (event) {
this.dataForm.communityName = ''
this.dataForm.communityId = ''
this.communitys = []
this.dataForm.gridName = ''
this.dataForm.gridId = ''
this.grids = []
this.dataForm.plotId = ''
this.plotArr = []
this.streetArr.find((item) => {
if (item.deptId === event) {
this.dataForm.streetId = item.deptId
this.dataForm.streetName = item.name
this.queryComm(event)
}
})
},
queryComm (event) {
this.$http.get(`sys/dept/deptInfo?deptPid=${event}`).then(({ data: res }) => {
this.communitys = res.data
}).catch(() => {})
},
selectGrid (event) {
this.dataForm.plotId = ''
this.plotArr = []
this.grids.find((item) => {
if (item.deptId === event) {
this.dataForm.gridId = item.deptId
this.dataForm.gridName = item.name
this.getOptions(this.dataForm.gridId)
}
})
},
selectPlot (event) {
this.dataForm.gridName = ''
this.dataForm.gridId = ''
this.grids = []
this.dataForm.plotId = ''
this.plotArr = []
this.communitys.find((item) => {
if (item.deptId === event) {
this.dataForm.communityId = item.deptId
this.dataForm.communityName = item.name
this.queryGrid(event)
}
})
},
queryGrid (event) {
this.$http.get(`sys/dept/deptInfo?deptPid=${event}`).then(({ data: res }) => {
this.grids = res.data
}).catch(() => {})
},
getOptions (gridId) {
this.$http
.get(`/epidemicplotcoordinate/getPlotOption?gridId=${gridId}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.plotArr = res.data
})
.catch(() => {})
this.$http.get(`/sys/dict/listSimple/building_type`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.buildingTypeArr = res.data
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/epidemicplotbuilding/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false }
),
getFormattedAddress() {
AMap.plugin('AMap.Geocoder', () => {
let GeocoderOptions = { city: '全国' }
let geocoder = new AMap.Geocoder(GeocoderOptions)
geocoder.getAddress(this.amap.mapInfo.lnglat, (status, result) => {
console.log('通过经纬度拿到的地址', result)
if (status === 'complete' && result.info === 'OK') {
this.amap.mapInfo.address = result.regeocode.formattedAddress
} else {
this.amap.mapInfo.address = '无法获取地址';
}
})
})
},
//
onSearchResult(pois){
console.log(pois)
this.input = document.querySelector('.search-box-wrapper input').value
console.log(this.input)
this.amap.mapInfo.lnglat = [pois[0].lng,pois[0].lat] //
this.amap.markers = []; //
this.amap.markers.push([pois[0].lng,pois[0].lat]) //
console.log(this.markers);
}
}
}
</script>
<style>
.amap-wrapper {
width: 100%;
height: 300px;
}
</style>

311
src/views/modules/personroom/epidemicplotbuilding.vue

@ -0,0 +1,311 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-__epidemicplotbuilding}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label="所在镇街" prop="streetId" label-width="100px">
<el-select v-model="dataForm.streetId" placeholder="所在镇街" @change="selectModelStreet($event)" clearable>
<el-option v-for="item in streetArr" :key="item.deptId" :label="item.name" :value="item.deptId" >
</el-option>
</el-select>
</el-form-item>
<el-form-item label="社区/村庄"
prop="communityName" label-width="100px">
<el-select v-model="dataForm.communityId"
placeholder="社区/村庄" @change="selectModelComm($event)" clearable>
<el-option v-for="item in communitys"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="网格名称"
prop="gridName" label-width="100px">
<el-select v-model="dataForm.gridId"
placeholder="网格名称" @change="selectGrid($event)" clearable>
<el-option v-for="item in grids"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
<br/>
<el-form-item label="所在小区" prop="plotId" label-width="100px">
<el-select v-model="dataForm.plotId" clearable placeholder="请选择">
<el-option
v-for="item in plotArr"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="楼栋名称" prop="buildingName" label-width="100px">
<el-input v-model="dataForm.buildingName" placeholder="楼栋名称" clearable></el-input>
</el-form-item>
<el-form-item label="楼栋唯一编码" prop="buildingCode" label-width="100px">
<el-input v-model="dataForm.buildingCode" placeholder="楼栋唯一编码" clearable></el-input>
</el-form-item>
<br/>
<el-form-item label="楼栋类型" prop="buildingType" label-width="100px">
<el-select v-model="dataForm.buildingType" placeholder="楼栋类型" clearable >
<el-option v-for="item in buildingTypeArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<!--<el-form-item>-->
<!--<el-button type="primary" @click="exportBuilding()">{{$t("export")}}</el-button>-->
<!--</el-form-item>-->
<el-form-item>
<el-button type="primary" @click="exportHandle()">{{$t("export")}}</el-button>
</el-form-item>
<el-form-item>
<el-upload class="upload-demo" ref="uploadBuilding" v-loading="uploadLoading" :action="uploadBuildingUrl" :limit="1"
:on-success="uploadBuildingSuccess" :on-error="errorExceed" :before-upload="beforeUpload" accept=".xls,.xlsx">
<el-button type="danger">导入楼栋信息</el-button>
</el-upload>
</el-form-item>
<el-form-item>
<el-button type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="streetName" label="所在镇街" width="120px" show-overflow-tooltip header-align="center" align="center"></el-table-column>
<el-table-column prop="communityName" label="所属社区" width="120px" show-overflow-tooltip header-align="center" align="center"></el-table-column>
<el-table-column prop="gridName" label="所属网格" width="200px" show-overflow-tooltip header-align="center" align="center"></el-table-column>
<el-table-column prop="plotName" label="所属小区" width="120px" show-overflow-tooltip header-align="center" align="center"></el-table-column>
<el-table-column prop="buildingName" label="楼栋名称" width="120px" show-overflow-tooltip header-align="center" align="center"></el-table-column>
<el-table-column prop="buildingCode" label="楼栋唯一编码" header-align="center" align="center"></el-table-column>
<!-- <el-table-column prop="buildingType" label="楼栋类型" width="90px" show-overflow-tooltip :formatter="buildingTypeFormat" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="floorNum" label="楼栋层数" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="roomNum" label="单元数" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="householdNum" label="住户数" header-align="center" align="center"></el-table-column>-->
<el-table-column prop="createdTime" label="录入时间" width="180px" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './epidemicplotbuilding-add-or-update'
import qs from 'qs'
import Cookies from 'js-cookie'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/custom/epidemicplotbuilding/page',
getDataListIsPage: true,
deleteURL: '/custom/epidemicplotbuilding',
deleteIsBatch: true,
exportURL: '/custom/epidemicplotbuilding/export',
exportErrorURL: '/custom/epidemicplotbuildingerror/export'
},
buildingTypeArr: [],
dataForm: {
id: '',
streetId: '',
communityId: '',
gridId: '',
plotId:''
},
uploadLoading: false,
uploadBuildingUrl: '',
streetArr: [],
communitys: [],
grids: [],
plotArr: []
}
},
components: {
AddOrUpdate
},
created: function () {
this.getOptions()
//
this.getDailyTypeArrInfo()
//url
this.uploadBuildingUrl = `${window.SITE_CONFIG['apiURL']}/custom/epidemicplotbuilding/importBuilding?token=${Cookies.get('token')}`
},
methods: {
// (4)
getDailyTypeArrInfo () {
this.$http.get(`sys/dept/deptInfo?tags=street_party`).then(({ data: res }) => {
this.streetArr = res.data
}).catch(() => {})
},
//
selectModelStreet (event) {
this.dataForm.communityName = ''
this.streetArr.find((item) => {
if (item.deptId === event) {
this.dataForm.streetId = item.deptId
this.$http.get(`sys/dept/deptInfo?deptPid=${event}`).then(({ data: res }) => {
this.communitys = res.data
}).catch(() => {})
}
})
},
//
selectModelComm (event) {
this.dataForm.gridName = ''
this.communitys.find((item) => {
if (item.deptId === event) {
this.dataForm.communityId = item.deptId
this.$http.get(`sys/dept/deptInfo?deptPid=${event}`).then(({ data: res }) => {
this.grids = res.data
}).catch(() => {})
}
})
},
//
selectGrid (event) {
this.dataForm.plotId = ''
this.plotArr = []
this.grids.find((item) => {
if (item.deptId === event) {
this.dataForm.gridId = item.deptId
this.dataForm.gridName = item.name
this.getPlotList(this.dataForm.gridId)
}
})
},
getPlotList (gridId) {
//
this.$http.get(`/custom/epidemicplotcoordinate/getPlotOption?gridId=${gridId}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.plotArr = res.data
})
.catch(() => {})
//
this.$http.get(`/sys/dict/listSimple/building_type`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.buildingTypeArr = res.data
}).catch(() => {})
},
getOptions() {
this.$http.get(`/sys/dict/listSimple/building_type`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.buildingTypeArr = res.data
}).catch(() => {})
},
buildingTypeFormat (row, column) {
if (row.buildingType) {
let dict = this.buildingTypeArr.filter(item => item.dictValue === row.buildingType)[0]
if (dict) {
return dict.dictName
}
}
return ''
},
//
exportBuilding () {
var params = qs.stringify({
// Cookies.get('token')
'token': Cookies.get('token'),
...this.dataForm
})
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportURL}?${params}`
},
beforeUpload (file) {
console.log('this.uploadBuildingUrl:'+this.uploadBuildingUrl)
this.uploadLoading = true
},
errorExceed (response,file, fileList) {
console.log('+++++++++ 失败 +++++++')
console.log(response)
this.uploadLoading = false
this.$message.error('上传失败请重试')
},
//
uploadBuildingSuccess (response, file, fileList) {
console.log('+++++++++ 成功 +++++++')
this.uploadLoading = false
this.$refs.uploadBuilding.clearFiles()
if ( response.code !== 0 || (response.data !== null && response.data.length > 0) ) {
this.errordataList = response.data
if (this.errordataList != null && this.errordataList.length > 0) {
this.$confirm(
response.data.slice(1, -27).length > 16
? response.data.slice(0, 1) +
response.data.slice(1, -27).slice(0, 16) +
'...' +
response.data.slice(-27)
: response.data,
'提示',
{
confirmButtonText: '下载',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
var params = qs.stringify({
token: Cookies.get('token'),
errorId: response.msg,
...this.dataForm
})
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportErrorURL}?${params}`
this.$message({
type: 'success',
message: '下载成功'
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消下载'
})
})
} else {
this.$message.error(response.msg)
}
this.getDataList()
return
}
this.$message({
message: '导入成功',
type: 'success',
duration: 1000,
onClose: () => {
this.getDataList()
}
})
},
}
}
</script>

557
src/views/modules/personroom/epidemicplotcoordinate-add-or-update.vue

@ -0,0 +1,557 @@
<template>
<el-dialog :visible.sync="visible"
:title="!dataForm.id ? $t('add') : $t('update')"
:close-on-click-modal="false"
:close-on-press-escape="false">
<el-form :model="dataForm"
:rules="dataRule"
ref="dataForm"
:label-width="$i18n.locale === 'en-US' ? '120px' : '90px'">
<el-form-item label="所在镇街"
prop="streetId">
<el-select v-model="dataForm.streetId"
placeholder="所在镇街"
ref="streetRef" style="width: 40%"
@change="selectModel($event)"
>
<el-option v-for="item in streetArr"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="社区/村庄"
prop="communityId">
<el-select v-model="dataForm.communityId"
placeholder="社区/村庄"
ref="communityRef" style="width: 40%"
@change="selectCommunity($event)"
>
<el-option v-for="item in communitys"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="网格名称"
prop="gridId">
<el-select v-model="dataForm.gridId"
placeholder="网格名称"
ref="gridRef" style="width: 40%"
@change="selectGrid($event)"
>
<el-option v-for="item in grids"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item> -->
<el-form-item label="网格名称" prop="gridIds">
<el-select style="width: 60%" v-model="dataForm.gridIds" ref="gridRef" clearable multiple placeholder="网格名称">
<el-option v-for="item in grids"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="小区名称"
prop="plotName">
<el-input style="width: 80%"
v-model="dataForm.plotName"
placeholder="请填写小区名称,不超过50字" @change="searchExist()"></el-input>&emsp;
</el-form-item>
<el-form-item label="小区地址"
prop="mapPlotName">
<el-input style="width: 80%"
v-model="dataForm.mapPlotName"
placeholder="请填写或点击下面地图获取地址"></el-input>&emsp;
<el-button type="primary"
@click="searchKeyword()">获取坐标</el-button>
</el-form-item>
<el-form-item size="mini">
<span style="color: red">*当前小区共有用户 {{updateNum}} 保存后将同步更新</span>
</el-form-item>
<div id="container" style="height:300px;margin-bottom: 20px"></div>
<div style="display: flex">
<el-form-item label="经度"
prop="longitude"
style="width: 40%">
<el-input disabled
v-model="dataForm.longitude"
placeholder="经度"></el-input>
</el-form-item>
<el-form-item label="纬度"
prop="latitude">
<el-input disabled
v-model="dataForm.latitude"
placeholder="纬度"></el-input>
</el-form-item>
</div>
<div style="display: flex">
<el-form-item label="联系人"
prop="contactPerson">
<el-input v-model="dataForm.contactPerson"
placeholder="请输入联系人"></el-input>&emsp;
</el-form-item>
<el-form-item label="联系电话"
prop="contactPerson">
<el-input v-model="dataForm.contactPhone"
placeholder="请输入联系电话"></el-input>&emsp;
</el-form-item>
</div>
<el-form-item prop="introduce" label="小区介绍">
<!-- 富文本编辑器, 容器 -->
<div id="J_quillEditor"></div>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary"
@click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import jsonp from 'jsonp'
import 'quill/dist/quill.snow.css'
import Quill from 'quill'
var searchService
export default {
data () {
return {
visible: false,
quillEditor: null,
quillEditorToolbarOptions: [
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'direction': 'rtl' }]
],
dataForm: {
communityName: '',
communityId: '',
gridIds: [],
gridName: [],
id: '',
streetName: '',
streetId: '',
mapPlotName: '',
plotName: '',
longitude: 0, //
latitude: 0, //
city: '',
contactPerson: '',
contactPhone: '',
introduce: '',
radius: 200
},
updateNum: 0,
streetArr: [],
communitys: [],
grids: []
}
},
computed: {
dataRule () {
return {
plotName: [
{
required: true,
message: this.$t('validate.required'),
trigger: 'blur'
}
],
gridIds: [
{
required: true,
message: this.$t('validate.required'),
trigger: 'blur'
}
],
streetId: [
{
required: true,
message: this.$t('validate.required'),
trigger: 'blur'
}
],
communityId: [
{
required: true,
message: this.$t('validate.required'),
trigger: 'blur'
}
],
mapPlotName: [
{
required: true,
message: this.$t('validate.required'),
trigger: 'blur'
}
],
longitude: [
{
required: true,
message: this.$t('validate.required'),
trigger: 'blur'
}
],
latitude: [
{
required: true,
message: this.$t('validate.required'),
trigger: 'blur'
}
]
}
}
},
methods: {
init () {
this.updateNum = 0
//
this.getDailyTypeArrInfo()
this.getMyLocation()
this.visible = true
this.$nextTick(() => {
if (this.quillEditor) {
this.quillEditor.deleteText(0, this.quillEditor.getLength())
} else {
this.quillEditorHandle()
}
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
this.searchExist()
},
// (4)
getDailyTypeArrInfo () {
this.$http.get(`sys/dept/deptInfo?tags=street_party`).then(({ data: res }) => {
this.streetArr = res.data
}).catch(() => {})
},
queryComm (event) {
this.$http.get(`sys/dept/deptInfo?deptPid=${event}`).then(({ data: res }) => {
this.communitys = res.data
}).catch(() => {})
},
queryGrid (event) {
this.$http.get(`sys/dept/deptInfo?deptPid=${event}`).then(({ data: res }) => {
this.grids = res.data
}).catch(() => {})
},
//
quillEditorHandle () {
this.quillEditor = new Quill('#J_quillEditor', {
modules: {
toolbar: this.quillEditorToolbarOptions
},
theme: 'snow'
})
//
this.quillEditor.on('text-change', () => {
this.dataForm.introduce = this.quillEditor.root.innerHTML
})
},
//
selectModel (event) {
this.dataForm.communityName = ''
this.dataForm.communityId = ''
this.communitys = []
this.dataForm.gridName = ''
this.dataForm.gridIds = ''
this.grids = []
this.streetArr.find((item) => {
if (item.deptId === event) {
this.dataForm.streetId = item.deptId
this.dataForm.streetName = item.name
this.queryComm(event)
searchService.setLocation('平阴县')
searchService.search(item.name)
}
})
},
//
selectCommunity (event) {
this.dataForm.gridName = ''
this.dataForm.gridId = ''
this.grids = []
this.communitys.find((item) => {
if (item.deptId === event) {
this.dataForm.communityId = item.deptId
this.dataForm.communityName = item.name
this.queryGrid(event)
searchService.setLocation('平阴县')
searchService.search(this.dataForm.streetName + item.name)
}
})
},
//
selectGrid (event) {
this.grids.find((item) => {
if (item.deptId === event) {
this.dataForm.gridId = item.deptId
this.dataForm.gridName = item.name
searchService.setLocation('平阴县')
searchService.search(this.dataForm.streetName + this.dataForm.communityName + item.name)
}
})
},
//
getInfo () {
this.$http
.get(`/custom/epidemicplotcoordinate/${this.dataForm.id}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
searchService.setLocation('平阴县')
searchService.search(res.data.mapPlotName)
this.dataForm = {
...this.dataForm,
...res.data
}
this.queryComm(this.dataForm.streetId)
this.queryGrid(this.dataForm.communityId)
console.log(this.dataForm.introduce)
this.quillEditor.root.innerHTML = this.dataForm.introduce
})
.catch(() => { })
},
//
getAddress (lat, lng) {
this.dataForm.longitude = lng
this.dataForm.latitude = lat
var url3 =
'https://apis.map.qq.com/ws/geocoder/v1/?location=' +
lat +
',' +
lng +
'&key=MQFBZ-LTWW6-R7XSK-MFXUQ-DVSIE-BGB4M&output=jsonp'
jsonp(url3, null, (err, data) => {
if (err) {
console.log(err)
}
this.dataForm.mapPlotName = data.result.formatted_addresses.recommend
})
},
getMyLocation () {
var geolocation = new qq.maps.Geolocation(
'MQFBZ-LTWW6-R7XSK-MFXUQ-DVSIE-BGB4M',
'PY'
)
geolocation.getIpLocation(this.showPosition, this.showErr)
},
showPosition (position) {
this.dataForm.latitude = position.lat
this.dataForm.longitude = position.lng
this.dataForm.city = position.city
this.setMap()
},
showErr () {
// console.log('')
this.getMyLocation() // 使
},
setMap () {
const that = this
var markerList = []
var radiusList = []
// map qq.maps.Map()
//
var myLatlng = new qq.maps.LatLng(
this.dataForm.latitude,
this.dataForm.longitude
)
//
var zoom = this.capacity()
var myOptions = {
zoom: zoom, //
center: myLatlng, //
mapTypeId: qq.maps.MapTypeId.ROADMAP // MapType
}
// dom
var map = new qq.maps.Map(
document.getElementById('container'),
myOptions
)
//
var radius = new qq.maps.Circle({
center: new qq.maps.LatLng(
this.dataForm.latitude,
this.dataForm.longitude
),
radius: this.dataForm.radius,
map: map
})
radiusList.push(radius)
var marker = new qq.maps.Marker({
position: myLatlng,
map: map
})
markerList.push(marker)
//
qq.maps.event.addListener(map, 'click', function (event) {
that.cleanMarkRadius(markerList, radiusList)
that.getAddress(event.latLng.lat, event.latLng.lng)
var myLatlng = new qq.maps.LatLng(event.latLng.lat, event.latLng.lng)
map.setCenter(myLatlng)
var marker = new qq.maps.Marker({
position: event.latLng,
map: map
})
//
var radius = new qq.maps.Circle({
center: new qq.maps.LatLng(event.latLng.lat, event.latLng.lng),
radius: that.dataForm.radius,
map: map
})
radiusList.push(radius)
markerList.push(marker)
qq.maps.event.addListener(map, 'click', function (event) {
that.cleanMarkRadius(markerList, radiusList)
})
qq.maps.event.addListener(marker, 'click', function (event) {
that.addressCheckHandle()
})
})
//
searchService = new qq.maps.SearchService({
complete: function (result) {
var pois = result.detail.pois
if (pois == null || pois.length <= 0) {
alert('未找到地址!')
that.getAddress(that.dataForm.latitude, that.dataForm.longitude)
return
}
map.setCenter(pois[0].latLng)
that.getAddress(pois[0].latLng.lat, pois[0].latLng.lng)
var marker = new qq.maps.Marker({
map: map,
position: pois[0].latLng
})
//
var radius = new qq.maps.Circle({
center: new qq.maps.LatLng(pois[0].latLng.lat, pois[0].latLng.lng),
radius: that.dataForm.radius,
map: map
})
radiusList.push(radius)
markerList.push(marker)
that.cleanMarkRadius(markerList, radiusList)
qq.maps.event.addListener(marker, 'click', function (event) {
that.addressCheckHandle()
})
}
})
},
searchKeyword () {
searchService.setLocation(this.dataForm.city)
searchService.search(this.dataForm.mapPlotName)
},
addressCheckHandle () {
if (this.dataForm.mapPlotName === '' || !(this.dataForm.latitude > 0)) {
alert('请选择地址!')
}
},
cleanMarkRadius (markerList, radiusList) {
if (markerList) {
if (markerList.length > 1) {
for (var i4 = 0; i4 < markerList.length - 1; i4++) {
markerList[i4].setMap(null)
}
} else {
for (var i3 = 0; i3 < markerList.length; i3++) {
markerList[i3].setMap(null)
}
}
}
if (radiusList) {
if (radiusList.length > 1) {
for (var i2 = 0; i2 < radiusList.length - 1; i2++) {
radiusList[i2].setMap(null)
}
} else {
for (var i1 = 0; i1 < markerList.length; i1++) {
radiusList[i1].setMap(null)
}
}
}
},
capacity () {
if (this.dataForm.radius > 0 && this.dataForm.radius <= 25) {
return 18
} else if (this.dataForm.radius > 25 && this.dataForm.radius <= 50) {
return 17
} else if (this.dataForm.radius > 50 && this.dataForm.radius <= 100) {
return 16
} else if (this.dataForm.radius > 100 && this.dataForm.radius <= 200) {
return 15
} else if (this.dataForm.radius > 200 && this.dataForm.radius <= 500) {
return 14
} else if (this.dataForm.radius > 500 && this.dataForm.radius <= 1000) {
return 13
} else if (this.dataForm.radius > 1000 && this.dataForm.radius <= 2000) {
return 12
} else if (this.dataForm.radius > 2000 && this.dataForm.radius <= 5000) {
return 11
}
},
searchExist () {
if (this.dataForm.plotName !== '' && this.dataForm.gridId !== '') {
this.$http
.get(`/demo/epidemicuserinoutrecord/getExist?plotName=` + this.dataForm.plotName + `&gridId=` + this.dataForm.gridId)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.updateNum = res.data.length
})
.catch(() => { })
} else {
this.updateNum = 0
}
},
//
dataFormSubmitHandle: debounce(
function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.dataForm.communityName = this.$refs.communityRef.selectedLabel
this.dataForm.streetName = this.$refs.streetRef.selectedLabel
this.dataForm.gridName = this.$refs.gridRef.selectedLabel
this.$http[!this.dataForm.id ? 'post' : 'put'](
'/custom/epidemicplotcoordinate/',
this.dataForm
)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
})
.catch(() => { })
})
},
1000,
{ leading: true, trailing: false }
)
}
}
</script>

148
src/views/modules/personroom/epidemicplotcoordinate.vue

@ -0,0 +1,148 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-__epidemicplotcoordinate}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataListSearch()">
<el-form-item label="所在镇街" prop="streetId">
<el-select v-model="dataForm.streetId" placeholder="所在镇街" @change="selectModelStreet($event)" clearable>
<el-option v-for="item in streetArr" :key="item.deptId" :label="item.name" :value="item.deptId" >
</el-option>
</el-select>
</el-form-item>
<el-form-item label="社区/村庄"
prop="communityName">
<el-select v-model="dataForm.communityId"
placeholder="社区/村庄" @change="selectModelComm($event)" clearable>
<el-option v-for="item in communitys"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="网格名称"
prop="gridName">
<el-select v-model="dataForm.gridId"
placeholder="网格名称" clearable>
<el-option v-for="item in grids"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="小区名称" prop="plotName">
<el-input v-model="dataForm.plotName" placeholder="小区名称" clearable maxlength="49" style="width:200px"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataListSearch()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('dev:unit:update')" type="danger" @click="updateRelation()">更新关系</el-button>
</el-form-item>
<!-- <el-form-item>
<el-button type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item> -->
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="plotName" label="小区名称" header-align="center" align="center"></el-table-column>
<el-table-column prop="streetName" label="所在镇街" header-align="center" align="center"></el-table-column>
<el-table-column prop="communityName" label="社区/村庄" header-align="center" align="center"></el-table-column>
<el-table-column prop="deptName" label="网格名称" header-align="center" align="center"></el-table-column>
<el-table-column prop="mapPlotName" label="小区地址" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataListSearch"></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './epidemicplotcoordinate-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/custom/epidemicplotcoordinate/page',
getDataListIsPage: true,
deleteURL: '/custom/epidemicplotcoordinate',
deleteIsBatch: true
},
dataForm: {
plotName: '',
streetId: '',
communityId: ''
},
streetArr: [],
communitys: [],
grids: []
}
},
components: {
AddOrUpdate
},
created: function () {
//
this.getDailyTypeArrInfo()
},
methods: {
// (4)
getDailyTypeArrInfo () {
this.$http.get(`sys/dept/deptInfo?tags=street_party`).then(({ data: res }) => {
this.streetArr = res.data
}).catch(() => {})
},
updateRelation () {
this.$http.get(`/epidemicplotcoordinate/updateRelation`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
}).catch(() => {})
},
//
selectModelStreet (event) {
this.dataForm.communityName = ''
this.streetArr.find((item) => {
if (item.deptId === event) {
this.dataForm.streetId = item.deptId
this.$http.get(`sys/dept/deptInfo?deptPid=${event}`).then(({ data: res }) => {
this.communitys = res.data
}).catch(() => {})
}
})
},
//
selectModelComm (event) {
this.dataForm.gridName = ''
this.communitys.find((item) => {
if (item.deptId === event) {
this.dataForm.communityId = item.deptId
this.$http.get(`sys/dept/deptInfo?deptPid=${event}`).then(({ data: res }) => {
this.grids = res.data
}).catch(() => {})
}
})
}
}
}
</script>

809
src/views/modules/personroom/epidemicreportuserinfo-add-or-update.vue

@ -0,0 +1,809 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false"
:close-on-press-escape="false">
<el-form v-loading="vueLoading" element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading" :model="dataForm" :rules="dataRule" ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-menu
:default-active="activeIndex"
class="el-menu-demo"
mode="horizontal"
@select="handleSelect"
>
<el-menu-item index="1">基本信息</el-menu-item>
<el-menu-item index="2">地址信息</el-menu-item>
<el-menu-item index="3">其他信息</el-menu-item>
</el-menu>
<div v-show="activeIndex === '1'" class="item-top">
<el-form-item label="人员姓名" prop="userName" label-width="155px">
<el-input :disabled="!dataForm.id ? false : true" v-model="dataForm.userName" placeholder="人员姓名" maxlength="20" clearable @keyup.native="btKeyUpUserName"></el-input>
</el-form-item>
<el-form-item label="曾用名" prop="formerName" label-width="155px">
<el-input :disabled="!dataForm.id ? false : true" v-model="dataForm.formerName" placeholder="曾用名"></el-input>
</el-form-item>
<el-form-item label="性别" prop="gender" label-width="155px">
<el-select :disabled="!dataForm.id ? false : true" v-model="dataForm.gender" clearable placeholder="性别">
<el-option v-for="item in gender" :key="item.dictValue" :label="item.dictName" :value="item.dictValue"></el-option>
</el-select>
</el-form-item>
<el-form-item label="出生年月" prop="birthday" label-width="155px">
<el-input :disabled="!dataForm.id ? false : true" v-model="dataForm.birthday" placeholder="出生年月"></el-input>
</el-form-item>
<el-form-item label="民族" prop="nation" label-width="155px">
<!-- <el-input v-model="dataForm.nation" placeholder="民族"></el-input> -->
<el-select :disabled="!dataForm.id ? false : true" v-model="dataForm.nation" clearable placeholder="民族" filterable>
<el-option v-for="item in nationList" :key="item.dictValue" :label="item.dictName" :value="item.dictName"></el-option>
</el-select>
</el-form-item>
<el-form-item label="政治面貌" prop="politicsStatus" label-width="155px">
<!-- <el-input v-model="dataForm.politicsStatus" placeholder="政治面貌"></el-input> -->
<el-select :disabled="!dataForm.id ? false : true" v-model="dataForm.politicsStatus" clearable placeholder="政治面貌">
<el-option v-for="item in politicsList" :key="item.dictValue" :label="item.dictName" :value="item.dictName"></el-option>
</el-select>
</el-form-item>
<el-form-item label="身份证号" prop="idCard" label-width="155px">
<el-input :disabled="!dataForm.id ? false : true" v-model="dataForm.idCard" placeholder="身份证" clearable maxlength="49" @keyup.native="btKeyUpIdCard"></el-input>
</el-form-item>
<el-form-item label="联系方式" prop="mobile" label-width="155px">
<el-input :disabled="!dataForm.id ? false : true" v-model="dataForm.mobile" placeholder="联系方式" clearable maxlength="11" @keyup.native="btKeyUpMobile"></el-input>
</el-form-item>
<el-form-item label="文化程度" prop="standardOfCulture" label-width="155px">
<!-- <el-input v-model="dataForm.standardOfCulture" placeholder="文化程度"></el-input> -->
<el-select :disabled="!dataForm.id ? false : true" v-model="dataForm.standardOfCulture" clearable placeholder="文化程度">
<el-option v-for="item in standardList" :key="item.dictValue" :label="item.dictName" :value="item.dictName"></el-option>
</el-select>
</el-form-item>
<el-form-item label="宗教信仰" prop="faith" label-width="155px">
<el-input :disabled="!dataForm.id ? false : true" v-model="dataForm.faith" placeholder="宗教信仰"></el-input>
<!-- <el-select v-model="dataForm.faith" clearable placeholder="宗教信仰">
<el-option v-for="item in faithList" :key="item.dictValue" :label="item.dictName" :value="item.dictName"></el-option>
</el-select> -->
</el-form-item>
<el-form-item label="籍贯" prop="nativePlace" label-width="155px">
<el-input :disabled="!dataForm.id ? false : true" v-model="dataForm.nativePlace" placeholder="籍贯"></el-input>
</el-form-item>
<el-form-item label="网格名称" prop="gridName" label-width="155px">
<el-input :disabled="!dataForm.id ? false : true" v-model="dataForm.gridName" placeholder="网格名称"></el-input>
</el-form-item>
<el-form-item label="户籍地" prop="householdRegisterName" label-width="155px">
<el-cascader
ref="hjdname"
:disabled="!dataForm.id ? false : true"
v-model="dataForm.householdRegisterCodes"
:options="options"
@change="householdRegisterChangeHandle"
:props="{ checkStrictly: true, emitPath: true}"
>
</el-cascader>
</el-form-item>
<el-form-item label="户籍地详细地址" prop="householdRegisterDetail" label-width="155px">
<el-input :disabled="!dataForm.id ? false : true" v-model="dataForm.householdRegisterDetail" placeholder="户籍地详细地址" maxlength="200" clearable></el-input>
</el-form-item>
</div>
<div v-show="activeIndex === '2'" class="item-top">
<el-form-item label="县内居住地" prop="liveAddressCode" label-width="155px">
<el-select v-model="dataForm.liveAddressCode" placeholder="请选择" @change="selectLive($event)">
<el-option
v-for="item in liveOptions"
:key="item.deptId"
:label="item.name"
:value="item.deptId">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="县内居住地详细地址" prop="liveAddressDetail" label-width="155px">
<el-input v-model="dataForm.liveAddressDetail" placeholder="县内居住地详细地址" maxlength="200" clearable></el-input>
</el-form-item> -->
<!-- <el-form-item label="社区/村庄" prop="community" label-width="155px">
<el-input v-model="dataForm.community" placeholder="社区/村庄"></el-input>
</el-form-item> -->
<el-form-item
label="社区/村庄"
prop="communityId"
label-width="155px"
>
<el-select
v-model="dataForm.communityId"
ref="jzdname"
placeholder="请选择"
@click.native="clickCommunity"
@change="changeCommunity"
>
<el-option
v-for="item in communityOptions"
:key="item.deptId"
:label="item.name"
:value="item.deptId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="网格名称"
prop="gridId"
label-width="155px"
>
<el-select
v-model="dataForm.gridId"
ref="jzdname"
placeholder="请选择"
@click.native="clickGridName"
@change="changeGridName"
style="width: 240px;"
>
<el-option
v-for="item in gridNameOptions"
:key="item.deptId"
:label="item.name"
:value="item.deptId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="关联小区/村坐标" prop="coordinateId" label-width="155px">
<el-select v-model="dataForm.coordinateId" clearable placeholder="关联小区/村坐标" @change="selectPlot($event)">
<el-option v-for="item in simplePlotList" :key="item.id" :label="item.plot" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="小区" prop="plot" label-width="155px">
<el-input v-model="dataForm.plot" placeholder="小区"></el-input>
</el-form-item>
<el-form-item label="楼号" prop="buildingNo" label-width="155px">
<el-input v-model="dataForm.buildingNo" placeholder="楼号"></el-input>
</el-form-item>
<el-form-item label="单元" prop="unit" label-width="155px">
<el-input v-model="dataForm.unit" placeholder="单元"></el-input>
</el-form-item>
<el-form-item label="房间号" prop="roomNo" label-width="155px">
<el-input v-model="dataForm.roomNo" placeholder="房间号"></el-input>
</el-form-item>
</div>
<div v-show="activeIndex === '3'" class="item-top">
<el-form-item label="房屋性质" prop="houseProperty" label-width="155px">
<!-- <el-input v-model="dataForm.houseProperty" placeholder="房屋性质"></el-input> -->
<el-select :disabled="!dataForm.id ? false : true" v-model="dataForm.houseProperty" clearable placeholder="房屋性质">
<el-option v-for="item in housePropertyList" :key="item.dictValue" :label="item.dictName" :value="item.dictName"></el-option>
</el-select>
</el-form-item>
<el-form-item label="县内居住地关联人" prop="relationPeople" label-width="155px">
<el-input :disabled="!dataForm.id ? false : true" v-model="dataForm.relationPeople" placeholder="居住地关联人" maxlength="20" clearable @keyup.native="btKeyUpRelationPeople"></el-input>
</el-form-item>
<el-form-item label="关联人联系电话" prop="relationPeopleMobile" label-width="155px">
<el-input :disabled="!dataForm.id ? false : true" v-model="dataForm.relationPeopleMobile" placeholder="关联人联系电话" clearable maxlength="11" @keyup.native="btKeyUpRelationPeopleMobile"></el-input>
</el-form-item>
<el-form-item label="特殊人群" prop="specialCrowd" label-width="155px">
<!-- <el-input v-model="dataForm.specialCrowd" placeholder="特殊人群"></el-input> -->
<el-select :disabled="!dataForm.id ? false : true" v-model="dataForm.specialCrowd" clearable placeholder="特殊人群">
<el-option v-for="item in specialCrowdList" :key="item.dictValue" :label="item.dictName" :value="item.dictName"></el-option>
</el-select>
</el-form-item>
<el-form-item label="有无车辆" prop="car" label-width="155px">
<!-- <el-input v-model="dataForm.car" placeholder="有无车辆"></el-input> -->
<el-select :disabled="!dataForm.id ? false : true" v-model="dataForm.car" clearable placeholder="有无车辆">
<el-option v-for="item in carList" :key="item.dictValue" :label="item.dictName" :value="item.dictName"></el-option>
</el-select>
</el-form-item>
<el-form-item label="车牌号" prop="carNo" label-width="155px">
<el-input :disabled="!dataForm.id ? false : true" v-model="dataForm.carNo" placeholder="车牌号"></el-input>
</el-form-item>
<!-- <el-form-item label="现居住地" prop="outLiveAddressName" label-width="155px">
<el-cascader
ref="zwjzdname"
:disabled="!dataForm.id ? false : true"
v-model="dataForm.outLiveAddressCodes"
:options="options"
@change="outLiveAddressChangeHandle"
:props="{ checkStrictly: true, emitPath: true}"
>
</el-cascader>
</el-form-item> -->
<el-form-item label="现居住地" prop="outLiveAddressName" label-width="155px">
<el-input :disabled="!dataForm.id ? false : true" v-model="dataForm.outLiveAddressName" placeholder="现居住地" maxlength="200" clearable></el-input>
</el-form-item>
<el-form-item label="现居住地详细地址" prop="outLiveAddressDetail" label-width="155px">
<el-input :disabled="!dataForm.id ? false : true" v-model="dataForm.outLiveAddressDetail" placeholder="现居住地详细地址" maxlength="200" clearable></el-input>
</el-form-item>
<el-form-item label="疫情风险等级" prop="riskGrade" label-width="155px">
<el-select :disabled="!dataForm.id ? false : true" v-model="dataForm.riskGrade" placeholder="现居住地疫情风险等级" clearable>
<el-option v-for="item in riskGradeList" :key="item.dictValue" :label="item.dictName" :value="item.dictValue"></el-option>
</el-select>
</el-form-item>
<el-form-item label="拟返回平阴时间" prop="goBarkTime" label-width="155px">
<el-date-picker
:disabled="!dataForm.id ? false : true"
v-model="dataForm.goBarkTime"
type="date"
placeholder="返回平阴时间"
label-width="155px"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
style="width:200px">
</el-date-picker>
</el-form-item>
<!--
<el-form-item label="身高" prop="height" label-width="155px">
<el-input v-model="dataForm.height" placeholder="身高"></el-input>
</el-form-item>
<el-form-item label="健康情况" prop="health" label-width="155px">
<el-input v-model="dataForm.health" placeholder="健康情况"></el-input>
</el-form-item>
<el-form-item label="血型" prop="bloodType" label-width="155px">
<el-input v-model="dataForm.bloodType" placeholder="血型"></el-input>
</el-form-item>
<el-form-item label="婚姻状况" prop="maritalStatus" label-width="155px">
<el-input v-model="dataForm.maritalStatus" placeholder="婚姻状况"></el-input>
</el-form-item>
<el-form-item label="与户主关系" prop="relation" label-width="155px">
<el-input v-model="dataForm.relation" placeholder="与户主关系"></el-input>
</el-form-item>
<el-form-item label="国籍" prop="nationality" label-width="155px">
<el-input v-model="dataForm.nationality" placeholder="国籍"></el-input>
</el-form-item>
<el-form-item label="毕业院校" prop="graduateSchool" label-width="155px">
<el-input v-model="dataForm.graduateSchool" placeholder="毕业院校"></el-input>
</el-form-item>
<el-form-item label="专业" prop="professional" label-width="155px">
<el-input v-model="dataForm.professional" placeholder="专业"></el-input>
</el-form-item>
<el-form-item label="工作状态" prop="workStatus" label-width="155px">
<el-input v-model="dataForm.workStatus" placeholder="工作状态"></el-input>
</el-form-item>
<el-form-item label="行业类别" prop="industryCategory" label-width="155px">
<el-input v-model="dataForm.industryCategory" placeholder="行业类别"></el-input>
</el-form-item>
<el-form-item label="工作单位(现/原)" prop="workUnits" label-width="155px">
<el-input v-model="dataForm.workUnits" placeholder="工作单位(现/原)"></el-input>
</el-form-item>
<el-form-item label="兵役状况" prop="military" label-width="155px">
<el-input v-model="dataForm.military" placeholder="兵役状况"></el-input>
</el-form-item>
<el-form-item label="人口类别" prop="peopleCategories" label-width="155px">
<el-input v-model="dataForm.peopleCategories" placeholder="人口类别"></el-input>
</el-form-item>
<el-form-item label="人户状况" prop="hushaiStatus" label-width="155px">
<el-input v-model="dataForm.hushaiStatus" placeholder="人户状况"></el-input>
</el-form-item>
<el-form-item label="往返情况" prop="returnState" label-width="155px">
<el-select v-model="dataForm.returnState" placeholder="往返情况" @change="selectModel($event)">
<el-option v-for="item in returnStateArr" :key="item.dictValue" :label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<div v-if="showFlagIn">
<el-form-item label="拟离开平阴时间" prop="leaveTime" label-width="155px">
<el-date-picker
v-model="dataForm.leaveTime"
type="date"
placeholder="选择拟离开平阴时间"
label-width="150px"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
style="width:200px">
</el-date-picker>
</el-form-item>
<el-form-item label="拟去往目的地" prop="destinationAddressName" label-width="155px">
<el-cascader
ref="qwmddname"
v-model="dataForm.destinationAddressCodes"
:options="options"
@change="destinationChangeHandle"
:props="{ checkStrictly: true, emitPath: true}"
>
</el-cascader>
</el-form-item>
<el-form-item label="拟去往目的地详细地址" prop="destinationAddressDetail" label-width="155px">
<el-input v-model="dataForm.destinationAddressDetail" placeholder="去往目的地详细地址" maxlength="200"
clearable></el-input>
</el-form-item>
</div>
<div v-if="showFlagOut">
</div>
<el-form-item label="家庭保障情况" prop="familySecurity" label-width="155px">
<el-input v-model="dataForm.familySecurity" placeholder="家庭保障情况"></el-input>
</el-form-item>
<el-form-item label="居住情况" prop="livingSituation" label-width="155px">
<el-input v-model="dataForm.livingSituation" placeholder="居住情况"></el-input>
</el-form-item> -->
</div>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
import 'element-ui/lib/theme-chalk/cascader.css'
// import area from '../../../utils/area.json'
export default {
data () {
return {
visible: false,
dataForm: {
userName: '',
formerName: '',
gender: '',
birthday: '',
nation: '',
politicsStatus: '',
idCard: '',
mobile: '',
standardOfCulture: '',
faith: '',
nativePlace: '',
householdRegisterCode: '',
householdRegisterName: '',
householdRegisterDetail: '',
liveAddressCode: '',
liveAddressName: '',
// liveAddressDetail: '',
outLiveAddressCode: '',
outLiveAddressName: '',
outLiveAddressDetail: '',
plot: '',
buildingNo: '',
unit: '',
roomNo: '',
houseProperty: '',
relationPeople: '',
relationPeopleMobile: '',
coordinateId: '',
longitude: '',
latitude: '',
specialCrowd: '',
car: '',
carNo: '',
riskGrade: '',
goBarkTime: '',
// 使
returnState: '1',
householdRegisterCodes: [],
liveAddressCodes: [],
outLiveAddressCodes: [],
leaveTime: '',
destinationAddressName: '',
destinationAddressCode: '',
destinationAddressDetail: '',
destinationAddressCodes: [],
bloodType: '',
height: '',
health: '',
maritalStatus: '',
relation: '',
nationality: '',
graduateSchool: '',
professional: '',
workStatus: '',
industryCategory: '',
workUnits: '',
military: '',
peopleCategories: '',
hushaiStatus: '',
communityOptions: [],
gridNameOptions: [],
community: '',
communityId: '',
gridName: '',
gridId: '',
familySecurity: '',
livingSituation: ''
},
isAble: false,
showFlagIn: true,
showFlagOut: false,
gender: [
{ dictValue: '男', dictName: '男' },
{ dictValue: '女', dictName: '女' }
],
// returnStateArr: [
// {dictValue: '1', dictName: ''},
// {dictValue: '2', dictName: ''}
// ],
liveOptions: [], //
nationList: [], //
politicsList: [], //
standardList: [], //
options: [], //
housePropertyList: [], //
simplePlotList: [], // / coordinateId
specialCrowdList: [], //
riskGradeList: [], //
carList: [
{ dictValue: '无', dictName: '无' },
{ dictValue: '有', dictName: '有' }
],
vueLoading: true,
activeIndex: '1'
}
},
computed: {
dataRule () {
return {
userName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
mobile: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
idCard: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ pattern: /(^\d{15}$)|bai(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '请输入正确身份证号', trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.visible = true
this.isAble = true
this.vueLoading = true
//
// this.dataForm.destinationAddressCodes = []
this.getOptions()
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getOptions () {
//
this.vueLoading = false
this.isAble = false
//
this.$http.get(`/sys/dict/listSimple/nation`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.nationList = res.data
}).catch((err) => {
console.log(err)
})
//
this.$http.get(`/sys/dict/listSimple/politics_status`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.politicsList = res.data
}).catch((err) => {
console.log(err)
})
//
this.$http.get(`/sys/dict/listSimple/education_level`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.standardList = res.data
}).catch((err) => {
console.log(err)
})
//
this.$http.get(`/sys/dict/listSimple/house_purpose`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.housePropertyList = res.data
}).catch((err) => {
console.log(err)
})
//
this.$http.get(`/sys/dict/listSimple/special_groups`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.specialCrowdList = res.data
}).catch((err) => {
console.log(err)
})
//
this.$http.get(`/sys/dict/listSimple/area_risk_level`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.riskGradeList = res.data
}).catch((err) => {
console.log(err)
})
this.$http.get(`/sys/dept/deptInfo?deptPid=53613e1c5de6ed473467f0159a10b135&tags=street_party`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.liveOptions = res.data
}).catch(() => {})
},
//
clickCommunity () {
if (this.dataForm.liveAddressCode) {
this.deptInfo(this.dataForm.liveAddressCode, '0') // 0, 1
} else {
this.$message.error('请选择县内居住地')
}
},
//
changeCommunity () {
this.dataForm.community = (this.communityOptions.find((item) => {
return item.deptId === this.dataForm.communityId
})).name
this.gridNameOptions = []
this.dataForm.gridName = ''
this.dataForm.gridId = ''
},
//
clickGridName () {
if (this.dataForm.communityId) {
this.deptInfo(this.dataForm.communityId, '1') // 0, 1
} else {
this.$message.error('请选择社区/村庄')
}
},
changeGridName () {
this.dataForm.gridName = (this.gridNameOptions.find((item) => {
return item.deptId === this.dataForm.gridId
})).name
},
// /
deptInfo (id, isCommunityOfGrid) {
this.$http.get(`/sys/dept/deptInfo?deptPid=${id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
if (isCommunityOfGrid === '0') { // 0, 1
this.communityOptions = res.data
} else {
this.gridNameOptions = res.data
}
}).catch(() => {})
},
// id name longitude latitude
getPlotList () {
if (!this.dataForm.liveAddressCode) {
return
}
let datas = {
params: {
streetCode: this.dataForm.liveAddressCode,
plot: ''
}
}
this.simplePlotList = []
this.$http.get(`/epidemicplotcoordinate/simplePlot/getList`, datas).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.simplePlotList = res.data
}).catch((err) => {
console.log(err)
})
},
// /
selectPlot (id) {
console.log(id)
if (id) {
this.simplePlotList.forEach(item => {
if (item.id === id) {
this.dataForm.latitude = item.latitude
this.dataForm.longitude = item.longitude
}
})
} else {
this.dataForm.latitude = ''
this.dataForm.longitude = ''
}
},
//
selectLive (id) {
this.dataForm.coordinateId = ''
this.dataForm.latitude = ''
this.dataForm.longitude = ''
this.getliveAddressName(id)
this.getPlotList()
this.communityOptions = [] // /
this.dataForm.community = ''
this.dataForm.communityId = ''
this.gridNameOptions = []
this.dataForm.gridName = ''
this.dataForm.gridId = ''
},
//
getliveAddressName (id) {
this.liveOptions.forEach(item => {
if (item.value === id) {
this.dataForm.liveAddressName = item.label
this.dataForm.liveAddressCodes = [id]
}
})
},
//
// selectModel(id) {
// if (id === '1') {
// //
// this.showFlagIn = true
// this.showFlagOut = false
// } else {
// this.showFlagIn = false
// this.showFlagOut = true
// }
// },
//
outLiveAddressChangeHandle (value, selectedData) {
let outLiveAddressCode = ''
let outLiveAddressName = ''
var outLiveAddressCodeArr = this.$refs['zwjzdname'].checkedValue
var outLiveAddressNameArr = this.$refs['zwjzdname'].getCheckedNodes()[0].pathLabels
for (var i = 0; i < outLiveAddressCodeArr.length; i++) {
if (i === outLiveAddressCodeArr.length - 1) {
outLiveAddressCode += outLiveAddressCodeArr[i]
} else {
outLiveAddressCode += outLiveAddressCodeArr[i] + ','
}
}
for (var j = 0; j < outLiveAddressNameArr.length; j++) {
if (j === outLiveAddressNameArr.length - 1) {
outLiveAddressName += outLiveAddressNameArr[j]
} else {
outLiveAddressName += outLiveAddressNameArr[j] + '/'
}
}
this.dataForm.outLiveAddressCode = outLiveAddressCode
this.dataForm.outLiveAddressName = outLiveAddressName
},
//
householdRegisterChangeHandle (value, selectedData) {
let householdRegisterCode = ''
let householdRegisterName = ''
var householdRegisterCodeArr = this.$refs['hjdname'].checkedValue
var householdRegisterNameArr = this.$refs['hjdname'].getCheckedNodes()[0].pathLabels
for (var i = 0; i < householdRegisterCodeArr.length; i++) {
if (i === householdRegisterCodeArr.length - 1) {
householdRegisterCode += householdRegisterCodeArr[i]
} else {
householdRegisterCode += householdRegisterCodeArr[i] + ','
}
}
for (var j = 0; j < householdRegisterNameArr.length; j++) {
if (j === householdRegisterNameArr.length - 1) {
householdRegisterName += householdRegisterNameArr[j]
} else {
householdRegisterName += householdRegisterNameArr[j] + '/'
}
}
this.dataForm.householdRegisterCode = householdRegisterCode
this.dataForm.householdRegisterName = householdRegisterName
},
// liveAddressChangeHandle(value, selectedData) {
// let liveAddressCode = ''
// let liveAddressName = ''
// var liveAddressCodeArr = this.$refs['jzdname'].checkedValue
// var liveAddressNameArr = this.$refs['jzdname'].getCheckedNodes()[0].pathLabels
// for (var i = 0; i < liveAddressCodeArr.length; i++) {
// if (i === liveAddressCodeArr.length - 1) {
// liveAddressCode += liveAddressCodeArr[i]
// } else {
// liveAddressCode += liveAddressCodeArr[i] + ','
// }
// }
// for (var j = 0; j < liveAddressNameArr.length; j++) {
// if (j === liveAddressNameArr.length - 1) {
// liveAddressName += liveAddressNameArr[j]
// } else {
// liveAddressName += liveAddressNameArr[j] + '/'
// }
// }
// this.dataForm.liveAddressCode = liveAddressCode
// this.dataForm.liveAddressName = liveAddressName
// },
// destinationChangeHandle(value, selectedData) {
// let destinationAddressCode = ''
// let destinationAddressName = ''
// var destinationAddressCodeArr = this.$refs['qwmddname'].currentValue
// var destinationAddressNameArr = this.$refs['qwmddname'].currentLabels
// for (var i = 0; i < destinationAddressCodeArr.length; i++) {
// if (i === destinationAddressCodeArr.length - 1) {
// destinationAddressCode += destinationAddressCodeArr[i]
// } else {
// destinationAddressCode += destinationAddressCodeArr[i] + ','
// }
// }
// for (var j = 0; j < destinationAddressNameArr.length; j++) {
// if (j === destinationAddressNameArr.length - 1) {
// destinationAddressName += destinationAddressNameArr[j]
// } else {
// destinationAddressName += destinationAddressNameArr[j] + '/'
// }
// }
// this.dataForm.destinationAddressCode = destinationAddressCode
// this.dataForm.destinationAddressName = destinationAddressName
// },
//
getInfo () {
this.$http.get(`/personroom/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
this.getPlotList()
if (this.dataForm.liveAddressCode) {
this.deptInfo(this.dataForm.liveAddressCode, '0') // /
}
if (this.dataForm.communityId) {
this.deptInfo(this.dataForm.communityId, '1') //
}
if (this.dataForm.returnState === '1') {
//
this.showFlagIn = true
this.showFlagOut = false
} else {
this.showFlagIn = false
this.showFlagOut = true
}
}).catch(() => {
})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
this.$message.error('请完善必填项')
return false
}
this.isAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/personroom/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
this.isAble = false
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {
})
})
}, 1000, { 'leading': true, 'trailing': false }),
btKeyUpIdCard (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.idCard = e.target.value
},
btKeyUpMobile (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.mobile = e.target.value
},
btKeyUpRelationPeopleMobile (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.relationPeopleMobile = e.target.value
},
btKeyUpUserName (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.userName = e.target.value
},
btKeyUpRelationPeople (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.relationPeople = e.target.value
},
handleSelect (key, keyPath) {
this.activeIndex = key
}
}
}
</script>
<style>
.item-top {
margin-top: 20px;
}
</style>

357
src/views/modules/personroom/epidemicreportuserinfo-ds.vue

@ -0,0 +1,357 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-demo__epidemicreportuserinfo}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="beforeSearch()">
<el-form-item label="姓名" prop="username" label-width="90px">
<el-input v-model="dataForm.username" placeholder="姓名" clearable maxlength="49" @keyup.native="btKeyUpUsername" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="身份证" prop="idCard" label-width="90px">
<el-input v-model="dataForm.idCard" placeholder="身份证" clearable maxlength="49" @keyup.native="btKeyUpIdCard" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="mobile" label-width="90px">
<el-input v-model="dataForm.mobile" placeholder="手机号" clearable maxlength="11" @keyup.native="btKeyUpMobile" style="width:200px"></el-input>
</el-form-item>
<br/>
<el-form-item label="楼号" prop="buildingNo" label-width="90px">
<el-input v-model="dataForm.buildingNo" placeholder="楼号" clearable maxlength="11" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="单元号" prop="unit" label-width="90px">
<el-input v-model="dataForm.unit" placeholder="单元号" clearable maxlength="11" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="房间号" prop="roomNo" label-width="90px">
<el-input v-model="dataForm.roomNo" placeholder="房间号" clearable maxlength="11" style="width:200px"></el-input>
</el-form-item>
<br>
<el-form-item label="现居住地" label-width="90px" ref="jzdname" >
<el-cascader
v-model="ids"
:options="options"
:props="{ checkStrictly: true }"
clearable
change-on-select
>
</el-cascader>
</el-form-item>
<!-- <el-form-item label="往返情况" prop="returnState" label-width="70px">-->
<!-- <el-select v-model="dataForm.returnState" placeholder="往返情况" clearable>-->
<!-- <el-option v-for="item in returnStateArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <br/>-->
<el-form-item label="居住乡镇" prop="outStreet" label-width="90px" v-if="$hasPermission('sys:epidemicreportuserinfo:townsSearch')">
<el-select v-model="dataForm.outStreet" placeholder="居住乡镇" @change="selectModel($event)" clearable>
<el-option v-for="item in outStreetArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="录入时间" prop="startTime" label-width="70px">-->
<!-- <el-date-picker v-model="dataForm.startTime"-->
<!-- type="date"-->
<!-- :picker-options="pickerBeginDateBefore"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- format="yyyy-MM-dd"-->
<!-- placeholder="选择日期时间"-->
<!-- style="width:200px" @change="changeTime">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="至" prop="endTime">-->
<!-- <el-date-picker v-model="dataForm.endTime"-->
<!-- type="date"-->
<!-- :picker-options="pickerBeginDateAfter"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- format="yyyy-MM-dd"-->
<!-- placeholder="选择日期时间"-->
<!-- style="width:200px" @change="changeTime">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" @click="beforeSearch()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="false" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('demo:epidemicreportuserinfo:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column label="序号" header-align="center" align="center" width="50px">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column prop="userName" label="姓名" header-align="center" align="center" width="150"></el-table-column>
<el-table-column prop="idCard" label="身份证号" header-align="center" align="center" width="170" show-overflow-tooltip></el-table-column>
<el-table-column prop="mobile" label="联系方式" header-align="center" align="center" width="150"></el-table-column>
<el-table-column prop="householdRegisterName" label="户籍所在地" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="householdRegisterDetail" label="户籍所在地详细地址" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="liveAddressName" label="县内居住镇街" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<!-- <el-table-column prop="outLiveAddressName" label="现居住地" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column> -->
<!-- <el-table-column prop="outLiveAddressDetail" label="现居住地详细地址" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="community" label="社区/村" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="plot" label="小区" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="buildingNo" label="楼" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="unit" label="单元" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="roomNo" label="房屋" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<!-- <el-table-column prop="riskGrade" label="现居住地风险等级" header-align="center" align="center" width="180" show-overflow-tooltip>
<template slot-scope="scope">
<el-tag v-if='scope.row.riskGrade === "3"' size="small" type="danger">高风险</el-tag>
<el-tag v-else-if='scope.row.riskGrade === "2"' size="small" type="warning">中风险</el-tag>
<el-tag v-else-if='scope.row.riskGrade === "1"' size="small" type="success">低风险</el-tag>
</template>
</el-table-column> -->
<!-- <el-table-column prop="returnState" label="往返情况" header-align="center" align="center" width="110" :formatter = "returnStateFormat"></el-table-column> -->
<!-- <el-table-column prop="goBarkTime" label="拟返回平阴时间" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column> -->
<!-- <el-table-column prop="liveAddressDetail" label="县内居住地详细地址" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>-->
<!-- <el-table-column prop="relationPeople" label="县内居住联系人" header-align="center" align="center" width="150"></el-table-column> -->
<!-- <el-table-column prop="relationPeopleMobile" label="联系人电话" header-align="center" align="center" width="150"></el-table-column> -->
<!-- <el-table-column prop="destinationAddressName" label="拟去往地" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>-->
<el-table-column prop="createdTime" label="录入时间" header-align="center" align="center" width="160"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="lookHandle(scope.row.id)">{{'查看'}}</el-button>
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
class="epidemic-report-userinfo"
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataListSearch"></add-or-update>
<infoDetail v-if="detailVisible" ref="infoDetail" @refreshDataList="getDataListSearch"></infoDetail>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './epidemicreportuserinfo-add-or-update'
import InfoDetail from './epidemicreportuserinfoDetail'
import qs from "qs";
import Cookies from "js-cookie";
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
activatedIsNeed: false,
getDataListURL: '/personroom/permissionPage',
getDataListIsPage: true,
deleteURL: '/personroom',
deleteIsBatch: true,
exportURL: '/personroom/export',
exportErrorInfoURL: '/epidemicusererror/export'
},
dataForm: {
id: '',
idCard: '',
username:'',
mobile: '',
outCode: '',
outStreet: '',
returnState: '',
startTime: '',
endTime: '',
roomNo: ''
},
publicPath: process.env.BASE_URL,
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.endTime
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal + ' 00:00:00').getTime()
}
}
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.startTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal + ' 00:00:00').getTime()
}
}
},
ids: [],
options: [],
outStreetArr: [],
returnStateArr: [
{ dictValue: 1, dictName: '在本地' },
{ dictValue: 2, dictName: '在外地' }
],
exportTemplate: false,
uploeadLoeading: false,
dialogVisibleExcel: false,
detailVisible: false
}
},
created: function () {
this.getOptions()
//
this.getDailyTypeArrInfo()
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/epidemicreportuserinfo/importManualScoreExcel?token=${window.localStorage.getItem('esrsToken')}`
},
components: {
AddOrUpdate,
InfoDetail
},
watch: {
ids: function (val) {
if (val.length === 0) {
this.dataForm.outCode = ''
} else {
this.dataForm.outCode = this.ids[val.length - 1]
}
}
},
methods: {
beforeSearch () {
if (this.dataForm.username.trim() === '' && this.dataForm.idCard.trim() === '' && this.dataForm.roomNo.trim() ==='') {
this.$message({
message: '姓名、身份证、房间号至少一项不能为空',
type: 'warning',
duration: 1000
})
} else {
this.getDataListSearch()
}
},
//
lookHandle (id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.infoDetail.dataForm.id = id
this.$refs.infoDetail.init()
})
},
// (4)
getDailyTypeArrInfo () {
this.$http.get(`epidemicreportuserinfo/selectStreet/4`).then(({ data: res }) => {
this.outStreetArr = res
}).catch(() => {})
},
//
selectModel (event) {
this.outStreetArr.find((item) => {
if (item.dictValue === event) {
this.dataForm.outStreet = item.dictValue
}
})
},
getOptions () {
this.$http
.get(`/select/getSysArea`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data
})
.catch(() => {})
},
btKeyUpUsername (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.username = e.target.value
},
btKeyUpIdCard (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.idCard = e.target.value
},
btKeyUpMobile (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.mobile = e.target.value
},
beforeUpload(file){
this.uploeadLoeading = true
},
errorExceed (file, fileList) {
this.uploeadLoeading = false
this.$message.error('上传失败请重试')
},
uploadSuccess (response, file, fileList) {
this.uploeadLoeading = false
this.dataForm.liveAddressName = this.$refs.jzdname.selectedLabel
this.$refs.upload.clearFiles()
if (response.code !== 0 || (response.data !== null && response.data.length > 0)) {
this.errordataList = response.data
if (this.errordataList != null && this.errordataList.length > 0) {
this.$confirm(response.data, '提示', {
confirmButtonText: '下载',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var params = qs.stringify({
'token': window.localStorage.getItem('esrsToken'),
...this.dataForm
})
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportErrorInfoURL}?${params}`
this.$message({
type: 'success',
message: '下载成功'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消下载'
});
});
} else {
this.$message.error(response.msg)
}
this.getDataList()
return
}
this.$message({
message: '导入成功',
type: 'success',
duration: 1000,
onClose: () => {
this.getDataList()
}
})
},
returnStateFormat (row, column) {
if (row.returnState === 1 || row.returnState === '1') {
return '在本地'
} else if (row.returnState === 2 || row.returnState === '2') {
return '在外地'
} else {
return ''
}
},
// returnriskGradeFormat (row, column) {
// //1:23
// if (row.riskGrade === 1 || row.riskGrade === '1') {
// return ''
// } else if (row.riskGrade === 2 || row.riskGrade === '2') {
// return ''
// } else if (row.riskGrade === 3 || row.riskGrade === '3') {
// return ''
// } else {
// return ''
// }
// },
//
exports() {
this.dialogVisibleExcel = true;
}
}
}
</script>
<style lang="scss">
.epidemic-report-userinfo .el-pagination__jump .el-input .el-input__inner{
font-size: 13px;
}
</style>

356
src/views/modules/personroom/epidemicreportuserinfo.vue

@ -0,0 +1,356 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-demo__epidemicreportuserinfo}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="beforeSearch()">
<el-form-item label="姓名" prop="username" label-width="90px">
<el-input v-model="dataForm.username" placeholder="姓名" clearable maxlength="49" @keyup.native="btKeyUpUsername" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="身份证" prop="idCard" label-width="90px">
<el-input v-model="dataForm.idCard" placeholder="身份证" clearable maxlength="49" @keyup.native="btKeyUpIdCard" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="mobile" label-width="90px">
<el-input v-model="dataForm.mobile" placeholder="手机号" clearable maxlength="11" @keyup.native="btKeyUpMobile" style="width:200px"></el-input>
</el-form-item>
<br/>
<el-form-item label="楼号" prop="buildingNo" label-width="90px">
<el-input v-model="dataForm.buildingNo" placeholder="楼号" clearable maxlength="11" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="单元号" prop="unit" label-width="90px">
<el-input v-model="dataForm.unit" placeholder="单元号" clearable maxlength="11" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="房间号" prop="roomNo" label-width="90px">
<el-input v-model="dataForm.roomNo" placeholder="房间号" clearable maxlength="11" style="width:200px"></el-input>
</el-form-item>
<br>
<el-form-item label="现居住地" label-width="90px" ref="jzdname" >
<el-cascader
v-model="ids"
:options="options"
:props="{ checkStrictly: true }"
clearable
change-on-select
>
</el-cascader>
</el-form-item>
<!-- <el-form-item label="往返情况" prop="returnState" label-width="70px">-->
<!-- <el-select v-model="dataForm.returnState" placeholder="往返情况" clearable>-->
<!-- <el-option v-for="item in returnStateArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <br/>-->
<el-form-item label="居住乡镇" prop="outStreet" label-width="90px" v-if="$hasPermission('sys:epidemicreportuserinfo:townsSearch')">
<el-select v-model="dataForm.outStreet" placeholder="居住乡镇" @change="selectModel($event)" clearable>
<el-option v-for="item in outStreetArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" >
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="录入时间" prop="startTime" label-width="70px">-->
<!-- <el-date-picker v-model="dataForm.startTime"-->
<!-- type="date"-->
<!-- :picker-options="pickerBeginDateBefore"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- format="yyyy-MM-dd"-->
<!-- placeholder="选择日期时间"-->
<!-- style="width:200px" @change="changeTime">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="至" prop="endTime">-->
<!-- <el-date-picker v-model="dataForm.endTime"-->
<!-- type="date"-->
<!-- :picker-options="pickerBeginDateAfter"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- format="yyyy-MM-dd"-->
<!-- placeholder="选择日期时间"-->
<!-- style="width:200px" @change="changeTime">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" @click="beforeSearch()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="false" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('demo:epidemicreportuserinfo:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column label="序号" header-align="center" align="center" width="50px">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column prop="userName" label="姓名" header-align="center" align="center" width="150"></el-table-column>
<el-table-column prop="idCard" label="身份证号" header-align="center" align="center" width="170" show-overflow-tooltip></el-table-column>
<el-table-column prop="mobile" label="联系方式" header-align="center" align="center" width="150"></el-table-column>
<el-table-column prop="householdRegisterName" label="户籍所在地" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="householdRegisterDetail" label="户籍所在地详细地址" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="liveAddressName" label="县内居住镇街" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<!-- <el-table-column prop="outLiveAddressName" label="现居住地" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column> -->
<!-- <el-table-column prop="outLiveAddressDetail" label="现居住地详细地址" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="community" label="社区/村" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="plot" label="小区" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="buildingNo" label="楼" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="unit" label="单元" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="roomNo" label="房屋" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>
<!-- <el-table-column prop="riskGrade" label="现居住地风险等级" header-align="center" align="center" width="180" show-overflow-tooltip>
<template slot-scope="scope">
<el-tag v-if='scope.row.riskGrade === "3"' size="small" type="danger">高风险</el-tag>
<el-tag v-else-if='scope.row.riskGrade === "2"' size="small" type="warning">中风险</el-tag>
<el-tag v-else-if='scope.row.riskGrade === "1"' size="small" type="success">低风险</el-tag>
</template>
</el-table-column> -->
<!-- <el-table-column prop="returnState" label="往返情况" header-align="center" align="center" width="110" :formatter = "returnStateFormat"></el-table-column> -->
<!-- <el-table-column prop="goBarkTime" label="拟返回平阴时间" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column> -->
<!-- <el-table-column prop="liveAddressDetail" label="县内居住地详细地址" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>-->
<!-- <el-table-column prop="relationPeople" label="县内居住联系人" header-align="center" align="center" width="150"></el-table-column> -->
<!-- <el-table-column prop="relationPeopleMobile" label="联系人电话" header-align="center" align="center" width="150"></el-table-column> -->
<!-- <el-table-column prop="destinationAddressName" label="拟去往地" header-align="center" align="center" width="180" show-overflow-tooltip></el-table-column>-->
<el-table-column prop="createdTime" label="录入时间" header-align="center" align="center" width="160"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="lookHandle(scope.row.id)">{{'查看'}}</el-button>
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
class="epidemic-report-userinfo"
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataListSearch"></add-or-update>
<infoDetail v-if="detailVisible" ref="infoDetail" @refreshDataList="getDataListSearch"></infoDetail>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './epidemicreportuserinfo-add-or-update'
import InfoDetail from './epidemicreportuserinfoDetail'
import qs from 'qs'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
activatedIsNeed: false,
getDataListURL: '/personroom/page',
getDataListIsPage: true,
deleteURL: '/personroom',
deleteIsBatch: true,
exportURL: '/personroom/export',
exportErrorInfoURL: '/epidemicusererror/export'
},
dataForm: {
id: '',
idCard: '',
username: '',
mobile: '',
outCode: '',
outStreet: '',
returnState: '',
startTime: '',
endTime: '',
roomNo: ''
},
publicPath: process.env.BASE_URL,
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.endTime
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal + ' 00:00:00').getTime()
}
}
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.startTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal + ' 00:00:00').getTime()
}
}
},
ids: [],
options: [],
outStreetArr: [],
returnStateArr: [
{ dictValue: 1, dictName: '在本地' },
{ dictValue: 2, dictName: '在外地' }
],
exportTemplate: false,
uploeadLoeading: false,
dialogVisibleExcel: false,
detailVisible: false
}
},
created: function () {
this.getOptions()
//
this.getDailyTypeArrInfo()
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/epidemicreportuserinfo/importManualScoreExcel?token=${window.localStorage.getItem('esrsToken')}`
},
components: {
AddOrUpdate,
InfoDetail
},
watch: {
ids: function (val) {
if (val.length === 0) {
this.dataForm.outCode = ''
} else {
this.dataForm.outCode = this.ids[val.length - 1]
}
}
},
methods: {
beforeSearch () {
if (this.dataForm.username.trim() === '' && this.dataForm.idCard.trim() === '' && this.dataForm.roomNo.trim() === '') {
this.$message({
message: '姓名、身份证、房间号至少一项不能为空',
type: 'warning',
duration: 1000
})
} else {
this.getDataListSearch()
}
},
//
lookHandle (id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.infoDetail.dataForm.id = id
this.$refs.infoDetail.init()
})
},
// (4)
getDailyTypeArrInfo () {
this.$http.get(`epidemicreportuserinfo/selectStreet/4`).then(({ data: res }) => {
this.outStreetArr = res
}).catch(() => {})
},
//
selectModel (event) {
this.outStreetArr.find((item) => {
if (item.dictValue === event) {
this.dataForm.outStreet = item.dictValue
}
})
},
getOptions () {
this.$http
.get(`/select/getSysArea`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data
})
.catch(() => {})
},
btKeyUpUsername (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.username = e.target.value
},
btKeyUpIdCard (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.idCard = e.target.value
},
btKeyUpMobile (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.mobile = e.target.value
},
beforeUpload (file) {
this.uploeadLoeading = true
},
errorExceed (file, fileList) {
this.uploeadLoeading = false
this.$message.error('上传失败请重试')
},
uploadSuccess (response, file, fileList) {
this.uploeadLoeading = false
this.dataForm.liveAddressName = this.$refs.jzdname.selectedLabel
this.$refs.upload.clearFiles()
if (response.code !== 0 || (response.data !== null && response.data.length > 0)) {
this.errordataList = response.data
if (this.errordataList != null && this.errordataList.length > 0) {
this.$confirm(response.data, '提示', {
confirmButtonText: '下载',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var params = qs.stringify({
'token': window.localStorage.getItem('esrsToken'),
...this.dataForm
})
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.mixinViewModuleOptions.exportErrorInfoURL}?${params}`
this.$message({
type: 'success',
message: '下载成功'
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消下载'
})
})
} else {
this.$message.error(response.msg)
}
this.getDataList()
return
}
this.$message({
message: '导入成功',
type: 'success',
duration: 1000,
onClose: () => {
this.getDataList()
}
})
},
returnStateFormat (row, column) {
if (row.returnState === 1 || row.returnState === '1') {
return '在本地'
} else if (row.returnState === 2 || row.returnState === '2') {
return '在外地'
} else {
return ''
}
},
// returnriskGradeFormat (row, column) {
// //1:23
// if (row.riskGrade === 1 || row.riskGrade === '1') {
// return ''
// } else if (row.riskGrade === 2 || row.riskGrade === '2') {
// return ''
// } else if (row.riskGrade === 3 || row.riskGrade === '3') {
// return ''
// } else {
// return ''
// }
// },
//
exports () {
this.dialogVisibleExcel = true
}
}
}
</script>
<style lang="scss">
.epidemic-report-userinfo .el-pagination__jump .el-input .el-input__inner{
font-size: 13px;
}
</style>

349
src/views/modules/personroom/epidemicreportuserinfoDetail.vue

@ -0,0 +1,349 @@
<template>
<el-dialog :visible.sync="visible" title="查看" :close-on-click-modal="false" width="70%" top="7vh"
:close-on-press-escape="false">
<el-form v-loading="vueLoading" element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading" :model="dataForm" :rules="dataRule" ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '160px' : '155px'" :disabled="true">
<div class="item-box">
<div class="item-title"><span></span> 基本信息</div>
<div class="item-table">
<div class="table-row">
<div class="table-col-label">姓名</div>
<div class="table-col-content">{{dataForm.userName}}</div>
<div class="table-col-label">曾用名</div>
<div class="table-col-content">{{dataForm.formerName}}</div>
<div class="table-col-label">性别</div>
<div class="table-col-content">{{dataForm.gender}}</div>
<div class="table-col-label">出生年月</div>
<div class="table-col-content">{{dataForm.birthday}}</div>
</div>
<div class="table-row">
<div class="table-col-label">民族</div>
<div class="table-col-content">{{dataForm.nation}}</div>
<div class="table-col-label">政治面貌</div>
<div class="table-col-content">{{dataForm.politicsStatus}}</div>
<div class="table-col-label">身份证号</div>
<div class="table-col-content">{{dataForm.idCard}}</div>
<div class="table-col-label">联系方式</div>
<div class="table-col-content">{{dataForm.mobile}}</div>
</div>
<div class="table-row">
<div class="table-col-label">文化程度</div>
<div class="table-col-content">{{dataForm.standardOfCulture}}</div>
<div class="table-col-label">宗教信仰</div>
<div class="table-col-content">{{dataForm.faith}}</div>
<div class="table-col-label">籍贯</div>
<div class="table-col-content">{{dataForm.nativePlace}}</div>
<div class="table-col-label">网格名称</div>
<div class="table-col-content">{{dataForm.liveAddressName}}/{{dataForm.community}}/{{dataForm.gridName}}</div>
</div>
</div>
</div>
<div class="item-box">
<div class="item-title"><span></span> 房屋信息</div>
<div class="item-table">
<div class="table-row">
<div class="table-col-label">户籍地</div>
<div class="table-col-content">{{dataForm.householdRegisterName}}</div>
<div class="table-col-label">户籍地详细地址</div>
<div class="table-col-content">{{dataForm.householdRegisterDetail}}</div>
<div class="table-col-label">现居住地</div>
<div class="table-col-content">{{dataForm.outLiveAddressName}}</div>
<div class="table-col-label">现居住地详细地址</div>
<div class="table-col-content">{{dataForm.outLiveAddressDetail}}</div>
</div>
<div class="table-row">
<div class="table-col-label">小区</div>
<div class="table-col-content">{{dataForm.plot}}</div>
<div class="table-col-label">楼号</div>
<div class="table-col-content">{{dataForm.buildingNo}}</div>
<div class="table-col-label">单元</div>
<div class="table-col-content">{{dataForm.unit}}</div>
<div class="table-col-label">房间号</div>
<div class="table-col-content">{{dataForm.roomNo}}</div>
</div>
<div class="table-row">
<div class="table-col-label">房屋性质</div>
<div class="table-col-content">{{dataForm.houseProperty}}</div>
<div class="table-col-label">居住地关联人</div>
<div class="table-col-content">{{dataForm.relationPeople}}</div>
<div class="table-col-label">关联人联系电话</div>
<div class="table-col-content">{{dataForm.relationPeopleMobile}}</div>
<div class="table-col-label">经纬度坐标</div>
<div class="table-col-content">{{dataForm.longitude}},{{dataForm.latitude}}</div>
</div>
</div>
</div>
<div class="item-box">
<div class="item-title"><span></span> 其他信息</div>
<div class="item-table">
<div class="table-row">
<div class="table-col-label">特殊人群类型</div>
<div class="table-col-content">{{dataForm.specialCrowd}}</div>
<div class="table-col-label">有无车辆</div>
<div class="table-col-content">{{dataForm.car}}</div>
<div class="table-col-label">车牌号</div>
<div class="table-col-content">{{dataForm.carNo}}</div>
<div class="table-col-label">现居住地疫情风险等级</div>
<div class="table-col-content">{{dataForm.riskGradeName}}</div>
</div>
<div class="table-row">
<div class="table-col-label">拟返回平阴时间</div>
<div class="table-col-content">{{dataForm.goBarkTime}}</div>
<div class="table-col-label"></div>
<div class="table-col-content"></div>
<div class="table-col-label"></div>
<div class="table-col-content"></div>
<div class="table-col-label"></div>
<div class="table-col-content"></div>
</div>
</div>
</div>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data() {
return {
visible: false,
dataForm: {
userName: '',
formerName: '',
gender: '',
birthday: '',
nation: '',
politicsStatus: '',
idCard: '',
mobile: '',
standardOfCulture: '',
faith: '',
nativePlace: '',
gridName: '',
householdRegisterCode: '',
householdRegisterName: '',
householdRegisterDetail: '',
outLiveAddressCode: '',
outLiveAddressName: '',
outLiveAddressDetail: '',
plot: '',
buildingNo: '',
unit: '',
roomNo: '',
houseProperty: '',
relationPeople: '',
relationPeopleMobile: '',
longitude: '',
latitude: '',
specialCrowd: '',
car: '',
carNo: '',
riskGrade: '',
riskGradeName: '', // getRiskGradeList()
goBarkTime: '',
returnState: '1',
// liveAddressCode: '',
// liveAddressName: '',
// liveAddressDetail: '',
// householdRegisterCodes: [],
// liveAddressCodes: [],
// outLiveAddressCodes: [],
// leaveTime: '',
// destinationAddressName: '',
// destinationAddressCode: '',
// destinationAddressDetail: '',
// destinationAddressCodes: [],
// bloodType: '',
// height: '',
// health: '',
// maritalStatus: '',
// relation: '',
// nationality: '',
// graduateSchool: '',
// professional: '',
// workStatus: '',
// industryCategory: '',
// workUnits: '',
// military: '',
// peopleCategories: '',
// hushaiStatus: '',
// community: '',
// familySecurity: '',
// livingSituation: ''
},
isAble: false,
showFlagIn: true,
showFlagOut: true,
vueLoading: true,
// riskGradeList: [],//
}
},
computed: {
dataRule() {
return {
userName: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
idCard: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'},
{pattern: /(^\d{15}$)|bai(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '请输入正确身份证号', trigger: 'blur'}
]
}
}
},
methods: {
init() {
this.visible = true
this.isAble = true
this.vueLoading = true
//
this.dataForm.destinationAddressCodes = []
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
this.vueLoading = false
this.isAble = false
},
//
getRiskGradeList () {
this.dataForm.riskGradeName = ''
this.$http.get(`/sys/dict/listSimple/area_risk_level`).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
// this.riskGradeList = res.data
res.data.forEach(item => {
if (item.dictValue == this.dataForm.riskGrade) {
this.dataForm.riskGradeName = item.dictName
}
})
}).catch((err) => {
console.log(err)
})
},
//
getInfo() {
this.$http.get(`/personroom/${this.dataForm.id}`).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
this.getRiskGradeList() //
if (this.dataForm.returnState === '1') {
//
this.showFlagIn = true
this.showFlagOut = false
} else {
this.showFlagIn = false
this.showFlagOut = true
}
}).catch((err) => {
console.log(err)
})
},
// - 使
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.isAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/personroom/', this.dataForm).then(({data: res}) => {
if (res.code !== 0) {
this.isAble = false
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {
})
})
}, 1000, {'leading': true, 'trailing': false}),
btKeyUpIdCard(e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.idCard = e.target.value
},
btKeyUpMobile(e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.mobile = e.target.value
},
btKeyUpRelationPeopleMobile(e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.relationPeopleMobile = e.target.value
},
btKeyUpUserName(e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.userName = e.target.value
},
btKeyUpRelationPeople(e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '')
this.dataForm.relationPeople = e.target.value
}
}
}
</script>
<style scoped>
.item-box {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.item-title {
height: 40px;
display: flex;
align-items: center;
}
.item-title span {
display: inline-block;
width: 5px;
height: 5px;
background-color: lightsalmon;
margin-right: 5px;
}
.item-table {
display: flex;
flex-direction: column;
}
.item-table .table-row {
display: flex;
align-items: center;
justify-content: space-around;
}
.table-row div {
border: 1px solid lightgray;
display: flex;
align-items: center;
white-space: normal;
padding: 4px 8px;
overflow: hidden;
}
.table-row .table-col-label {
width: 15%;
height: 40px;
}
.table-row .table-col-content {
width: 30%;
height: 40px;
}
</style>

171
src/views/modules/personroom/plotbinding.vue

@ -0,0 +1,171 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-__epidemicplotcoordinate}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataListSearch()">
<el-form-item label="街道" prop="streetCode">
<el-select v-model="dataForm.streetCode" placeholder="街道" @change="selectModel($event)" clearable>
<el-option v-for="item in streetArr" :key="item.deptId"
:label="item.name"
:value="item.deptId" >
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item>
<el-input v-model="dataForm.id" placeholder="id" clearable></el-input>
</el-form-item> -->
<el-form-item label="小区/村名称" prop="plot" label-width="90px">
<el-input v-model="dataForm.plot" placeholder="小区/村名称" clearable maxlength="49" style="width:200px"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataListSearch()">{{ $t('query') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="liveAddressName" label="街道名" header-align="center" align="center"></el-table-column>
<el-table-column prop="community" label="社区名" header-align="center" align="center"></el-table-column>
<el-table-column prop="gridName" label="网格" header-align="center" align="center"></el-table-column>
<el-table-column prop="plot" label="小区/村名称" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="binding(scope.row)">绑定</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<el-dialog
title="小区绑定"
:visible.sync="dialogVisible"
width="40%">
<el-form :inline="true" :model="form" ref="dataRule" :rules="dataRule" @keyup.enter.native="getDataListSearch()">
<el-form-item label="小区/村名称" prop="plot" label-width="100px">
<!-- <el-input v-model="dataForm.plot" placeholder="小区/村名称" clearable maxlength="49" style="width:200px"></el-input> -->
<el-select filterable v-model="form.plotName" placeholder="请选择小区/村名称" style="width:190%">
<el-option
v-for="item in datas"
:key="item.plotName"
:label="item.plotName"
:value="item.plotName">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit()"> </el-button>
</span>
</el-dialog>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/demo/epidemicuserinoutrecord/getCoordinateIdIsNullList',
getDataListIsPage: true
// deleteURL: '/epidemicplotcoordinate',
// deleteIsBatch: true
},
dataForm: {
plot: '',
streetCode: ''
},
dataRule: {
mapPlotName: [
{ required: true, message: '请选择小区/村名称', trigger: 'blur' }
]
},
form: {
plotName: ''
},
submitForm: {
plot: '',
community: '',
liveAddressName: '',
latitude: null,
longitude: null,
coordinateId: null
},
dialogVisible: false,
streetArr: [],
datas: []
}
},
components: {
},
created: function () {
//
this.getDailyTypeArrInfo()
},
methods: {
binding (row) {
this.datas = []
this.form.plot = ''
this.submitForm.plot = row.plot
this.submitForm.community = row.community
this.submitForm.liveAddressName = row.liveAddressName
this.$http.get(`epidemicplotcoordinate/getList`).then(({ data: res }) => {
this.datas = res.data
}).catch(() => {})
this.dialogVisible = true
},
submit () {
this.$refs['dataRule'].validate((valid) => {
if (valid) {
this.datas.forEach(x => {
if (x.plotName === this.form.plotName) {
this.submitForm.coordinateId = x.id
this.submitForm.latitude = x.latitude
this.submitForm.longitude = x.longitude
}
})
this.$http.post(`/demo/epidemicuserinoutrecord/plotBinding`, this.submitForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
if (res.code === 0) {
this.$message({
message: '绑定成功,已更新 ' + res.data + ' 户居民坐标信息',
type: 'success'
})
this.dialogVisible = false
this.getDataList()
}
}).catch(() => {})
}
})
},
// (4)
getDailyTypeArrInfo () {
this.$http.get(`/sys/dept/deptInfo?deptPid=53613e1c5de6ed473467f0159a10b135&tags=street_party`).then(({ data: res }) => {
this.streetArr = res.data
}).catch(() => {})
},
//
selectModel (event) {
this.streetArr.find((item) => {
if (item.dictValue === event) {
this.dataForm.streetCode = item.deptId
}
})
}
}
}
</script>
Loading…
Cancel
Save