diff --git a/Laravel/app/Http/Controllers/API/H5/OrderController.php b/Laravel/app/Http/Controllers/API/H5/OrderController.php index e6fa678..efba424 100644 --- a/Laravel/app/Http/Controllers/API/H5/OrderController.php +++ b/Laravel/app/Http/Controllers/API/H5/OrderController.php @@ -565,13 +565,49 @@ class OrderController extends Controller if ($orderInfo->hospital_id == 4) { $yyid = 2; } + + //如果重新选择了体检号源,则检验号源有效性//判断体检日期是否在核磁前N天范围内 + if(isset($plan_id) && $plan_id <> $orderInfo->plan_id){ + $planInfo = DB::table('plans')->where(['id' => $plan_id, 'status' => 1])->first(); + if (!$planInfo) return \Yz::echoError1("所选体检日期号源无效"); + // $check_plan_kuadu=$this->checkDatesWithinDays([['date'=>$check_erxian_kuadu['mindate'],'date'=>$planInfo->date]],$ErXianKuaDu); + // if(!$check_erxian_kuadu['check_status']) return \Yz::echoError1("体检日期与核磁日期跨度不能大于".$ErXianKuaDu."天,请重新选择"); + } //判断核磁号源有效性能,日期范围是否正常,判断核磁新日期时间是否和旧的日期时间一样 - //判断各个二线直接的跨度是否在设定范围内 - $ErXianKuaDu = config('app.globals.erxian_kuadu'); - $check_erxian_kuadu=$this->checkDatesWithinDays($nmr_info,$ErXianKuaDu); - if(!$check_erxian_kuadu['check_status']) return \Yz::echoError1("所有二线项目预约跨度不应大于".$ErXianKuaDu."天,请重新选择"); - //判断二线号源日期时间是否改变,如果改变校验号源有效性 + //判断各个二线直接的跨度是否在设定范围内---废弃 + // $ErXianKuaDu = config('app.globals.erxian_kuadu'); + // $check_erxian_kuadu=$this->checkDatesWithinDays($nmr_info,$ErXianKuaDu); + // if(!$check_erxian_kuadu['check_status']) return \Yz::echoError1("所有二线项目预约跨度不应大于".$ErXianKuaDu."天,请重新选择"); + if(isset($plan_id) && $plan_id == $orderInfo->plan_id) return \Yz::echoError1("无需进行此操作"); + //如果有二线号源,根据体检时间查询二线可用号源,区分上下午 $db_nmr_info=json_decode($orderInfo->erxian_appointment_info,true); + $nmr_info=[]; + if (isset($db_nmr_info) and !empty($db_nmr_info)) { + foreach ($db_nmr_info as $erxian_item) { + $nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$planInfo->date],'action'=>"1"],uniqid()); + if($planInfo->time<="12:00") $end_time="12:00"; + if($planInfo->time>"12:00") $end_time="23:59"; + if(!isset($nmrPlans[$planInfo->date]) or empty($nmrPlans[$planInfo->date])) return \Yz::echoError1("二线号源不可用,请重新选则日期"); + $temp_date=[]; + foreach ($nmrPlans[$planInfo->date] as $nmp_p){ + if($nmp_p['Time']>=substr($planInfo->time,0,5) and $nmp_p['Time']<=$end_time and $nmp_p['keyong']==="0"){ + $temp_date=[ + "item_id"=>$erxian_item['item_id'], + "name"=>$erxian_item['name'], + "price"=>$erxian_item['price'], + "time"=>$nmp_p['Time'], + "date"=>$planInfo->date, + ]; + $nmr_info[]=$temp_date; + break; + } + } + if(empty($temp_date)) return \Yz::echoError1("二线号源不可用,请重新选则日期"); + } + + } + + //判断二线号源日期时间是否改变,如果改变校验号源有效性 foreach ($nmr_info as $key=>$nmr_item){ foreach ($db_nmr_info as $db_nmr_item){ if($nmr_item['item_id']==$db_nmr_item['item_id']){ @@ -590,14 +626,6 @@ class OrderController extends Controller continue; } } - - } - //如果重新选择了体检号源,则检验号源有效性//判断体检日期是否在核磁前N天范围内 - if(isset($plan_id) && $plan_id <> $orderInfo->plan_id){ - $planInfo = DB::table('plans')->where(['id' => $plan_id, 'status' => 1])->first(); - if (!$planInfo) return \Yz::echoError1("所选体检日期号源无效"); - $check_plan_kuadu=$this->checkDatesWithinDays([['date'=>$check_erxian_kuadu['mindate'],'date'=>$planInfo->date]],$ErXianKuaDu); - if(!$check_erxian_kuadu['check_status']) return \Yz::echoError1("体检日期与核磁日期跨度不能大于".$ErXianKuaDu."天,请重新选择"); } //如果二线号源校验通过,则先取消再预约新的 foreach ($nmr_info as $key=>$nmr_item){ diff --git a/Laravel/app/Http/Controllers/API/Internal/PlanController.php b/Laravel/app/Http/Controllers/API/Internal/PlanController.php index f04fcff..c3d6d6e 100644 --- a/Laravel/app/Http/Controllers/API/Internal/PlanController.php +++ b/Laravel/app/Http/Controllers/API/Internal/PlanController.php @@ -35,7 +35,7 @@ class PlanController extends Controller $id =request('id'); $plan=DB::table('plans')->where('id',$id)->first(); if(!$plan) return \Yz::echoError1("该号源不存在"); - if($plan->status<>1) return \Yz::echoError1("该号源不已被占用,请重新选择"); + if($plan->status<>1) return \Yz::echoError1("该号源已被占用,请重新选择"); $u=DB::table('plans')->where(['id'=>$id,'status'=>1])->update(['status'=>2]); if($u){ diff --git a/h5/pages/main/ctime/ctime.vue b/h5/pages/main/ctime/ctime.vue index 218137f..4dbfebe 100644 --- a/h5/pages/main/ctime/ctime.vue +++ b/h5/pages/main/ctime/ctime.vue @@ -124,25 +124,22 @@ orderInfo.value = response.data.info doctor_name.value = orderInfo.value.doctor //如果有核磁项目 - if (orderInfo.value.buy_info.nmr_list && orderInfo.value.buy_info.nmr_list.length > 0) { - itemSelected.value.type = 'nmr' - if(orderInfo.value.erxian_appointment_info.length>0){ - selectedTime.value = orderInfo.value.erxian_appointment_info[0].time //应该是核磁时间 - selectedDate.value = orderInfo.value.erxian_appointment_info[0].date //应该是核磁日期 - // nmr_date.value = orderInfo.value.erxian_appointment_info[0].date - // nmr_time.value = orderInfo.value.erxian_appointment_info[0].time - YuYueInfo.value.NmrInfo= orderInfo.value.erxian_appointment_info - } - - - NMRGetDayPlanListFunc() - } else { + // if (orderInfo.value.buy_info.nmr_list && orderInfo.value.buy_info.nmr_list.length > 0) { + // itemSelected.value.type = 'nmr' + // if(orderInfo.value.erxian_appointment_info.length>0){ + // selectedTime.value = orderInfo.value.erxian_appointment_info[0].time //应该是核磁时间 + // selectedDate.value = orderInfo.value.erxian_appointment_info[0].date //应该是核磁日期 + // YuYueInfo.value.NmrInfo= orderInfo.value.erxian_appointment_info + // YuYueInfo.value.NmrInfo=[] + // } + // NMRGetDayPlanListFunc() + // } else { itemSelected.value.type = 'tj' selectedTime.value = orderInfo.value.appointment_time selectedDate.value = orderInfo.value.appointment_date GetDayPlanListFunc() - } + //} tj_date.value = orderInfo.value.appointment_date tj_time.value = orderInfo.value.appointment_time @@ -201,15 +198,15 @@ NMRGetDayPlanListFunc() } if (type == 'tj') { - if (orderInfo.value.buy_info.nmr_list && orderInfo.value.buy_info.nmr_list.length > 0) { - if (YuYueInfo.value.NmrInfo[itemSelected.value.index].date == null || YuYueInfo.value.NmrInfo[itemSelected.value.index].time == null) { - uni.$lu.toast("请先预约为影像科项目选择时间"); - return false - } - } - if (tj_date.value == null) { - tj_date.value =YuYueInfo.value.NmrInfo[itemSelected.value.index].date - } + // if (orderInfo.value.buy_info.nmr_list && orderInfo.value.buy_info.nmr_list.length > 0) { + // if (YuYueInfo.value.NmrInfo[itemSelected.value.index].date == null || YuYueInfo.value.NmrInfo[itemSelected.value.index].time == null) { + // uni.$lu.toast("请先预约为影像科项目选择时间"); + // return false + // } + // } + // if (tj_date.value == null) { + // tj_date.value =YuYueInfo.value.NmrInfo[itemSelected.value.index].date + // } selectedTime.value = tj_time.value selectedDate.value = tj_date.value GetDayPlanListFunc()