取 消
@@ -175,39 +152,41 @@
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // 引入Loading服务
import { requestPost } from '@/js/dai/request'
-
-
-
var map
var search
var markers
var infoWindowList
-var geocoder // 新建一个正逆地址解析类
-
let loading // 加载动画
export default {
data () {
return {
formType: 'add', //表单操作类型 add新增,edit编辑,detail详情
+ gridList: [],
+ propertyList: [],
btnDisable: false,
- unitId: '',
- keyWords: '',
- formData: {
- gridId: '',
- unitName: '',
- serviceMatter: [],
- type: '',
- contact: '',
- contactMobile: '',
- memberCount: 0,
- remark: '', //备注【最大500字】
+ neighborHoodId: '', //小区ID
+ dataForm: {
+ neighborHoodName: '', // 小区名称【不超过50字】
+ agencyId: '', // 所属组织ID
+ agencyName: '',
+ gridId: '', //所属网格ID
+ propertyId: '', //关联物业
address: '', //详细地址
- longitude: 36.0722275, //经度
- latitude: 120.38945519 //纬度
+ remark: '', //备注【最大500字】
+ location: '', //坐标位置
+ longitude: '', //经度
+ latitude: '' //纬度
+ },
+
+ propertyFormShow: false,
+ propertyForm: {
+ name: ''
},
+ keyWords: '',
+ agencyObj: {}
}
},
components: {},
@@ -216,101 +195,6 @@ export default {
},
methods: {
-
- async initForm (type, unitId) {
- this.$refs.ref_form.resetFields();
-
- // debugger
- // map.setCenter(new TMap.LatLng(agencyObj.latitude, agencyObj.longitude))
-
- this.formType = type
- if (unitId) {
- this.unitId = unitId
- this.formData.id = unitId
- await this.loadFormData()
- }
-
- },
-
- //加载组织
- async loadFormData () {
- // const url = '/heart/icpartyunit/detail'
- const url = 'http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/detail'
- let params = {
- id: this.unitId
- }
-
- const { data, code, msg } = await requestPost(url, params)
-
- if (code === 0) {
- this.formData = data
-
- } else {
- this.$message.error(msg)
- }
- },
-
-
-
- async handleComfirm () {
-
- this.btnDisable = true
- setTimeout(() => {
- this.btnDisable = false
- }, 10000)
- this.$refs['ref_form'].validate((valid, messageObj) => {
- if (!valid) {
- app.util.validateRule(messageObj)
- this.btnDisable = false
- } else {
- this.addUnit()
- }
-
- })
-
-
- },
- async addUnit () {
- // const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //手机号码
- // if (regPhone.test(this.formData.contactMobile) === false) {
- // this.btnDisable = false
- // this.$message({
- // type: 'warning',
- // message: '请输入正确的手机号码'
- // })
- // return false;
- // }
-
- // let url = '/heart/icpartyunit/save'
- let url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/save"
- // if (this.formType === 'edit') {
- // this.formData.id = this.unitId
- // }
-
- const { data, code, msg } = await requestPost(url, this.formData)
-
- if (code === 0) {
- this.$message({
- type: 'success',
- message: '新增联建单位成功'
- })
- this.resetData()
- this.$emit('dialogOk')
- this.btnDisable = false
- } else {
- this.btnDisable = false
- this.$message.error(msg)
- }
-
- },
-
- handleCancle () {
-
- this.resetData()
- this.$emit('dialogCancle')
-
- },
-
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义
initMap () {
// 定义地图中心点坐标
@@ -331,14 +215,11 @@ export default {
})
infoWindowList = Array(10)
- geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类
-
// 监听地图平移结束
map.on('panend', () => {
this.handleMoveCenter()
})
this.handleMoveCenter()
- this.convert()
},
setMarker (lat, lng) {
@@ -373,13 +254,10 @@ export default {
const {
location: { lat, lng }
} = data[0]
-
-
map.setCenter(new TMap.LatLng(lat, lng))
this.setMarker(lat, lng)
- this.formData.latitude = lat
- this.formData.longitude = lng
- this.convert()
+ this.dataForm.latitude = lat
+ this.dataForm.longitude = lng
} else {
this.$message.error('未检索到相关位置坐标')
}
@@ -391,54 +269,185 @@ export default {
const center = map.getCenter()
const lat = center.getLat()
const lng = center.getLng()
- this.formData.latitude = lat
- this.formData.longitude = lng
+ this.dataForm.latitude = lat
+ this.dataForm.longitude = lng
this.setMarker(lat, lng)
- this.convert(lat, lng)
},
- convert (lat, lng) {
- markers.setGeometries([]);
- // var input = document.getElementById('location').value.split(',');
- let location
- if (lat && lng) {
- location = new TMap.LatLng(lat, lng);
+ async initForm (type, row, agencyObj) {
+ this.$refs.ref_form.resetFields();
+ this.agencyObj = agencyObj
+ // debugger
+ map.setCenter(new TMap.LatLng(agencyObj.latitude, agencyObj.longitude))
+
+ this.formType = type
+ if (row) {
+
+ this.dataForm = JSON.parse(JSON.stringify(row))
+ this.neighborHoodId = this.dataForm.neighborHoodId
+ }
+
+
+ await this.loadAgency()
+ await this.loadGrid()
+ await this.loadProperty()
+ },
+
+ //加载组织
+ async loadAgency () {
+ const url = '/epmetuser/customerstaff/staffbasicinfo'
+ let params = {}
+
+ const { data, code, msg } = await requestPost(url, params)
+
+ if (code === 0) {
+ this.dataForm.agencyId = data.agencyId
+ this.dataForm.agencyName = data.agencyName
+ } else {
+ this.$message.error(msg)
+ }
+ },
+ //加载网格
+ async loadGrid () {
+ const url = '/gov/org/grid/allgridsnopermission '
+ // const url = "https://epmet-dev.elinkservice.cn:7082/api/apimock-v2/95518686fa128a53f64c678906848062/gov/org/grid/allgrids"
+ let params = {
+ agencyId: this.dataForm.agencyId
+ }
+
+ const { data, code, msg } = await requestPost(url, params)
+
+ if (code === 0) {
+ this.gridList = data
} else {
- location = new TMap.LatLng(this.formData.latitude, this.formData.longitude);
+ this.$message.error(msg)
}
+ },
+ //加载物业
+ async loadProperty () {
+ const url = '/gov/org/propertymanagement/list'
+ // const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/list"
+ let params = {}
- // map.setCenter(location);
- markers.updateGeometries([
- {
- id: 'main', // 点标注数据数组
- position: location,
- },
- ]);
- geocoder
- .getAddress({ location: location }) // 将给定的坐标位置转换为地址
- .then((result) => {
- this.formData.address = result.result.address
- // 显示搜索到的地址
- });
+ const { data, code, msg } = await requestPost(url, params)
+
+ if (code === 0) {
+ this.propertyList = data
+ } else {
+ this.$message.error(msg)
+ }
+ },
+
+ handleAddProperty () {
+ this.propertyForm.name = ''
+ this.propertyFormShow = true
+ },
+
+ async handleComfirm () {
+
+ if (this.propertyFormShow) {
+
+ this.addProperty()
+
+ } else {
+ this.btnDisable = true
+ setTimeout(() => {
+ this.btnDisable = false
+ }, 10000)
+ this.$refs['ref_form'].validate((valid, messageObj) => {
+ if (!valid) {
+ app.util.validateRule(messageObj)
+ this.btnDisable = false
+ } else {
+ this.addCommunity()
+ }
+
+ })
+
+ }
},
+ async addCommunity () {
+
+ let url = ''
+ if (this.formType === 'add') {
+ url = '/gov/org/neighborhood/neighborhoodadd'
+ // url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodadd"
+ } else {
+ url = '/gov/org/neighborhood/neighborhoodupdate'
+ this.dataForm.neighborHoodId = this.neighborHoodId
+ }
+
+ const { data, code, msg } = await requestPost(url, this.dataForm)
+ if (code === 0) {
+ this.$message({
+ type: 'success',
+ message: '添加小区成功'
+ })
+ this.resetData()
+ this.$emit('dialogOk')
+ this.btnDisable = false
+ } else {
+ this.btnDisable = false
+ this.$message.error(msg)
+ }
+
+ },
+ async addProperty () {
+ if (!this.propertyForm.name || this.propertyForm.name === '') {
+ this.$message({
+ type: 'error',
+ message: '物业名称不能为空'
+ })
+ return false
+ }
+ const url = '/gov/org/propertymanagement/add'
+ // const url = "http://yapi.elinkservice.cn/mock/245/gov/org/propertymanagement/add"
+ let params = {
+ name: this.propertyForm.name
+ }
+
+ const { data, code, msg } = await requestPost(url, params)
+
+ if (code === 0) {
+ this.$message({
+ type: 'success',
+ message: '操作成功'
+ })
+ this.dataForm.propertyId = data.propertyId
+ this.propertyForm.name = ''
+ this.propertyFormShow = false
+ this.loadProperty()
+ } else {
+ this.$message.error(msg)
+ }
+ },
+ handleCancle () {
+ if (this.propertyFormShow) {
+ this.propertyForm.name = ''
+ this.propertyFormShow = false
+ } else {
+ this.resetData()
+ this.$emit('dialogCancle')
+ }
+ },
resetData () {
- this.unitId = ''
this.keyWords = ''
- this.formData = {
- gridId: '',
- unitName: '',
- serviceMatter: [],
- type: '',
- contact: '',
- contactMobile: '',
- memberCount: 0,
- remark: '', //备注【最大500字】
+ this.neighborHoodId = '' //小区ID
+ this.dataForm = {
+ neighborHoodName: '', // 小区名称【不超过50字】
+ agencyId: '', // 所属组织ID
+ agencyName: '',
+ gridId: '', //所属网格ID
+ propertyId: '', //关联物业
address: '', //详细地址
+ remark: '', //备注【最大500字】
+ location: '', //坐标位置
longitude: '', //经度
latitude: '' //纬度
}
+ this.propertyFormShow = false
},
// 开启加载动画
startLoading () {
@@ -459,24 +468,20 @@ export default {
computed: {
dataRule () {
return {
- gridId: [
- { required: true, message: '所属网格不能为空', trigger: 'blur' }
- ],
- unitName: [
- { required: true, message: '单位名称不能为空', trigger: 'blur' },
- ],
- type: [
- { required: true, message: '分类不能为空', trigger: 'blur' }
- ],
-
- contact: [
- { required: true, message: '联系人不能为空', trigger: 'blur' }
+ neighborHoodName: [
+ { required: true, message: '小区名称不能为空', trigger: 'blur' },
+ {
+ min: 1,
+ max: 50,
+ message: '小区名称长度在 1 到 50个字符',
+ trigger: 'blur'
+ }
],
- contactMobile: [
- { required: true, message: '联系电话不能为空', trigger: 'blur' }
+ agencyId: [
+ { required: true, message: '所属组织不能为空', trigger: 'blur' }
],
- memberCount: [
- { required: true, message: '在职党员数不能为空', trigger: 'blur' }
+ gridId: [
+ { required: true, message: '所属网格不能为空', trigger: 'blur' }
],
address: [
{ required: true, message: '详细地址不能为空', trigger: 'blur' }
@@ -486,23 +491,14 @@ export default {
]
}
},
-
+ propertyRule () {
+ name: [
+ { required: true, message: '物业名称不能为空', trigger: 'blur' }
+ // { min: 1, max: 50, message: '小区名称长度在 1 到 50个字符', trigger: 'blur' }
+ ]
+ }
},
- props: {
-
- gridList: {
- type: Array,
- default: []
- },
- typeList: {
- type: Array,
- default: []
- },
- serviceList: {
- type: Array,
- default: []
- },
- }
+ props: {}
}
-
diff --git a/src/views/modules/visual/basicinfo/basicInfoCommunity.vue b/src/views/modules/visual/basicinfo/basicInfoCommunity.vue
index 50f54367a..dbb0a3c43 100644
--- a/src/views/modules/visual/basicinfo/basicInfoCommunity.vue
+++ b/src/views/modules/visual/basicinfo/basicInfoCommunity.vue
@@ -95,264 +95,7 @@ export default {
selBuildingName: '',
roomLoaded: false,
- roomArray: [
- {
- houseId: "1",
- houseName: "101室",
- categoryList: [
- {
- name: '党员',
- iconUrl: require('../../../../assets/img/shuju/dangyuan.png'),
- isSpecial: '1',
- },
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "2",
- houseName: "102室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- },
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- },
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- },
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "3",
- houseName: "103室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "4",
- houseName: "104室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "5",
- houseName: "105室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "6",
- houseName: "106室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- }, {
- houseId: "1",
- houseName: "101室",
- categoryList: [
- {
- name: '党员',
- iconUrl: require('../../../../assets/img/shuju/dangyuan.png'),
- isSpecial: '1',
- },
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "2",
- houseName: "102室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- },
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- },
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- },
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "3",
- houseName: "103室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "4",
- houseName: "104室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "5",
- houseName: "105室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "6",
- houseName: "106室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- }, {
- houseId: "1",
- houseName: "101室",
- categoryList: [
- {
- name: '党员',
- iconUrl: require('../../../../assets/img/shuju/dangyuan.png'),
- isSpecial: '1',
- },
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "2",
- houseName: "102室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- },
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- },
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- },
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "3",
- houseName: "103室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "4",
- houseName: "104室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "5",
- houseName: "105室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- },
- {
- houseId: "6",
- houseName: "106室",
- categoryList: [
- {
- name: '低保',
- iconUrl: require('../../../../assets/img/modules/visual/dabing.png'),
- isSpecial: '0',
- }
- ]
- }
- ],
+ roomArray: [],
selHouseId: '',
selHouseName: '',
selHouseIndex: 0,
@@ -414,6 +157,7 @@ export default {
//点击全部成员
async handleShowAllUser (selIndex) {
// this.startLoading()
+ await this.loadUser(this.roomArray[selIndex].houseId, selIndex)
this.roomArray.forEach((element, index) => {
let obj = JSON.parse(JSON.stringify(element))
@@ -422,7 +166,7 @@ export default {
obj.showAllUser = !obj.showAllUser
this.$set(this.roomArray, selIndex, obj)
- this.loadUser(element.houseId, selIndex)
+
} else {
obj.showAllUser = false
this.$set(this.roomArray, index, obj)
diff --git a/src/views/modules/visual/basicinfo/basicInfoMain.vue b/src/views/modules/visual/basicinfo/basicInfoMain.vue
index fffed07dc..8c0f4a590 100644
--- a/src/views/modules/visual/basicinfo/basicInfoMain.vue
+++ b/src/views/modules/visual/basicinfo/basicInfoMain.vue
@@ -316,7 +316,7 @@ const vueGis = {
name: '搜索'
}
this.$nextTick(() => {
- this.$refs.ref_search.loadList();
+ this.$refs.ref_search.reset();
});
} else {
diff --git a/src/views/modules/visual/basicinfo/people.vue b/src/views/modules/visual/basicinfo/people.vue
index 8fa9049e2..a75bebad5 100644
--- a/src/views/modules/visual/basicinfo/people.vue
+++ b/src/views/modules/visual/basicinfo/people.vue
@@ -353,6 +353,7 @@ export default {
},
userId() {
this.getApiData();
+ window.scrollTo(0, 0);
},
},
diff --git a/src/views/modules/visual/basicinfo/peopleSearch.vue b/src/views/modules/visual/basicinfo/peopleSearch.vue
index e19d780fa..7e44c6d3b 100644
--- a/src/views/modules/visual/basicinfo/peopleSearch.vue
+++ b/src/views/modules/visual/basicinfo/peopleSearch.vue
@@ -97,7 +97,10 @@ export default {
}
},
-
+ reset () {
+ this.searchName = ''
+ this.tableData = []
+ },
async loadList () {
if (this.searchName) {
const url = "/epmetuser/icresiuser/searchbyname"
@@ -130,7 +133,11 @@ export default {
this.pageNo = val
this.loadList()
},
- }
+ },
+ destroyed () {
+ console.log("我已经离开了!");
+
+ },
};
diff --git a/src/views/modules/visual/warning/components/screen-table/index.vue b/src/views/modules/visual/warning/components/screen-table/index.vue
index 7b6dce78c..41c80f97f 100644
--- a/src/views/modules/visual/warning/components/screen-table/index.vue
+++ b/src/views/modules/visual/warning/components/screen-table/index.vue
@@ -1,62 +1,101 @@
-
-
\ No newline at end of file
+