|
|
|
|
@ -27,6 +27,8 @@ let timeIndex = ref(null); // 当前选中时间索引
|
|
|
|
|
let status = ref(0); // 1:点了确定 2:未点确定
|
|
|
|
|
let calendarShow = ref(false); // 日历显示
|
|
|
|
|
const rl_list = ref(false); //日历插槽
|
|
|
|
|
let calendar = ref(null);
|
|
|
|
|
let isClickDoctor = ref(0); // 是否点击了医生
|
|
|
|
|
|
|
|
|
|
const mountedAction = async () => {
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
@ -79,11 +81,14 @@ const getnmrList = async () => {
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const moreTime = async (m) => {
|
|
|
|
|
const moreTime = async (m, status) => {
|
|
|
|
|
isClickDoctor.value = status;
|
|
|
|
|
// 日历
|
|
|
|
|
const [year, month, day] = currentDate.value.split("-");
|
|
|
|
|
let dqmonth = m || `${year}-${month}`; //年 月份
|
|
|
|
|
let obj = {
|
|
|
|
|
let obj = {};
|
|
|
|
|
let methods = "";
|
|
|
|
|
obj = {
|
|
|
|
|
hospital: buyInfo.value.hospital,
|
|
|
|
|
person_id: buyInfo.value.person_id,
|
|
|
|
|
month: dqmonth, //月份
|
|
|
|
|
@ -93,7 +98,22 @@ const moreTime = async (m) => {
|
|
|
|
|
: $store.getCheckupTypeId()?.id,
|
|
|
|
|
amount: truePrice.value,
|
|
|
|
|
};
|
|
|
|
|
const response = await $api("GetMonthPlanCount", obj);
|
|
|
|
|
if (yytjInfo.value.nmr_list?.length > 1) {
|
|
|
|
|
if (nmrIndex.value) {
|
|
|
|
|
// 体检
|
|
|
|
|
methods = "GetMonthPlanCount";
|
|
|
|
|
} else {
|
|
|
|
|
// 核磁
|
|
|
|
|
methods = "NMRGetMonthPlanCount";
|
|
|
|
|
obj = {
|
|
|
|
|
hospital: buyInfo.value.hospital,
|
|
|
|
|
month: dqmonth, //月份
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
methods = "GetMonthPlanCount";
|
|
|
|
|
}
|
|
|
|
|
const response = await $api(methods, obj);
|
|
|
|
|
$response(response, () => {
|
|
|
|
|
console.log(response.data.list, "response.data.list");
|
|
|
|
|
let rlArr = [];
|
|
|
|
|
@ -104,17 +124,25 @@ const moreTime = async (m) => {
|
|
|
|
|
};
|
|
|
|
|
rlArr.push(o);
|
|
|
|
|
});
|
|
|
|
|
console.log(rlArr);
|
|
|
|
|
rl_list.value = rlArr;
|
|
|
|
|
calendarShow.value = true;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const monthSwitch = (e) => {
|
|
|
|
|
let [year, month] = getToday().split("-");
|
|
|
|
|
if (e.year >= year && e.month >= month) {
|
|
|
|
|
console.log(e, "monthSwitch");
|
|
|
|
|
let str = `${e.year}-${e.month}`;
|
|
|
|
|
moreTime(str);
|
|
|
|
|
const monthSwitch = (givenDate) => {
|
|
|
|
|
const currentYear = new Date().getFullYear();
|
|
|
|
|
const currentMonth = new Date().getMonth() + 1;
|
|
|
|
|
// 获取当前日期
|
|
|
|
|
if (
|
|
|
|
|
givenDate.year < currentYear ||
|
|
|
|
|
(givenDate.year === currentYear && givenDate.month < currentMonth)
|
|
|
|
|
) {
|
|
|
|
|
// uni.$lu.toast("不能选择过去时间");
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
let str = `${givenDate.year}-${givenDate.month}`;
|
|
|
|
|
moreTime(str, 0);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const getToday = () => {
|
|
|
|
|
@ -190,36 +218,67 @@ const changerl = (e) => {
|
|
|
|
|
if (num == 0) {
|
|
|
|
|
uni.$lu.toast("当前余号剩余0");
|
|
|
|
|
} else if (num > 0) {
|
|
|
|
|
if (isClickDoctor.value == 1) {
|
|
|
|
|
// 点击医生进入的
|
|
|
|
|
status.value = 0;
|
|
|
|
|
yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time =
|
|
|
|
|
e.fulldate;
|
|
|
|
|
yytjInfo.value.doctor_date = e.fulldate;
|
|
|
|
|
$store.setYytjInfo(yytjInfo.value);
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/pages/main/selectDoctor/selectDoctor?date=${e.fulldate}`,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (date_list.value[3]?.date == e.fulldate) {
|
|
|
|
|
calendarShow.value = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
title: "加载中",
|
|
|
|
|
});
|
|
|
|
|
currentDate.value = e.fulldate;
|
|
|
|
|
time.value = "";
|
|
|
|
|
timeIndex.value = null;
|
|
|
|
|
yytjInfo.value.nmr_list[nmrIndex.value].time = "";
|
|
|
|
|
yytjInfo.value.nmr_list[nmrIndex.value].id = "";
|
|
|
|
|
yytjInfo.value.doctor_name = ""; // 每次切换都清空医生
|
|
|
|
|
getTjTimeList(yytjInfo.value.nmr_list[nmrIndex.value]);
|
|
|
|
|
calendarShow.value = false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const getCurrentClick = (item, i) => {
|
|
|
|
|
// 选择日期
|
|
|
|
|
console.log(item, i); //当前日期和星期
|
|
|
|
|
if (new Date(item.date).getTime() < new Date(getToday()).getTime()) {
|
|
|
|
|
uni.$lu.toast("不能选择过去时间");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (item.count < 0) {
|
|
|
|
|
uni.$lu.toast("该日期已满,请选择其他日期");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
time.value = "";
|
|
|
|
|
timeIndex.value = null;
|
|
|
|
|
yytjInfo.value.nmr_list[nmrIndex.value].time = "";
|
|
|
|
|
yytjInfo.value.nmr_list[nmrIndex.value].id = "";
|
|
|
|
|
console.log(
|
|
|
|
|
yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time,
|
|
|
|
|
"xxsxsx"
|
|
|
|
|
);
|
|
|
|
|
if (!yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time) {
|
|
|
|
|
yytjInfo.value.doctor_name = "";
|
|
|
|
|
if (i != 3) {
|
|
|
|
|
if(yytjInfo.value.nmr_list.length > 1 && nmrIndex.value == 0){
|
|
|
|
|
yytjInfo.value.nmr_list = yytjInfo.value.nmr_list.map((val) => {
|
|
|
|
|
return {
|
|
|
|
|
...val,
|
|
|
|
|
time: "",
|
|
|
|
|
id: ""
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
time.value = "";
|
|
|
|
|
timeIndex.value = null;
|
|
|
|
|
yytjInfo.value.nmr_list[nmrIndex.value].time = "";
|
|
|
|
|
yytjInfo.value.nmr_list[nmrIndex.value].id = "";
|
|
|
|
|
yytjInfo.value.doctor_name = ""; // 每次切换都清空医生
|
|
|
|
|
yytjInfo.value.doctor_date = ""; // 每次切换都清空医生
|
|
|
|
|
$store.setYytjInfo(yytjInfo.value);
|
|
|
|
|
status.value = 0;
|
|
|
|
|
currentDate.value = item.date;
|
|
|
|
|
getTjTimeList(item); //带着选中的日期重新选择
|
|
|
|
|
}
|
|
|
|
|
$store.setYytjInfo(yytjInfo.value);
|
|
|
|
|
status.value = 0;
|
|
|
|
|
currentDate.value = item.date;
|
|
|
|
|
getTjTimeList(item); //带着选中的日期重新选择
|
|
|
|
|
};
|
|
|
|
|
const getCurrentTime = (item, index) => {
|
|
|
|
|
// 选择时分
|
|
|
|
|
@ -236,6 +295,14 @@ const getCurrentTime = (item, index) => {
|
|
|
|
|
};
|
|
|
|
|
const xmmcClick = (val, index) => {
|
|
|
|
|
// 选择项目
|
|
|
|
|
if (
|
|
|
|
|
yytjInfo.value.nmr_list.length > 1 &&
|
|
|
|
|
index != 0 &&
|
|
|
|
|
yytjInfo.value.nmr_list[0].time == ""
|
|
|
|
|
) {
|
|
|
|
|
uni.$lu.toast("请先选择" + yytjInfo.value.nmr_list[0].name + "时间");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
nmrIndex.value = index;
|
|
|
|
|
time.value = "";
|
|
|
|
|
timeIndex.value = null;
|
|
|
|
|
@ -249,18 +316,52 @@ const xmmcClick = (val, index) => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const clickDoctor = () => {
|
|
|
|
|
//选择医生列表
|
|
|
|
|
//选择医生
|
|
|
|
|
if (
|
|
|
|
|
yytjInfo.value.nmr_list.length > 1 &&
|
|
|
|
|
yytjInfo.value.nmr_list[0].time == ""
|
|
|
|
|
) {
|
|
|
|
|
uni.$lu.toast("请先选择" + yytjInfo.value.nmr_list[0].name + "时间");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time == "") {
|
|
|
|
|
uni.$lu.toast("请先选择体检时间");
|
|
|
|
|
nmrIndex.value = yytjInfo.value.nmr_list?.length - 1;
|
|
|
|
|
moreTime(null, 1);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
status.value = 0;
|
|
|
|
|
let date =
|
|
|
|
|
yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time?.split(
|
|
|
|
|
" "
|
|
|
|
|
)[0];
|
|
|
|
|
yytjInfo.value.doctor_date = date;
|
|
|
|
|
$store.setYytjInfo(yytjInfo.value);
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/pages/main/selectDoctor/selectDoctor?date=${currentDate.value}`,
|
|
|
|
|
url: `/pages/main/selectDoctor/selectDoctor?date=${date}`,
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const confirm = (e) => {
|
|
|
|
|
console.log(e);
|
|
|
|
|
if (new Date(e.fulldate).getTime() < new Date(getToday()).getTime()) {
|
|
|
|
|
uni.$lu.toast("不能选择过去时间");
|
|
|
|
|
let time = setTimeout(() => {
|
|
|
|
|
calendar.value.open();
|
|
|
|
|
clearTimeout(time);
|
|
|
|
|
}, 500);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
status.value = 0;
|
|
|
|
|
yytjInfo.value.nmr_list[yytjInfo.value.nmr_list.length - 1].time = e.fulldate;
|
|
|
|
|
yytjInfo.value.doctor_date = e.fulldate;
|
|
|
|
|
$store.setYytjInfo(yytjInfo.value);
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/pages/main/selectDoctor/selectDoctor?date=${e.fulldate}`,
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const comfrimyy = () => {
|
|
|
|
|
console.log(yytjInfo.value);
|
|
|
|
|
status.value = 1;
|
|
|
|
|
uni.navigateBack({
|
|
|
|
|
delta: 1,
|
|
|
|
|
@ -422,15 +523,25 @@ onShow(() => {
|
|
|
|
|
<uni-icons type="right" size="14"></uni-icons>
|
|
|
|
|
</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="ylrl">
|
|
|
|
|
<uni-calendar
|
|
|
|
|
ref="calendar"
|
|
|
|
|
:startDate="getToday()"
|
|
|
|
|
:showMonth="false"
|
|
|
|
|
:date="getToday()"
|
|
|
|
|
:insert="false"
|
|
|
|
|
@confirm="confirm"
|
|
|
|
|
/>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
id="ylrl"
|
|
|
|
|
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
|
|
|
|
|
class="p-16rpx pb-20rpx pt-30rpx rounded-15rpx bg-#fff mt-15rpx"
|
|
|
|
|
class="p-16rpx pb-20rpx pt-30rpx rounded-15rpx bg-#fff mt-15rpx ylrl"
|
|
|
|
|
v-if="calendarShow"
|
|
|
|
|
>
|
|
|
|
|
<uni-calendar
|
|
|
|
|
:selected="rl_list"
|
|
|
|
|
:startDate="getToday()"
|
|
|
|
|
:showMonth="false"
|
|
|
|
|
:insert="true"
|
|
|
|
|
:date="currentDate"
|
|
|
|
|
@ -459,12 +570,13 @@ onShow(() => {
|
|
|
|
|
>
|
|
|
|
|
<view
|
|
|
|
|
@click="getCurrentClick(item, index)"
|
|
|
|
|
:style="
|
|
|
|
|
item.count < 0
|
|
|
|
|
? 'background-color:#EFEFEF;color:#aaa8a8'
|
|
|
|
|
: ''
|
|
|
|
|
"
|
|
|
|
|
:class="3 == index ? 'activeTime' : ''"
|
|
|
|
|
:class="{
|
|
|
|
|
activeTime: 3 == index,
|
|
|
|
|
'bg-#efefef text-#aaa8a8':
|
|
|
|
|
item.count < 0 ||
|
|
|
|
|
new Date(item.date).getTime() <
|
|
|
|
|
new Date(getToday()).getTime(),
|
|
|
|
|
}"
|
|
|
|
|
class="rounded-12rpx pt-10rpx pb-10rpx ml-10rpx mr-10rpx mb-6rpx"
|
|
|
|
|
>
|
|
|
|
|
<view> {{ item.newMonthDate }} </view>
|
|
|
|
|
@ -482,7 +594,7 @@ onShow(() => {
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
class="flex-1 col center text-#239EA3 text-20rpx bs b-#E7E7E7 b-l-1 h-80rpx"
|
|
|
|
|
@click="moreTime()"
|
|
|
|
|
@click="moreTime(null, 0)"
|
|
|
|
|
>
|
|
|
|
|
<uni-icons
|
|
|
|
|
type="calendar"
|
|
|
|
|
@ -567,7 +679,7 @@ onShow(() => {
|
|
|
|
|
background-color: #e0f1f2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep #ylrl {
|
|
|
|
|
::v-deep .ylrl {
|
|
|
|
|
.uni-calendar__header,
|
|
|
|
|
.uni-calendar__weeks-day {
|
|
|
|
|
border: none;
|
|
|
|
|
@ -615,5 +727,11 @@ onShow(() => {
|
|
|
|
|
.uni-calendar__backtoday {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.uni-calendar-item--disable {
|
|
|
|
|
.uni-calendar-item__weeks-lunar-text {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|