自动预约二线

main
yanzai 1 year ago
parent 023aa43bb1
commit f0726c5154

@ -565,13 +565,49 @@ class OrderController extends Controller
if ($orderInfo->hospital_id == 4) { if ($orderInfo->hospital_id == 4) {
$yyid = 2; $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'); // $ErXianKuaDu = config('app.globals.erxian_kuadu');
$check_erxian_kuadu=$this->checkDatesWithinDays($nmr_info,$ErXianKuaDu); // $check_erxian_kuadu=$this->checkDatesWithinDays($nmr_info,$ErXianKuaDu);
if(!$check_erxian_kuadu['check_status']) return \Yz::echoError1("所有二线项目预约跨度不应大于".$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); $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 ($nmr_info as $key=>$nmr_item){
foreach ($db_nmr_info as $db_nmr_item){ foreach ($db_nmr_info as $db_nmr_item){
if($nmr_item['item_id']==$db_nmr_item['item_id']){ if($nmr_item['item_id']==$db_nmr_item['item_id']){
@ -590,14 +626,6 @@ class OrderController extends Controller
continue; 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){ foreach ($nmr_info as $key=>$nmr_item){

@ -35,7 +35,7 @@ class PlanController extends Controller
$id =request('id'); $id =request('id');
$plan=DB::table('plans')->where('id',$id)->first(); $plan=DB::table('plans')->where('id',$id)->first();
if(!$plan) return \Yz::echoError1("该号源不存在"); 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]); $u=DB::table('plans')->where(['id'=>$id,'status'=>1])->update(['status'=>2]);
if($u){ if($u){

@ -124,25 +124,22 @@
orderInfo.value = response.data.info orderInfo.value = response.data.info
doctor_name.value = orderInfo.value.doctor doctor_name.value = orderInfo.value.doctor
// //
if (orderInfo.value.buy_info.nmr_list && orderInfo.value.buy_info.nmr_list.length > 0) { // if (orderInfo.value.buy_info.nmr_list && orderInfo.value.buy_info.nmr_list.length > 0) {
itemSelected.value.type = 'nmr' // itemSelected.value.type = 'nmr'
if(orderInfo.value.erxian_appointment_info.length>0){ // if(orderInfo.value.erxian_appointment_info.length>0){
selectedTime.value = orderInfo.value.erxian_appointment_info[0].time // // selectedTime.value = orderInfo.value.erxian_appointment_info[0].time //
selectedDate.value = orderInfo.value.erxian_appointment_info[0].date // // selectedDate.value = orderInfo.value.erxian_appointment_info[0].date //
// nmr_date.value = orderInfo.value.erxian_appointment_info[0].date // YuYueInfo.value.NmrInfo= orderInfo.value.erxian_appointment_info
// nmr_time.value = orderInfo.value.erxian_appointment_info[0].time // YuYueInfo.value.NmrInfo=[]
YuYueInfo.value.NmrInfo= orderInfo.value.erxian_appointment_info // }
} // NMRGetDayPlanListFunc()
// } else {
NMRGetDayPlanListFunc()
} else {
itemSelected.value.type = 'tj' itemSelected.value.type = 'tj'
selectedTime.value = orderInfo.value.appointment_time selectedTime.value = orderInfo.value.appointment_time
selectedDate.value = orderInfo.value.appointment_date selectedDate.value = orderInfo.value.appointment_date
GetDayPlanListFunc() GetDayPlanListFunc()
} //}
tj_date.value = orderInfo.value.appointment_date tj_date.value = orderInfo.value.appointment_date
tj_time.value = orderInfo.value.appointment_time tj_time.value = orderInfo.value.appointment_time
@ -201,15 +198,15 @@
NMRGetDayPlanListFunc() NMRGetDayPlanListFunc()
} }
if (type == 'tj') { if (type == 'tj') {
if (orderInfo.value.buy_info.nmr_list && orderInfo.value.buy_info.nmr_list.length > 0) { // 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) { // if (YuYueInfo.value.NmrInfo[itemSelected.value.index].date == null || YuYueInfo.value.NmrInfo[itemSelected.value.index].time == null) {
uni.$lu.toast("请先预约为影像科项目选择时间"); // uni.$lu.toast("");
return false // return false
} // }
} // }
if (tj_date.value == null) { // if (tj_date.value == null) {
tj_date.value =YuYueInfo.value.NmrInfo[itemSelected.value.index].date // tj_date.value =YuYueInfo.value.NmrInfo[itemSelected.value.index].date
} // }
selectedTime.value = tj_time.value selectedTime.value = tj_time.value
selectedDate.value = tj_date.value selectedDate.value = tj_date.value
GetDayPlanListFunc() GetDayPlanListFunc()

Loading…
Cancel
Save