You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

313 lines
6.9 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view>
<topnav :title='pageTitle' @tohome="tohome"></topnav>
<view class="content">
<view class="orderBox">
<orderinfo :info="order"></orderinfo>
</view>
<view class="pageTitle">请选择开始日期</view>
<view class="listBox" style="margin-top: 30rpx;">
<picker mode="date" :value="to_date" :start="startDate" :end="endDate" @change="bindDateChange">
<view class="listBoxItem">
<view class="listBoxItemLeft">
<view class="vred">*</view>日期
</view>
<view class="listBoxItemRight">
<text class="novalue" v-if="to_date==''"></text>
<text v-else>{{to_date}}</text>
<text class="iconfont icon-Icons_ToolBar_ArrowRight"></text>
</view>
</view>
</picker>
</view>
<view class="pageTitle">
添加护工
</view>
<view class="listBox" style="margin-top: 30rpx;">
<view class="listBoxItem">
<view class="listBoxItemLeft">
选择护工
</view>
<view class="listBoxItemRight" @click="bindSelectCarer">
<text>{{selectCarer==""?"请选择":selectCarer}}</text>
<text class="iconfont icon-Icons_ToolBar_ArrowRight"></text>
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="bottomLeft">
</view>
<view class="bottomRight">
<view class="btnCancel btn" @click="bindCancel"></view>
<view class="btnSubmit btn" @click="bindsubmitFun"></view>
</view>
</view>
</view>
</template>
<script>
var util = require("../../../../utils/util.js");
export default {
data() {
const currentDate = this.getDate({
format: true
})
return {
pageTitle: "更换护工",
order: {
"id": 731,
"serial": "",
"customer_id": 16,
"manager_id": null,
"bed_id": 778,
"patient_id": 793,
"project_id": 1,
"product_id": 1,
"product_item_id": 1,
"product_paramedic_level_id": 1,
"from_date": "",
"to_date": "",
"status": 0,
"total": 150,
"paid_total": 0,
"contact": null,
"mobile": "13912797667",
"paramedic_id": 31,
"price": "150.00",
"patient_quantity": null,
"created_at": "",
"updated_at": "",
"balance": "0.00",
"status_name": "",
"days": 0,
"product_item": {
"id": 1,
"name": "一对一"
},
"paramedic_level": {
"id": 8,
"name": "",
"laravel_through_key": 1
},
"project": {
"id": 1,
"name": "",
"logo_url": null,
"banners_url": null
},
"bed": {
"id": 778,
"name": "1",
"room_name": "101",
"area_name": "",
"building_name": "内科楼"
},
"customer": {
"id": 16,
"name": null,
"balance": "0.00"
},
"patient": {
"id": 793,
"name": "刘瑜",
"sex": null,
"age": null,
"mobile": null
},
"paramedic": {
"id": 31,
"name": "刘忠兰",
"mobile": "15850579275",
"paramedic_level_name": "普通护工",
"avatar_url": null,
"age": "",
"status_name": null
},
"factorjson": [{
"fee": "0.00",
"price": "0.00",
"factor_id": 1,
"factor_name": "所在科室",
"fee_percent": "25.00",
"used_for_fee": 1,
"factor_item_id": 2,
"factor_item_name": "骨科"
}]
},
selectCarer: "",
selectCarerID: "",
id: "",
to_date:currentDate
}
},
onLoad: function(option) {
var that = this;
that.id = option.id;
util.getOrderInfo(option.id, function(r) {
that.order = r.data;
}, function(r) {
});
},
onShow: function() {
var carer = uni.getStorageSync("selectCarer");
if (carer != null && !util.isNull(carer)) {
this.selectCarer = carer.name;
this.selectCarerID = carer.id;
}
},
onUnload: function() {
uni.removeStorageSync('selectCarer');
},
onHide: function() {
uni.removeStorageSync('selectCarer');
},
computed: {
startDate() {
return this.getDate('start');
},
endDate() {
return this.getDate('end');
}
},
methods: {
bindDateChange: function(e) {
var that = this;
that.to_date = e.target.value
},
getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === 'start') {
year = year - 1;
} else if (type === 'end') {
year = year + 2;
}
month = month > 9 ? month : '0' + month;;
day = day > 9 ? day : '0' + day;
return `${year}-${month}-${day}`;
},
tohome: function() {
uni.navigateTo({
url: "../../../../pages/index/index"
})
},
bindCancel: function(e) {
uni.navigateBack({
})
},
bindsubmitFun: function(e) {
var that = this;
if (util.isNull(that.selectCarerID)) {
util.alert("请选择护工")
return false;
}
uni.showModal({
title: '提示',
content: "确认派单?",
confirmText: "确认",
confirmColor: "#000",
cancelColor: "#eee",
success(res) {
if (res.confirm) {
that.doAssgin();
}
}
});
},
doAssgin: function() {
var that = this;
util.request({
bindThis: that,
method: 'POST',
customLoading: false,
api: 'manager/assign-order/' + that.id,
data: {
paramedic_id: that.selectCarerID
},
utilSuccess: function(res) {
console.log('3提交成功返回' + res);
uni.showModal({
title: "派单成功",
success: function() {
uni.navigateTo({
url: "../orderinfo/orderinfo?id=" + that.id
})
}
})
that.processAfterPay(res);
},
utilFail: function(res) {
console.log('4提交失败' + res);
util.alert(res);
}
});
},
bindSelectCarer: function(e) {
uni.navigateTo({
url: "../../../packagecarer/pages/selectcarer/selectcarer"
})
}
}
}
</script>
<style>
.bottom {
background: #FFFFFF;
box-shadow: 0 -2rpx 12rpx 0 rgba(0, 0, 0, 0.16), inset 0 1rpx 0 0 #E4E4E4;
width: 100%;
height: 100rpx;
position: fixed;
bottom: 0;
left: 0;
display: flex;
justify-content: space-between;
}
.bottom .bottomLeft {
display: flex;
align-items: center;
}
.bottom .bottomRight {
display: flex;
flex: 1;
}
.btn {
width: 50%;
line-height: 100rpx;
text-align: center;
line-height: 100rpx;
font-family: SourceHanSansCN-Medium;
font-size: 32rpx;
letter-spacing: 0;
}
.btnCancel {
color: #666666;
background: #F0F0F0;
}
.btnSubmit {
color: #FFFFFF;
background: #0DC99E;
}
</style>