Commit d38dc6b2 by 赵增煜
parents 4da9d3c6 6e0776be
...@@ -60,14 +60,14 @@ public function search() ...@@ -60,14 +60,14 @@ public function search()
return response()->json([ return response()->json([
'status' => true, 'status' => true,
'data' => [ 'data' => [
'img_url' => Storage::url($prescription->prescription_pic_eseal), 'img_url' => $prescription->prescription_pic_eseal,
], ],
]); ]);
} elseif ($prescription->prescription_pic) { } elseif ($prescription->prescription_pic) {
return response()->json([ return response()->json([
'status' => true, 'status' => true,
'data' => [ 'data' => [
'img_url' => Storage::url($prescription->prescription_pic), 'img_url' => $prescription->prescription_pic,
], ],
]); ]);
} }
...@@ -125,8 +125,7 @@ public function search() ...@@ -125,8 +125,7 @@ public function search()
$font->color('#000000'); $font->color('#000000');
}); });
$drugInfo = $prescription->drug_info; // 每个元素包含 'pharmacy_drug', 'num' $medicines = $prescription->drug_info; // 每个元素包含 'pharmacy_drug', 'num'
$medicines = json_decode($drugInfo, true);
// $medicines = []; // $medicines = [];
// foreach ($drugInfo as $v) { // foreach ($drugInfo as $v) {
// $pharmacyDrug = PharmacyDrugModel::with(['drug', 'dosage'])->find($v['pharmacy_drug']); // $pharmacyDrug = PharmacyDrugModel::with(['drug', 'dosage'])->find($v['pharmacy_drug']);
...@@ -145,7 +144,7 @@ public function search() ...@@ -145,7 +144,7 @@ public function search()
foreach ($medicines as $medicine) { foreach ($medicines as $medicine) {
// 打印药品名称、规格和盒数 // 打印药品名称、规格和盒数
$medicineText = "{$medicine['drug_name']} {$medicine['spec']} {$medicine['num']}{$medicine['unit']}"; $medicineText = "{$medicine['drug_name']} {$medicine['spec']} {$medicine['num']}{$medicine['unit']}";
$img->text($medicineText, 550, $yCoordinate, function ($font) { $img->text($medicineText, 450, $yCoordinate, function ($font) {
$font->filename(public_path('static/fonts/SimHei.ttf')); $font->filename(public_path('static/fonts/SimHei.ttf'));
$font->size(32); $font->size(32);
$font->color('#000000'); $font->color('#000000');
...@@ -156,11 +155,11 @@ public function search() ...@@ -156,11 +155,11 @@ public function search()
$yCoordinate += 40; // 根据字体大小调整行间距 $yCoordinate += 40; // 根据字体大小调整行间距
// 打印 sig 信息 // 打印 sig 信息
$img->text('Sig: '.$medicine['dosage_desc'], 550, $yCoordinate, function ($font) { $img->text('Sig: '.$medicine['dosage_desc'], 450, $yCoordinate, function ($font) {
$font->filename(public_path('static/fonts/SimHei.ttf')); $font->filename(public_path('static/fonts/SimHei.ttf'));
$font->size(32); $font->size(32);
$font->color('#000000'); $font->color('#000000');
$font->align('center'); $font->align('left');
}); });
// 增加 Y 坐标以准备打印下一个药品 // 增加 Y 坐标以准备打印下一个药品
...@@ -181,16 +180,16 @@ public function search() ...@@ -181,16 +180,16 @@ public function search()
// 医师签名图片 // 医师签名图片
if ($prescription->doctor_signed_pic) { if ($prescription->doctor_signed_pic) {
$pharmacistSignPath = Storage::url($prescription->doctor_signed_pic); $pharmacistSignPath = file_get_contents($prescription->doctor_signed_pic);
$doctorSign = Image::read(file_get_contents($pharmacistSignPath)); $doctorSign = Image::read($pharmacistSignPath);
$doctorSign->rotate(90); $doctorSign->rotate(90);
$doctorSign->resize(150, 100); $doctorSign->resize(150, 100);
$img->place($doctorSign, 'bottom-left', 400, 410); $img->place($doctorSign, 'bottom-left', 400, 410);
} }
// 药师签名图片 // 药师签名图片
if ($prescription->pharmacist_signed_pic) { if ($prescription->pharmacist_signed_pic) {
$pharmacistSignPath = Storage::url($prescription->pharmacist_signed_pic); $pharmacistSignPath = file_get_contents($prescription->pharmacist_signed_pic);
$pharmacistSign = Image::read(file_get_contents($pharmacistSignPath)); $pharmacistSign = Image::read($pharmacistSignPath);
$pharmacistSign->rotate(90); $pharmacistSign->rotate(90);
$pharmacistSign->resize(150, 100); $pharmacistSign->resize(150, 100);
$img->place($pharmacistSign, 'bottom-left', 870, 410); $img->place($pharmacistSign, 'bottom-left', 870, 410);
...@@ -205,7 +204,7 @@ public function search() ...@@ -205,7 +204,7 @@ public function search()
// 电子印章版处方图片生成 // 电子印章版处方图片生成
$eseal = Image::read(public_path('static/images/dianzizhang.png')); $eseal = Image::read(public_path('static/images/dianzizhang.png'));
// $eseal->rotate(90); // $eseal->rotate(90);
$eseal->resize(150, 150); // $eseal->resize(500, 500);
$img->place($eseal, 'bottom-right', 180, 500); $img->place($eseal, 'bottom-right', 180, 500);
$picEsealName = $prescriptionNo.'-eseal.jpg'; $picEsealName = $prescriptionNo.'-eseal.jpg';
$tempEsealPath = storage_path('app/public').$picEsealName; $tempEsealPath = storage_path('app/public').$picEsealName;
......
...@@ -145,6 +145,7 @@ public function create(Request $request) ...@@ -145,6 +145,7 @@ public function create(Request $request)
'pharmacy_drug_id' => $drug['pharmacy_drug_id'], 'pharmacy_drug_id' => $drug['pharmacy_drug_id'],
'drug_id' => $pharmacyDrugQueryInfo->drug_id, 'drug_id' => $pharmacyDrugQueryInfo->drug_id,
'drug_name' => $pharmacyDrugQueryInfo->drug->name, 'drug_name' => $pharmacyDrugQueryInfo->drug->name,
'spec' => $pharmacyDrugQueryInfo->drug->spec,
'unit' => $pharmacyDrugQueryInfo->unit, 'unit' => $pharmacyDrugQueryInfo->unit,
'dosage_id' => $pharmacyDrugQueryInfo->dosage_id, 'dosage_id' => $pharmacyDrugQueryInfo->dosage_id,
'dosage_desc' => $pharmacyDrugQueryInfo->dosage->dosage_desc, 'dosage_desc' => $pharmacyDrugQueryInfo->dosage->dosage_desc,
......
...@@ -72,4 +72,13 @@ public function getPrescriptionPicAttribute($value) ...@@ -72,4 +72,13 @@ public function getPrescriptionPicAttribute($value)
return Storage::url($value); return Storage::url($value);
} }
public function getPrescriptionPicEsealAttribute($value)
{
if (Str::contains($value, '//') || ! $value) {
return $value;
}
return Storage::url($value);
}
} }
...@@ -513,11 +513,11 @@ public function run() ...@@ -513,11 +513,11 @@ public function run()
'name' => '药品池', 'name' => '药品池',
'slug' => 'drug', 'slug' => 'drug',
'http_method' => '', 'http_method' => '',
'http_path' => 'drug*', 'http_path' => 'drug*,drug-template',
'order' => 3, 'order' => 3,
'parent_id' => 8, 'parent_id' => 8,
'created_at' => '2024-11-13 22:27:21', 'created_at' => '2024-11-13 22:27:21',
'updated_at' => '2024-11-13 22:35:07', 'updated_at' => '2024-11-20 15:48:37',
], ],
[ [
'id' => 11, 'id' => 11,
...@@ -770,6 +770,13 @@ public function run() ...@@ -770,6 +770,13 @@ public function run()
'created_at' => '2024-11-11 00:40:57', 'created_at' => '2024-11-11 00:40:57',
'updated_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() ...@@ -1189,6 +1196,126 @@ public function run()
'created_at' => '2024-11-13 22:44:24', 'created_at' => '2024-11-13 22:44:24',
'updated_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() ...@@ -1339,6 +1466,90 @@ public function run()
'created_at' => '2024-11-19 15:38:21', 'created_at' => '2024-11-19 15:38:21',
'updated_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',
],
] ]
); );
......

47.2 KB | W: | H:

422 KB | W: | H:

public/static/images/dianzizhang.png
public/static/images/dianzizhang.png
public/static/images/dianzizhang.png
public/static/images/dianzizhang.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment