This commit is contained in:
”Rain“ 2024-05-20 13:49:20 +08:00
parent 8bdc11408c
commit 59f792503c
4 changed files with 74 additions and 5 deletions

View File

@ -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
})
}

View File

@ -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];

View File

@ -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('用户点击取消');

View File

@ -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: {