Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵增煜
/
tzt-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9e36284f
authored
Nov 18, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.imohe.com/zhaozengyu/tzt-admin
parents
8812d3c6
1777ace9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
app/Admin/Controllers/PrescriptionPrintController.php
+5
-5
resources/views/admin/prescription-print.blade.php
+10
-4
No files found.
app/Admin/Controllers/PrescriptionPrintController.php
View file @
9e36284f
...
...
@@ -28,7 +28,7 @@ public function index(Content $content): Content
public
function
search
()
{
$prescriptionNo
=
request
(
'prescription_no'
);
$
printEseal
=
request
(
'print
_eseal'
,
0
);
// 是否打印电子印章,实时生成
$
isEseal
=
request
(
'is
_eseal'
,
0
);
// 是否打印电子印章,实时生成
if
(
empty
(
$prescriptionNo
))
{
return
response
()
->
json
([
...
...
@@ -44,7 +44,7 @@ public function search()
return
response
()
->
json
([
'status'
=>
false
,
'message'
=>
'未找到该处方'
]);
}
// 检查处方图片是否已经生成
if
(
$
print
Eseal
&&
$prescription
->
prescription_pic_eseal
)
{
if
(
$
is
Eseal
&&
$prescription
->
prescription_pic_eseal
)
{
return
response
()
->
json
([
'status'
=>
true
,
'data'
=>
[
...
...
@@ -67,7 +67,7 @@ public function search()
$imageWidth
=
1653
;
$centerX
=
$imageWidth
/
2
;
// 手动调整 X 坐标以居中
// 医院
$img
->
text
(
$prescription
->
doctor_online_hospital_name
,
$centerX
,
70
,
function
(
$font
)
{
$img
->
text
(
"
{
$prescription
->
doctor_online_hospital_name
}
处方笺"
,
$centerX
,
70
,
function
(
$font
)
{
$font
->
filename
(
public_path
(
'static/fonts/SimHei.ttf'
));
$font
->
size
(
72
);
$font
->
color
(
'#000000'
);
...
...
@@ -75,7 +75,7 @@ public function search()
$font
->
valign
(
'top'
);
// 确保文本垂直对齐方式
});
// 处方单编号
$img
->
text
(
"处方
单
编号:
{
$prescription
->
id
}
"
,
1170
,
190
,
function
(
$font
)
{
$img
->
text
(
"处方编号:
{
$prescription
->
id
}
"
,
1170
,
190
,
function
(
$font
)
{
$font
->
filename
(
public_path
(
'static/fonts/SimHei.ttf'
));
$font
->
size
(
24
);
$font
->
color
(
'#000000'
);
...
...
@@ -212,7 +212,7 @@ public function search()
$prescription
->
prescription_pic_eseal
=
$cosEsealPath
;
$prescription
->
save
();
// 保存处方图片路径
if
(
$
printEseal
=
true
)
{
if
(
$
isEseal
)
{
$imgUrl
=
Storage
::
url
(
$cosEsealPath
);
}
else
{
$imgUrl
=
Storage
::
url
(
$cosPath
);
...
...
resources/views/admin/prescription-print.blade.php
View file @
9e36284f
<div
class=
"search-form"
>
<div
class=
"input-group mb-3"
>
<input
type=
"text"
class=
"form-control"
id=
"prescription_no"
placeholder=
"请输入处方编号"
>
<div
class=
"input-group mb-3"
style=
"max-width: 600px;"
>
<input
type=
"text"
class=
"form-control"
id=
"prescription_no"
placeholder=
"请输入处方编号"
style=
"width: 200px;"
>
<div
class=
"input-group-append"
>
<button
class=
"btn btn-primary"
type=
"button"
id=
"search-btn"
>
<div
class=
"form-check"
style=
"margin-left: 10px;"
>
<input
type=
"checkbox"
class=
"form-check-input"
id=
"is_eseal"
name=
"is_eseal"
>
<label
class=
"form-check-label"
for=
"is_eseal"
>
带电子印章
</label>
</div>
<button
class=
"btn btn-primary"
type=
"button"
id=
"search-btn"
style=
"margin-left: 10px;"
>
<i
class=
"fa fa-search"
></i>
搜索
</button>
</div>
...
...
@@ -59,12 +63,13 @@
search
()
{
console
.
log
(
'进入搜索方法'
);
let
prescriptionNo
=
$
(
'#prescription_no'
).
val
();
let
isEseal
=
$
(
'#is_eseal'
).
is
(
':checked'
)
?
1
:
0
;
if
(
!
prescriptionNo
)
{
Dcat
.
warning
(
'请输入处方编号'
);
return
;
}
console
.
log
(
'开始发送请求,处方编号:'
,
prescriptionNo
);
console
.
log
(
'开始发送请求,处方编号:'
,
prescriptionNo
,
'电子印章:'
,
isEseal
);
Dcat
.
loading
();
$
.
ajax
({
...
...
@@ -73,6 +78,7 @@
dataType
:
'json'
,
data
:
{
prescription_no
:
prescriptionNo
,
is_eseal
:
isEseal
,
_token
:
'{{ csrf_token() }}'
},
success
:
(
response
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment