Browse Source

Merge remote-tracking branch 'origin/dev_ljj_samll_adjust'

V1.0
jianjun 3 years ago
parent
commit
b282091d3c
  1. 75
      src/views/modules/communityParty/regionalParty/activitysForm.vue
  2. 19
      src/views/modules/communityParty/regionalParty/units.vue
  3. 3
      src/views/modules/communityParty/regionalParty/unitsDetail.vue
  4. 53
      src/views/modules/communityParty/regionalParty/unitsForm.vue
  5. 14
      src/views/modules/shequzhili/event/cpts/add.vue

75
src/views/modules/communityParty/regionalParty/activitysForm.vue

@ -234,6 +234,22 @@ var geocoder // 新建一个正逆地址解析类
let loading // let loading //
export default { export default {
data () { data () {
let initFormData = () => {
let _form = {
unitName: '',
serviceMatterList: [],
type: '',
contact: '',
contactMobile: '',
memberCount: 0,
remark: '', //500
address: '', //
longitude: this.$store.state.user.longitude, //
latitude: this.$store.state.user.latitude//
}
return _form
}
return { return {
formType: 'add', // addeditdetail formType: 'add', // addeditdetail
@ -241,22 +257,7 @@ export default {
keyWords: '', keyWords: '',
activityId: '', activityId: '',
formData: { formData: initFormData(),
gridId: '',
serviceMatter: '',//
serviceMatterList: [],
unitId: '',//ID
unitIdList: [],
title: '',//
target: '',//
content: '',//
activityTime: '',//
peopleCount: 0,//
result: '', //
address: '', //
longitude: 36.0722275, //
latitude: 120.38945519 //
},
serviceList: [], serviceList: [],
// gridList: [], // gridList: [],
agencyId: '' agencyId: ''
@ -274,23 +275,31 @@ export default {
async initForm (type, activityId) { async initForm (type, activityId) {
this.startLoading() this.startLoading()
this.$refs.ref_form.resetFields(); this.$refs.ref_form.resetFields();
// const { user } = this.$store.state
// this.agencyId = user.agencyId
// await this.loadGrid()
// //
await this.loadService() await this.loadService()
let { latitude, longitude } = this.$store.state.user;
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
this.formData.latitude = latitude
this.formData.longitude = longitude
this.formType = type this.formType = type
if (activityId) { if (activityId) {
this.activityId = activityId this.activityId = activityId
this.formData.id = activityId this.formData.id = activityId
await this.loadFormData() await this.loadFormData()
} else { } else {
map.setCenter(new TMap.LatLng(36.0722275, 120.38945519))
this.setMarker(36.0722275, 120.38945519)
} }
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
this.endLoading() this.endLoading()
}, },
@ -353,8 +362,8 @@ export default {
} }
console.log(this.formData.content) console.log(this.formData.content)
map.setCenter(new TMap.LatLng(parseFloat(this.formData.latitude), parseFloat(this.formData.longitude))) // map.setCenter(new TMap.LatLng(parseFloat(this.formData.latitude), parseFloat(this.formData.longitude)))
this.setMarker(this.formData.latitude, this.formData.longitude) // this.setMarker(this.formData.latitude, this.formData.longitude)
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
@ -519,20 +528,16 @@ export default {
this.activityId = '' this.activityId = ''
this.keyWords = '' this.keyWords = ''
this.formData = { this.formData = {
gridId: '', unitName: '',
serviceMatter: '',//
serviceMatterList: [], serviceMatterList: [],
unitId: '',//ID type: '',
unitIdList: [], contact: '',
title: '',// contactMobile: '',
target: '',// memberCount: 0,
content: '',// remark: '', //500
activityTime: '',//
peopleCount: 0,//
result: '', //
address: '', // address: '', //
longitude: 36.0722275, // longitude: this.$store.state.user.longitude, //
latitude: 120.38945519 // latitude: this.$store.state.user.latitude//
} }
}, },
// //

19
src/views/modules/communityParty/regionalParty/units.vue

@ -477,9 +477,10 @@ export default {
}, },
handleDetail (row) { handleDetail (row) {
this.detailShow = true this.formTitle = '详情'
this.formShow = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ref_detail.initForm(row) this.$refs.ref_form.initForm('detail', row.id)
}) })
}, },
@ -501,7 +502,7 @@ export default {
handleAdd () { handleAdd () {
this.formTitle = '新增' this.formTitle = '新增'
this.formShow = 'edit' this.formShow = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ref_form.initForm('add', null) this.$refs.ref_form.initForm('add', null)
}) })
@ -574,12 +575,12 @@ export default {
if (code === 0) { if (code === 0) {
if (data.type) { if (data.type) {
this.$message({ this.$message({
type: "success", type: "success",
message: data.msg || "同步成功" message: data.msg || "同步成功"
}); });
this.loadTable() this.loadTable()
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
} }

3
src/views/modules/communityParty/regionalParty/unitsDetail.vue

@ -106,7 +106,7 @@ export default {
} }
}, },
components: {}, components: {},
mounted () { created () {
this.initMap() this.initMap()
}, },
@ -118,6 +118,7 @@ export default {
}, },
async initForm (row) { async initForm (row) {
this.startLoading() this.startLoading()
this.formData = { ...row } this.formData = { ...row }
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude)) map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))

53
src/views/modules/communityParty/regionalParty/unitsForm.vue

@ -173,14 +173,8 @@ var geocoder // 新建一个正逆地址解析类
let loading // let loading //
export default { export default {
data () { data () {
return { let initFormData = () => {
formType: 'add', // addeditdetail let _form = {
btnDisable: false,
unitId: '',
keyWords: '',
formData: {
unitName: '', unitName: '',
serviceMatterList: [], serviceMatterList: [],
type: '', type: '',
@ -189,15 +183,27 @@ export default {
memberCount: 0, memberCount: 0,
remark: '', //500 remark: '', //500
address: '', // address: '', //
longitude: 36.0722275, // longitude: this.$store.state.user.longitude, //
latitude: 120.38945519 // latitude: this.$store.state.user.latitude//
}, }
return _form
}
return {
formType: 'add', // addeditdetail
btnDisable: false,
unitId: '',
keyWords: '',
formData: initFormData(),
serviceList: [],//list serviceList: [],//list
} }
}, },
components: {}, components: {},
mounted () { mounted () {
this.initMap() this.initMap()
}, },
@ -210,16 +216,27 @@ export default {
// //
await this.loadService() await this.loadService()
let { latitude, longitude } = this.$store.state.user;
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
this.formData.latitude = latitude
this.formData.longitude = longitude
this.formType = type this.formType = type
if (unitId) { if (unitId) {
this.unitId = unitId this.unitId = unitId
this.formData.id = unitId this.formData.id = unitId
await this.loadFormData() await this.loadFormData()
} else { } else {
map.setCenter(new TMap.LatLng(36.0722275, 120.38945519))
this.setMarker(36.0722275, 120.38945519)
} }
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
this.endLoading() this.endLoading()
}, },
@ -259,8 +276,8 @@ export default {
} }
this.formData = { ...data } this.formData = { ...data }
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude)) // map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude) // this.setMarker(this.formData.latitude, this.formData.longitude)
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
@ -329,7 +346,7 @@ export default {
// init // init
initMap () { initMap () {
// //
var center = new window.TMap.LatLng(36.0722275, 120.38945519) var center = new window.TMap.LatLng(this.formData.latitude, this.formData.longitude)
// map TMap.Map() // map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), { map = new window.TMap.Map(document.getElementById('app'), {
center: center, // center: center, //
@ -450,8 +467,8 @@ export default {
memberCount: 0, memberCount: 0,
remark: '', //500 remark: '', //500
address: '', // address: '', //
longitude: '', // longitude: this.$store.state.user.longitude, //
latitude: '' // latitude: this.$store.state.user.latitude//
} }
}, },
// //

14
src/views/modules/shequzhili/event/cpts/add.vue

@ -402,10 +402,20 @@ export default {
async mounted () { async mounted () {
const { user } = this.$store.state const { user } = this.$store.state
this.agencyId = user.agencyId this.agencyId = user.agencyId
let { latitude, longitude } = this.$store.state.user;
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
this.formData.latitude = latitude
this.formData.longitude = longitude
this.initMap()
this.loadGrid(); this.loadGrid();
this.getCategoryList() this.getCategoryList()
this.initMap()
}, },
@ -597,7 +607,7 @@ export default {
// init // init
initMap () { initMap () {
// //
var center = new window.TMap.LatLng(36.0722275, 120.38945519) var center = new window.TMap.LatLng(this.formData.latitude, this.formData.longitude)
// map TMap.Map() // map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), { map = new window.TMap.Map(document.getElementById('app'), {
center: center, // center: center, //

Loading…
Cancel
Save