NurseStationPersonAppletUl/pages/taskDetails/taskDetails.vue

188 lines
4.7 KiB
Vue
Raw Normal View History

2023-03-28 10:02:47 +08:00
<template>
2023-04-03 14:55:17 +08:00
<view class="app" v-if="baseurl">
<view class="top">
<view class="title">
<image src="../../static/fuwu.png" mode=""></image>
<view class="text">
2023-03-28 10:02:47 +08:00
{{list.nurseItemName}}
</view>
2023-04-07 15:34:32 +08:00
<view class="righttext">
2023-04-12 09:22:10 +08:00
<span v-if="list.orderCommissionAmount&&list.orderCommissionAmount>=0">
{{list.orderCommissionAmount}}
</span>
<span v-else>
0
</span>
2023-04-03 14:55:17 +08:00
</view>
</view>
<view class="content">
2023-03-28 10:02:47 +08:00
<view class="time">
2023-04-03 14:55:17 +08:00
时间{{list.serviceDate}}
<span style='padding-left: 10rpx;'>{{list.serviceStartTime}}</span>
2023-03-28 10:02:47 +08:00
</view>
2023-04-03 14:55:17 +08:00
<view class="address">
地点{{list.serviceAddress}}
2023-03-28 10:02:47 +08:00
</view>
</view>
</view>
2023-04-03 14:55:17 +08:00
<view class="top">
<view class="title">
<image src="../../static/user.png" mode=""></image>
<view class="text">
用户信息
</view>
2023-03-28 10:02:47 +08:00
</view>
2023-04-03 14:55:17 +08:00
<view class="content" style="margin-top: 20rpx;">
<view class="item">
2023-04-12 13:33:21 +08:00
姓名
<span v-if="list.patientName">{{list.patientName}}</span>
2023-04-03 14:55:17 +08:00
</view>
<view class="item">
年龄{{list.age}}
2023-04-12 13:33:21 +08:00
<span v-if="list.age>=0">{{list.age}}</span>
2023-04-03 14:55:17 +08:00
</view>
<view class="item">
2023-04-12 13:33:21 +08:00
电话
<span v-if="list.phone">{{list.phone}}</span>
2023-04-03 14:55:17 +08:00
</view>
<view class="item address" @tap='getlocations'>
<view class="text" style="line-height: 60rpx;">
2023-04-12 13:33:21 +08:00
住址
<span v-if="list.address">{{list.address}}</span>
2023-04-03 14:55:17 +08:00
</view>
<view class="daohang">
<image src="../../static/daohang.png" mode=""></image>
<span class='p'>导航</span>
</view>
</view>
<view class="item">
是否失能{{list.disablingCondition=="NOT_DISABLED"?'未失能':''}}
{{list.disablingCondition=="DISABLED"?'已失能':''}}
</view>
<view class="item" v-if="list.disablingCondition=='DISABLED'">
2023-04-12 09:22:10 +08:00
失能情况
<span v-if="list.disablingReason">{{list.disablingReason}}</span>
2023-04-03 14:55:17 +08:00
</view>
2023-03-28 10:02:47 +08:00
</view>
</view>
2023-04-07 15:34:32 +08:00
<span v-if="list.orderStatus=='NOT_FINISH'||list.orderStatus=='WAIT_RECEIVE'">
<view class="btnsuccess" @tap='goconfirmCompletion' v-if="list.orderStatus=='NOT_FINISH'">
去完成
</view>
<view class="btnsuccess" @tap='Receivingorders' v-if="list.orderStatus=='WAIT_RECEIVE'">
接单
</view>
<view class="btnreturn" @tap='gotaskReturn'>
退回
</view>
</span>
2023-04-10 10:54:46 +08:00
<u-toast ref="uToast" />
2023-03-28 10:02:47 +08:00
</view>
</template>
<script>
import {
taskDetails
2023-04-03 14:55:17 +08:00
} from '@/api/taskDetails/taskDetails.js'
2023-04-07 15:34:32 +08:00
import {
receiveOrders
} from '@/api/Mymission/Mymission.js'
2023-03-28 10:02:47 +08:00
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
2023-04-07 15:34:32 +08:00
nursePersonId: null, //护理员id
2023-04-03 14:55:17 +08:00
baseurl: null,
list: {}, //详情对象
tude: { //经纬度
latitude: null,
longitude: null,
},
2023-04-12 14:13:29 +08:00
orderNo: null, //工单orderno
2023-03-28 10:02:47 +08:00
}
},
methods: {
//详情接口
2023-04-12 14:13:29 +08:00
taskDetailsinfo(orderNo) {
taskDetails(orderNo).then(res => {
2023-04-03 14:55:17 +08:00
if (res.code == 200) {
this.list = res.data
}
this.baseurl = baseurl
})
},
2023-04-07 15:34:32 +08:00
//接单
Receivingorders() {
var obj = {
"appointmentOrderId": this.list.orderDetailsId,
"stationPersonId": this.nursePersonId,
"appointmentOrderNo": this.list.orderNo
}
receiveOrders(obj).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '接单成功',
type: 'success',
duration: '1500'
})
2023-04-12 14:13:29 +08:00
this.taskDetailsinfo(this.orderNo)
2023-04-07 15:34:32 +08:00
}
})
},
2023-04-03 14:55:17 +08:00
//经纬度
getlocations() {
let that = this
uni.request({
url: 'https://apis.map.qq.com/ws/geocoder/v1/?address=',
method: 'GET',
data: {
2023-04-12 14:06:44 +08:00
key: 'TXGBZ-VGEWW-LJHRR-3CDLI-N57YO-YQBHJ', //高德地图key
2023-04-03 14:55:17 +08:00
address: that.list.address // 详细地址
},
success: function(res) {
that.tude.latitude = res.data.result.location.lat
that.tude.longitude = res.data.result.location.lng
that.goaddress();
},
fail(err) {}
})
},
//跳转地图
goaddress() {
let that = this
uni.openLocation({
latitude: Number(that.tude.latitude),
longitude: Number(that.tude.longitude),
2023-03-28 10:02:47 +08:00
})
},
2023-04-03 14:55:17 +08:00
//退回
gotaskReturn() {
2023-03-28 10:02:47 +08:00
uni.navigateTo({
2023-04-03 14:55:17 +08:00
url: `/pages/taskReturn/taskReturn?item=${JSON.stringify(this.list)}`
2023-03-28 10:02:47 +08:00
})
},
2023-04-03 14:55:17 +08:00
//去完成
goconfirmCompletion() {
2023-03-28 10:02:47 +08:00
uni.navigateTo({
2023-04-03 14:55:17 +08:00
url: `/pages/confirmCompletion/confirmCompletion?list=${JSON.stringify(this.list)}&&orderDetailsId=${this.list.orderDetailsId}`
2023-03-28 10:02:47 +08:00
})
},
},
onLoad(options) {
2023-04-12 14:13:29 +08:00
this.orderNo = options.orderNo
2023-03-28 10:02:47 +08:00
},
onShow() {
2023-04-07 15:34:32 +08:00
var that = this
const value = uni.getStorageSync('nursePersonId');
if (value) {
that.nursePersonId = value
} else {}
2023-04-12 14:13:29 +08:00
this.taskDetailsinfo(this.orderNo)
2023-03-28 10:02:47 +08:00
},
}
</script>
<style lang="scss">
@import './taskDetails.scss';
</style>