diff --git a/h5/pages/main/yytjsj/yytjsj.vue b/h5/pages/main/yytjsj/yytjsj.vue index 6367b61..9314fe5 100755 --- a/h5/pages/main/yytjsj/yytjsj.vue +++ b/h5/pages/main/yytjsj/yytjsj.vue @@ -273,27 +273,29 @@ nmrIndex.value == yytjInfo.value.nmr_list.length - 1 && yytjInfo.value.doctor_date ) { - console.log("切换体检时间"); - uni.showModal({ - title: "提示", - content: "已选择医生,切换日期将重新选择医生,是否继续", - showCancel: true, - success: ({ - confirm - }) => { - if (confirm) { - 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; - } - }, - }); - return; + console.log("切换体检时间"); + if(!!yytjInfo.value.doctor_name) { + uni.showModal({ + title: "提示", + content: "已选择医生,切换日期将重新选择医生,是否继续", + showCancel: true, + success: ({ + confirm + }) => { + if (confirm) { + 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; + } + }, + }); + return; + } } // uni.showLoading({ // title: "加载中", @@ -327,39 +329,41 @@ nmrIndex.value == yytjInfo.value.nmr_list.length - 1 && yytjInfo.value.doctor_date ) { - console.log("切换体检时间"); - uni.showModal({ - title: "提示", - content: "已选择医生,切换日期将重新选择医生,是否继续", - showCancel: true, - success: ({ - confirm - }) => { - console.log(confirm); - if (confirm) { - 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); //带着选中的日期重新选择 - } - }, - }); - return; + console.log("切换体检时间"); + if(!!yytjInfo.value.doctor_name){ + uni.showModal({ + title: "提示", + content: "已选择医生,切换日期将重新选择医生,是否继续", + showCancel: true, + success: ({ + confirm + }) => { + console.log(confirm); + if (confirm) { + 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); //带着选中的日期重新选择 + } + }, + }); + return; + } } if (yytjInfo.value.nmr_list.length > 1 && nmrIndex.value == 0) { if (!yytjInfo.value.doctor_name) {