新增体检结构参数管理,h5预览pdf,调整查询预约详情接口返回值
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]);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
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 |
@ -1,5 +1,5 @@
|
|||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
VITE_APP_API = 'http://223.71.106.251:33581/common/la/public/api/'
|
VITE_APP_API = 'http://223.71.106.251:82/common/la/public/api/'
|
||||||
VITE_APP_WXCODE_URL = 'http://223.71.106.251:33581/common/la/public/wxLogin/production'
|
VITE_APP_WXCODE_URL = 'http://223.71.106.251:82/common/la/public/wxLogin/production'
|
||||||
VITE_APP_FILE_URL= 'http://223.71.106.251:33581/common/la/public/'
|
VITE_APP_FILE_URL= 'http://223.71.106.251:82/common/la/public/'
|
||||||
VITE_APPID = "wx526430047d34c85c"
|
VITE_APPID = "wx526430047d34c85c"
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,24 +1,79 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<vue-pdf-app style="height: 100vh; width: 100vw" :pdf="pdfData"></vue-pdf-app>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<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 route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
let tijian_file =import.meta.env.VITE_APP_FILE_URL+ route.query.tijian_num //获取到体检流水号
|
let loading = ref(false);
|
||||||
console.log(tijian_file)
|
let pdf_num = route.query.pdf_num //获取到pdf array的key
|
||||||
onMounted(()=>{
|
let recordid = route.query.recordid
|
||||||
|
|
||||||
window.location.href=tijian_file
|
|
||||||
|
|
||||||
|
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) //res就是pdf流文件
|
||||||
|
//获取blob链接
|
||||||
|
pdfData.value = window.URL.createObjectURL(new Blob(binaryData, {
|
||||||
|
type: 'application/pdf'
|
||||||
|
}))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getPdf()
|
||||||
|
// window.location.href=tijian_file
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Loading…
Reference in New Issue