|
|
|
|
@ -70,7 +70,8 @@ |
|
|
|
|
rules: {}, |
|
|
|
|
userInfo: {}, |
|
|
|
|
locationInfo: {}, |
|
|
|
|
deviceSn:'' |
|
|
|
|
deviceSn:'', |
|
|
|
|
filesList:[] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onUnload() { |
|
|
|
|
@ -107,7 +108,7 @@ |
|
|
|
|
this.form.longidute = obj.y; |
|
|
|
|
}); |
|
|
|
|
this.queryPlanTypeList(); |
|
|
|
|
this.getDeviceSn() |
|
|
|
|
// this.getDeviceSn() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getDeviceSn(){ |
|
|
|
|
@ -143,25 +144,43 @@ |
|
|
|
|
uni.removeStorageSync('bizToken'); |
|
|
|
|
this.getDeviceSn(deviceId); |
|
|
|
|
}else{ |
|
|
|
|
// setTimeout(() =>{ |
|
|
|
|
// uni.showToast({ |
|
|
|
|
// title: 'device ============>' + res.data.rows[0].tags, |
|
|
|
|
// icon: 'none' |
|
|
|
|
// }); |
|
|
|
|
// },1000) |
|
|
|
|
// setTimeout(() =>{ |
|
|
|
|
// uni.showToast({ |
|
|
|
|
// title: 'mac ============>' + JSON.parse(res.data.rows[0].tags), |
|
|
|
|
// icon: 'none' |
|
|
|
|
// }); |
|
|
|
|
// },5000) |
|
|
|
|
// setTimeout(() =>{ |
|
|
|
|
// uni.showToast({ |
|
|
|
|
// title: 'mac1 ============>' + JSON.parse(res.data.rows[0].tags).mac, |
|
|
|
|
// icon: 'none' |
|
|
|
|
// }); |
|
|
|
|
// },10000) |
|
|
|
|
this.deviceSn = JSON.parse(res.data.rows[0].tags).mac; |
|
|
|
|
let _arr = []; |
|
|
|
|
this.filesList.forEach(item => { |
|
|
|
|
_arr.push({url: item}); |
|
|
|
|
}) |
|
|
|
|
let data = { |
|
|
|
|
"alarmTypeIdentity": "700006", |
|
|
|
|
"description": "巡更照片上报", |
|
|
|
|
"deviceSn": this.deviceSn, |
|
|
|
|
"platformCode": "DIANXIN", |
|
|
|
|
"pictureList": _arr |
|
|
|
|
} |
|
|
|
|
console.log('iot', data) |
|
|
|
|
uni.request({ |
|
|
|
|
url: getApp().globalData.apiUrl + '/appData/escalation', |
|
|
|
|
method: 'POST', |
|
|
|
|
data: data, |
|
|
|
|
success: (res) => { |
|
|
|
|
let _data = JSON.parse(res.data.data); |
|
|
|
|
if (_data.resultCode == 0) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '成功' |
|
|
|
|
}); |
|
|
|
|
uni.redirectTo({ |
|
|
|
|
url: '/pages/patrolRecord/list' |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: _data.msg, |
|
|
|
|
icon: 'none' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
complete: (res) => { |
|
|
|
|
console.log(res) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
fail: (err) => { |
|
|
|
|
@ -323,42 +342,8 @@ |
|
|
|
|
// title: 'deviceSN ===========>' + this.deviceSn, |
|
|
|
|
// icon: 'none' |
|
|
|
|
// }) |
|
|
|
|
let _arr = []; |
|
|
|
|
files.forEach(item => { |
|
|
|
|
_arr.push({url: item}); |
|
|
|
|
}) |
|
|
|
|
let data = { |
|
|
|
|
"alarmTypeIdentity": "700006", |
|
|
|
|
"description": "巡更照片上报", |
|
|
|
|
"deviceSn": this.deviceSn, |
|
|
|
|
"platformCode": "DIANXIN", |
|
|
|
|
"pictureList": _arr |
|
|
|
|
} |
|
|
|
|
console.log('iot', data) |
|
|
|
|
uni.request({ |
|
|
|
|
url: getApp().globalData.apiUrl + '/appData/escalation', |
|
|
|
|
method: 'POST', |
|
|
|
|
data: data, |
|
|
|
|
success: (res) => { |
|
|
|
|
let _data = JSON.parse(res.data.data); |
|
|
|
|
if (_data.resultCode == 0) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '成功' |
|
|
|
|
}); |
|
|
|
|
uni.redirectTo({ |
|
|
|
|
url: '/pages/patrolRecord/list' |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: _data.msg, |
|
|
|
|
icon: 'none' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
complete: (res) => { |
|
|
|
|
console.log(res) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.filesList = files |
|
|
|
|
this.getDeviceSn() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|