|
@@ -1,9 +1,5 @@
|
|
-
|
|
|
|
-// pages/new_patrol_point/new_patrol_point.js
|
|
|
|
-
|
|
|
|
import http from '../../base/httputil'
|
|
import http from '../../base/httputil'
|
|
const app = getApp()
|
|
const app = getApp()
|
|
-
|
|
|
|
Page({
|
|
Page({
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -18,21 +14,17 @@ Page({
|
|
latitude: Number,
|
|
latitude: Number,
|
|
name: null,
|
|
name: null,
|
|
code: null,
|
|
code: null,
|
|
- address: null,
|
|
|
|
|
|
+ remark: null,
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
*/
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- this.enterpriseId = options.id
|
|
|
|
|
|
+ this.data.enterpriseId = options.enterpriseId
|
|
// this.getDetails()
|
|
// this.getDetails()
|
|
},
|
|
},
|
|
|
|
|
|
@@ -50,8 +42,8 @@ Page({
|
|
bindInputName(e) {
|
|
bindInputName(e) {
|
|
this.data.details.name = e.detail.value
|
|
this.data.details.name = e.detail.value
|
|
},
|
|
},
|
|
- bindInputAddress(e) {
|
|
|
|
- this.data.details.address = e.detail.value
|
|
|
|
|
|
+ bindInputRemark(e) {
|
|
|
|
+ this.data.details.remark = e.detail.value
|
|
},
|
|
},
|
|
bindInputCode(e) {
|
|
bindInputCode(e) {
|
|
this.data.details.code = e.detail.value
|
|
this.data.details.code = e.detail.value
|
|
@@ -60,13 +52,33 @@ Page({
|
|
//------------------------------------------
|
|
//------------------------------------------
|
|
|
|
|
|
updateDetails() {
|
|
updateDetails() {
|
|
|
|
+ if(this.data.details.name==null){
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title:'请输入巡更点名称',
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(this.data.details.code==null){
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title:'请扫描巡更点编码',
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(this.data.details.longitude||this.data.details.latitude){
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title:'请点击定位当前位置',
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
let obj = new Object();
|
|
let obj = new Object();
|
|
- obj.enterpriseId = this.data.details.enterpriseId
|
|
|
|
- obj.name = this.data.details.name
|
|
|
|
- obj.address = this.data.details.address
|
|
|
|
- obj.code = this.data.details.code
|
|
|
|
|
|
+ obj.busEnterpriseId = this.data.enterpriseId
|
|
|
|
+ obj.busPatrolstationName = this.data.details.name
|
|
|
|
+ obj.busPatrolstationCode = this.data.details.code
|
|
|
|
+ obj.longitude=this.data.details.longitude
|
|
|
|
+ obj.latitude=this.data.details.latitude
|
|
|
|
+ obj.remarks = this.data.details.remark
|
|
|
|
|
|
- // http.post("/system/AppEnterpriseController/updateEnterprise", obj, this.updateDetailsSuccess)
|
|
|
|
|
|
+ http.post("/system/AppPatrolstationController/addPatrolstation", obj, this.updateDetailsSuccess)
|
|
},
|
|
},
|
|
updateDetailsSuccess(res) {
|
|
updateDetailsSuccess(res) {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
@@ -74,9 +86,6 @@ Page({
|
|
})
|
|
})
|
|
if(res.code == 200){
|
|
if(res.code == 200){
|
|
wx.navigateBack()
|
|
wx.navigateBack()
|
|
- // wx.navigateTo({
|
|
|
|
- // url: '../details/details?busEnterpriseId=' + this.busEnterpriseId,
|
|
|
|
- // })
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
deletePatrolPoint() {
|
|
deletePatrolPoint() {
|
|
@@ -94,7 +103,6 @@ Page({
|
|
// })
|
|
// })
|
|
// }
|
|
// }
|
|
// },
|
|
// },
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
*/
|
|
@@ -142,7 +150,6 @@ Page({
|
|
*/
|
|
*/
|
|
onShareAppMessage() {
|
|
onShareAppMessage() {
|
|
|
|
|
|
-
|
|
|
|
},
|
|
},
|
|
|
|
|
|
getLocation() {
|
|
getLocation() {
|