NurseStationPersonAppletUl/pages/taskReturn/taskReturn.vue

233 lines
4.8 KiB
Vue
Raw Normal View History

2023-03-28 10:02:47 +08:00
<template>
2023-04-12 09:22:10 +08:00
<view class="app" v-if="tasklist">
2023-04-03 14:55:17 +08:00
<view class="top">
<view class="title">
<image src="../../static/fuwu.png" mode=""></image>
<view class="text">
2023-04-12 09:22:10 +08:00
{{tasklist.nurseItemName}}
</view>
<view class="righttext">
<span v-if="tasklist.orderCommissionAmount&&tasklist.orderCommissionAmount>=0">
{{tasklist.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">
2023-04-12 09:22:10 +08:00
时间{{tasklist.serviceDate}}
<span style='padding-left: 10rpx;'>{{tasklist.serviceStartTime}}</span>
2023-04-03 14:55:17 +08:00
</view>
<view class="address">
2023-04-12 09:22:10 +08:00
地点{{tasklist.serviceAddress}}
2023-04-03 14:55:17 +08:00
</view>
2023-03-28 10:02:47 +08:00
</view>
</view>
2023-04-03 14:55:17 +08:00
<view class="bottom">
<view class="title">
<image src="../../static/no.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="checkboxs">
<u-checkbox-group @change="checkboxGroupChange" :wrap='true'>
<u-checkbox @change="checkboxChange" v-model="item.checked" v-for="(item, index) in list"
:key="index" :name="item.name" shape='circle'>{{item.name}}</u-checkbox>
</u-checkbox-group>
</view>
2023-04-12 09:22:10 +08:00
<u-input v-model="value" type="text" :border="true" border-color='#E6E6E6' placeholder='请在此输入'
v-if="list[4].checked" />
2023-04-03 14:55:17 +08:00
</view>
<view class="btn" @tap='taskreturn'>
立即提交
2023-03-28 10:02:47 +08:00
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
2023-04-12 09:22:10 +08:00
import {
taskDetails
} from '@/api/taskDetails/taskDetails.js'
2023-03-28 10:02:47 +08:00
import {
orderFallback
} from '@/api/taskReturn/index.js'
export default {
data() {
return {
2023-04-12 09:22:10 +08:00
baseurl: null,
tasklist: null, //传值item
2023-04-06 13:46:00 +08:00
nursePersonId: null, //护理员id
2023-04-03 14:55:17 +08:00
taskReturnReason: '',
2023-04-12 09:22:10 +08:00
value: null, //input绑定
2023-04-03 14:55:17 +08:00
list: [{
name: '与其他工单时间冲突',
checked: false,
}, {
name: '服务要求较高,当前资质无法完成',
checked: false,
}, {
name: '距离较远无法到达',
checked: false,
}, {
2023-04-12 10:01:07 +08:00
name: '价格不合理',
2023-04-03 14:55:17 +08:00
checked: false,
}, {
name: '其它',
checked: false,
}]
2023-03-28 10:02:47 +08:00
}
},
methods: {
2023-04-03 14:55:17 +08:00
// 选中某个复选框时由checkbox时触发
checkboxChange(e) {},
// 选中任一checkbox时由checkbox-group触发
checkboxGroupChange(e) {
2023-04-12 09:22:10 +08:00
this.taskReturnReason = ''
e.forEach(el => {
if (el != '其它') {
this.taskReturnReason += el + ';'
}
2023-04-03 14:55:17 +08:00
})
},
2023-03-28 10:02:47 +08:00
taskreturn() {
2023-04-12 09:22:10 +08:00
if (this.list[4].checked && this.value) {
this.taskReturnReason += this.value + ';'
}
if (!this.tasklist.id) {
this.tasklist.id = this.tasklist.orderDetailsId
}
2023-04-03 14:55:17 +08:00
var obj = {
2023-04-12 09:22:10 +08:00
"appointmentOrderId": this.tasklist.id,
2023-04-03 14:55:17 +08:00
"stationPersonId": this.nursePersonId,
2023-04-12 09:22:10 +08:00
"appointmentOrderNo": this.tasklist.orderNo,
2023-04-03 14:55:17 +08:00
"taskReturnReason": this.taskReturnReason,
}
orderFallback(obj).then(res => {
2023-04-12 10:23:40 +08:00
if (res.code == 200) {
this.$refs.uToast.show({
title: '任务退回成功',
type: 'success',
duration: '1500'
2023-03-28 10:02:47 +08:00
})
2023-04-12 10:23:40 +08:00
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 1500);
} else {
this.$refs.uToast.show({
title: res.msg,
type: 'error',
duration: '1500'
})
}
2023-03-28 10:02:47 +08:00
})
},
},
onLoad(options) {
2023-04-12 09:22:10 +08:00
this.tasklist = JSON.parse(options.item)
2023-04-06 13:46:00 +08:00
var that = this
const value = uni.getStorageSync('nursePersonId');
if (value) {
that.nursePersonId = value
} else {}
2023-03-28 10:02:47 +08:00
},
}
</script>
<style lang="scss">
2023-04-03 14:55:17 +08:00
::v-deep .u-input {
border: 1rpx solid #E6E6E6;
width: 85%;
display: block;
margin: 20rpx auto;
}
::v-deep .u-checkbox {
height: 80rpx !important;
}
2023-03-28 10:02:47 +08:00
.app {
padding: 0;
2023-04-03 14:55:17 +08:00
.btn {
width: 496rpx;
2023-04-12 09:22:10 +08:00
height: 70rpx;
2023-04-03 14:55:17 +08:00
background: #4271B9;
border-radius: 5rpx;
margin: 80rpx auto;
text-align: center;
2023-04-12 09:22:10 +08:00
line-height: 70rpx;
2023-04-03 14:55:17 +08:00
color: #fff;
}
2023-03-28 10:02:47 +08:00
2023-04-03 14:55:17 +08:00
.checkboxs {
padding-left: 50rpx;
}
.bottom {
padding-bottom: 40rpx;
}
.bottom,
.top {
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;
}
.top {
padding-bottom: 40rpx;
.content {
2023-04-12 09:22:10 +08:00
padding: 0 50rpx;
2023-03-28 10:02:47 +08:00
font-size: 30rpx;
2023-04-03 14:55:17 +08:00
.time {
line-height: 90rpx;
}
.address {}
2023-03-28 10:02:47 +08:00
}
}
2023-04-03 14:55:17 +08:00
.title {
border-bottom: 1rpx solid #E6E6E6;
display: flex;
height: 100rpx;
line-height: 100rpx;
2023-04-12 09:22:10 +08:00
width: 100%;
position: relative;
.righttext {
position: absolute;
right: 20rpx;
top: 50%;
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
}
}
}
</style>