继续改约

wenjuan
yanzai 1 year ago
parent 8ab7ed1228
commit 4401ed0f50

@ -64,6 +64,7 @@ class ApiMapController extends Controller
'AnalysisTypeGetList' => $base_url . '/api/H5/AnalysisTypeGetList',//趋势分析项目列表
'ReportAnalysis' => $base_url . '/api/H5/ReportAnalysis',//报告趋势详情
'HunQianQuestionSubmit' => $base_url . '/api/H5/HunQianQuestionSubmit',//婚前问卷提交
'ChangeAppointment' => $base_url . '/api/H5/ChangeAppointment',//改约
'FenzhenAbandon' => $base_url . '/api/H5/Fenzhen/abandon',// 分诊弃检
'FenzhenList' => $base_url . '/api/H5/Fenzhen/list',// 分诊时间线

@ -336,10 +336,10 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
'pay_item_count' => $pay_item_count,//需要付费的项目数量
'lose_price'=>number_format($lose_price, 2, '.', ''),//剩余的不用就会浪费的金额
'nmr_list' => [
// [
// 'item_id' => "1",
// "name" => "磁共振平扫(腰椎)"
// ]
[
'item_id' => "1",
"name" => "磁共振平扫(腰椎)"
]
]//核磁项目列表
];
return \Yz::Return(true, "查询成功", $data);

@ -315,6 +315,45 @@ class OrderController extends Controller
return \Yz::echoError1('操作失败');
}
}
//订单改约
public function ChangeAppointment()
{
$orderid = request('orderid');
$plan_id = request('planid');
$nmr_plan_id = request('nmrPlanid');
$doctor = request('doctor');
$orderInfo=DB::table('orders')->where(['id' => $orderid,'status'=>2])->first();
if(!$orderInfo) return \Yz::echoError1("未找到有效订单");
$planInfo = DB::table('plans')->where(['id' => $plan_id,'status'=>1])->first();
if(!$planInfo) return \Yz::echoError1("所选体检日期号源无效");
//判断核磁号源有效性能,日期范围是否正常,判断核磁新日期时间是否和旧的日期时间一样
//判断体检日期是否在核磁3天左右
//判断体检日期时间是否和旧的日期时间一样。一样则跳过,不一样则更新
if(isset($plan_id) && $plan_id<>$orderInfo->plan_id){
$peis = new PEISApiController();
$data="appointmentId=".$orderInfo->appointment_number."&appGroupId=66&appPlanId=".$plan_id."&appPlanNumber=".$planInfo->plan_number."&date=".urlencode($planInfo->date.' '.$planInfo->time);
$ch = $peis::Post2('修改用户预约时间', $peis::Api('修改用户预约时间',$data),$orderInfo->hospital_id,[]);
if($ch=='修改预约时刻保存成功'){
//恢复旧的plans
DB::table('plans')->where(['id' => $orderInfo->plan_id])->update(
['status'=>1]
);
//使用新的plans
DB::table('plans')->where(['id' => $plan_id])->update(
['status'=>2]
);
//更新订单
DB::table('orders')->where(['id' => $orderInfo->id])->update([
'plan_id'=>$plan_id,
'plan_number'=>$planInfo->plan_number,
'appointment_date'=>$planInfo->date,
'appointment_time'=>$planInfo->time,
]);
}
return \Yz::Return(true,"操作完成",[]);
}
return \Yz::echoError1("未更改内容,无需进行此操作");
}
public function generateOrderNumber()
{

@ -29,6 +29,7 @@ class PEISApiController extends Controller
$api['团检预约取消'] = "{$url}/PEISCommon/CancelUnitAppointment/{$code}";
$api['体检报告查询'] = "{$url}/PEISCommon/QueryExamReport/{$code}";
$api['预约时段修改'] = "{$url}/PEISCommon/ModifyAppointmentDTRange/{$code}";
$api['修改用户预约时间'] = "http://10.0.20.227:8888/ExtAPI/SetAppointmentMoment?key=YmMxOGI2MDUxZmFh&{$code}";
return $api["{$url_code}"] ?? $url_code;
}
@ -62,6 +63,52 @@ class PEISApiController extends Controller
if (!json_decode($res_string, true)) {
return \Yz::Return(false, '获取失败', [
'url' => $url,
'data' => $data,
'res' => $res_string
]);
}
$res = json_decode($res_string, true);
if ($res['ResultCode'] != 0){
throw new HttpResponseException( \Yz::echoError1("体检系统提示:". $res['ResultContent']));
}
return [
'code' => $res['ResultCode'],
'message' => $res['ResultContent'],
'data' => $res['Records']
];
}
public static function Post2($url_code,$url, $hospital_id, $data)
{
$hospital = DB::table('hospitals')->where(['id' => $hospital_id, 'status' => 1, 'is_del' => 0])->first();
if (!$hospital) return \Yz::echoError1('医院不存在或不可用');
$code = $hospital->code;
self::RequestLog($url, $data, $code, $url_code);
$data_string = json_encode($data, JSON_UNESCAPED_UNICODE);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json; charset=utf-8',
'Content-Length: ' . strlen($data_string)
]);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
$res_string = curl_exec($ch);
curl_close($ch);
$str_len = mb_strlen($res_string, 'utf-8');
$str_size = $str_len / 1024;
$save_res = $res_string;
if ($str_size > 10) $save_res = '{"data":"Row size too large"}';
self::$request->response_data = $save_res;
self::$request->save();
if (!json_decode($res_string, true)) {
return \Yz::Return(false, '获取失败', [
'url' => $url,

@ -64,6 +64,7 @@ Route::group(['middleware' => ['log'],'prefix' => 'api/H5'], function () {
Route::post('/CheckPay', 'App\Http\Controllers\API\H5\PayController@CheckPay');//支付结果查询接口
Route::post('/Refund', 'App\Http\Controllers\API\H5\PayController@Refund');//退款
Route::post('/GetOrderDetail', 'App\Http\Controllers\API\H5\OrderController@GetDetail');//获取订单详情
Route::post('/ChangeAppointment', 'App\Http\Controllers\API\H5\OrderController@ChangeAppointment');//改约
Route::post('/ReportContrast', 'App\Http\Controllers\API\H5\ReportController@contrast');//报告对比
Route::post('/ReportAnalysis', 'App\Http\Controllers\API\H5\ReportController@Analysis');//报告趋势
Route::post('/AnalysisTypeGetList', 'App\Http\Controllers\API\H5\AnalysisTypeController@GetList');//趋势分析项目列表

@ -199,9 +199,7 @@
}
itemSelected.value = type
}
const StartYuYue = () => {
console.log(tj_plan_id.value, tj_time.value);
}
let DoctorMonthCalendar = ref(null)
const selectDoctor = () => {
if (orderInfo.value.buy_info.nmr_list && orderInfo.value.buy_info.nmr_list.length > 0) {
@ -231,7 +229,6 @@
let currentDate = ref(null); //
const monthSwitch = (e) => { //
let ym=e.year+""+"-"+e.month+""
console.log(e);
if (itemSelected.value == 'nmr') {
NMRGetMonthPlanListFunc(ym)
}
@ -240,7 +237,24 @@
}
}
const MonthConfirm = (e) => { //
console.log(e.fulldate)
selectedDate.value=e.fulldate
selectedTime.value = null
if (itemSelected.value == 'nmr') {
nmr_time.value = null
nmr_date.value = e.fulldate
tj_time.value = null //
tj_date.value = null
doctor_name.value = null //
NMRGetDayPlanListFunc()
}
if (itemSelected.value == 'tj') {
tj_time.value = null
tj_date.value = e.fulldate
doctor_name.value = null //
GetDayPlanListFunc()
}
}
//
const GetMonthPlanListFunc = async (ym='') => {
@ -300,6 +314,33 @@
}
MonthCalendar.value.open()
}
//
const StartYuYue = async() => {
if(tj_time.value==null){
uni.$lu.toast("请选择体检日期");
return false
}
console.log(tj_plan_id.value);
uni.showLoading();
let data = {
orderid: orderInfo.value.id,
planid: tj_plan_id,
nmrPlanid:nmr_plan_id,
doctor: doctor_name.value
}
const response = await $api("ChangeAppointment", data);
uni.hideLoading();
$response(response, () => {
if(response.status){
uni.showToast({
title: '改约完成'
});
uni.redirectTo({
url:'/pages/main/order/order'
})
}
});
}
let temp = null
onMounted(() => {

@ -261,7 +261,7 @@
</view>
</view>
</view>
<view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">10082019</view>
<view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">10111124</view>
</view>
</view>
</template>

@ -188,8 +188,8 @@ onMounted(() => {
class="button_item_wrapper pay_button_wrapper"
>继续付款</view
>
<!-- <view v-if="[2].includes(order_info.status)" class="button_item_wrapper change_button_wrapper">
改约</view> -->
<view v-if="[2].includes(order_info.status)" class="button_item_wrapper change_button_wrapper">
改约</view>
<view
v-if="[2].includes(order_info.status)"
@click="Refound(order_info.id)"

Loading…
Cancel
Save