|
@@ -8,8 +8,8 @@ Page({
|
|
onLoad(e) {
|
|
onLoad(e) {
|
|
this.data.busEnterpriseId = e.busEnterpriseId
|
|
this.data.busEnterpriseId = e.busEnterpriseId
|
|
},
|
|
},
|
|
- onShow(){
|
|
|
|
-
|
|
|
|
|
|
+ onShow() {
|
|
|
|
+
|
|
this.getEnterpriseDetails()
|
|
this.getEnterpriseDetails()
|
|
},
|
|
},
|
|
data: {
|
|
data: {
|
|
@@ -29,7 +29,8 @@ Page({
|
|
longitude: 125.3504459,
|
|
longitude: 125.3504459,
|
|
width: 35,
|
|
width: 35,
|
|
height: 50
|
|
height: 50
|
|
- }]
|
|
|
|
|
|
+ }],
|
|
|
|
+ isShowEdit: true,
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
@@ -40,11 +41,15 @@ Page({
|
|
http.post("/system/AppEnterpriseController/getEnterpriseDetails", obj, this.getEnterpriseDetailsSuccess)
|
|
http.post("/system/AppEnterpriseController/getEnterpriseDetails", obj, this.getEnterpriseDetailsSuccess)
|
|
},
|
|
},
|
|
getEnterpriseDetailsSuccess(res) {
|
|
getEnterpriseDetailsSuccess(res) {
|
|
-
|
|
|
|
|
|
+ // var currentUserId=res.enterpriseDetails.userId;
|
|
|
|
+ // var loginUserid=app.loginUserId;
|
|
|
|
+ this.isShowEdit = (res.enterpriseDetails.userId === app.loginUserId)
|
|
this.setData({
|
|
this.setData({
|
|
enterpriseDetails: res.enterpriseDetails,
|
|
enterpriseDetails: res.enterpriseDetails,
|
|
latitude: res.enterpriseDetails.latitude,
|
|
latitude: res.enterpriseDetails.latitude,
|
|
longitude: res.enterpriseDetails.longitude,
|
|
longitude: res.enterpriseDetails.longitude,
|
|
|
|
+ isShowEdit: this.isShowEdit,
|
|
|
|
+
|
|
markers: [{
|
|
markers: [{
|
|
id: res.enterpriseDetails.busEnterpriseId,
|
|
id: res.enterpriseDetails.busEnterpriseId,
|
|
name: res.enterpriseDetails.businessName,
|
|
name: res.enterpriseDetails.businessName,
|
|
@@ -52,7 +57,7 @@ Page({
|
|
latitude: res.enterpriseDetails.latitude,
|
|
latitude: res.enterpriseDetails.latitude,
|
|
longitude: res.enterpriseDetails.longitude,
|
|
longitude: res.enterpriseDetails.longitude,
|
|
width: 35,
|
|
width: 35,
|
|
- height: 50
|
|
|
|
|
|
+ height: 50,
|
|
}]
|
|
}]
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -70,20 +75,20 @@ Page({
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//巡更点跳转
|
|
//巡更点跳转
|
|
- xungengList(){
|
|
|
|
|
|
+ xungengList() {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
- url: '../patrol_list/patrol_list?enterpriseId='+this.data.busEnterpriseId,
|
|
|
|
|
|
+ url: '../patrol_list/patrol_list?enterpriseId=' + this.data.busEnterpriseId,
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//导航
|
|
//导航
|
|
navRoad(event) {
|
|
navRoad(event) {
|
|
-
|
|
|
|
|
|
+
|
|
wx.getLocation({ //获取当前经纬度
|
|
wx.getLocation({ //获取当前经纬度
|
|
type: 'wgs84', //返回可以用于wx.openLocation的经纬度,
|
|
type: 'wgs84', //返回可以用于wx.openLocation的经纬度,
|
|
success: function (res) {
|
|
success: function (res) {
|
|
wx.openLocation({ //使用微信内置地图查看位置。
|
|
wx.openLocation({ //使用微信内置地图查看位置。
|
|
latitude: Number(event.currentTarget.dataset.marker.latitude), //要去的纬度-地址
|
|
latitude: Number(event.currentTarget.dataset.marker.latitude), //要去的纬度-地址
|
|
- longitude:Number( event.currentTarget.dataset.marker.longitude), //要去的经度-地址
|
|
|
|
|
|
+ longitude: Number(event.currentTarget.dataset.marker.longitude), //要去的经度-地址
|
|
name: event.currentTarget.dataset.marker.name,
|
|
name: event.currentTarget.dataset.marker.name,
|
|
address: event.currentTarget.dataset.marker.address
|
|
address: event.currentTarget.dataset.marker.address
|
|
})
|
|
})
|
|
@@ -97,48 +102,48 @@ Page({
|
|
//巡检跳转
|
|
//巡检跳转
|
|
bindViewXunJian() {
|
|
bindViewXunJian() {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
- url: '../xunjian/xunjian?busEnterpriseId='+this.data.busEnterpriseId
|
|
|
|
- +"&isBeforeBack=true",
|
|
|
|
|
|
+ url: '../xunjian/xunjian?busEnterpriseId=' + this.data.busEnterpriseId
|
|
|
|
+ + "&isBeforeBack=true",
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//巡检跳转
|
|
//巡检跳转
|
|
bindViewXunChaJiLu() {
|
|
bindViewXunChaJiLu() {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: '../xunchajilu/xunchajilu?busEnterpriseId='
|
|
url: '../xunchajilu/xunchajilu?busEnterpriseId='
|
|
- +this.data.enterpriseDetails.busEnterpriseId
|
|
|
|
- +"&businessName="+this.data.enterpriseDetails.businessName,
|
|
|
|
|
|
+ + this.data.enterpriseDetails.busEnterpriseId
|
|
|
|
+ + "&businessName=" + this.data.enterpriseDetails.businessName,
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//企业详情
|
|
//企业详情
|
|
bindViewQiYeXiangQingTable() {
|
|
bindViewQiYeXiangQingTable() {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
- url: '../qiyexqtable/qiyexqtable?busEnterpriseId='+this.data.busEnterpriseId,
|
|
|
|
|
|
+ url: '../qiyexqtable/qiyexqtable?busEnterpriseId=' + this.data.busEnterpriseId,
|
|
})
|
|
})
|
|
- },
|
|
|
|
- bindViewQiYeDelete(){
|
|
|
|
- wx.showModal({
|
|
|
|
- title: '提示',
|
|
|
|
- content: '确认废弃该企业?',
|
|
|
|
- complete: (res) => {
|
|
|
|
- if (res.cancel) {
|
|
|
|
-
|
|
|
|
- }else {
|
|
|
|
- this.deleteEnterprise()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- deleteEnterprise() {
|
|
|
|
- let obj = new Object();
|
|
|
|
- obj.busEnterpriseId = this.data.busEnterpriseId
|
|
|
|
- http.post("/system/AppEnterpriseController/deleteEnterprise", obj, this.deleteEnterpriseSuccess)
|
|
|
|
- },
|
|
|
|
- deleteEnterpriseSuccess(res) {
|
|
|
|
- wx.showToast({
|
|
|
|
- title: res.msg,
|
|
|
|
- })
|
|
|
|
- if(res.code == 200){
|
|
|
|
- wx.navigateBack()
|
|
|
|
|
|
+ },
|
|
|
|
+ bindViewQiYeDelete() {
|
|
|
|
+ wx.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '确认废弃该企业?',
|
|
|
|
+ complete: (res) => {
|
|
|
|
+ if (res.cancel) {
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ this.deleteEnterprise()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ deleteEnterprise() {
|
|
|
|
+ let obj = new Object();
|
|
|
|
+ obj.busEnterpriseId = this.data.busEnterpriseId
|
|
|
|
+ http.post("/system/AppEnterpriseController/deleteEnterprise", obj, this.deleteEnterpriseSuccess)
|
|
|
|
+ },
|
|
|
|
+ deleteEnterpriseSuccess(res) {
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: res.msg,
|
|
|
|
+ })
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ wx.navigateBack()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
})
|
|
})
|