调整选择医生逻辑

main
yanzai 11 months ago
parent ba482f8095
commit b64f539826

@ -20,6 +20,7 @@
useStore
} from "@/store";
const $store = useStore();
let currentDate=ref("");
let dqDate = ref("");
let yytjInfo = ref({}); //
let user_person = ref({});
@ -108,6 +109,49 @@
}
};
const clickDoctor = (item) => {
if(!!yytjInfo.value.nmr_list && yytjInfo.value.nmr_list[0].time.substring(0,10) != selectedDate.value && selectedDate.value!='' &&selectedDate.value!=null){
console.log('日期不一致');
uni.showModal({
title: "提示",
content: "已选择体检日期,切换日期需要重新选择体检号源,是否继续",
showCancel: true,
success: ({
confirm
}) => {
if (confirm) {
console.log(yytjInfo.value.nmr_list[0].time.substring(0,7));
console.log( selectedDate.value);
//return false;
yytjInfo.value.doctor_date = selectedDate.value;
yytjInfo.value.nmr_list[0].time = "";
yytjInfo.value.nmr_list[0].id = "";
$store.setYytjInfo(yytjInfo.value);
yytjInfo.value.doctor_name = item.name;
yytjInfo.value.doctor_id = item.id;
yytjInfo.value.nmrIndex = -1;
$store.setYytjInfo(yytjInfo.value);
if ($props.month == 'all') {
let riqiurl=''
if(dqDate.value){
riqiurl='?date='+dqDate.value;
}
uni.navigateTo({
url: '/pages/main/ysdate/ysdate_new'+riqiurl
})
} else {
// item.name
uni.navigateBack({
delta: 1,
});
}
}
},
});
return;
}
yytjInfo.value.doctor_name = item.name;
yytjInfo.value.doctor_id = item.id;
yytjInfo.value.nmrIndex = -1;
@ -173,7 +217,7 @@
} else {
let str = `${givenDate.year}-${givenDate.month}`;
nowMonth.value=str
moreTime(str, 0);
//moreTime(str, 0);
RiLiGetDoctorPaiBanFuc()
}
};
@ -182,11 +226,14 @@
console.log(e)
dqDate.value = e.fulldate
zhou_firstday.value = e.fulldate
selectedDate.value=e.fulldate
getdoctorList()
}
onShow(() => {
selectedDate.value = ''
dqDate.value = ''
zhou_firstday.value = $props.date ? $props.date : "";
selectedDate.value = $props.date ? $props.date : ""
dqDate.value = $props.date ? $props.date : ""
currentDate.value=selectedDate.value
console.log($props.month);
if (!!config_ref.value) {
mountedAction();
@ -256,7 +303,7 @@
</view>
</view>
<uni-calendar class="ylrl" ref="YueLiRef" :selected="MonthList" :startDate="getToday()" :insert="false"
@confirm="RiLiDateFunc" @monthSwitch="monthSwitch" />
:date="currentDate" @confirm="RiLiDateFunc" @monthSwitch="monthSwitch" />
</view>
</template>
<style scoped>

@ -159,6 +159,9 @@
console.log(rlArr);
rl_list.value = rlArr;
calendarShow.value = true;
if(!!yytjInfo.value.doctor_date){
currentDate.value=yytjInfo.value.doctor_date
}
uni.hideLoading();
});
};

Loading…
Cancel
Save