安全例会优化
parent
869c0a6cda
commit
5be53f55b0
|
@ -85,12 +85,13 @@
|
||||||
<view class="cu-modal" :class="{'show':modalShow}">
|
<view class="cu-modal" :class="{'show':modalShow}">
|
||||||
<sign @confirm="subCanvas" @cancel="modalShow = false"></sign>
|
<sign @confirm="subCanvas" @cancel="modalShow = false"></sign>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group" style="margin-top: 20px;">
|
<view class="cu-form-group" style="margin-top: 20px; ">
|
||||||
<button class="cu-btn block bg-blue margin-tb-sm" @click="submitMeetingAttendance">确定</button>
|
<button class="cu-btn block bg-blue margin-tb-sm" @click="submitMeetingAttendance('ACCESS_FINE_LOCATION')">提交当前位置</button>
|
||||||
</view>
|
</view>
|
||||||
|
<yk-authpup ref="authpup" type="top" @changeAuth="$noMultipleClicks(editLocation)" :permissionID="permissionID"></yk-authpup>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</uni-drawer>
|
</uni-drawer>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group" v-if="pd.ATTENDANCE_STATUS === '0'">
|
||||||
<view class="title">是否参会:</view>
|
<view class="title">是否参会:</view>
|
||||||
<button class="cu-btn round bg-blue" @click="addMeeting">参会</button>
|
<button class="cu-btn round bg-blue" @click="addMeeting">参会</button>
|
||||||
</view>
|
</view>
|
||||||
|
@ -131,6 +132,7 @@
|
||||||
signImgList: [],
|
signImgList: [],
|
||||||
LIVEPHOTOS: '',
|
LIVEPHOTOS: '',
|
||||||
SIGNATUREPICTURE: '',
|
SIGNATUREPICTURE: '',
|
||||||
|
ATTENDANCE_STATUS: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e){
|
onLoad(e){
|
||||||
|
@ -225,7 +227,8 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
submitMeetingAttendance() {
|
submitMeetingAttendance(permissionID) {
|
||||||
|
var _this = this;
|
||||||
if (this.liveImgs.length === 0 || this.signImgList.length === 0) {
|
if (this.liveImgs.length === 0 || this.signImgList.length === 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请上传实时照片和签字图片',
|
title: '请上传实时照片和签字图片',
|
||||||
|
@ -233,28 +236,91 @@
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.permissionID = permissionID;
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.$refs['authpup'].open();
|
||||||
|
},200)
|
||||||
|
|
||||||
const livePhotoPath = this.liveImgs[0].FILEPATH;
|
uni.getLocation({
|
||||||
const signPhotoPath = this.signImgList[0].filePath;
|
type: 'gcj02',
|
||||||
const params = {
|
geocode: true,
|
||||||
SAFETY_MEETING_ID: this.SAFETY_MEETING_ID,
|
success: function (res) {
|
||||||
LIVEPHOTOS: livePhotoPath,
|
const locationAddress = `${res.address.province}${res.address.city}${res.address.district}${res.address.street}${res.address.streetNum}${res.address.poiName}`;
|
||||||
SIGNATUREPICTURE: signPhotoPath,
|
_this.longitude = res.longitude;
|
||||||
ATTENDANCE_STATUS: '1'
|
_this.latitude = res.latitude;
|
||||||
};
|
// 获取位置成功后,上传图片和其他数据
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '提交中...'
|
title: '提交中...'
|
||||||
});
|
});
|
||||||
uni.request({
|
|
||||||
|
uni.uploadFile({
|
||||||
url: basePath + '/app/safetymeeting/edit',
|
url: basePath + '/app/safetymeeting/edit',
|
||||||
method: 'POST',
|
filePath:_this.liveImgs[0].FILEPATH,
|
||||||
header: {
|
name: 'livePhoto',
|
||||||
'Content-type':'application/x-www-form-urlencoded'
|
formData: {
|
||||||
|
SAFETY_MEETING_ID: _this.SAFETY_MEETING_ID,
|
||||||
|
SIGNATUREPICTURE: _this.SIGNATUREPICTURE,
|
||||||
|
ATTENDANCE_STATUS: '1',
|
||||||
|
LATITUDE: _this.longitude, // 上传经度
|
||||||
|
LONGITUDE: _this.latitude, // 上传纬度
|
||||||
|
LOCATIONADDRESS: locationAddress
|
||||||
},
|
},
|
||||||
data: params,
|
success: uploadRes => {
|
||||||
success: (res) => {
|
// 解析返回的数据
|
||||||
|
const data = JSON.parse(uploadRes.data);
|
||||||
|
if (data.result === 'success') {
|
||||||
|
// 关闭弹窗
|
||||||
|
_this.$refs.showHiddenWindow.close();
|
||||||
|
// 重新加载数据
|
||||||
|
_this.getData();
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '提交失败: ' + data.message,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '上传失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
complete: () => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
if (res.data.result === 'success') {
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: function () {
|
||||||
|
uni.showToast({
|
||||||
|
title: '获取位置信息失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 封装一个上传数据的函数,包括位置信息、实时照片和签字图片
|
||||||
|
formData(latitude, longitude) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '提交中...'
|
||||||
|
});
|
||||||
|
const livePhotoPath =baseImgPath + this.liveImgs[0].FILEPATH;
|
||||||
|
const signPhotoPath = this.signImgList[0].filePath;
|
||||||
|
|
||||||
|
uni.uploadFile({
|
||||||
|
url: basePath + '/app/safetymeeting/edit',
|
||||||
|
filePath: livePhotoPath,
|
||||||
|
name: 'livePhoto',
|
||||||
|
formData: {
|
||||||
|
SAFETY_MEETING_ID: this.SAFETY_MEETING_ID,
|
||||||
|
SIGNATUREPICTURE: this.SIGNATUREPICTURE,
|
||||||
|
ATTENDANCE_STATUS: '1',
|
||||||
|
},
|
||||||
|
success: uploadRes => {
|
||||||
|
const data = JSON.parse(uploadRes.data);
|
||||||
|
uni.hideLoading();
|
||||||
|
if (data.result === 'success') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '提交成功',
|
title: '提交成功',
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
|
@ -262,10 +328,17 @@
|
||||||
this.$refs.showHiddenWindow.close();
|
this.$refs.showHiddenWindow.close();
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '提交失败',
|
title: '提交失败: ' + data.message,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '上传失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -280,7 +353,6 @@
|
||||||
NAME: loginUser.NAME,
|
NAME: loginUser.NAME,
|
||||||
USER_ID: loginUser.USER_ID
|
USER_ID: loginUser.USER_ID
|
||||||
}]
|
}]
|
||||||
// 重新打开抽屉(drawer)时,上面的代码会重置照片和签字
|
|
||||||
this.$refs['showHiddenWindow'].open()
|
this.$refs['showHiddenWindow'].open()
|
||||||
this.showHiddenWindow = true
|
this.showHiddenWindow = true
|
||||||
this.hiddenIsEdit = true
|
this.hiddenIsEdit = true
|
||||||
|
@ -317,7 +389,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.dy-card-content-item {
|
.dy-card-content-item {
|
||||||
margin-top: 20upx;
|
margin-top: 10upx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dy-card-content-item .title {
|
.dy-card-content-item .title {
|
||||||
|
|
|
@ -94,7 +94,6 @@
|
||||||
_this.LEVELID=e.LEVELID;
|
_this.LEVELID=e.LEVELID;
|
||||||
_this.DEPT_NAME=e.DEPT_NAME;
|
_this.DEPT_NAME=e.DEPT_NAME;
|
||||||
_this.getData();
|
_this.getData();
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//跳转事件
|
//跳转事件
|
||||||
|
|
|
@ -15,9 +15,7 @@
|
||||||
<view class="title">
|
<view class="title">
|
||||||
通知内容:
|
通知内容:
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<rich-text class="info" :nodes="content"></rich-text>
|
||||||
{{pd.NOTIFICATIONCONTENT}}
|
|
||||||
</view>
|
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<text>{{pd.CREATETIME}}</text>
|
<text>{{pd.CREATETIME}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
Loading…
Reference in New Issue