调整转赠,输入手机号按建档信息转赠

main
yanzai 10 months ago
parent eccc131edf
commit cce02df7e3

@ -92,6 +92,7 @@ class ApiMapController extends Controller
'CreateTransferCode' => $base_url . '/api/H5/CreateTransferCode', // 创建转赠码 'CreateTransferCode' => $base_url . '/api/H5/CreateTransferCode', // 创建转赠码
'OrderZhuanZeng' => $base_url . '/api/H5/OrderZhuanZeng', // 订单转赠 'OrderZhuanZeng' => $base_url . '/api/H5/OrderZhuanZeng', // 订单转赠
'OrderReceiveZhuanZeng' => $base_url . '/api/H5/OrderReceiveZhuanZeng', // 接受订单转赠 'OrderReceiveZhuanZeng' => $base_url . '/api/H5/OrderReceiveZhuanZeng', // 接受订单转赠
'GetPersonJianDangInfo' => $base_url . '/api/H5/GetPersonJianDangInfo', // 根据多种条件查询建档信息
]; ];
} }

@ -115,6 +115,11 @@ class AspNetZhuanController extends Controller
if($data['action']==2) return $res; if($data['action']==2) return $res;
return $res['data'] ?? false; return $res['data'] ?? false;
} }
public static function GetPersonInfo2($data)
{
$res= self::Post(self::$BaseUrl . '/renyuan.aspx',$data,'获取人员档案');
return $res['data'] ?? false;
}
//获取报告解读日期和状态 //获取报告解读日期和状态
public static function GetReportAnalysis($data) public static function GetReportAnalysis($data)
{ {

@ -521,10 +521,9 @@ class OrderNewController extends Controller
public function ZhuanZeng() public function ZhuanZeng()
{ {
$order_id = request('order_id'); $order_id = request('order_id');
$person_id = request('person_id'); $person = request('person_info');
$openid = request('openid'); $openid = request('openid');
$person=DB::table('web_user_person')->where(['id'=>$person_id,'is_del'=>0])->first(); if(!isset($person)) return \Yz::echoError1("转赠人不能为空");
if(!$person) return \Yz::echoError1('转赠用户不存在');
$user = DB::table('web_users')->where(['openid' => $openid, 'status' => 1, 'is_del' => 0])->first(); $user = DB::table('web_users')->where(['openid' => $openid, 'status' => 1, 'is_del' => 0])->first();
if (!$user) return \Yz::echoError1('用户不存在'); if (!$user) return \Yz::echoError1('用户不存在');
$order = DB::table('orders') $order = DB::table('orders')
@ -540,7 +539,7 @@ class OrderNewController extends Controller
})->first(); })->first();
if(!$order) return \Yz::echoError1('此订单无法转赠他人'); if(!$order) return \Yz::echoError1('此订单无法转赠他人');
if($order->web_user_id<>$user->id) return \Yz::echoError1('无权操作此订单'); if($order->web_user_id<>$user->id) return \Yz::echoError1('无权操作此订单');
if($order->person_id==$person_id) return \Yz::echoError1('被转赠人不能和原用户相同'); if($order->id_number==$person['ID_No']) return \Yz::echoError1('被转赠人不能和原用户相同');
//查询转赠码表是否生成了对应的转赠码 //查询转赠码表是否生成了对应的转赠码
$transfer_code=DB::table('transfer_code')->where(['link_order_id'=>$order->id,'is_del'=>0])->first(); $transfer_code=DB::table('transfer_code')->where(['link_order_id'=>$order->id,'is_del'=>0])->first();
if(!!$transfer_code) return \Yz::echoError1('此订单已生成转赠码,无法再次转赠'); if(!!$transfer_code) return \Yz::echoError1('此订单已生成转赠码,无法再次转赠');
@ -552,7 +551,7 @@ class OrderNewController extends Controller
if($comboDetail_sex=='全部') $comboDetail_sex=0; if($comboDetail_sex=='全部') $comboDetail_sex=0;
if($comboDetail_sex=='男') $comboDetail_sex=1; if($comboDetail_sex=='男') $comboDetail_sex=1;
if($comboDetail_sex=='女') $comboDetail_sex=2; if($comboDetail_sex=='女') $comboDetail_sex=2;
if($comboDetail_sex <> 0 and $comboDetail_sex <> $person->sex) return \Yz::echoError1('性别不符,此套餐不适合转赠给此用户'); if($comboDetail_sex <> 0 and $comboDetail_sex <> $person['Patsexid']) return \Yz::echoError1('性别不符,此套餐不适合转赠给此用户');
DB::beginTransaction(); DB::beginTransaction();
$now_datetime=date('Y-m-d H:i:s'); $now_datetime=date('Y-m-d H:i:s');
@ -563,8 +562,8 @@ class OrderNewController extends Controller
'web_user_id' => 0, 'web_user_id' => 0,
'checkup_type_id' => $order->checkup_type_id, 'checkup_type_id' => $order->checkup_type_id,
'person_id' => 0, 'person_id' => 0,
'name' => $person->name, 'name' => $person['Patname'],
'id_number' => $person->id_number, 'id_number' => $person['ID_No'],
'buy_info' => $order->buy_info, 'buy_info' => $order->buy_info,
'price' => $order->price, 'price' => $order->price,
'true_price' =>$order->true_price, 'true_price' =>$order->true_price,
@ -573,10 +572,10 @@ class OrderNewController extends Controller
'erxian_appointment_info' => $order->erxian_appointment_info, 'erxian_appointment_info' => $order->erxian_appointment_info,
'combo_id' => $order->combo_id, 'combo_id' => $order->combo_id,
'hospital_id' => $order->hospital_id, 'hospital_id' => $order->hospital_id,
'phone' => $person->phone, 'phone' => $person['Fixphone'],
'sex' => $person->sex, 'sex' => $person['Patsexid'],
'birthday' => $person->birthday, 'birthday' => $this->formatDate($person['Patbdate']),
'married' => $person->married, 'married' => 0,
'created_at' => $now_datetime, 'created_at' => $now_datetime,
'paycheck_time' => $now_datetime 'paycheck_time' => $now_datetime
]; ];
@ -633,4 +632,12 @@ class OrderNewController extends Controller
return $orderNumber; return $orderNumber;
} }
function formatDate($dateString) {
$dateTime = DateTime::createFromFormat('Y/n/j G:i:s', $dateString);
// 检查是否有错误发生
if (!$dateTime || $dateTime->format('Y/n/j G:i:s') !== $dateString) {
return "1900-01-01";
}
return $dateTime->format('Y-m-d');
}
} }

@ -31,6 +31,30 @@ class UserController extends Controller
return \Yz::echoError1('身份证不能为空'); return \Yz::echoError1('身份证不能为空');
} }
} }
//获取建档信息
public function GetPersonJianDangInfo(Request $request)
{
$sfz = $request->post('sfz');
$tel = $request->post('tel');
$dnet = new AspNetZhuanController();
$data=[];
if(isset($sfz)) {
$data=[
"zjh" => $sfz,
"action" => "2",
"ghzid" => ""
];
}
if(isset($tel)) {
$data=[
"sjh" => $tel,
"action" => "3",
"ghzid" => ""
];
}
$res = $dnet->GetPersonInfo2($data);
return \Yz::Return(true,"查询完成",['info'=>$res]);
}
public function hunjian(Request $request) public function hunjian(Request $request)
{ {
$person_id = $request->post('person_id'); $person_id = $request->post('person_id');

@ -73,6 +73,7 @@ Route::group(['middleware' => ['log'],'prefix' => 'api/H5'], function () {
Route::post('/AnalysisTypeGetList', 'App\Http\Controllers\API\H5\AnalysisTypeController@GetList');//趋势分析项目列表 Route::post('/AnalysisTypeGetList', 'App\Http\Controllers\API\H5\AnalysisTypeController@GetList');//趋势分析项目列表
Route::post('/HunQianQuestionSubmit', 'App\Http\Controllers\API\H5\QuestionController@HunQianQuestionSubmit');//婚前问卷提交 Route::post('/HunQianQuestionSubmit', 'App\Http\Controllers\API\H5\QuestionController@HunQianQuestionSubmit');//婚前问卷提交
Route::post('/hunjianBySFZ', 'App\Http\Controllers\API\H5\UserController@hunjianBySFZ');//根据身份证查询建档信息 Route::post('/hunjianBySFZ', 'App\Http\Controllers\API\H5\UserController@hunjianBySFZ');//根据身份证查询建档信息
Route::post('/GetPersonJianDangInfo', 'App\Http\Controllers\API\H5\UserController@GetPersonJianDangInfo');//根据多种条件查询建档信息
Route::post('/CheckedSignIn', 'App\Http\Controllers\API\H5\OrderController@CheckedSignIn');//检后签到 Route::post('/CheckedSignIn', 'App\Http\Controllers\API\H5\OrderController@CheckedSignIn');//检后签到
Route::post('/SendMsgCode', 'App\Http\Controllers\API\SendMsgCodeController@SendMsgCode');//发送验证码 Route::post('/SendMsgCode', 'App\Http\Controllers\API\SendMsgCodeController@SendMsgCode');//发送验证码
Route::post('/CheckMsgCode', 'App\Http\Controllers\API\SendMsgCodeController@CheckMsgCode');//验证验证码 Route::post('/CheckMsgCode', 'App\Http\Controllers\API\SendMsgCodeController@CheckMsgCode');//验证验证码

@ -135,6 +135,7 @@
if (response.status) { if (response.status) {
OrderInfoDetail.value = response.data.info OrderInfoDetail.value = response.data.info
TransferPopupRef.value.open() TransferPopupRef.value.open()
ZhuanZengType.value=0
} }
}) })
} }
@ -157,11 +158,13 @@
} }
}) })
} }
let ZhuanZengType=ref(0);
// //
const ZhuanZengPerson=async()=>{ const ZhuanZengPerson=async(type)=>{
uni.navigateTo({ ZhuanZengType.value=type
url: "/pages/user/choose/choose?do=transfer&orderid="+OrderInfoDetail.value.id // uni.navigateTo({
}); // url: "/pages/user/choose/choose?do=transfer&orderid="+OrderInfoDetail.value.id
// });
} }
// //
const ReceiveZhuanZeng=async()=>{ const ReceiveZhuanZeng=async()=>{
@ -200,6 +203,62 @@
} }
}) })
} }
let SearchUserInfo=ref('');
let JianDangPersonList=ref([]);
const GetPersonJianDangInfo=async()=>{
uni.showLoading();
const response = await $api("GetPersonJianDangInfo", {
tel: SearchUserInfo.value,
});
uni.hideLoading();
$response(response, () => {
if (response.status) {
JianDangPersonList.value= response.data.info
ShowJianDangPersonList()
}
})
}
//
const ShowJianDangPersonList=()=>{
let temp=[]
JianDangPersonList.value.forEach((v,i)=>{
temp.push(v.Patname)
})
uni.showActionSheet({
itemList: temp,
success: function (res) {
TransferPopupRef.value.close()
ZhuanZengChoosePersonClick(JianDangPersonList.value[res.tapIndex])
// console.log('' + (res.tapIndex + 1) + '');
},
fail: function (res) {
console.log(res.errMsg);
}
});
}
//
const ZhuanZengChoosePersonClick=async(info)=>{
uni.showLoading();
const response = await $api("OrderZhuanZeng", {
order_id: OrderInfoDetail.value.id,
person_info:info
});
uni.hideLoading();
$response(response, () => {
if (response.status) {
uni.showToast({
title: '转赠成功'
});
setTimeout(()=>{
uni.redirectTo({
url: "/pages/main/order/order"
});
},1000)
}
})
}
onMounted(() => { onMounted(() => {
deepInfo(); deepInfo();
}); });
@ -208,8 +267,12 @@
<view> <view>
<uni-popup ref="TransferPopupRef" style="z-index: 999;"> <uni-popup ref="TransferPopupRef" style="z-index: 999;">
<view class="tishi_main"> <view class="tishi_main">
<view v-if="OrderInfoDetail.transfer_type==null || OrderInfoDetail.transfer_type==''"> <view v-if="ZhuanZengType==1">
<view @click="ZhuanZengPerson()" class="tishi_button">指定转赠人</view> <view ><uni-easyinput v-model="SearchUserInfo" placeholder="请输入手机号"></uni-easyinput></view>
<view @click="GetPersonJianDangInfo()" class="tishi_button">查询</view>
</view>
<view v-if="(OrderInfoDetail.transfer_type==null || OrderInfoDetail.transfer_type=='') && ZhuanZengType!=1">
<view @click="ZhuanZengPerson(1)" class="tishi_button">指定转赠人</view>
<view @click="CreateTransferCode()" class="tishi_button">生成转赠码</view> <view @click="CreateTransferCode()" class="tishi_button">生成转赠码</view>
</view> </view>
<view v-if="OrderInfoDetail.transfer_type==2"> <view v-if="OrderInfoDetail.transfer_type==2">

@ -37,9 +37,32 @@ const configRef = (e) => {
getPersonList(); getPersonList();
} }
}; };
const getUserInfo = async () => {
const response = await $api("UserInfo");
$response(response, () => {
// $store.user = response.data.info
$store.setUser(response.data.info);
$store.setYytjInfo({}); //
let buyinfo=$store.getBuyInfo()
buyinfo.person_id=response.data.info.person_id
$store.setBuyInfo(buyinfo);
// uni.$lu.toast("");
// uni.navigateBack({
// delta: 1,
// });
});
};
const choosePersonClick = async (info) => { const choosePersonClick = async (info) => {
uni.showLoading(); uni.showLoading();
const response1 = await $api("SetDefaultPerson", {
person_id: info.id,
});
$response(response1, () => {
getUserInfo();
});
// ID // ID
const response = await $api("GetGroupUnit", { const response = await $api("GetGroupUnit", {
hospital_id: $store.save.hospital, hospital_id: $store.save.hospital,

@ -11,17 +11,6 @@ import { onShow } from "@dcloudio/uni-app";
import { useStore } from "@/store"; import { useStore } from "@/store";
const $store = useStore(); const $store = useStore();
const $props = defineProps({
do: {
type: String,
default: "",
},
orderid: {
type: String,
default: "",
},
})
const person_list = ref([]); const person_list = ref([]);
const getPersonList = async () => { const getPersonList = async () => {
const response = await $api("GetPersonList"); const response = await $api("GetPersonList");
@ -54,18 +43,7 @@ const getUserInfo = async () => {
}); });
}); });
}; };
const choosePersonClick = async (info) => {
if($store.getBuyInfo().combo_sex && info.sex != 0 && info.sex != $store.getBuyInfo().combo_sex ){
uni.$lu.toast("当前套餐性别与此用户不符,不能预约");
return false;
}
const response = await $api("SetDefaultPerson", {
person_id: info.id,
});
$response(response, () => {
getUserInfo();
});
};
const ZhuanZengChoosePersonClick=async(info)=>{ const ZhuanZengChoosePersonClick=async(info)=>{
uni.showLoading(); uni.showLoading();
const response = await $api("OrderZhuanZeng", { const response = await $api("OrderZhuanZeng", {
@ -118,11 +96,7 @@ onShow(() => {
@click="choosePersonClick(i)" @click="choosePersonClick(i)"
class="person_choose_wrapper" class="person_choose_wrapper"
>切换</view> >切换</view>
<view
v-if="$props.do === 'transfer'"
@click="ZhuanZengChoosePersonClick(i)"
class="person_choose_wrapper"
>转赠</view>
</view> </view>
</view> </view>
</view> </view>

Loading…
Cancel
Save