更新 体检分诊联动

wenjuan
鹿和sa0ChunLuyu 1 year ago
parent 4401ed0f50
commit 2b8d8fde58

@ -3,11 +3,16 @@
namespace App\Http\Controllers\API\H5;
use App\Http\Controllers\Controller;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
class FenzhenController extends Controller
{
public static $url = 'https://lkt3.work.cjy.net.cn';
public static $log = null;
public function abandon()
{
// 这里放 弃检逻辑
@ -29,75 +34,112 @@ class FenzhenController extends Controller
$info = DB::table('orders')->where(['id' => $id])->whereIn('status', [2, 4])->first();
if (!$info) return \Yz::echoError1("查询就诊人订单失败");
$end_time = date('H:i', strtotime($info->appointment_date . ' ' . $info->appointment_time) + (60 * 60 * 0.54));
return \Yz::Return(true, "获取成功", [
'info' => [
'name' => $info->name,
'sex' => $info->sex,
'combo_name' => $info->title,
'check_date' => $info->appointment_date,
'start_time' => $info->appointment_time,
'end_time' => $end_time,
'qrcode' => '',
'code' => $info->appointment_number, // 体检条码
],
'list' => [[
'time' => '08:25',
'name' => '体检登记',
'status' => 4,
'desc' => '已完成',
'tip' => '体检登记 2024-08-09 08:25:30',
'more' => 0
], [
'time' => '08:30',
'name' => '体格检查',
'status' => 4,
'desc' => '已完成',
'tip' => '体格检查 2024-08-09 08:30:33',
'more' => 0
$res = self::fz('time', [
'exam_id' => $info->tj_number ?? '??????????',
'start_time' => date('H:i', strtotime($info->appointment_date . ' ' . $info->appointment_time)),
'clinics' => [[
"name" => "外科诊室",
"count" => 3
], [
'time' => '08:50',
'name' => '超声科',
'status' => 2,
'desc' => '第5位预计等待 11 分钟',
'tip' => '腹部彩超',
'more' => 0
], [
'time' => '09:20',
'name' => '心电图',
'status' => 1,
'desc' => '预计 09:20 进入队列',
'tip' => '剩余5项正在排队中',
'more' => 1
], [
'time' => $end_time,
'name' => '体检结束',
"name" => "内科诊室",
"count" => 3
]]
]);
if (!!$res) {
$time_line = $res['data']['time_line'];
$check_report_status = -1;
if (!!$res['data']['report']) {
$report_time = date('m月d日', strtotime($res['data']['report'] . ' 00:00:00') + (60 * 60 * 24 * 5));
$report_status = false;
// 这里补充 获取 出具报告 时间的逻辑
if (!$report_status) {
$time_line[] = [
'time' => '',
'name' => '出具报告',
'status' => -1,
'desc' => '用餐时间 ' . $end_time,
'desc' => "预计 $report_time 出具体检报告",
'tip' => '',
'more' => 0
], [
];
} else {
$time_line[] = [
'time' => '',
'name' => '出具报告',
'status' => -1,
'desc' => '预计 9月23日 出具体检报告',
'desc' => "已出具体检报告 $report_status",
'tip' => '',
'more' => 0
], [
];
}
$check_report_status = 0;
// $check_report_status = '2024年10月11日';
// 这里补充 获取 报告解读 时间的逻辑
if ($check_report_status == 0) {
$check_report_time = date('m月d日', strtotime($res['data']['report'] . ' 00:00:00') + (60 * 60 * 24 * 6));
$time_line[] = [
'time' => '',
'name' => '报告解读',
'status' => -1,
'desc' => '预计 9月24日 可以预约报告解读',
'desc' => "预计 $check_report_time 可以预约报告解读",
'tip' => '',
'more' => 0
]],
];
} else {
$show_date = explode('年', $check_report_status)[1];
$time_line[] = [
'time' => '',
'name' => '报告解读',
'status' => -1,
'desc' => "已预约 $show_date 报告解读",
'tip' => '',
'more' => 0
];
}
}
return \Yz::Return(true, "获取成功", [
'info' => [
'name' => $info->name,
'sex' => $info->sex,
'combo_name' => $info->title,
'check_date' => $info->appointment_date,
'start_time' => $res['data']['start_time'] . ':00',
'end_time' => $res['data']['end_time'],
'qrcode' => '',
'code' => $info->appointment_number,
],
'list' => $time_line,
'report' => $check_report_status,
]);
} else {
return \Yz::Return(true, "获取成功", [
'info' => [
'name' => $info->name,
'sex' => $info->sex,
'combo_name' => $info->title,
'check_date' => $info->appointment_date,
'start_time' => $info->appointment_time,
'end_time' => $end_time,
'qrcode' => '',
'code' => $info->appointment_number,
],
'list' => [],
'report' => -1,
]);
}
}
public function info()
{
$id = request('id');
$clinic = request('clinic');
$info = DB::table('orders')->where(['id' => $id])->whereIn('status', [2, 4])->first();
if (!$info) return \Yz::echoError1("查询就诊人订单失败");
$res = self::fz('info', [
'exam_id' => $info->tj_number ?? '??????????',
'clinic' => $clinic,
]);
if (!!$res) {
if ($res['code'] == 200) {
return \Yz::Return(true, "获取成功", [
'info' => [
'name' => $info->name,
@ -107,34 +149,79 @@ class FenzhenController extends Controller
'start_time' => $info->appointment_time,
'end_time' => '10:25',
'qrcode' => '',
'code' => $info->appointment_number, // 体检条码
'code' => $info->appointment_number,
],
'list' => [[
'id' => '1',
'time' => '2024.09.11 08:25',
'name' => '超声科-颈部血管彩超',
'status' => 4,
], [
'id' => '1',
'time' => '2024.09.11 08:25',
'name' => '内科-内科问诊',
'status' => 4,
], [
'id' => '1',
'time' => '2024.09.11 08:25',
'name' => '内科-内科问诊',
'status' => 1,
], [
'id' => '1',
'time' => '2024.09.11 08:25',
'name' => '内科-内科问诊',
'status' => 1,
], [
'id' => '1',
'time' => '2024.09.11 08:25',
'name' => '内科-内科问诊',
'status' => 1,
]],
'list' => $res['data']['list'],
]);
} else {
return \Yz::Return(false, $res['message']);
}
} else {
return \Yz::Return(false, "获取失败");
}
}
public function post($url, $data)
{
$data_string = json_encode($data, JSON_UNESCAPED_UNICODE);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
'Content-Type: application/json; charset=utf-8',
'Content-Length: ' . strlen($data_string),
'Authorization: Bearer BD30333C-CBD4-4BA3-A27C-76727FF4D8B1'
]);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);
$r = curl_exec($curl);
curl_close($curl);
return $r;
}
public function fz($type, $content)
{
$date = date('Y-m-d');
self::CheckTableName(date('Y-m-d'));
self::$log->date = $date;
self::$log->type = $type;
self::$log->content = json_encode($content, JSON_UNESCAPED_UNICODE);
self::$log->callback = '{}';
self::$log->save();
$url_map = [
'time' => '/api/Open/TiJian/get',
'info' => '/api/Open/TiJian/info',
];
$url = self::$url;
$res = self::post("$url{$url_map[$type]}", $content);
// /api/Open/TiJian/get
self::$log->callback = $res;
self::$log->save();
if (json_decode($res)) {
return json_decode($res, true);
} else {
return false;
}
}
public static function CheckTableName($date)
{
$table_name = 'zz_fenzhen_log_' . date('ym', strtotime($date));
$table_count = DB::select('select count(1) as c from information_schema.TABLES where table_schema = ? and table_name = ?', [env('DB_DATABASE'), $table_name])[0];
if ($table_count->c === 0) {
Schema::create($table_name, function (Blueprint $table) {
$table->id();
$table->date('date')->index();
$table->string('type', 20)->index();
$table->longText('content');
$table->longText('callback');
$table->timestamps();
});
}
self::$log = new \App\Models\FenzhenLog;
self::$log->setTable($table_name);
return $table_name;
}
}

@ -0,0 +1,10 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class FenzhenLog extends Model
{
use HasFactory;
}

@ -5,10 +5,19 @@ import DraggableButton from "@/pages/components/goHome.vue";
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import { ref } from "vue";
import { $api, $response } from "@/api";
import { onShow } from "@dcloudio/uni-app";
import { useStore } from "@/store";
import {
ref
} from "vue";
import {
$api,
$response
} from "@/api";
import {
onShow
} from "@dcloudio/uni-app";
import {
useStore
} from "@/store";
const $store = useStore();
const $props = defineProps({
id: {
@ -41,9 +50,9 @@ const configRef = (e) => {
}
};
const toRouter = () => {
const toRouter = (clinic) => {
uni.navigateTo({
url: "/pages/user/fenzhen/xindiantu?id=" + $props.id,
url: "/pages/user/fenzhen/xindiantu?id=" + $props.id + '&clinic=' + clinic,
});
};
@ -71,6 +80,12 @@ const tipShowClick = () => {
}
};
const toReport = () => {
wx.miniProgram.navigateTo({
url: '/pages/other/entry/index?path=/pages/outpatient/doctor-appointment/index&scene=1035&hospitalAreaId=6&departmentCode=A0030077&subDepartmentCode=4773794195699464904'
})
}
onShow(() => {
if (!!config_ref.value) {
mountedAction();
@ -92,18 +107,13 @@ onShow(() => {
</view>
</view>
<view v-if="!!fenzhen_list">
<view
class="order_info_wrapper relative"
>
<w-qrcode
v-if="fenzhen_list.info.qrcode"
class="absolute top-20rpx right-15rpx b-1 b-dashed b-#000 p-8rpx"
<view class="order_info_wrapper relative">
<w-qrcode v-if="fenzhen_list.info.qrcode" class="absolute top-20rpx right-15rpx b-1 b-dashed b-#000 p-8rpx"
:options="{
level: 4,
size: 130,
code: fenzhen_list.info.qrcode,
}"
></w-qrcode>
}"></w-qrcode>
<view class="person_name_wrapper">
<view class="person_name_text_wrapper">{{
fenzhen_list.info.name
@ -145,21 +155,15 @@ onShow(() => {
<view class="tip_icon_wrapper">
<image src="@/static/assets/fenzhen/tip@2x.png"></image>
</view>
<view class="tip_text_wrapper"
>尊敬的客户为了使您的体检流程更加顺畅请按以下步骤提
示顺序逐项完成体检</view
>
<view class="tip_text_wrapper">尊敬的客户为了使您的体检流程更加顺畅请按以下步骤提
示顺序逐项完成体检</view>
</view>
</view>
<view class="time_line_wrapper">
<view class="time_line_title_wrapper">自助导检</view>
<view class="time_line_box_wrapper">
<view
class="time_line_item_wrapper"
:class="[`time_line_item-${i.status}_wrapper`]"
v-for="(i, k) in fenzhen_list.list"
:key="k"
>
<view class="time_line_item_wrapper" :class="[`time_line_item-${i.status}_wrapper`]"
v-for="(i, k) in fenzhen_list.list" :key="k">
<view class="time_line_item_time_wrapper">
<view v-if="!!i.time" class="time_line_item_time_value_wrapper">{{
i.time
@ -167,39 +171,28 @@ onShow(() => {
<view class="time_line_item_time_dot_wrapper">
<view class="time_line_item_time_dot_in_wrapper"></view>
</view>
<view
v-if="!!i.time"
class="time_line_item_time_line_wrapper"
></view>
<view
v-if="!i.time"
class="time_line_item_time_cover_wrapper"
></view>
<view v-if="!!i.time" class="time_line_item_time_line_wrapper"></view>
<view v-if="!i.time" class="time_line_item_time_cover_wrapper"></view>
</view>
<view class="time_line_item_content_wrapper">
<view class="time_line_item_triangle_wrapper"></view>
<view class="time_line_item_flex_wrapper">
<view class="time_line_item_title_wrapper"
>{{ k + 1 }}.{{ i.name }}</view
>
<view class="time_line_item_title_wrapper">{{ k + 1 }}.{{ i.name }}</view>
<view class="time_line_item_box_wrapper">{{ i.desc }}</view>
</view>
<view
v-if="!!i.time && !!i.tip"
class="time_line_item_line_wrapper"
></view>
<view
v-if="!!i.time && !!i.tip"
class="time_line_item_flex_wrapper"
>
<view v-if="!!i.time && !!i.tip" class="time_line_item_line_wrapper"></view>
<view v-if="!!i.time && !!i.tip" class="time_line_item_flex_wrapper">
<view class="time_line_item_text_wrapper">{{ i.tip }}</view>
<view
v-if="i.more > 0"
class="time_line_item_more_wrapper"
@click="toRouter()"
>查看详情>></view
>
<view v-if="i.more !== 0" class="time_line_item_more_wrapper" @click="toRouter(i.more)">>></view>
</view>
</view>
</view>
<view v-if="fenzhen_list.report !== -1" class="report_wrapper">
<view v-if="fenzhen_list.report !== 0" class="report_tip_wrapper">
已预约 {{ fenzhen_list.report }} 报告解读
</view>
<view v-else @click="toReport()" class="report_button_wrapper">
预约解读
</view>
</view>
</view>
@ -208,6 +201,32 @@ onShow(() => {
</view>
</template>
<style scoped>
.report_tip_wrapper {
font-weight: 500;
font-size: 28rpx;
color: #239EA3;
line-height: 90rpx;
margin-right: 29rpx;
}
.report_wrapper {
display: flex;
justify-content: end;
}
.report_button_wrapper {
width: 200rpx;
height: 60rpx;
background: #239ea3;
border-radius: 30rpx;
font-size: 24rpx;
color: #ffffff;
line-height: 60rpx;
text-align: center;
margin-right: 29rpx;
margin-top: 50rpx;
}
.tip_dialog_text_wrapper {
max-height: calc(100vh - 600rpx);
overflow-y: auto;
@ -268,6 +287,11 @@ onShow(() => {
color: #6e6e6e;
line-height: 1;
margin-left: 42rpx;
width: calc(100% - 210rpx);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.time_line_item_line_wrapper {

@ -5,26 +5,53 @@ import DraggableButton from "@/pages/components/goHome.vue";
* usersa0ChunLuyu
* date2024年9月11日 19:24:50
*/
import { ref } from "vue";
import { $api, $response } from "@/api";
import { onShow } from "@dcloudio/uni-app";
import { useStore } from "@/store";
import {
ref
} from "vue";
import {
$api,
$response
} from "@/api";
import {
onShow
} from "@dcloudio/uni-app";
import {
useStore
} from "@/store";
const $store = useStore();
const $props = defineProps({
id: {
type: String,
default: "0",
},
clinic: {
type: String,
default: "0",
},
});
let tabIndex = ref(0);
const fenzhen_time = ref(false);
const fenzhen_list = ref(false);
const getFenzhenList = async () => {
uni.showLoading();
const response = await $api("FenzhenList", {
id: $props.id,
});
uni.hideLoading();
$response(response, () => {
fenzhen_time.value = response.data;
getFenzhenInfo()
});
};
const getFenzhenInfo = async (id) => {
uni.showLoading();
const response = await $api("FenzhenInfo", {
id: $props.id,
clinic: $props.clinic,
});
uni.hideLoading();
$response(response, () => {
@ -33,7 +60,7 @@ const getFenzhenInfo = async (id) => {
};
const mountedAction = () => {
getFenzhenInfo();
getFenzhenList();
};
const config_ref = ref(null);
@ -78,81 +105,66 @@ onShow(() => {
<view class="tip_dialog_text_wrapper" v-html="tip_content"></view>
</view>
</view> -->
<view v-if="!!fenzhen_list">
<view v-if="!!fenzhen_list && !!fenzhen_time">
<view class="order_info_wrapper">
<view class="person_name_wrapper">
<view class="person_name_text_wrapper">{{
fenzhen_list.info.name
fenzhen_time.info.name
}}</view>
<view class="person_sex_wrapper">{{
fenzhen_list.info.sex === 1 ? "男士" : "女士"
fenzhen_time.info.sex === 1 ? "男士" : "女士"
}}</view>
</view>
<view class="info_box_wrapper">
<view class="info_wrapper">
<view class="info_title_wrapper">体检套餐</view>
<view class="info_text_wrapper">{{
fenzhen_list.info.combo_name
fenzhen_time.info.combo_name
}}</view>
</view>
<view class="info_wrapper info2_wrapper">
<view class="info_title_wrapper">体检日期</view>
<view class="info_text_wrapper">{{
fenzhen_list.info.check_date
fenzhen_time.info.check_date
}}</view>
</view>
<view
class="info_wrapper info2_wrapper"
v-if="fenzhen_list.info.code"
>
<view class="info_wrapper info2_wrapper" v-if="fenzhen_time.info.code">
<view class="info_title_wrapper">体检号条码</view>
<w-barcode
:options="{
<w-barcode :options="{
width: 500,
height: 100,
code: fenzhen_list.info.code,
}"
></w-barcode>
code: fenzhen_time.info.code,
}"></w-barcode>
</view>
</view>
<view class="tip_wrapper">
<view class="tip_time_wrapper">
<view class="tip_time_text_wrapper">开始体检时间</view>
<view class="tip_time_value_wrapper">{{
timeShow(fenzhen_list.info.start_time)
timeShow(fenzhen_time.info.start_time)
}}</view>
<view class="tip_time_text_wrapper"> 预计结束时间</view>
<view class="tip_time_value_wrapper">{{
timeShow(fenzhen_list.info.end_time)
timeShow(fenzhen_time.info.end_time)
}}</view>
</view>
<view class="tip_box_wrapper">
<view class="tip_icon_wrapper">
<image src="@/static/assets/fenzhen/tip@2x.png"></image>
</view>
<view class="tip_text_wrapper"
>尊敬的客户为了使您的体检流程更加顺畅请按以下步骤提
示顺序逐项完成体检</view
>
<view class="tip_text_wrapper">尊敬的客户为了使您的体检流程更加顺畅请按以下步骤提
示顺序逐项完成体检</view>
</view>
</view>
</view>
<view class="time_line_wrapper py-40rpx px-10rpx">
<view
class="mb-20rpx flex rounded-8rpx w-428rpx h-66rpx ma b-0 b-1 b-solid b-#239EA3"
>
<view
@click="tabIndex = 0"
:class="tabIndex == 0 ? 'ckjg_active' : ''"
class="text-#239EA3 flex-1 text-#26rpx bg-#D9F3F2 flex flex-items-center flex-justify-center rounded-l-8rpx"
>
<view class="mb-20rpx flex rounded-8rpx w-428rpx h-66rpx ma b-0 b-1 b-solid b-#239EA3">
<view @click="tabIndex = 0" :class="tabIndex == 0 ? 'ckjg_active' : ''"
class="text-#239EA3 flex-1 text-#26rpx bg-#D9F3F2 flex flex-items-center flex-justify-center rounded-l-8rpx">
未完成
</view>
<view
@click="tabIndex = 1"
:class="tabIndex == 1 ? 'ckjg_active' : ''"
class="text-#239EA3 flex-1 flex flex-items-center flex-justify-center bg-#D9F3F2 rounded-r-8rpx"
>已完成
<view @click="tabIndex = 1" :class="tabIndex == 1 ? 'ckjg_active' : ''"
class="text-#239EA3 flex-1 flex flex-items-center flex-justify-center bg-#D9F3F2 rounded-r-8rpx">已完成
</view>
</view>
<view>
@ -160,20 +172,14 @@ onShow(() => {
<view class="between h-90rpx b-0 b-b-1 b-solid b-#EAEAEA" v-if="item.status == 1 && tabIndex == 0">
<view class="text-#000000 text-30rpx">{{ item.name }}</view>
<view class="center">
<text
@click="qijian(item)"
class="rounded-full text-28rpx center w-105rpx h-48rpx text-#E95515 bg-#FAECE6"
>弃检</text
>
<text @click="qijian(item)"
class="rounded-full text-28rpx center w-105rpx h-48rpx text-#E95515 bg-#FAECE6">弃检</text>
</view>
</view>
<view class="between h-90rpx b-0 b-b-1 b-solid b-#EAEAEA" v-if="item.status == 4 && tabIndex == 1">
<view class="text-#000000 text-30rpx">{{ item.name }}</view>
<view class="center">
<text
class="rounded-full text-28rpx center w-105rpx h-48rpx mr-30rpx text-#239EA3 bg-#E5F3F2"
>完成</text
>
<text class="rounded-full text-28rpx center w-105rpx h-48rpx mr-30rpx text-#239EA3 bg-#E5F3F2">完成</text>
<text class="text-#141414 text-28rpx">{{ item.time }}</text>
</view>
</view>

Loading…
Cancel
Save