改版婚检预约

main
yanzai 12 months ago
parent 32419f0f34
commit bbc2624bbc

@ -4,6 +4,9 @@ namespace App\Http\Controllers\API\H5;
use App\Http\Controllers\API\AspNetZhuanController;
use App\Http\Controllers\Controller;
use DateInterval;
use DatePeriod;
use DateTime;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
@ -18,6 +21,7 @@ class DoctorController extends Controller
$doctor_id = request('doctor_id');
$person_id = request('person_id');
$checkup_type = request('checkup_type');
$zhou_firstday = request('zhou_firstday');
if(!isset($person_id)) return \Yz::echoError1("用户id缺失");
$personInfo=DB::table('web_user_person')->where('id',$person_id)->first();
@ -28,8 +32,7 @@ class DoctorController extends Controller
$datesArray = [];
if (isset($date)) {
$datesArray[] = $date;
}
if (isset($month) and $month == 'all') {
}elseif(isset($month) and $month == 'all') {
// 循环30次每次获取一天后的日期
for ($i = 0; $i < 31; $i++) {
// 使用strtotime函数计算$i天后的日期然后用date函数格式化日期
@ -85,18 +88,33 @@ class DoctorController extends Controller
$keshi_sex=$keshi_sex_list[$value['KSID']];
}
if($keshi_sex==$personInfo->sex){
$list[] = [
'head_img' => 'data:image/jpeg;base64,' . $value['U_IMG'],
'name' => $value['U_NAME'],
'id' => $value['U_ID'],
'level' => $value['ZC_NAME'],
'hospital' => '',
'time' => $value['U_GDPB'],
'desc' => $value['U_JIANJIE'],
'keshiname'=>$keshiname,
'keshi_id'=>$value['KSID'],
'keshi_sex'=>$keshi_sex,
];
$is_paiban=false;
if(isset($res['paiban'])){
foreach ($res['paiban'] as $key => $date_value) {
foreach ($date_value as $key2 => $value2) {
if($value2['YSID']== $value['U_ID'] and $value2['KSID']==$value['KSID']){
$is_paiban=true;
break;
}
}
if($is_paiban) break;
}
}
if($is_paiban){
$list[] = [
'head_img' => 'data:image/jpeg;base64,' . $value['U_IMG'],
'name' => $value['U_NAME'],
'id' => $value['U_ID'],
'level' => $value['ZC_NAME'],
'hospital' => '',
'time' => $value['U_GDPB'],
'desc' => $value['U_JIANJIE'],
'keshiname'=>$keshiname,
'keshi_id'=>$value['KSID'],
'keshi_sex'=>$keshi_sex,
];
}
}
}
@ -112,8 +130,6 @@ class DoctorController extends Controller
$paiban[]=$value2;
}
}
}
$firstDay = date("Y-m-d", strtotime($month . "-01"));
// 获取当月的最后一天
@ -132,8 +148,31 @@ class DoctorController extends Controller
}
}
//7日内的日期
$startDate = new DateTime('today'); // 设置开始时间为今天
if(isset($zhou_firstday)){
$startDate = new DateTime($zhou_firstday);
}
$endDate = clone $startDate;
$endDate->modify('+6 days'); // 结束时间为今天之后的第6天
$period = new DatePeriod($startDate, new DateInterval('P1D'), $endDate);
$week7=[];
foreach ($period as $date) {
$f_date=$date->format('Y-m-d');
$xingqi=\App\Lib\Tools::GetWeekName($f_date);
$week7[]=[
'date'=>$f_date,
'xingqi'=>$xingqi
];
}
$f_date=$endDate->format('Y-m-d');
$xingqi=\App\Lib\Tools::GetWeekName($f_date);
$week7[] = [
'date'=>$f_date,
'xingqi'=>$xingqi
];
return \Yz::Return(true, "查询完成", ['list' => $list, 'paiban' => $dates]);
return \Yz::Return(true, "查询完成", ['list' => $list, 'paiban' => $dates, 'week7' => $week7]);
}
}

@ -72,6 +72,7 @@ class QuestionController extends Controller
if (!$user) return \Yz::echoError1('用户不存在');
$data=[
'userid'=>$user->id,
'personid'=>$person_id,
'q_type'=>3,
'content'=>!empty($content)?json_encode($content,JSON_UNESCAPED_UNICODE):[]
];

@ -191,8 +191,8 @@ class UserController extends Controller
'民族' => $res['MZ'] ?? '',
'现地址省市区' => $address_array,
'现地址' => $address,
'详细地址省市区' => $address_array,
'详细地址' => $address,
// '详细地址省市区' => $address_array,
// '详细地址' => $address,
'户籍地址省市区' => $address_array,
'户籍地址' => $address,
'工作单位' => "",
@ -203,9 +203,17 @@ class UserController extends Controller
'配偶证件类型' => 0,
'配偶证件号' => "",
'血缘关系' => "无",
'邮政编码' => "",
// '邮政编码' => "",
'手机号码' => $res['Mobile'] ?? '',
];
}
//查询日志是否曾经录入过婚检
$hunjianLog=DB::table("questions_log")->where(['personid'=>$person_id,'q_type'=>3])->orderBy('id','desc')->first();
if(!!$hunjianLog){
$person_info=json_decode($hunjianLog->content,true);
}
return \Yz::Return(true, '获取成功', [
'info' => $person_info

@ -15,8 +15,7 @@ use Illuminate\Support\Facades\Http;
class TestController extends Controller
{
public function DBtest(){
$a=$this->ApiTest();
dd($a->getContent());
//微信推送
// $data = [
// "ghzid" => "b3346cd4d63b49a58dbd9a41d69efde2",
@ -57,7 +56,44 @@ class TestController extends Controller
// }
//--------------
// $aspnet=new AspNetZhuanController();
$aspnet=new AspNetZhuanController();
//医生排班
$res = $aspnet->GetDoctorDateList([
"yyid" => 6,
"data" => ["2024-12-24",
"2024-12-25",
"2024-12-26",
"2024-12-27",
"2024-12-28",
"2024-12-29",
"2024-12-30",
"2024-12-31",
"2025-01-01",
"2025-01-02",
"2025-01-03",
"2025-01-04",
"2025-01-05",
"2025-01-06",
"2025-01-07",
"2025-01-08",
"2025-01-09",
"2025-01-10",
"2025-01-11",
"2025-01-12",
"2025-01-13",
"2025-01-14",
"2025-01-15",
"2025-01-16",
"2025-01-17",
"2025-01-18",
"2025-01-19",
"2025-01-20",
"2025-01-21",
"2025-01-22",
"2025-01-23"],
"action" => "1"
]);
dd($res);
//优惠券-----------------
// $data=[
// 'action'=>4,

@ -13,6 +13,7 @@ const $store = useStore();
let dqDate = ref("");
let yytjInfo = ref({}); //
let user_person=ref({});
let zhou_firstday=ref('');
const $props = defineProps({
date: {
type: String,
@ -24,7 +25,6 @@ const $props = defineProps({
},
});
const mountedAction = () => {
uni.showLoading({
title: "加载中",
@ -44,7 +44,7 @@ const mountedAction = () => {
}
};
const doctor_list = ref(false);
const week7=ref([])
const getdoctorList = async () => {
let c_type=$store.getCheckupTypeId()
//
@ -53,12 +53,17 @@ const getdoctorList = async () => {
date: dqDate.value,
month:$props.month,
person_id:user_person.value.person_id,
checkup_type:c_type.id
checkup_type:c_type.id,
zhou_firstday:zhou_firstday.value
};
uni.showLoading({
title: "加载中",
});
const response = await $api("DoctorGetList", obj);
$response(response, () => {
console.log(response, "response");
doctor_list.value = response.data.list;
week7.value=response.data.week7
uni.hideLoading();
});
};
@ -86,8 +91,60 @@ const clickDoctor = (item) => {
}
};
let selectedDate=ref("");
const selectDateFunc=(date)=>{
selectedDate.value=date
dqDate.value=date
getdoctorList()
}
let YueLiRef=ref(null);
//
const ClickMore=()=>{
YueLiRef.value.open()
}
const getToday = () => {
var today = new Date();
var year = today.getFullYear();
var month = (today.getMonth() + 1).toString().padStart(2, "0");
var day = today.getDate().toString().padStart(2, "0");
return year + "-" + month + "-" + day;
};
zhou_firstday.value=getToday()
let MonthList=ref([]);
const moreTime = async (m, status) => {
const [year, month, day] = currentDate.value.split("-");
let dqmonth = m || `${year}-${month}`; //
let obj = {};
let methods = "";
getdoctorList(`${year}-${month}`)
calendarShow.value = true;
};
const monthSwitch = (givenDate) => {
const currentYear = new Date().getFullYear();
const currentMonth = new Date().getMonth() + 1;
//
if (
givenDate.year < currentYear ||
(givenDate.year === currentYear && givenDate.month < currentMonth)
) {
// uni.$lu.toast("");
return false;
} else {
let str = `${givenDate.year}-${givenDate.month}`;
moreTime(str, 0);
}
};
//
const RiLiDateFunc=(e)=>{
console.log(e)
dqDate.value=e.fulldate
zhou_firstday.value=e.fulldate
getdoctorList()
}
onShow(() => {
selectedDate.value=''
dqDate.value=''
console.log($props.month);
if (!!config_ref.value) {
mountedAction();
@ -107,6 +164,21 @@ onShow(() => {
style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.04)"
class="pb-80rpx pt-30rpx rounded-15rpx bg-#fff"
>
<view class="zhou" v-if="week7.length>1">
<view class="day" v-for="(item,index) in week7">
<view :class="item.date==selectedDate?'day_top selected':'day_top'" @click="selectDateFunc(item.date)">
<view>{{item.date.split('-').slice(1).join('/')}}</view>
<view class="zhou_title">{{ item.xingqi.replace('星期', '周').replace('日', '天')}}</view>
</view>
</view>
<view class="xian_k">
<view class="xian"></view>
</view>
<view class="rili_icon" @click="ClickMore()">
<uni-icons type="calendar" style="font-size: 50rpx;" color="#239EA3"></uni-icons>
<text>更多</text>
</view>
</view>
<view v-if="doctor_list.length>0">
<view v-for="(item, index) in doctor_list" :key="index" class="p-10rpx">
<view class="flex flex-row text-#8B8B8B text-23rpx">
@ -143,6 +215,77 @@ onShow(() => {
</view>
</view>
</view>
<uni-calendar ref="YueLiRef" :selected="MonthList" :startDate="getToday()" :insert="false"
@confirm="RiLiDateFunc" @monthSwitch="monthSwitch" />
</view>
</template>
<style scoped></style>
<style scoped>
.zhou {
display: flex;
justify-content: space-between;
padding: 0rpx 20rpx 20rpx 20rpx;
}
.day {
display: flex;
flex-direction: column;
align-items: center;
font-size: 25rpx;
font-weight: 500;
color: #131313;
}
.day_top {
font-size: 24rpx;
font-weight: 500;
display: flex;
flex-direction: column;
align-items: center;
margin-top: 10rpx;
padding: 10rpx;
border-radius: 16rpx;
}
.selected {
background-color: #239EA3;
color: #fff !important;
}
.zhou_title {
font-size: 28rpx;
font-weight: 500;
margin-top: 6rpx;
}
.yu {
background-color: #EFEFEF;
margin-top: 8rpx;
border-radius: 10rpx;
padding: 2rpx 8rpx;
font-size: 22rpx;
}
.xian_k {
display: flex;
flex-direction: column;
justify-content: center;
}
.xian {
height: 70rpx;
border-left: 1px solid #d8d8d8;
}
.rili_icon {
font-size: 24rpx;
font-weight: 500;
display: flex;
flex-direction: column;
justify-content: center;
color: #239EA3;
font-weight: 500;
}
</style>

@ -66,6 +66,18 @@
if (!!response.data.info['姓名']) {
input_data.value = response.data.info
}
if (!!response.data.info['职业']) {
let index=zhiye_array.indexOf(response.data.info['职业'])
if(index != -1){
ZhiYeIndex.value=index
}
}
if (!!response.data.info['文化程度']) {
let index=wenhua_array.indexOf(response.data.info['文化程度'])
if(index != -1){
WenHuaIndex.value=index
}
}
form_show.value = true
})
}
@ -106,6 +118,14 @@
label: '其他'
},
]
const zhiye_array=[
"","国家公务员","专业技术人员","职员","企业管理人员","工人","农民","学生","现役军人","自由职业者","个体经营者","无业人员","退(离)休人员","其他"
]
const ZhiYeIndex=ref("");
const wenhua_array=[
"","小学","初中","高中","中专","大专","本科","其他"
]
const WenHuaIndex=ref("");
const getEndDate = () => {
const date = new Date();
@ -138,20 +158,20 @@
},
],
'现地址': "",
'详细地址省市区': [{
value: '11',
text: '北京市'
},
{
value: '1101',
text: '市辖区'
},
{
value: '110101',
text: '东城区'
},
],
'详细地址': "",
// '': [{
// value: '11',
// text: ''
// },
// {
// value: '1101',
// text: ''
// },
// {
// value: '110101',
// text: ''
// },
// ],
// '': "",
'户籍地址省市区': [{
value: '11',
text: '北京市'
@ -174,13 +194,21 @@
'配偶证件类型': 0,
'配偶证件号': "",
'血缘关系': "无",
'邮政编码': "",
// '': "",
'手机号码': "",
}
const input_data = ref(JSON.parse(JSON.stringify(input_data_default)))
const bindPickerChange = (e, key) => {
input_data.value[key] = e.detail.value
}
const bindZhiYePickerChange = (e,key) => {
ZhiYeIndex.value=e.detail.value
input_data.value[key] = zhiye_array[e.detail.value]
}
const bindWenHuaPickerChange = (e,key) => {
WenHuaIndex.value=e.detail.value
input_data.value[key] = wenhua_array[e.detail.value]
}
const bindDateChange = (e, key) => {
input_data.value[key] = e.detail.value
}
@ -261,8 +289,20 @@
</view>
</view>
</template>
<template v-else-if="k === ''">
<picker class="select_picker_wrapper" @change="(e)=>{bindWenHuaPickerChange(e, k)}" :value="WenHuaIndex"
:range="wenhua_array" >
<view>{{WenHuaIndex==""?"请选择文化程度":wenhua_array[WenHuaIndex]}}</view>
</picker>
</template>
<template v-else-if="k === ''">
<picker class="select_picker_wrapper" @change="(e)=>{bindZhiYePickerChange(e, k)}" :value="ZhiYeIndex"
:range="zhiye_array" >
<view>{{ZhiYeIndex==""?"请选择职业":zhiye_array[ZhiYeIndex]}}</view>
</picker>
</template>
<template v-else-if="k === ''">
<picker mode="date" :value="input_data[k]" :end="getEndDate" @change="(e)=>{bindDateChange(e, k)}">
<picker mode="date" :value="input_data[k]" :end="getEndDate()" @change="(e)=>{bindDateChange(e, k)}">
<view>{{ input_data[k] }}</view>
</picker>
</template>

Loading…
Cancel
Save