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.

348 lines
7.8 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 class="container">
<view class="header">
<text>已选择信息</text>
</view>
<view class="box">
<view class="boxHeader">
<view class="headerItem">
<text class="headerItemInfo">{{buyInfo.selectedProject}}</text>
<text class="headerItemInfo">{{buyInfo.selectArea}}</text>
<text class="headerItemInfo">{{buyInfo.selectbed}}</text>
</view>
<view class="boxForm">
<view class="boxFormItem">
<view class="boxFormItemLeft">
起止日期
</view>
<view class="boxFormItemRight" @click="showSDate=true">
<text>{{from_date+"~"+to_date }} 共计 {{days}} </text>
</view>
</view>
<view class="boxFormItem">
<view class="boxFormItemLeft">
被护理人
</view>
<view class="boxFormItemRight">
<text>{{patient_name}} {{mobile}}</text>
</view>
</view>
</view>
</view>
</view>
<view class="box">
<view v-if="step==1">
<view class="boxHeader">
<text>陪护天数</text>
</view>
<view class="boxContent">
<view class="boxForm">
<view class="boxFormItem">
<view class="boxFormItemLeft">
<text style="color: red;">*</text> 开始日期
</view>
<view class="boxFormItemRight" @click="showSDate=true">
<text>{{from_date==""?"请选择开始日期 >":from_date}}</text>
<u-picker v-model="showSDate" @confirm="toGetDate" mode="time"></u-picker>
</view>
</view>
<view class="boxFormItem">
<view class="boxFormItemLeft">
<text style="color: red;">*</text> 天数
</view>
<view class="boxFormItemRight">
<u-number-box :min="1" :max="100" v-model="days" @change="toChangeDays"></u-number-box>
</view>
</view>
<view class="boxFormItem">
<view class="boxFormItemLeft">
<text style="color: red;">*</text> 结束日期
</view>
<view class="boxFormItemRight">
<text>{{to_date==""?"请选择开始日期 >":to_date}}</text>
</view>
</view>
</view>
</view>
<view class="boxFooter">
<view class="btn" @click="step=2">下一步</view>
</view>
</view>
<view v-if="step==2">
<view class="boxHeader">
<text>患者信息</text>
</view>
<view class="boxContent">
<view class="boxForm">
<view class="boxFormItem">
<view class="boxFormItemLeft">
<text style="color: red;">*</text> 姓名
</view>
<view class="boxFormItemRight">
<u-input placeholder="请输入内容" v-model="patient_name" border="surround"></u-input>
</view>
</view>
<view class="boxFormItem">
<view class="boxFormItemLeft">
<text style="color: red;">*</text> 联系电话
</view>
<view class="boxFormItemRight">
<u-input placeholder="请输入内容" v-model="mobile" border="surround"></u-input>
</view>
</view>
<view class="boxFormItem">
<view class="boxFormItemLeft">
家属信息
</view>
<view class="boxFormItemRight">
<u-input placeholder="请输入内容" v-model="contact" border="surround"></u-input>
</view>
</view>
</view>
</view>
<view class="boxFooter">
<view class="btn" @click="step=1">上一步</view>
</view>
</view>
</view>
<view class="footer">
<view class="footerLeft">
<text>预付金额:¥{{selectPrice==0?buyInfo.selectProduct.minPrice:selectPrice}}/ 天</text>
</view>
<view class="footerRight" @click="toStep" :class="{footerRightOn:buyInfo.paramedic_id!=''}">
<text>确认下单</text>
</view>
</view>
</view>
</template>
<script>
import util from "../../../../utils/util.js";
export default {
data() {
return {
step: 1,
showSDate: false,
from_date: "",
to_date: "",
days: 1,
patient_name: "",
contact: "",
mobile: "",
buyInfo: {
"selectArea": "住院部 一楼51急诊病区",
"selectbed": "101-31床",
"selectbedID": 3348,
"selectAreaID": 63,
"selectSex": {
"sex": 0,
"isChecked": true,
"selectImg": "/static/resource/icon/icon_boy_on.png",
"img": "/static/resource/icon/icon_boy.png",
"text": "男"
},
"selectFactors": [{
"id": 5,
"factor_item_id": 18
}, {
"id": 6,
"factor_item_id": 25
}, {
"id": 18,
"factor_item_id": 107
}],
"selectProduct": {
"id": 3,
"name": "院内陪护",
"minPrice": "100.00",
"maxPrice": 440
},
"selectProjectID": 3,
"selectedProject": "五金中医院",
"paramedic_id": ""
}
}
},
onShareAppMessage() {},
onLoad() {
this.from_date = this.$moment().format("YYYY-MM-DD");
this.to_date = this.$moment().add(1, "d").format("YYYY-MM-DD");
},
onReady() {},
onHide() {},
methods: {
toGetDate(e) {
this.from_date = e.year + "-" + e.month + "-" + e.day
this.to_date = this.$moment(this.from_date).add(this.days - 1, 'd').format("YYYY-MM-DD");
},
toChangeDays() {
this.to_date = this.$moment(this.from_date).add(this.days - 1, 'd').format("YYYY-MM-DD");
},
submitOrder() {
var that = this;
if (!this.$u.test.mobile(this.mobile)) {
util.alert("请正确填写手机号");
return false;
}
if (util.isnull(tihs.patient_name)) {
util.alert("请正确填写患者信息");
return false;
}
let data = {
product_id: this.buyInfo.selectProduct.id,
factors: this.buyInfo.selectFactors,
bed_id: this.buyInfo.selectbedID,
paramedic_id: this.buyInfo.paramedic_id,
patient_name: this.patient_name,
patient_sex: this.buyInfo.selectSex,
from_date: this.from_date,
to_date: this.to_date,
contact: this.contact,
mobile: this.mobile
}
util.request({
bindThis: this,
customLoading: true,
api: 'customer/create-order',
data: data,
method: 'POST',
utilSuccess: function(e) {
that.loadPage(1);
},
utilFail: function(e) {
util.alert(e);
}
})
}
}
}
</script>
<style>
view {
box-sizing: border-box;
}
.container {
background-color: rgb(231, 245, 244) !important;
height: 100vh;
overflow: hidden;
padding: 30rpx;
}
.header {
font-weight: 300;
font-size: 32rpx;
color: #303233;
}
.box {
background: #fff;
width: 100%;
border-radius: 8rpx 8rpx 8rpx 8rpx;
margin: 30rpx auto;
padding: 43rpx 20rpx;
}
.boxContent {
padding: 10rpx;
}
.headerItem {
display: flex;
flex-wrap: wrap;
}
text.headerItemInfo {
background: #E7F5F4;
border-radius: 4rpx 4rpx 4rpx 4rpx;
padding: 10rpx 20rpx;
margin-right: 10rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
color: #303233;
}
.footer {
width: 750rpx;
height: 92rpx;
background: #FFFFFF;
position: fixed;
bottom: 0;
left: 0;
display: flex;
}
.footerLeft {
width: 60%;
line-height: 92rpx;
font-weight: 600;
font-size: 30rpx;
color: #F7723F;
padding: 0rpx 67rpx;
}
.footerRight {
width: 40%;
height: 100%;
line-height: 92rpx;
text-align: center;
background: #ccc;
color: #fff;
}
.footerRightOn {
background: linear-gradient(90deg, #0ee2ba, #0CC7A4);
}
.boxForm {
display: flex;
flex-direction: column;
margin-top: 30rpx;
}
.boxFormItem {
display: flex;
justify-content: space-between;
margin-bottom: 30rpx;
font-size: 28rpx;
align-items: center;
height: 70rpx;
}
.boxFormItemRight {
font-size: 24rpx;
}
.boxHeader {
font-size: 32rpx;
color: #303233;
}
.btn {
width: 347rpx;
height: 72rpx;
background: linear-gradient(90deg, #0ee2ba, #67F7DC);
border-radius: 36rpx 36rpx 36rpx 36rpx;
line-height: 72rpx;
text-align: center;
color: #fff;
font-weight: 300;
font-size: 26rpx;
margin: 20rpx auto;
}
</style>