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