提交应急
This commit is contained in:
parent
efeceec3fe
commit
92827d6a79
@ -28,14 +28,15 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
emergencyRecordAdd,
|
emergencyRecordAdd,
|
||||||
emergencyRecordSendNotice
|
emergencyRecordSendNotice,
|
||||||
|
emergencyRecordEdit
|
||||||
} from "@/api/index.js"
|
} from "@/api/index.js"
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
projectSn:"",
|
projectSn: "",
|
||||||
workerInfoId:"",
|
workerInfoId: "",
|
||||||
id:"",
|
id: "",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@ -49,7 +50,7 @@
|
|||||||
emergencyRecordAdd({
|
emergencyRecordAdd({
|
||||||
projectSn: this.projectSn,
|
projectSn: this.projectSn,
|
||||||
emergencyTypeId: -1,
|
emergencyTypeId: -1,
|
||||||
alarmPersonId:this.workerInfoId,
|
alarmPersonId: this.workerInfoId,
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
if (result.code == 200) {
|
if (result.code == 200) {
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
@ -72,25 +73,78 @@
|
|||||||
success: function(res) {
|
success: function(res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:`${url}?id=${that.id}`,
|
url: `${url}?id=${that.id}`,
|
||||||
});
|
});
|
||||||
} else if (res.cancel) {
|
} else if (res.cancel) {
|
||||||
console.log('用户点击取消');
|
console.log('用户点击取消');
|
||||||
emergencyRecordSendNotice({
|
uni.getLocation({
|
||||||
projectSn: this.projectSn,
|
type: 'gcj02',
|
||||||
id:that.id,
|
// type: 'wgs84',
|
||||||
}).then(result => {
|
geocode: true, //设置该参数为true可直接获取经纬度及城市信息
|
||||||
if (result.code == 200) {
|
isHighAccuracy: "true",
|
||||||
// uni.showToast({
|
accuracy: "best", // 精度值为20m
|
||||||
// title: "登录成功"
|
success: function(res) {
|
||||||
// })
|
console.log(res)
|
||||||
} else {
|
// const latitude = parseFloat(res.latitude);
|
||||||
uni.showToast({
|
// const longitude = parseFloat(res.longitude);
|
||||||
title: result.message,
|
that.emergencyInfo.longitude =
|
||||||
icon: "none"
|
that.emergencyInfo.latitude = parseFloat(res.latitude);
|
||||||
|
that.addressList = [
|
||||||
|
res.address.province,
|
||||||
|
res.address.city,
|
||||||
|
res.address.district,
|
||||||
|
res.address.street,
|
||||||
|
res.address.streetNum,
|
||||||
|
res.address.city,
|
||||||
|
res.address.poiName,
|
||||||
|
res.address.cityCode,
|
||||||
|
]
|
||||||
|
that.emergencyInfo.incidentSite = that.addressList.map(
|
||||||
|
item => item).join('、')
|
||||||
|
emergencyRecordEdit({
|
||||||
|
id: that.id,
|
||||||
|
projectSn: that.projectSn,
|
||||||
|
incidentSite: JSON.stringify(that.emergencyInfo
|
||||||
|
.incidentSite),
|
||||||
|
longitude: that.emergencyInfo.longitude,
|
||||||
|
latitude: that.emergencyInfo.latitude,
|
||||||
|
}).then(result => {
|
||||||
|
if (result.code == 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: result.message,
|
||||||
|
})
|
||||||
|
emergencyRecordSendNotice({
|
||||||
|
projectSn: that.projectSn,
|
||||||
|
id: that.id,
|
||||||
|
}).then(result => {
|
||||||
|
if (result.code == 200) {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: "登录成功"
|
||||||
|
// })
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: result
|
||||||
|
.message,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: result.message,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
// that.addrDel = res;
|
||||||
|
},
|
||||||
|
fail: function() {
|
||||||
|
uni.showToast({
|
||||||
|
title: '获取地址失败,将导致部分功能不可用',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user