NurseStationPersonAppletUl/pages/confirmCompletion/confirmCompletion.vue

472 lines
11 KiB
Vue
Raw Normal View History

2023-03-28 10:02:47 +08:00
<template>
<view class="app">
2023-04-03 14:55:17 +08:00
<view class="top">
<view class="title">
<image src="../../static/fuwu.png" mode=""></image>
<view class="text">
{{itemlist.nurseItemName}}
</view>
<view class="righttext">
2023-04-12 09:22:10 +08:00
<span v-if="itemlist.orderCommissionAmount&&itemlist.orderCommissionAmount>=0">
{{itemlist.orderCommissionAmount}}
</span>
<span v-else>
0
</span>
2023-04-03 14:55:17 +08:00
</view>
2023-03-28 10:02:47 +08:00
</view>
2023-04-03 14:55:17 +08:00
<view class="content">
<view class="time">
时间 {{itemlist.serviceDate}}
<span style='padding-left: 10rpx;'>{{itemlist.serviceStartTime}}</span>
</view>
<view class="address">
地点{{itemlist.serviceAddress}}
2023-03-28 10:02:47 +08:00
</view>
</view>
</view>
2023-04-07 15:34:32 +08:00
<view class="pictures top">
<view class="title">
<image src="../../static/upload.png" mode=""></image>
<view class="text">
资料上传
</view>
</view>
2023-04-03 14:55:17 +08:00
<view class="picture">
<view class="attendantImg">
护理员到岗照片
</view>
<view class="uppicture" @tap='uploadonDutyPictureUrl'>
<view class="choice" v-if="!onDutyPictureUrl">
拍摄照片
</view>
<image v-else :src="onDutyPictureUrl" mode=""></image>
<!-- <u-upload class="slot-btn" width="530" height="130" ></u-upload> -->
</view>
2023-03-28 10:02:47 +08:00
</view>
2023-04-03 14:55:17 +08:00
<!-- <view class="picture" style="height: 330rpx;">
<view class="attendantImg">
服务进行中视频不少于1min<span>*选填</span>
</view>
<view class="uppicture">
<u-upload class="slot-btn" width="530" height="130"></u-upload>
</view>
<view class="user">
<image src="../../static/radio.png" mode=""></image>
用户不同意拍摄
</view>
</view> -->
<view class="picture">
<view class="attendantImg">
服务结束照片
</view>
<view class="uppicture" @tap='uploadserviceEndPictureUrl'>
<view class="choice" v-if="!serviceEndPictureUrl">
拍摄照片
</view>
<image v-else :src="serviceEndPictureUrl" mode=""></image>
<!-- <u-upload class="slot-btn" width="530" height="130" ></u-upload> -->
</view>
2023-03-28 10:02:47 +08:00
</view>
2023-04-03 14:55:17 +08:00
<view class="picture" style="height: 730rpx;">
<view class="attendantImg" style="border-bottom: 1rpx solid #BAB7B8;">
2023-04-07 15:34:32 +08:00
用户签名
2023-04-03 14:55:17 +08:00
</view>
2023-04-12 11:01:29 +08:00
<!-- <view class="receive">
2023-04-03 14:55:17 +08:00
我确认已接受服务
</view> -->
<view class="uppicture" @tap='show=true'>
<image v-if="!userSignaturePictureUrl" style="width: 36rpx;height: 36rpx;margin:8% 0 0 35%"
src="../../static/autograph.png" mode="">
</image>
<span v-if="!userSignaturePictureUrl">点此签名</span>
<image v-else :src="userSignaturePictureUrl" mode=""></image>
<!-- <u-upload class="slot-btn" :action="action" :file-list="fileList" width="620" height="130"></u-upload> -->
2023-03-28 10:02:47 +08:00
</view>
</view>
</view>
2023-04-03 14:55:17 +08:00
<view class="submit" @tap='finishshow=true'>
完成
2023-03-28 10:02:47 +08:00
</view>
2023-04-03 14:55:17 +08:00
<u-popup v-model="finishshow" mode='bottom' :closeable='true' :safe-area-inset-bottom='true'>
<view class="finishmask">
<view class="title">
是否确认完成当前工单
</view>
<view class="leftbtn" @tap='finishshow = false'>
</view>
<view class="rightbtn" @tap='buyfinish'>
</view>
2023-03-28 10:02:47 +08:00
</view>
2023-04-03 14:55:17 +08:00
</u-popup>
2023-04-12 11:01:29 +08:00
<!-- <u-popup v-model="show" mode='bottom' :closeable='true' :safe-area-inset-bottom='true' @touchmove.stop.prevent
height='900'>
2023-03-28 10:02:47 +08:00
<signature @userSignaturePictureUrl='userSignaturePicture' @click.native.stop
2023-04-12 11:01:29 +08:00
style='background-color: #F4F5F7;width: 100%;height: 800rpx;'>
</signature>
</u-popup> -->
<u-mask :show="show" @click="show = false" @touchmove.stop.prevent>
<signature @userSignaturePictureUrl='userSignaturePicture' @click.native.stop v-if='show'
2023-04-12 10:06:30 +08:00
style='background-color: #F4F5F7;position:absolute;bottom:0%;width: 100%;height: 800rpx;'></signature>
</u-mask>
2023-03-28 10:02:47 +08:00
<u-toast ref="uToast" />
</view>
</template>
<script>
import signature from '../signature/signature.vue'
import {
orderConfirm
} from '@/api/confirmCompletion/index.js'
import baseurl from '@/api/baseurl.js'
export default {
components: {
signature
},
data() {
return {
2023-04-03 14:55:17 +08:00
itemlist: null, //信息list
finishshow: false, //是否完成
show: false, //签名
orderNo: null, //订单编号
2023-03-28 10:02:47 +08:00
onDutyPictureUrl: null,
serviceEndPictureUrl: null,
userSignaturePictureUrl: null,
list: {
res: {},
id: null,
serviceLocationName: null,
onDutyPictureUrl: null,
serviceEndPictureUrl: null,
userSignaturePictureUrl: null,
serveLocationLatitude: null,
serveLocationLongitude: null,
},
}
},
methods: {
//签名
userSignaturePicture(data) {
this.userSignaturePictureUrl = data
this.show = false
},
// /base64转二进制
dataURLtoBlob(dataurl) {
var arr = dataurl.split(","),
mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]),
n = bstr.length,
u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new Blob([u8arr], {
type: mime,
});
},
//上传头像
uploadserviceEndPictureUrl() { //服务结束照片
var that = this;
uni.chooseImage({
count: 1,
sourceType: ['camera'],
success(res) {
that.serviceEndPictureUrl = res.tempFilePaths[0]
}
})
},
uploadonDutyPictureUrl() { //护理员到岗照片
var that = this;
uni.chooseImage({
count: 1,
sourceType: ['camera'],
success(res) {
that.onDutyPictureUrl = res.tempFilePaths[0]
}
})
},
//完成
buyfinish() {
2023-04-03 14:55:17 +08:00
this.finishshow = true
2023-03-28 10:02:47 +08:00
if (this.serviceEndPictureUrl && this.userSignaturePictureUrl && this.onDutyPictureUrl) {
let that = this
uni.uploadFile({
url: baseurl + '/nurseApplet/uploadFile/uploadPictureUrl',
filePath: that.serviceEndPictureUrl,
name: 'file',
formData: {
'orderNo': that.orderNo
},
timeout: 5000,
success(res) {
that.list.serviceEndPictureUrl = JSON.parse(res.data).imgUrl
uni.uploadFile({
url: baseurl + '/nurseApplet/uploadFile/uploadPictureUrl',
filePath: that.userSignaturePictureUrl,
name: 'file',
formData: {
'orderNo': that.orderNo
},
timeout: 5000,
success(res) {
that.list.userSignaturePictureUrl = JSON.parse(res.data).imgUrl
uni.uploadFile({
url: baseurl + '/nurseApplet/uploadFile/uploadPictureUrl',
filePath: that.onDutyPictureUrl,
name: 'file',
formData: {
'orderNo': that.orderNo
},
timeout: 5000,
success(res) {
that.list.onDutyPictureUrl = JSON.parse(res.data)
.imgUrl
orderConfirm(that.list).then(res => {
if (res.code == 200) {
that.$refs.uToast.show({
title: '服务完成',
type: 'success',
duration: '1500',
})
if (that.timer) {
clearTimeout(that.timer)
}
that.timer = setTimeout(e => {
uni.navigateBack({
delta: 1
})
}, 1500)
} else {
that.$refs.uToast.show({
title: res.msg,
type: 'error'
})
}
})
}
})
}
})
}
})
} else {
this.$refs.uToast.show({
title: '请上传全部照片并用户签名确认',
type: 'error'
})
}
},
},
onLoad(options) {
2023-04-03 14:55:17 +08:00
this.itemlist = JSON.parse(options.list)
2023-03-28 10:02:47 +08:00
this.list.id = options.orderDetailsId
2023-04-03 14:55:17 +08:00
this.orderNo = this.itemlist.orderNo
2023-03-28 10:02:47 +08:00
var that = this
2023-04-03 14:55:17 +08:00
// uni.getLocation({
// type: 'gcj02',
// geocode: true,
// success: function(res) {
// that.list.serviceLocationName = res.address.poiName
// that.list.serveLocationLatitude = res.latitude
// that.list.serveLocationLongitude = res.longitude
// },
// fail: error => {
// uni.showModal({
// title: '提示',
// content: '获取定位失败,是否授权打开定位',
// success: (res) => {
// if (res.confirm) {}
// }
// })
// }
// });
2023-03-28 10:02:47 +08:00
},
}
</script>
<style lang="scss">
.app {
font-size: 36rpx;
2023-04-12 11:01:29 +08:00
padding: 0;
overflow: scroll;
height: 100vh;
2023-03-28 10:02:47 +08:00
2023-04-03 14:55:17 +08:00
.finishmask {
height: 300rpx;
position: relative;
.rightbtn,
.leftbtn {
position: absolute;
text-align: center;
line-height: 59rpx;
width: 249rpx;
height: 59rpx;
border-radius: 5rpx;
top: 200rpx;
}
2023-03-28 10:02:47 +08:00
2023-04-03 14:55:17 +08:00
.leftbtn {
border: 1px solid #4271B9;
background: #FFFFFF;
color: #4271B9;
left: 61rpx;
}
2023-03-28 10:02:47 +08:00
2023-04-03 14:55:17 +08:00
.rightbtn {
background: #4271B9;
color: #fff;
right: 61rpx;
2023-03-28 10:02:47 +08:00
}
2023-04-03 14:55:17 +08:00
.title {
width: 100%;
text-align: center;
font-size: 41rpx;
margin-top: 160rpx;
color: #333333;
}
}
2023-03-28 10:02:47 +08:00
2023-04-03 14:55:17 +08:00
.top {
padding-bottom: 40rpx;
background-color: #fff;
width: 96%;
margin: 15rpx auto 0;
color: #333333;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 5rpx;
.content {
margin-left: 50rpx;
font-size: 30rpx;
.time {
line-height: 90rpx;
2023-03-28 10:02:47 +08:00
}
2023-04-03 14:55:17 +08:00
.address {}
}
.title {
border-bottom: 1rpx solid #E6E6E6;
display: flex;
height: 100rpx;
line-height: 100rpx;
position: relative;
.righttext {
2023-03-28 10:02:47 +08:00
position: absolute;
2023-04-03 14:55:17 +08:00
right: 20rpx;
2023-03-28 10:02:47 +08:00
top: 50%;
2023-04-03 14:55:17 +08:00
transform: translateY(-50%);
font-size: 34rpx;
color: #EA706A;
2023-03-28 10:02:47 +08:00
}
2023-04-03 14:55:17 +08:00
.text {
font-size: 34rpx;
line-height: 100rpx;
padding-left: 18rpx;
2023-03-28 10:02:47 +08:00
}
2023-04-03 14:55:17 +08:00
image {
margin: 50rpx 0 0 35rpx;
transform: translateY(-50%);
width: 40rpx;
height: 40rpx;
2023-03-28 10:02:47 +08:00
}
}
2023-04-03 14:55:17 +08:00
}
.pictures {
width: 96%;
margin: 15rpx auto;
background: #FFFFFF;
box-shadow: 0px 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 5rpx;
2023-03-28 10:02:47 +08:00
2023-04-03 14:55:17 +08:00
.picture {
width: 100%;
height: 630rpx;
2023-03-28 10:02:47 +08:00
2023-04-03 14:55:17 +08:00
.attendantImg {
color: #000000;
height: 88rpx;
line-height: 88rpx;
margin-left: 30rpx;
span {
color: #BAB7B8;
}
2023-03-28 10:02:47 +08:00
}
2023-04-03 14:55:17 +08:00
.uppicture {
border: 1rpx dashed #818181;
width: 90%;
height: 500rpx;
margin: 0 auto;
position: relative;
image {
width: 100%;
height: 100%;
}
2023-03-28 10:02:47 +08:00
2023-04-03 14:55:17 +08:00
.choice {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
::v-deep .u-list-item[data-v-49deb6f2] {
background: #FFFFFF;
}
span {
font-size: 35rpx;
color: #969394;
}
}
.user {
height: 88rpx;
line-height: 88rpx;
color: #969394;
margin-left: 30rpx;
image {
width: 34rpx;
height: 34rpx;
}
}
.receive {
height: 88rpx;
line-height: 88rpx;
color: #969394;
margin-left: 30rpx;
2023-03-28 10:02:47 +08:00
2023-04-03 14:55:17 +08:00
}
2023-03-28 10:02:47 +08:00
}
}
.submit {
2023-04-03 14:55:17 +08:00
width: 496rpx;
height: 58rpx;
background: #4271B9;
border-radius: 5rpx;
2023-03-28 10:02:47 +08:00
color: #FFFFFF;
text-align: center;
2023-04-03 14:55:17 +08:00
line-height: 58rpx;
background: #4C7BC9;
margin: 90rpx auto;
2023-03-28 10:02:47 +08:00
}
}
</style>