继续改约

wenjuan
yanzai 1 year ago
parent ee2c099297
commit 8ab7ed1228

@ -12,14 +12,14 @@
<view class="xian_k">
<view class="xian"></view>
</view>
<view class="rili_icon">
<view class="rili_icon" @click="ClickMore()">
<uni-icons type="calendar" style="font-size: 50rpx;" color="#239EA3"></uni-icons>
<text>更多</text>
</view>
</view>
<view class="hengxian"></view>
<view class="timelist">
<view v-for="(item,index) in dataInfo.list" @click="timeClick(item)" :class="item.time==selectedTime?'time selected':'time'">{{item.time.substring(0, 5)}}</view>
<view v-for="(item,index) in dataInfo.list" @click="timeClick(item)" :class="(item.time==selectedTime)?'time selected':'time'" ><span :class="item.status==2?'used':''">{{item.time.substring(0, 5)}}</span></view>
</view>
</view>
</template>
@ -34,16 +34,25 @@
},
selectedTime: {
type: String,
required: true
}
// required: true
},
});
const selectDate = (date) => {
emit('selectDate', date);
};
const timeClick=(timeInfo)=>{
if(timeInfo.status==2){
uni.$lu.toast("该号源已经被占用");
return false;
}
emit('selectTime', timeInfo);
}
const ClickMore=()=>{
emit('openMonth');
}
</script>
<style scoped>
@ -150,4 +159,7 @@
.time:nth-child(5n) {
margin-right: 0;
}
.used{
color:red;
}
</style>

@ -1,36 +1,53 @@
<template>
<view class="ctime_main">
<view class="top">
<view v-if="orderInfo" style="display: flex;justify-content: space-between;">
<view style="font-size: 26rpx; color: #666;">体检医生 - <span v-if="doctor_name"
style="font-size: 28rpx;font-weight: 700;"> {{doctor_name}}</span></view>
<view style="font-size: 26rpx; color: #333;font-weight: 700;" @click="selectDoctor()"> </view>
</view>
</view>
<view class="zhouli">
<WeeklyCalendar v-if="weekList" :dataInfo="weekList" :selectedTime="selectedTime"
@selectDate="selectDateFunc" @selectTime="selectTimeFunc" />
@selectDate="selectDateFunc" @selectTime="selectTimeFunc" @openMonth="openMonthFunc" />
</view>
<view class="dateitem" v-if="orderInfo">
<view
style="background-color: #f7f7f7; padding: 20rpx; font-size: 30rpx; border-radius: 20rpx;color: #333;">
<view>{{orderInfo.name}}</view>
<view
style="background-color: #f1f1f1;padding: 20rpx 30rpx; margin-top: 10rpx;border-radius: 14rpx;font-size: 28rpx;">
<view v-if=" orderInfo.buy_info.nmr_list && orderInfo.buy_info.nmr_list.length>0">
style="background-color: #f1f1f1;padding: 20rpx 10rpx; margin-top: 10rpx;border-radius: 14rpx;font-size: 28rpx;color: #666;">
<view @click="itemClick('nmr')"
v-if=" orderInfo.buy_info.nmr_list && orderInfo.buy_info.nmr_list.length>0"
style="padding: 20rpx;" :class="itemSelected=='nmr'?'itemSelected':''">
<view v-for="(item1,index1) in orderInfo.buy_info.nmr_list">
{{item1.name}}
{{item1.name}} <span v-if="nmr_date && nmr_time">{{nmr_date}} {{nmr_time}}</span>
</view>
</view>
<view style="margin-top: 10rpx;">体检日期</view>
<view @click="itemClick('tj')" style="margin-top: 10rpx;padding: 20rpx;color: #666;"
:class="itemSelected=='tj'?'itemSelected':''">体检日期 <span v-if="tj_date && tj_time">{{tj_date}}
{{tj_time}}</span></view>
</view>
</view>
</view>
<view class="pb-100rpx">
<view
<view @click="StartYuYue()"
class="text-#fff text-32rpx rounded-45rpx bg-#239EA3 mt-40rpx ma w-520rpx h-90rpx flex flex-items-center flex-justify-center">
确定
</view>
</view>
<view id="ylrl">
<uni-calendar :insert="false" :showMonth="false" ref="DoctorMonthCalendar" @confirm="DoctMonthConfirm" />
<uni-calendar :selected="MonthList" @monthSwitch="monthSwitch" :insert="false"
:showMonth="false" ref="MonthCalendar" @confirm="MonthConfirm" />
</view>
</view>
</template>
<script setup>
import {
onMounted,
ref
} from 'vue';
import {
@ -38,11 +55,26 @@
$api,
$response
} from "@/api";
import {
useStore
} from "@/store";
const $store = useStore();
import {
onShow
} from "@dcloudio/uni-app";
import WeeklyCalendar from '@/common/WeeklyCalendar.vue';
let nmr_date = ref(null);
let nmr_time = ref(null);
let nmr_plan_id = ref(null); //id
let tj_date = ref(null);
let tj_time = ref(null);
let tj_plan_id = ref(null); //id
let weekList = ref(null);
let doctor_name = ref(null);
//
const GetDayPlanListFunc = async () => {
uni.showLoading();
let data = {
@ -57,6 +89,21 @@
uni.hideLoading();
$response(response, () => {
weekList.value = response.data
});
};
//
const NMRGetDayPlanListFunc = async () => {
uni.showLoading();
let data = {
hospital: orderInfo.value.hospital_id,
date: selectedDate.value,
}
const response = await $api("NMRGetDayPlanList", data);
uni.hideLoading();
$response(response, () => {
weekList.value = response.data
});
};
let selectedTime = ref(null);
@ -69,10 +116,25 @@
uni.hideLoading();
$response(response, () => {
orderInfo.value = response.data.info
selectedTime.value = orderInfo.value.appointment_time
selectedDate.value = orderInfo.value.appointment_date
GetDayPlanListFunc()
doctor_name.value = orderInfo.value.doctor
//
if (orderInfo.value.buy_info.nmr_list && orderInfo.value.buy_info.nmr_list.length > 0) {
itemSelected.value = 'nmr'
selectedTime.value = '10:45' //
selectedDate.value = '2024-10-09' //
NMRGetDayPlanListFunc()
} else {
itemSelected.value = 'tj'
selectedTime.value = orderInfo.value.appointment_time
selectedDate.value = orderInfo.value.appointment_date
GetDayPlanListFunc()
}
nmr_date.value = '2024-10-09'
nmr_time.value = '10:45'
tj_date.value = orderInfo.value.appointment_date
tj_time.value = orderInfo.value.appointment_time
});
}
@ -80,34 +142,262 @@
let selectedDate = ref(null);
const selectDateFunc = (date) => {
selectedDate.value = date
GetDayPlanListFunc();
selectedTime.value = null
if (itemSelected.value == 'nmr') {
nmr_time.value = null
nmr_date.value = date
tj_time.value = null //
tj_date.value = null
doctor_name.value = null //
NMRGetDayPlanListFunc()
}
if (itemSelected.value == 'tj') {
tj_time.value = null
tj_date.value = date
doctor_name.value = null //
GetDayPlanListFunc();
}
}
//weekly
let SelectedPlanId = ref(null)
const selectTimeFunc = (timeinfo) => {
selectedTime.value = timeinfo.time
SelectedPlanId.value = timeinfo.id
if (itemSelected.value == 'nmr') {
nmr_time.value = timeinfo.time
nmr_plan_id.value = timeinfo.id
}
if (itemSelected.value == 'tj') {
tj_time.value = timeinfo.time
tj_plan_id.value = timeinfo.id
}
}
onShow(() => {
let itemSelected = ref(null);
const itemClick = (type) => {
//weekList.value=null
if (type == 'nmr') {
selectedTime.value = nmr_time.value
selectedDate.value = nmr_date.value
NMRGetDayPlanListFunc()
}
if (type == 'tj') {
if (orderInfo.value.buy_info.nmr_list && orderInfo.value.buy_info.nmr_list.length > 0) {
if (nmr_time.value == null || nmr_date.value == null) {
uni.$lu.toast("请先预约为影像科项目选择时间");
return false
}
}
if (tj_date.value == null) {
tj_date.value = nmr_date.value
}
selectedTime.value = tj_time.value
selectedDate.value = tj_date.value
GetDayPlanListFunc()
}
itemSelected.value = type
}
const StartYuYue = () => {
console.log(tj_plan_id.value, tj_time.value);
}
let DoctorMonthCalendar = ref(null)
const selectDoctor = () => {
if (orderInfo.value.buy_info.nmr_list && orderInfo.value.buy_info.nmr_list.length > 0) {
if (nmr_time.value == null || nmr_date.value == null) {
uni.$lu.toast("请先预约为影像科项目选择时间");
return false
}
}
if (tj_date.value == null) { //
DoctorMonthCalendar.value.open();
} else {
uni.navigateTo({
url: `/pages/main/selectDoctor/selectDoctor?date=${tj_date.value}`,
});
}
}
//
const DoctMonthConfirm = (e) => {
tj_date.value = e.year + "-" + e.month + "-" + e.date
uni.navigateTo({
url: `/pages/main/selectDoctor/selectDoctor?date=${tj_date.value}`,
});
}
let MonthCalendar = ref(null)
let MonthList = ref([]); //
let currentDate = ref(null); //
const monthSwitch = (e) => { //
let ym=e.year+""+"-"+e.month+""
console.log(e);
if (itemSelected.value == 'nmr') {
NMRGetMonthPlanListFunc(ym)
}
if (itemSelected.value == 'tj') {
GetMonthPlanListFunc(ym)
}
}
const MonthConfirm = (e) => { //
}
//
const GetMonthPlanListFunc = async (ym='') => {
uni.showLoading();
let data = {
hospital: orderInfo.value.hospital_id,
person_id: orderInfo.value.person_id,
month: ym?ym:tj_date.value.substring(0, 7),
use_type: orderInfo.value.type,
checkup_type_id: orderInfo.value.checkup_type_id,
amount: orderInfo.value.true_price,
}
const response = await $api("GetMonthPlanCount", data);
uni.hideLoading();
$response(response, () => {
let rlArr = [];
response.data.list.forEach((item) => {
let o = {
date: item.date,
info: "余号" + item.count,
};
rlArr.push(o);
});
MonthList.value = rlArr;
//MonthCalendar.value.open()
});
};
//
const NMRGetMonthPlanListFunc = async (ym='') => {
uni.showLoading();
let data = {
hospital: orderInfo.value.hospital_id,
month: ym?ym:nmr_date.value.substring(0, 7),
}
const response = await $api("NMRGetMonthPlanCount", data);
uni.hideLoading();
$response(response, () => {
let rlArr = [];
response.data.list.forEach((item) => {
let o = {
date: item.date,
info: "余号" + item.count,
};
rlArr.push(o);
});
MonthList.value = rlArr;
//MonthCalendar.value.open()
});
};
//
const openMonthFunc = async() => {
if (itemSelected.value == 'nmr') {
await NMRGetMonthPlanListFunc()
}
if (itemSelected.value == 'tj') {
await GetMonthPlanListFunc()
}
MonthCalendar.value.open()
}
let temp = null
onMounted(() => {
//
temp = $store.getYytjInfo()
temp.doctor_name = ""
$store.setYytjInfo(temp)
GetOrderInfo()
});
onShow(() => {
temp = $store.getYytjInfo()
if (temp.doctor_name != null && temp.doctor_name != '') {
doctor_name.value = temp.doctor_name
}
})
</script>
<style scoped>
<style scoped lang="scss">
.ctime_main {
padding: 20rpx;
}
.top {
background-color: #fff;
border-radius: 20rpx;
margin-bottom: 20rpx;
padding: 20rpx;
}
.zhouli {
padding: 20rpx;
background-color: #fff;
border-radius: 20rpx;
}
.itemSelected {
background-color: #e0fafa;
border-radius: 10rpx;
}
.dateitem {
padding: 20rpx;
background-color: #fff;
border-radius: 20rpx;
margin-top: 20rpx;
}
::v-deep #ylrl {
.uni-calendar__header,
.uni-calendar__weeks-day {
border: none;
}
.uni-calendar-item--checked {
background-color: transparent;
.uni-calendar-item__weeks-box-item {
background-color: #239ea3 !important;
border-radius: 12rpx;
.uni-calendar-item--extra {
color: #fff !important;
}
}
}
.uni-calendar-item--isDay {
background-color: #239ea3 !important;
border-radius: 12rpx;
color: #fff !important;
}
.uni-calendar-item--extra {
color: #239ea3;
}
.uni-calendar-item__weeks-box {
// padding: 10rpx;
box-sizing: border-box;
}
.uni-calendar-item__weeks-box-circle {
background-color: rgba(0, 0, 0, 0);
}
.uni-calendar-item--isDay-text {
color: #333;
}
.uni-calendar-item__weeks-box-text {
font-size: 26rpx;
}
.uni-calendar-item__weeks-lunar-text {
font-size: 16rpx;
}
.uni-calendar-item__weeks-box-item {
width: 100%;
}
.uni-calendar__backtoday {
display: none;
}
}
</style>
Loading…
Cancel
Save