From 430233f406d969d9fec3058d8fd6d6429cb0896a Mon Sep 17 00:00:00 2001 From: yanzai Date: Sat, 26 Apr 2025 23:46:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=8A=A5=E5=91=8A=E6=94=B9?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/ReportController.php | 4 ++++ 彰武县人民医院小程序/pages/test/test.vue | 15 ++++++++++++++- .../components/report/type3.vue | 7 +++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 64ddff0..784790d 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -17,6 +17,8 @@ class ReportController extends Controller "查询密码" => $request->post('password'), "文件Id" => $request->post('id') ]; + $reportname=$request->post('reportname'); + $username=$request->post('name'); $hospital_info = Hospital::where('id', $request->post('hospital'))->where('del', 2)->first(); if (!$hospital_info) Yo::error_echo(100000, ['机构/医院']); $code = $hospital_info->code; @@ -38,6 +40,7 @@ class ReportController extends Controller $disk = Storage::disk('public'); $name = $request->post('id'); $date = $request->post('rid'); + $name=$username.$data['体检号'].$reportname.'_'.$name; $path = "/assets/upload/pdf/$date/$name.pdf"; $put = $disk->put($path, $res_string); if (!$put) Yo::error_echo(100028, ['put']); @@ -555,6 +558,7 @@ class ReportController extends Controller // ]); $list['info']['id'] = $info['体检号']; + $list['info']['name'] = $info['姓名']; $list['info']['password'] = $info['查询密码']; $list['list'] = $info['报告文件列表']; $conclusion = [ diff --git a/彰武县人民医院小程序/pages/test/test.vue b/彰武县人民医院小程序/pages/test/test.vue index 3d568ff..cda3b57 100644 --- a/彰武县人民医院小程序/pages/test/test.vue +++ b/彰武县人民医院小程序/pages/test/test.vue @@ -35,7 +35,20 @@ success: function(res) { downLoadOk.value = true filePath.value = res.tempFilePath; - + + const newFilePath = `${wx.env.USER_DATA_PATH}/${e.url.split('/').pop()}`; + uni.saveFile({ + tempFilePath:res.tempFilePath, // 临时文件路径 + filePath: newFilePath, // 新的文件路径 + success: (saveResult) => { + console.log("文件保存成功,新路径为:", saveResult.savedFilePath); + filePath.value= saveResult.savedFilePath + }, + fail: (saveErr) => { + console.error("文件保存失败:", saveErr); + reject(saveErr); + } + }); }, }); diff --git a/彰武县人民医院报告对比/components/report/type3.vue b/彰武县人民医院报告对比/components/report/type3.vue index a45c3f9..2140629 100644 --- a/彰武县人民医院报告对比/components/report/type3.vue +++ b/彰武县人民医院报告对比/components/report/type3.vue @@ -32,12 +32,15 @@ const popup=ref(null) let url = ref('') - const ReportDown = async (id) => { + const ReportDown = async (id,index) => { uni.showLoading({ title: '正在查询报告...' }) + console.log(props.list); const response = await ReportDownAction({ rid: props.list.info.id, + reportname:props.list.list[index].报告名称, + name:props.list.info.name, password: props.list.info.password, id, }) @@ -137,7 +140,7 @@ - +