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
d38dc6b2
authored
Nov 20, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.imohe.com/zhaozengyu/tzt-admin
parents
4da9d3c6
6e0776be
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
234 additions
and
14 deletions
+234
-14
app/Admin/Controllers/PrescriptionPrintController.php
+11
-12
app/Api/Controllers/PrescriptionController.php
+1
-0
app/Models/PrescriptionModel.php
+9
-0
database/seeders/AdminTablesSeeder.php
+213
-2
public/static/images/dianzizhang.png
+0
-0
No files found.
app/Admin/Controllers/PrescriptionPrintController.php
View file @
d38dc6b2
...
...
@@ -60,14 +60,14 @@ public function search()
return
response
()
->
json
([
'status'
=>
true
,
'data'
=>
[
'img_url'
=>
Storage
::
url
(
$prescription
->
prescription_pic_eseal
)
,
'img_url'
=>
$prescription
->
prescription_pic_eseal
,
],
]);
}
elseif
(
$prescription
->
prescription_pic
)
{
return
response
()
->
json
([
'status'
=>
true
,
'data'
=>
[
'img_url'
=>
Storage
::
url
(
$prescription
->
prescription_pic
)
,
'img_url'
=>
$prescription
->
prescription_pic
,
],
]);
}
...
...
@@ -125,8 +125,7 @@ public function search()
$font
->
color
(
'#000000'
);
});
$drugInfo
=
$prescription
->
drug_info
;
// 每个元素包含 'pharmacy_drug', 'num'
$medicines
=
json_decode
(
$drugInfo
,
true
);
$medicines
=
$prescription
->
drug_info
;
// 每个元素包含 'pharmacy_drug', 'num'
// $medicines = [];
// foreach ($drugInfo as $v) {
// $pharmacyDrug = PharmacyDrugModel::with(['drug', 'dosage'])->find($v['pharmacy_drug']);
...
...
@@ -145,7 +144,7 @@ public function search()
foreach
(
$medicines
as
$medicine
)
{
// 打印药品名称、规格和盒数
$medicineText
=
"
{
$medicine
[
'drug_name'
]
}
{
$medicine
[
'spec'
]
}
{
$medicine
[
'num'
]
}{
$medicine
[
'unit'
]
}
"
;
$img
->
text
(
$medicineText
,
5
50
,
$yCoordinate
,
function
(
$font
)
{
$img
->
text
(
$medicineText
,
4
50
,
$yCoordinate
,
function
(
$font
)
{
$font
->
filename
(
public_path
(
'static/fonts/SimHei.ttf'
));
$font
->
size
(
32
);
$font
->
color
(
'#000000'
);
...
...
@@ -156,11 +155,11 @@ public function search()
$yCoordinate
+=
40
;
// 根据字体大小调整行间距
// 打印 sig 信息
$img
->
text
(
'Sig: '
.
$medicine
[
'dosage_desc'
],
5
50
,
$yCoordinate
,
function
(
$font
)
{
$img
->
text
(
'Sig: '
.
$medicine
[
'dosage_desc'
],
4
50
,
$yCoordinate
,
function
(
$font
)
{
$font
->
filename
(
public_path
(
'static/fonts/SimHei.ttf'
));
$font
->
size
(
32
);
$font
->
color
(
'#000000'
);
$font
->
align
(
'
center
'
);
$font
->
align
(
'
left
'
);
});
// 增加 Y 坐标以准备打印下一个药品
...
...
@@ -181,16 +180,16 @@ public function search()
// 医师签名图片
if
(
$prescription
->
doctor_signed_pic
)
{
$pharmacistSignPath
=
Storage
::
url
(
$prescription
->
doctor_signed_pic
);
$doctorSign
=
Image
::
read
(
file_get_contents
(
$pharmacistSignPath
)
);
$pharmacistSignPath
=
file_get_contents
(
$prescription
->
doctor_signed_pic
);
$doctorSign
=
Image
::
read
(
$pharmacistSignPath
);
$doctorSign
->
rotate
(
90
);
$doctorSign
->
resize
(
150
,
100
);
$img
->
place
(
$doctorSign
,
'bottom-left'
,
400
,
410
);
}
// 药师签名图片
if
(
$prescription
->
pharmacist_signed_pic
)
{
$pharmacistSignPath
=
Storage
::
url
(
$prescription
->
pharmacist_signed_pic
);
$pharmacistSign
=
Image
::
read
(
file_get_contents
(
$pharmacistSignPath
)
);
$pharmacistSignPath
=
file_get_contents
(
$prescription
->
pharmacist_signed_pic
);
$pharmacistSign
=
Image
::
read
(
$pharmacistSignPath
);
$pharmacistSign
->
rotate
(
90
);
$pharmacistSign
->
resize
(
150
,
100
);
$img
->
place
(
$pharmacistSign
,
'bottom-left'
,
870
,
410
);
...
...
@@ -205,7 +204,7 @@ public function search()
// 电子印章版处方图片生成
$eseal
=
Image
::
read
(
public_path
(
'static/images/dianzizhang.png'
));
// $eseal->rotate(90);
$eseal
->
resize
(
150
,
15
0
);
// $eseal->resize(500, 50
0);
$img
->
place
(
$eseal
,
'bottom-right'
,
180
,
500
);
$picEsealName
=
$prescriptionNo
.
'-eseal.jpg'
;
$tempEsealPath
=
storage_path
(
'app/public'
)
.
$picEsealName
;
...
...
app/Api/Controllers/PrescriptionController.php
View file @
d38dc6b2
...
...
@@ -145,6 +145,7 @@ public function create(Request $request)
'pharmacy_drug_id'
=>
$drug
[
'pharmacy_drug_id'
],
'drug_id'
=>
$pharmacyDrugQueryInfo
->
drug_id
,
'drug_name'
=>
$pharmacyDrugQueryInfo
->
drug
->
name
,
'spec'
=>
$pharmacyDrugQueryInfo
->
drug
->
spec
,
'unit'
=>
$pharmacyDrugQueryInfo
->
unit
,
'dosage_id'
=>
$pharmacyDrugQueryInfo
->
dosage_id
,
'dosage_desc'
=>
$pharmacyDrugQueryInfo
->
dosage
->
dosage_desc
,
...
...
app/Models/PrescriptionModel.php
View file @
d38dc6b2
...
...
@@ -72,4 +72,13 @@ public function getPrescriptionPicAttribute($value)
return
Storage
::
url
(
$value
);
}
public
function
getPrescriptionPicEsealAttribute
(
$value
)
{
if
(
Str
::
contains
(
$value
,
'//'
)
||
!
$value
)
{
return
$value
;
}
return
Storage
::
url
(
$value
);
}
}
database/seeders/AdminTablesSeeder.php
View file @
d38dc6b2
...
...
@@ -513,11 +513,11 @@ public function run()
'name'
=>
'药品池'
,
'slug'
=>
'drug'
,
'http_method'
=>
''
,
'http_path'
=>
'drug*'
,
'http_path'
=>
'drug*
,drug-template
'
,
'order'
=>
3
,
'parent_id'
=>
8
,
'created_at'
=>
'2024-11-13 22:27:21'
,
'updated_at'
=>
'2024-11-
13 22:35:0
7'
,
'updated_at'
=>
'2024-11-
20 15:48:3
7'
,
],
[
'id'
=>
11
,
...
...
@@ -770,6 +770,13 @@ public function run()
'created_at'
=>
'2024-11-11 00:40:57'
,
'updated_at'
=>
'2024-11-11 00:40:57'
,
],
[
'id'
=>
4
,
'name'
=>
'普通管理员'
,
'slug'
=>
'tgz.administrator'
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
]
);
...
...
@@ -1189,6 +1196,126 @@ public function run()
'created_at'
=>
'2024-11-13 22:44:24'
,
'updated_at'
=>
'2024-11-13 22:44:24'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
9
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
10
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
11
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
12
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
13
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
14
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
15
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
16
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
17
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
18
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
19
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
20
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
21
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
22
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
29
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
30
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
31
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
32
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
34
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'menu_id'
=>
35
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
]
);
...
...
@@ -1339,6 +1466,90 @@ public function run()
'created_at'
=>
'2024-11-19 15:38:21'
,
'updated_at'
=>
'2024-11-19 15:38:21'
,
],
[
'role_id'
=>
4
,
'permission_id'
=>
9
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'permission_id'
=>
10
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'permission_id'
=>
11
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'permission_id'
=>
12
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'permission_id'
=>
14
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'permission_id'
=>
15
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'permission_id'
=>
17
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'permission_id'
=>
18
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'permission_id'
=>
20
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'permission_id'
=>
21
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'permission_id'
=>
22
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'permission_id'
=>
24
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'permission_id'
=>
25
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
[
'role_id'
=>
4
,
'permission_id'
=>
27
,
'created_at'
=>
'2024-11-20 15:47:55'
,
'updated_at'
=>
'2024-11-20 15:47:55'
,
],
]
);
...
...
public/static/images/dianzizhang.png
View file @
d38dc6b2
47.2 KB
|
W:
|
H:
422 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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