新增体检结构参数管理,h5预览pdf,调整查询预约详情接口返回值

main
yanzai 2 years ago
parent 3c5007dc49
commit a9f188f613

@ -0,0 +1,103 @@
<?php
namespace App\Http\Controllers\API\Admin\YeWu;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class InstitutionController extends Controller
{
//获取体检机构总列表
public function GetList()
{
$page = request('page');
$pagesize = request('pageSize');
$searchInfo = request('searchInfo');
$list = DB::table('medical_institution as a');
$list = $list->leftJoin('users as b', 'a.link_user_id', '=', 'b.id');
$count = $list->count();
$list = $list->select('a.*', 'b.username');
$list=$list->orderBy('id', 'desc')->skip(($page-1)*$pagesize)->take($pagesize)->get();
return \Yz::Return(true, '', ['list' => $list, 'count' => $count]);
}
//保存机构设置
public function SavdSeting()
{
$SetingInfo= request('SetingInfo');
if(isset($SetingInfo['institution_id'])){
//更新机构表预约状态
DB::table('medical_institution')->where(['id'=>$SetingInfo['institution_id']])->update([
'enable_yuyue'=> $SetingInfo['enable_yuyue'],
'enable_laonianren_mf'=> $SetingInfo['enable_laonianren_mf'],
'enable_jiankangzheng_mf'=> $SetingInfo['enable_jiankangzheng_mf'],
]);
DB::beginTransaction();
$saveStatus=false;
try {
//查询是否有此机构的设置信息,如果有,先删除再添加(因为设置项有可能会变,所以直接删除再添加)
$cha=DB::table('institution_seting')->where(['institution_id'=>$SetingInfo['institution_id']])->first();
if(!!$cha){
DB::table('institution_seting')->where(['institution_id'=>$SetingInfo['institution_id']])->delete();
}
$i1_count=0;
$i2_count=0;
//添加设置
foreach ($SetingInfo['laonianren_mf']['fenlei'] as $key=>$item){
$i1= DB::table('institution_seting')->insert([
'institution_id'=>$SetingInfo['institution_id'],
'big_check_type'=>"老年人免费体检",
'small_check_type'=>$item['name'],
'bind_check_type'=>$item['bind_check_type'],
'bind_unit_id'=>$item['bind_unit_id'],
'bind_group_id'=>$item['bind_group_id'],
'bind_batch_id'=>$item['bind_batch_id'],
'enable_yuyue'=>$item['enable_yuyue'],
]);
if($i1) $i1_count++;
}
foreach ($SetingInfo['jiankangzheng_mf']['fenlei'] as $key=>$item){
$i2= DB::table('institution_seting')->insert([
'institution_id'=>$SetingInfo['institution_id'],
'big_check_type'=>"健康证免费体检",
'small_check_type'=>$item['name'],
'bind_check_type'=>$item['bind_check_type'],
'bind_unit_id'=>$item['bind_unit_id'],
'bind_group_id'=>$item['bind_group_id'],
'bind_batch_id'=>$item['bind_batch_id'],
'enable_yuyue'=>$item['enable_yuyue'],
]);
if($i2) $i2_count++;
}
if(count($SetingInfo['laonianren_mf']['fenlei'])== $i1_count and count($SetingInfo['jiankangzheng_mf']['fenlei'])== $i2_count){
DB::commit();
return \Yz::Return(true,'操作完成',[]);
}else{
DB::rollback();
return \Yz::Return(false,'操作失败');
}
} catch (\Exception $e) {
DB::rollback();
return \Yz::Return(false,'操作异常'.$e);
}
}else{
return \Yz::echoError1('参数缺失');
}
}
public function GetSetingDetail()
{
$institution_id= request('institution_id');
$seting=DB::table('institution_seting')->where(['institution_id'=>$institution_id])->get();
$info=DB::table('medical_institution')->where(['id'=>$institution_id])->get();
return \Yz::Return(true,'查询成功',['info'=>$info,'seting'=>$seting]);
}
}

@ -10,7 +10,7 @@ class DxAppController extends Controller
//大兴app根据userid查询用户信息
public function getUserInfo(){
$userId=request('userId');
$base_url="http://223.71.106.241:8097";
$base_url="http://114.242.58.53:8782";
$url =$base_url.'/family/api/getUserFamilyDataList?userId='.$userId;
$encryptStr=self::post($url,'');
$r_data=json_decode($encryptStr, true);

@ -12,7 +12,17 @@ class IndustryController extends Controller
//获取行业列表
public function GetIndustry()
{
$list=DB::table('industry')->get();
$institution_id=request('institution_id');
$alllist=DB::table('industry')->get();
$enablelist=DB::table('institution_seting')->where(['institution_id'=>$institution_id])->get();
$list=[];
foreach ($alllist as $key=>$item){
foreach ($enablelist as $K=>$it){
if($item->name == $it->small_check_type and $it->enable_yuyue==1){
$list[]=$item;
}
}
}
return \Yz::Return(true,'查询成功',$list);
}
}

@ -10,8 +10,9 @@ class OrganizationController extends Controller
{
//获取正常状态的体检机构
public function GetEnableList(){
$yuyue_type=request('yuyue_type');
$s=app()->make(OrganizationService::class);
return $s->GetList(['type'=>'enable']);
return $s->GetList(['type'=>'enable','yuyue_type'=>$yuyue_type]);
}
//获取单独体检机构可预约日历时间表
public function GetEnableCalendar(){

@ -6,6 +6,9 @@ use App\Http\Controllers\Controller;
use App\Services\mH5\PersonService;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\Storage;
class PersonController extends Controller
{
//注册
@ -24,23 +27,82 @@ class PersonController extends Controller
//获取用户体检详情和pdf
public function GetPersonReportDetail(){
$sfz =request('sfz');
//HSM加密
$HSM_sfz =\App\Lib\HSM::HsmEncrypt($sfz);
if($HSM_sfz['status']!=true){
return \Yz::echoError1('调用HSM加密失败');
}
$sfz=$HSM_sfz['data'];
$info=DB::table('examination_records')->where(['id_card_num'=>$sfz]) ->orderBy('id', 'desc')->first();
if($info){
$info->pdfs=count(json_decode($info->pdfs, true));
$item=DB::table('report_result_item')
->where(['examination_id'=>$info->id])
->select(['item_name','item_result','flag'])->get();
$info->items=$item;
if(strlen($info->id_card_num)>30){
//HSM解密
$HSM_sfz =\App\Lib\HSM::HsmDecrypt($info->id_card_num);
if($HSM_sfz['status']!=true){
return \Yz::echoError1('调用HSM加密失败');
}
$info->id_card_num=$HSM_sfz['data'];
}
return \Yz::Return(true,'',['info'=>$info]);
}else{
return \Yz::echoError1('未找到相关体检信息');
}
}
//修改H5获取用户pdf方式改为根据体检提供的pdf链接地址获取pdf
public function GetPersonPdfDetailByLink()
{
$recordid =request('recordid');
$pdf_num =request('pdf_num');
$query=DB::table('examination_records')->where(['id'=>$recordid])->first();
if(!$query) return \Yz::echoError1('未找到对应体检记录');
$pdfs=json_decode($query->pdfs, true);
$pdfurl=$pdfs[$pdf_num];
// 使用 GuzzleHttp 获取第三方 PDF 地址的内容
$client = new Client();
$response = $client->get($pdfurl);
return response($response->getBody());
// return response($response->getBody()->getContents(), 200)
// ->header('Content-Type', 'application/pdf')
// ->header('Content-Disposition', 'inline; filename="sample.pdf"');
// $date = date("Ymd");
// $filename = 'pdf_' . time() . '.pdf';
// Storage::disk('public')->put('/pdf/'.$date.'/'."a.pdf", $response->getBody());
//
// return \Yz::Return(true,'获取成功',['fileurl' =>'/storage/pdf/'.$date.'/'.$filename]);
}
//用户扫码跳转输入身份证和电话 查询用户体检详情和pdf
public function H5GetPersonReportDetail(){
$get_info =request('info');
if(!isset($get_info['sfz'])) return \Yz::echoError1('身份证不能为空');
if(!isset($get_info['tel'])) return \Yz::echoError1('电话不能为空');
//HSM加密
$HSM_sfz =\App\Lib\HSM::HsmEncrypt($get_info['sfz']);
if($HSM_sfz['status']!=true){
return \Yz::echoError1('调用HSM加密失败');
}
$get_info['sfz']=$HSM_sfz['data'];
if(isset($get_info['tel'])){
$HSM_tel =\App\Lib\HSM::HsmEncrypt($get_info['tel']);
if($HSM_tel['status']!=true){
return \Yz::echoError1('调用HSM加密失败');
}
$get_info['tel']=$HSM_tel['data'];
}
$info=DB::table('examination_records')->where(['id_card_num'=>$get_info['sfz'],'tel'=>$get_info['tel']]) ->orderBy('id', 'desc')->first();
if($info){
$item=DB::table('report_result_item')

@ -20,6 +20,9 @@ class Log
$insert_id=0;
$insert_id=self::requestLog($request,$insert_id); //记录请求时日志,不含返回信息
$response = $next($request);
if($request->getPathInfo()=='/api/v1/mH5/GetPersonPdfDetailByLink'){
return $response;
}
$content = $response->getContent();
$data = json_decode($content, true); // 解码响应内容为关联数组
@ -29,11 +32,12 @@ class Log
$data['code'] = $response->getStatusCode();
$modifiedContent = json_encode($data); // 编码修改后的关联数组为 JSON 字符串
$response->setContent($modifiedContent);
if(env('REQUEST_LOG') and $response->getStatusCode()==200){ //如果返回状态为200进行log
$ip=self::getTrustedProxiesIp(); //真实ip
$request_header=$request->header(); //请求头
// dd($response);
//dd($response);
$response_data = $response->getData(); //返回data,json格式
$post_data=$request->post(); //post请求数据
$get_data=$request->query(); //get请求

@ -8,12 +8,17 @@ class OrganizationService
//如果查询可用机构列表则数组 type字段传 enable,查全部 则传 all
$result=array();
if($arr['type']){
$list=DB::table('medical_institution');
if ($arr['type']=='enable'){
$list=DB::table('medical_institution')->where(['status'=>1])->get();
$list=$list->where(['status'=>1]);
}
if ($arr['type']=='all'){
$list=DB::table('medical_institution')->whereIn('status',[0,1])->get();
$list=$list->whereIn('status',[0,1]);
}
if($arr['yuyue_type']=='jiankangzheng_mf'){
$list= $list->where(['enable_yuyue'=>1,'enable_jiankangzheng_mf'=>1]);
}
$list= $list->get();
if(count($list)>0){
$result['status']=true;
$result['list']=$list;
@ -95,6 +100,9 @@ class OrganizationService
return \Yz::Return(false,'当前时间段预约已满');
}
//获取体检机构编号sn
$jgINfo=DB::table('medical_institution')->where('id',$info['org_id'])->first();
$Hmac=\App\Lib\HSM::Hmac($cha_info[0]->name.$cha_info[0]->id_card_num.$info['org_id']);
if($Hmac['status']!=true){
return \Yz::echoError1('HMAC摘要失败');
@ -113,9 +121,11 @@ class OrganizationService
'openid'=>$openid,
'date'=>$q_date[0]->date,
'time'=>$q_date[0]->time,
'fee_type'=>0,
'doc_type_id'=>$info['doc_id'],
'doc_type_name'=>$info['doc_name'],
'org_id'=>$info['org_id'],
'org_code'=>$jgINfo->sn,
'status'=>1,
'hmac'=>$Hmac['data'],
]

@ -62,6 +62,7 @@ class PersonService
$id_num='';
if(isset($arr['group']) and $arr['group']=='mH5user'){ //如果是本地项目请求(非对外接口)
$openid=$arr['openid'];
$c=DB::table('persons')->select(['id_card_num'])->where(['openid'=>$openid,'status'=>1])->get();
if(count($c)>0){
@ -69,6 +70,7 @@ class PersonService
}else{
$result['status']=false;
$result['msg']='未找到有效用户';
return $result;
}
}else{ //对外接口直接获取证件IdNum
$id_num=$arr['id_num'];
@ -112,6 +114,30 @@ class PersonService
$cha = DB::select("SELECT a.*,b.sex,b.tel,b.status,c.org_name from appointment_record as a INNER JOIN
persons as b on a.person_id=b.id INNER JOIN medical_institution as c on a.org_id=c.id where a.id_card_num=?
and a.status=1",[$arr['id_num']]);
if(count($cha)>0){
$cha[0]->bind_check_type=null;
$cha[0]->bind_unit_id=null;
$cha[0]->bind_group_id=null;
$cha[0]->bind_batch_id=null;
$cha[0]->start_time=substr($cha[0]->time, 0,5);
$cha[0]->end_time=substr($cha[0]->time,-5);
$org_seting=DB::table('institution_seting')->where(['institution_id'=>$cha[0]->org_id,'small_check_type'=>$cha[0]->doc_type_name])->first();
if(!!$org_seting){
$cha[0]->bind_check_type=$org_seting->bind_check_type;
$cha[0]->bind_unit_id=$org_seting->bind_unit_id;
$cha[0]->bind_group_id=$org_seting->bind_group_id;
$cha[0]->bind_batch_id=$org_seting->bind_batch_id;
}
$cha_img =DB::table('appointment_img')->where('appointment_record_id',$cha[0]->id)->get();
//env('APP_URL')
foreach ($cha_img as $key=>$item){
$cha_img[$key]->imgurl=env('APP_URL').$item->imgurl;
}
$cha[0]->imgs=$cha_img;
}
if(!count($cha)>0) return \Yz::echoError1("未找到预约记录");
return \Yz::Return(true,'',$cha);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@ -53,6 +53,9 @@ Route::group(['middleware'=>['checktoken','log'],'prefix'=>'v1'],function () {
Route::post('admin/XTSignBindUser','App\Http\Controllers\API\XTSignController@bindUser');//admin后台用户绑定协同签名useid
Route::post('admin/UkeyBindUser','App\Http\Controllers\API\UkeyController@Bind');//admin后台用户绑定协同签名useid
Route::post('admin/AppointmentCount','App\Http\Controllers\API\Admin\YeWu\AppointmentController@AppointmentCount'); //admin后台预约统计
Route::post('admin/InstitutionGetList','App\Http\Controllers\API\Admin\YeWu\InstitutionController@GetList');//获取体检机构列表
Route::post('admin/InstitutionSavdSeting','App\Http\Controllers\API\Admin\YeWu\InstitutionController@SavdSeting');//保存机构设置
Route::post('admin/InstitutionGetSetingDetail','App\Http\Controllers\API\Admin\YeWu\InstitutionController@GetSetingDetail');//获取机构设置详情
});
@ -69,6 +72,7 @@ Route::group(['middleware'=>['checktoken','log'],'prefix'=>'v1/mH5'],function ()
Route::post('UpFileBase64','App\Http\Controllers\API\UpLoadController@UpFileBase64');//上传文件base64
Route::post('GetPersonReportDetail','App\Http\Controllers\API\mH5\PersonController@GetPersonReportDetail');//获取用户pdf
Route::post('GetIndustryList','App\Http\Controllers\API\mH5\IndustryController@GetIndustry');
Route::post('GetPersonPdfDetailByLink','App\Http\Controllers\API\mH5\PersonController@GetPersonPdfDetailByLink');//根据链接获取体检那边的pdf
});

@ -136,4 +136,16 @@ export const GetLogTableName = (data={}) => {
//预约登记统计
export const AppointmentCount = (data={}) => {
return axios({url:import.meta.env.VITE_APP_API+'v1/admin/AppointmentCount',data:data})
}
//机构管理获取列表
export const InstitutionGetList = (data={}) => {
return axios({url:import.meta.env.VITE_APP_API+'v1/admin/InstitutionGetList',data:data})
}
//保存机构设置
export const InstitutionSavdSeting = (data={}) => {
return axios({url:import.meta.env.VITE_APP_API+'v1/admin/InstitutionSavdSeting',data:data})
}
//获取机构设置详情
export const InstitutionGetSetingDetail = (data={}) => {
return axios({url:import.meta.env.VITE_APP_API+'v1/admin/InstitutionGetSetingDetail',data:data})
}

@ -64,6 +64,13 @@ const router = createRouter({
meta: {
title: '系统日志'
}
} ,{
path: '/systemMngr/InstitutionMngr',
name: 'SystemInstitutionMngr',
component: () => import('../views/SystemMngr/Institution/InstitutionMngr.vue'),
meta: {
title: '机构管理'
}
},{
path: '/healthCalendar',
name: 'HealthCalendar',

@ -0,0 +1,290 @@
<template>
<div>
<el-table :data="tableData" style="width: 100%;" row-key="id" v-loading="loading">
<el-table-column prop="id" label="Id" width="80" />
<el-table-column prop="org_name" label="名称" />
<el-table-column prop="sn" label="Code" />
<el-table-column prop="username" label="关联的账号" />
<el-table-column prop="enable_yuyue" label="是否开启预约">
<template #default="scope">
<el-tag v-if="scope.row.enable_yuyue == 1" class="ml-2" type="success"></el-tag>
<el-tag v-if="scope.row.enable_yuyue == 0" class="ml-2" type="danger"></el-tag>
</template>
</el-table-column>
<el-table-column prop="enable_laonianren_mf" label="开启老年人免费预约">
<template #default="scope">
<el-tag v-if="scope.row.enable_laonianren_mf == 1" class="ml-2" type="success"></el-tag>
<el-tag v-if="scope.row.enable_laonianren_mf == 0" class="ml-2" type="danger"></el-tag>
</template>
</el-table-column>
<el-table-column prop="enable_jiankangzheng_mf" label="开启健康证免费预约">
<template #default="scope">
<el-tag v-if="scope.row.enable_jiankangzheng_mf == 1" class="ml-2" type="success"></el-tag>
<el-tag v-if="scope.row.enable_jiankangzheng_mf == 0" class="ml-2" type="danger"></el-tag>
</template>
</el-table-column>
<el-table-column prop="status" label="状态">
<template #default="scope">
<el-tag v-if="scope.row.status == 1" class="ml-2" type="success"></el-tag>
<el-tag v-if="scope.row.status == 0" class="ml-2" type="danger"></el-tag>
</template>
</el-table-column>
<el-table-column label="操作">
<template #default="scope">
<el-button round type="primary" size="small" @click="seting(scope.row.id)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page">
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
:page-sizes="[15, 50, 100, 200]" layout="total,sizes, prev, pager, next" :total="total"
@size-change="PageSizeChange" @current-change="PageCurrentChange" />
</div>
<el-dialog v-model="dialogVisible" title="机构配置" width="50%">
<el-form :model="SetingInfo" v-loading="loading" label-width="150px">
<el-form-item label="是否开启预约">
<el-switch v-model="SetingInfo.enable_yuyue" size="large" active-text="" inactive-text=""
:active-value="1" :inactive-value="0" /> 开启后此机构才能进行预约
</el-form-item>
<el-form-item label="老年人免费体检">
<div class="bigClassDiv">
<el-switch v-model="SetingInfo.enable_laonianren_mf" size="large" active-text=""
inactive-text="关闭" :active-value="1" :inactive-value="0" />
<div v-if="SetingInfo.enable_laonianren_mf===1">
<div v-for="(item,index) in SetingInfo.laonianren_mf.fenlei" :key="index">
<div>分类{{item.name}}</div>
<el-form-item class="bindinput" label="绑定体检类型:">
<el-input v-model="SetingInfo.laonianren_mf.fenlei[index].bind_check_type" />
</el-form-item>
<el-form-item class="bindinput" label="绑定单位id:">
<el-input v-model="SetingInfo.laonianren_mf.fenlei[index].bind_unit_id" />
</el-form-item>
<el-form-item class="bindinput" label="绑定分组id:">
<el-input v-model="SetingInfo.laonianren_mf.fenlei[index].bind_group_id" />
</el-form-item>
<el-form-item class="bindinput" label="绑定批次id:">
<el-input v-model="SetingInfo.laonianren_mf.fenlei[index].bind_batch_id" />
</el-form-item>
</div>
</div>
</div>
</el-form-item>
<el-form-item label="健康证免费体检">
<div class="bigClassDiv">
<el-switch v-model="SetingInfo.enable_jiankangzheng_mf" size="large" active-text=""
inactive-text="关闭" :active-value="1" :inactive-value="0" />
<div v-if="SetingInfo.enable_jiankangzheng_mf===1">
<div style="margin-top: 20px;" v-for="(item,index) in SetingInfo.jiankangzheng_mf.fenlei"
:key="index">
<div>分类{{item.name}}
<el-switch style="margin-left: 20px;"
v-model="SetingInfo.jiankangzheng_mf.fenlei[index].enable_yuyue" size="large"
active-text="开启" inactive-text="关闭" :active-value="1" :inactive-value="0" />
</div>
<div v-show="SetingInfo.jiankangzheng_mf.fenlei[index].enable_yuyue===1">
<el-form-item class="bindinput" label="绑定体检类型:">
<el-input v-model="SetingInfo.jiankangzheng_mf.fenlei[index].bind_check_type" />
</el-form-item>
<el-form-item class="bindinput" label="绑定单位id:">
<el-input v-model="SetingInfo.jiankangzheng_mf.fenlei[index].bind_unit_id" />
</el-form-item>
<el-form-item class="bindinput" label="绑定分组id:">
<el-input v-model="SetingInfo.jiankangzheng_mf.fenlei[index].bind_group_id" />
</el-form-item>
<el-form-item class="bindinput" label="绑定批次id:">
<el-input v-model="SetingInfo.jiankangzheng_mf.fenlei[index].bind_batch_id" />
</el-form-item>
</div>
</div>
</div>
</div>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="Save">
确定
</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script setup>
import {
ref,
onMounted
} from 'vue'
import {
ElMessage
} from 'element-plus'
import {
InstitutionGetList,
InstitutionSavdSeting,
InstitutionGetSetingDetail
} from '@/api/api.js'
let loading = ref(false)
let tableData = ref([])
let currentPage = ref(1) //
let pageSize = ref(15) //
let total = 0 //
const PageSizeChange = (e) => { //
pageSize.value = e
GetList()
}
const PageCurrentChange = (e) => { //
currentPage.value = e
GetList()
}
let searchInfo = ref({
})
const GetList = () => {
loading.value = true
InstitutionGetList({
page: currentPage.value,
pageSize: pageSize.value,
searchInfo: searchInfo.value
}).then(res => {
loading.value = false
if (res.status) {
tableData.value = res.data.list
total = res.data.count
} else {
ElMessage.error(res.msg)
}
})
}
let dialogVisible = ref(false);
let SetingInfo = ref({
institution_id: 0,
enable_yuyue: 0,
enable_laonianren_mf: 0,
enable_jiankangzheng_mf: 0,
laonianren_mf: {
fenlei: [{
enable_yuyue: 1,
name: '全部',
bind_check_type: '',
bind_unit_id: '',
bind_group_id: '',
bind_batch_id:''
}]
},
jiankangzheng_mf: {
fenlei: [{
enable_yuyue: 0,
name: '食品类',
bind_check_type: '',
bind_unit_id: '',
bind_group_id: '',
bind_batch_id:''
}, {
enable_yuyue: 0,
name: '化妆品类',
bind_check_type: '',
bind_unit_id: '',
bind_group_id: '',
bind_batch_id:''
}, {
enable_yuyue: 0,
name: '公共场所类',
bind_check_type: '',
bind_unit_id: '',
bind_group_id: '',
bind_batch_id:''
}, {
enable_yuyue: 0,
name: '生活饮用水类',
bind_check_type: '',
bind_unit_id: '',
bind_group_id: '',
bind_batch_id:''
}, {
enable_yuyue: 0,
name: '消毒产品生产类',
bind_check_type: '',
bind_unit_id: '',
bind_group_id: '',
bind_batch_id:''
}]
},
})
const seting = (id) => {
dialogVisible.value = true
SetingInfo.value.institution_id = id
GetDetail()
}
const Save = () => {
loading.value = true
console.log(SetingInfo.value);
InstitutionSavdSeting({
SetingInfo: SetingInfo.value
}).then(res => {
loading.value = false
if (res.status) {
dialogVisible.value = false
GetList()
} else {
ElMessage.error(res.msg)
}
})
}
const GetDetail = () => {
loading.value = true
InstitutionGetSetingDetail({
institution_id: SetingInfo.value.institution_id
}).then(res => {
loading.value = false
if (res.status) {
SetingInfo.value.enable_yuyue = res.data.info[0].enable_yuyue
SetingInfo.value.enable_laonianren_mf = res.data.info[0].enable_laonianren_mf
SetingInfo.value.enable_jiankangzheng_mf = res.data.info[0].enable_jiankangzheng_mf
if(res.data.seting.length>0){
SetingInfo.value.laonianren_mf.fenlei = []
SetingInfo.value.jiankangzheng_mf.fenlei = []
}
res.data.seting.forEach(function(v, i) {
if (v.big_check_type == '老年人免费体检') {
v.name = v.small_check_type
SetingInfo.value.laonianren_mf.fenlei.push(v);
}
if (v.big_check_type == "健康证免费体检") {
v.name = v.small_check_type
SetingInfo.value.jiankangzheng_mf.fenlei.push(v);
}
})
} else {
ElMessage.error(res.msg)
}
})
}
onMounted(() => {
GetList()
})
</script>
<style scoped>
.page {
display: flex;
justify-content: flex-end;
margin-top: 10px;
}
.bindinput {
margin-top: 8px;
}
</style>

@ -1,5 +1,5 @@
ENV = 'production'
VITE_APP_API = 'http://223.71.106.251:33581/common/la/public/api/'
VITE_APP_WXCODE_URL = 'http://223.71.106.251:33581/common/la/public/wxLogin/production'
VITE_APP_FILE_URL= 'http://223.71.106.251:33581/common/la/public/'
VITE_APPID = "wx526430047d34c85c"
VITE_APP_API = 'http://223.71.106.251:82/common/la/public/api/'
VITE_APP_WXCODE_URL = 'http://223.71.106.251:82/common/la/public/wxLogin/production'
VITE_APP_FILE_URL= 'http://223.71.106.251:82/common/la/public/'
VITE_APPID = "wx526430047d34c85c"

985
mH5/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -11,11 +11,11 @@
},
"dependencies": {
"axios": "^1.5.1",
"pdfjs-dist": "^4.0.269",
"pinia": "^2.1.6",
"vant": "^4.7.0",
"vue": "^3.3.4",
"vue-router": "^4.2.4"
"vue-router": "^4.2.4",
"vue3-pdf-app": "^1.0.3"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.3.3",

@ -56,4 +56,9 @@ export const AppGetUserInfo = (data) => {
//获取行业列表
export const GetIndustryList = (data) => {
return axios({url:import.meta.env.VITE_APP_API+'v1/mH5/GetIndustryList',data:data})
}
//根据链接获取体检那边的pdf
export const GetPersonPdfDetailByLink = (data) => {
return axios({url:import.meta.env.VITE_APP_API+'v1/mH5/GetPersonPdfDetailByLink',data:data,responseType: 'blob'})
}

@ -56,6 +56,10 @@ const router = createRouter({
path: '/uploadFiles',
name: 'UploadFiles',
component: () => import('../views/UploadFiles.vue')
},{
path: '/uploadFilesNoApp',
name: 'UploadFilesNoApp',
component: () => import('../views/UploadFilesNoApp.vue')
},{
path: '/previewReport',
name: 'PreviewReport',

@ -14,10 +14,10 @@ axios.interceptors.request.use(
// config.data = {
// originalData: originalRequest.data ,// 携带原来请求的参数
// originalUrl: originalRequest.url ,// 携带原来请求的参数
// };
// config.url = 'http://daxing-middle/redirect_api'; // 将请求重定向到同一个接口
return config
},
err => {
@ -28,7 +28,10 @@ axios.interceptors.request.use(
axios.interceptors.response.use(
async response => {
const res = response.data
// console.log(response)
if (res instanceof Blob) {
return res
}
if (res.code !== 200) {
if (res.code == 10001) { //token验证出错
window.location.href = "./#/login"
@ -124,4 +127,4 @@ function TokenRefresh() {
}
export default axios
export default axios

@ -8,13 +8,13 @@
<div class="left_xia">
<div>类型{{reportinfo.industry_type}}</div>
<div>日期{{reportinfo.tijian_time.substring(0,10)}}</div>
<div>编号1235454546</div>
<!-- <div>编号1235454546</div> -->
</div>
</div>
<div class="right">
<div class="right_shang">
<div class="erweima">
<img src="@/assets/image/erweima.jpg">
<!-- <img src="@/assets/image/erweima.jpg"> -->
</div>
<div class="userinfo">
<div class="name">{{reportinfo.name}}<span class="sex" v-if="reportinfo.sex==1">()</span><span class="sex" v-if="reportinfo.sex==2">()</span></div>
@ -31,7 +31,7 @@
<tr v-for="(item,index) in reportinfo.items">
<td>{{item.item_name}}</td>
<td>合格</td>
<td>2022-05-01</td>
<td>-</td>
</tr>
</table>
@ -41,7 +41,7 @@
<div class="bottom">22</div>
</div>
<div class="zhang">
<img src="@/assets/image/zhang.png">
<!-- <img src="@/assets/image/zhang.png"> -->
</div>
</div>
</template>

@ -1,24 +1,79 @@
<template>
<div>
<vue-pdf-app style="height: 100vh; width: 100vw" :pdf="pdfData"></vue-pdf-app>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import {
ref,
reactive,
nextTick,
onMounted
} from 'vue';
import {
GetPersonPdfDetailByLink
} from "@/api/api.js";
import {
useRoute,
useRouter
} from "vue-router"
import {
showToast,
showDialog
} from 'vant';
// pdf
import VuePdfApp from "vue3-pdf-app";
import "vue3-pdf-app/dist/icons/main.css";
import { useRoute,useRouter } from "vue-router"
const route = useRoute()
const router = useRouter()
let tijian_file =import.meta.env.VITE_APP_FILE_URL+ route.query.tijian_num //
console.log(tijian_file)
onMounted(()=>{
window.location.href=tijian_file
})
let loading = ref(false);
let pdf_num = route.query.pdf_num //pdf arraykey
let recordid = route.query.recordid
let pdfData = ref(null);
let filePath = ref(
'https://bgdq-api.sixinyun.com/storage/assets/upload/pdf/2306070013/3309d209-1e10-4475-a1ac-bf437e748feb.pdf');
const getPdf = () => {
loading.value = true
GetPersonPdfDetailByLink({
recordid: recordid,
pdf_num: pdf_num
}).then(res => {
loading.value = false
console.log(res)
// const blob = new Blob([res], { type: 'application/pdf;charset=UTF-8' }); //
// const imageUrl = URL.createObjectURL(blob);
// pdfData.value=imageUrl
const binaryData = []
binaryData.push(res) //respdf
//blob
pdfData.value = window.URL.createObjectURL(new Blob(binaryData, {
type: 'application/pdf'
}))
})
}
onMounted(() => {
getPdf()
// window.location.href=tijian_file
})
</script>
<style>

@ -1,9 +1,9 @@
<template>
<div class="DocumentSubmit">
<van-steps active="0" active-icon="checked" active-color="#33cdc9">
<van-step>类型选择</van-step>
<van-step>选择日期</van-step>
<van-step>预约完成</van-step>
<van-step>类型选择</van-step>
<van-step>选择日期</van-step>
<van-step>预约完成</van-step>
</van-steps>
<div class="head">
请选择您的从业场所
@ -12,17 +12,18 @@
选择您所在的行业类型
</div>
<van-radio-group v-model="type" class="radioGroup">
<div v-for=" item in DocInfo" :key="item.id" class="item" :class="type==item.id?'active':''" @click="check(item.id,item.name)">
<div class="logo"><img :src="item.img"/></div>
<div v-for=" (item,index) in DocInfo" :key="item.id" class="item" :class="type==item.id?'active':''"
@click="check(item.id,item.name,index)">
<div class="logo"><img :src="BaseUrl+item.img" /></div>
<div class="name">
<van-radio checked-color="#33cdc9" :name="item.id" style="margin-right: 10px;"></van-radio>
{{item.name}}
<van-radio checked-color="#33cdc9" :name="item.id" style="margin-right: 10px;"></van-radio>
{{item.name}}
</div>
</div>
</van-radio-group>
<van-button v-if="type" type="primary" class="button" round @click="to()"></van-button>
<van-button v-if="type" type="primary" class="button" round @click="to()"></van-button>
</div>
</template>
@ -37,56 +38,63 @@
GetIndustryList
} from "@/api/api.js";
import {
ref,onMounted
ref,
onMounted
} from 'vue';
import {
showDialog
} from 'vant';
import {useRouter} from "vue-router"
import {
useRouter
} from "vue-router"
import {
usePiniaStore
} from '@/stores/index.js'
const pinia=usePiniaStore()
const pinia = usePiniaStore()
const router = useRouter();
console.log(pinia.yuyue_info)
let type=ref('')
let DocInfo=ref([])
let type = ref('')
let DocInfo = ref([])
let BaseUrl = import.meta.env.VITE_APP_FILE_URL
let info = pinia.yuyue_info
const check = (id, label,index) => {
const check=(id,label)=>{
let info = pinia.yuyue_info
info.doc_id=id
info.doc_name=label
info.doc_id = id
info.doc_name = label
pinia.ChangeYuYueInfo(info)
console.log(pinia.yuyue_info)
type.value=id
type.value = id
showDialog({
title:DocInfo.value[id-1].label,
message:DocInfo.value[id-1].content,
messageAlign:'left',
confirmButtonText:'我已经知晓',
theme: 'round-button',
confirmButtonColor:"#33cdc9"
title: DocInfo.value[index].name,
message: DocInfo.value[index].content,
messageAlign: 'left',
confirmButtonText: '我已经知晓',
theme: 'round-button',
confirmButtonColor: "#33cdc9"
}).then(() => {
});
}
let loading=ref(false)
const to=()=>{
// router.push('/selectDate')
router.push('/uploadFiles')
let loading = ref(false)
const to = () => {
// router.push('/selectDate')
router.push('/uploadFiles')
}
onMounted(()=>{
loading.value=true
GetIndustryList().then(res => {
loading.value=false
onMounted(() => {
loading.value = true
GetIndustryList({
institution_id:info.org_id
}).then(res => {
loading.value = false
if (res.status == true) {
DocInfo.value=res.data
DocInfo.value.forEach((v,i)=>{
DocInfo.value[i].content=v.content.replace(/\\n/g, '\n');
})
DocInfo.value = res.data
DocInfo.value.forEach((v, i) => {
DocInfo.value[i].content = v.content.replace(/\\n/g, '\n');
})
} else {
showToast(res.msg);
}
@ -95,7 +103,7 @@
</script>
<style scoped>
.DocumentSubmit{
.DocumentSubmit {
height: 100vh;
background-image: url('../assets/image/r_head2.jpg');
background-size: 50vw;
@ -103,13 +111,15 @@
background-position: 100% 100%;
padding: 20px;
}
.head{
.head {
font-size: 24px;
font-weight: 700;
color: #175e5c;
padding-top: 20px;
}
.item{
.item {
display: flex;
border: 1px solid #c7f3f6;
border-radius: 10px;
@ -117,22 +127,26 @@
background: linear-gradient(to right, #aee3f1, #fff);
margin-top: 15px;
}
.active{
.active {
border: 2px solid #33cdc9;
}
.item .logo{
.item .logo {
width: 30%;
display: flex;
align-items: center;
justify-content: center;
}
.item .logo img{
height:60px ;
.item .logo img {
height: 60px;
position: relative;
border-radius: 50%;
}
.item .name{
.item .name {
width: 70%;
display: flex;
align-items: center;
@ -142,7 +156,8 @@
font-weight: 700;
color: #414141;
}
.button{
.button {
width: calc(100vw - 40px);
background-color: #33cdc9;
border: 0px;
@ -150,22 +165,23 @@
bottom: 20px;
border: 3px solid #fff;
}
.radioGroup{
}
.radioGroup {}
</style>
<style>
.van-step__title {
font-size: 16px !important;
font-size: 16px !important;
}
.van-step__icon{
font-size: 20px !important;
.van-step__icon {
font-size: 20px !important;
}
.van-step__circle-container {
top:35px !important;
top: 35px !important;
}
.van-step__line{
top:35px !important;
.van-step__line {
top: 35px !important;
}
</style>

@ -73,7 +73,7 @@
}
const getList = () => {
loading.value = true
GetOrgEnableList().then(res => {
GetOrgEnableList({yuyue_type:'jiankangzheng_mf'}).then(res => {
loading.value = false
if (res.status) {
orgList.value = res.list

@ -36,6 +36,13 @@
</van-row>
</div>
<van-popup v-model:show="showPicker" round position="bottom">
<van-picker
:columns="columns"
@cancel="showPicker = false"
@confirm="selectPDF"
/>
</van-popup>
</div>
</template>
<script setup>
@ -91,6 +98,14 @@ const getDetail=()=>{
loading.value=false
if (res.status) {
reportinfo.value=res.data.info
for(var i=0;i<reportinfo.value.pdfs;i++){
let ii=0;
ii=i+1;
console.log(999)
columns.value.push({text:'报告'+ii,value:i});
}
console.log(columns.value);
} else {
showToast(res.msg);
}
@ -99,10 +114,25 @@ const getDetail=()=>{
}
//
const previewReport=()=>{
console.log(reportinfo.value)
if(reportinfo.value.report_file !=undefined && reportinfo.value.report_file.length>2){
//router.push('/previewReport?tijian_num='+reportinfo.value.report_file)
window.location.href=import.meta.env.VITE_APP_FILE_URL+ reportinfo.value.report_file
// if(reportinfo.value.report_file !=undefined && reportinfo.value.report_file.length>2){
// //router.push('/previewReport?tijian_num='+reportinfo.value.report_file)
// window.location.href=import.meta.env.VITE_APP_FILE_URL+ reportinfo.value.report_file
// }else{
// showDialog({
// title: '',
// message: "",
// messageAlign: 'left',
// confirmButtonText: '',
// theme: 'round-button',
// confirmButtonColor: "#33cdc9"
// }).then(() => {
// });
// }
if(reportinfo.value.pdfs>0){
showPicker.value=true;
}else{
showDialog({
title: '通知',
@ -115,7 +145,6 @@ const previewReport=()=>{
});
}
}
const gotoHealthCertificate=()=>{
if(reportinfo.value.result_status==1){
@ -124,6 +153,14 @@ const gotoHealthCertificate=()=>{
showToast('暂无对应此次体检结果的健康证');
}
}
let showPicker=ref(false);
let columns = ref([])
const selectPDF=({ selectedOptions })=>{
showPicker.value = false;
console.log(selectedOptions[0].value) ;
router.push('/previewReport?recordid='+reportinfo.value.id+'&pdf_num='+selectedOptions[0].value)
}
onMounted(()=>{
getDetail()
})

@ -16,9 +16,9 @@
</div>
<van-uploader :ref="`uploader${index}`" accept="" :name="index" :key="index" :after-read="afterRead"
v-model="needinfo.fileList[index].fileurl" preview-size="2.5rem" multiple>
<!-- <van-button icon="plus" plain size="small" type="primary">上传文件</van-button> -->
<van-button icon="plus" plain size="small" type="primary">上传文件</van-button>
</van-uploader>
<van-button icon="plus" plain size="small" @click="callAPP(index)" type="primary">上传文件</van-button>
<!-- <van-button icon="plus" plain size="small" @click="callAPP(index)" type="primary">上传文件</van-button> -->
</div>
<van-button type="primary" class="button" round @click="to()"></van-button>
Loading…
Cancel
Save