1
This commit is contained in:
parent
8bdc11408c
commit
59f792503c
16
api/index.js
16
api/index.js
@ -26,4 +26,20 @@ export function mechanicalEquipmentPositionDataAdd(data) {
|
||||
url: "/xmgl/mechanicalEquipmentPositionData/add",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function emergencyRecordAdd(data) {
|
||||
// 添加一键报警
|
||||
return request.post({
|
||||
url: "/xmgl/xzEmergencyRecord/add",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function emergencyRecordQueryById(data) {
|
||||
// 处置台账信息详情
|
||||
return request.get({
|
||||
url: "/xmgl/xzEmergencyRecord/queryById",
|
||||
data
|
||||
})
|
||||
}
|
||||
@ -80,6 +80,9 @@
|
||||
|
||||
<script>
|
||||
import headers from "@/components/headers/headers.vue"
|
||||
import {
|
||||
emergencyRecordQueryById
|
||||
} from "@/api/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -90,8 +93,29 @@
|
||||
inputAddress: "",
|
||||
videoFileList: [],
|
||||
imgFileList: [],
|
||||
id:"",
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.id = options.id;
|
||||
console.log(options);
|
||||
emergencyRecordQueryById({
|
||||
projectSn: this.projectSn,
|
||||
id:this.id,
|
||||
}).then(result => {
|
||||
if (result.code == 200) {
|
||||
// uni.showToast({
|
||||
// title: "登录成功"
|
||||
// })
|
||||
console.log(result);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: result.message,
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
pick(e) {
|
||||
this.inputType = this.list[e.target.value];
|
||||
|
||||
@ -26,15 +26,44 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
emergencyRecordAdd
|
||||
} from "@/api/index.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
projectSn:"",
|
||||
workerInfoId:"",
|
||||
id:"",
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
console.log(uni.getStorageSync('devInfoList')[0])
|
||||
this.projectSn = uni.getStorageSync('devInfoList')[0].projectSn;
|
||||
this.workerInfoId = uni.getStorageSync('devInfoList')[0].workerInfoId;
|
||||
},
|
||||
methods: {
|
||||
goNavigateTo(url, type) {
|
||||
const that = this;
|
||||
if (type == 1) {
|
||||
emergencyRecordAdd({
|
||||
projectSn: this.projectSn,
|
||||
emergencyTypeId: -1,
|
||||
alarmPersonId:this.workerInfoId,
|
||||
}).then(result => {
|
||||
if (result.code == 200) {
|
||||
// uni.showToast({
|
||||
// title: "登录成功"
|
||||
// })
|
||||
that.id = result.result.id;
|
||||
console.log(result);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: result.message,
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
})
|
||||
uni.showModal({
|
||||
title: '提示信息',
|
||||
content: '报警信息已经发送给救援人员,是否需要补充表单信息?',
|
||||
@ -43,7 +72,7 @@
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url,
|
||||
url:`${url}?id=${that.id}`,
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
|
||||
@ -76,9 +76,9 @@
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/personLocation/home/home'
|
||||
// });
|
||||
uni.reLaunch({
|
||||
url: '/pages/personLocation/index/index'
|
||||
});
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/personLocation/index/index'
|
||||
// });
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user