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
6a6bbd65
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
759b5b57
c297fbb9
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
139 additions
and
7 deletions
+139
-7
app/Admin/Controllers/PharmacyController.php
+9
-3
app/Admin/Controllers/PrescriptionController.php
+71
-4
database/migrations/2024_11_18_112046_add_is_open_to_pharmacy_table.php
+28
-0
database/migrations/2024_11_18_114538_add_business_to_pharmacy_table.php
+30
-0
lang/zh_CN/pharmacy.php
+1
-0
No files found.
app/Admin/Controllers/PharmacyController.php
View file @
6a6bbd65
...
@@ -28,6 +28,7 @@ protected function grid()
...
@@ -28,6 +28,7 @@ protected function grid()
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'status'
)
->
switch
();
$grid
->
column
(
'status'
)
->
switch
();
$grid
->
column
(
'is_open'
)
->
switch
()
->
help
(
'药店控制'
);
$grid
->
column
(
'name'
);
$grid
->
column
(
'name'
);
// $grid->column('business_license')->image('', 50, 50);
// $grid->column('business_license')->image('', 50, 50);
// $grid->column('drug_biz_license')->image('', 50, 50);
// $grid->column('drug_biz_license')->image('', 50, 50);
...
@@ -37,7 +38,12 @@ protected function grid()
...
@@ -37,7 +38,12 @@ protected function grid()
// $grid->column('pre_packaged_food')->image('', 50, 50);
// $grid->column('pre_packaged_food')->image('', 50, 50);
$grid
->
column
(
'area'
);
$grid
->
column
(
'area'
);
$grid
->
column
(
'address'
);
$grid
->
column
(
'address'
);
$grid
->
column
(
'business_hours'
);
$grid
->
column
(
'营业时间'
)
->
display
(
function
()
{
$start
=
\Carbon\Carbon
::
parse
(
$this
->
business_start
)
->
format
(
'H:i'
);
$end
=
\Carbon\Carbon
::
parse
(
$this
->
business_end
)
->
format
(
'H:i'
);
return
$start
.
'~'
.
$end
;
});
$grid
->
column
(
'mobile'
);
$grid
->
column
(
'mobile'
);
// $grid->column('lng');
// $grid->column('lng');
// $grid->column('lat');
// $grid->column('lat');
...
@@ -84,7 +90,6 @@ protected function detail($id)
...
@@ -84,7 +90,6 @@ protected function detail($id)
$show
->
field
(
'area'
)
->
width
(
4
);
$show
->
field
(
'area'
)
->
width
(
4
);
$show
->
field
(
'address'
)
->
width
(
4
);
$show
->
field
(
'address'
)
->
width
(
4
);
$show
->
field
(
'mobile'
)
->
width
(
4
);
$show
->
field
(
'mobile'
)
->
width
(
4
);
$show
->
field
(
'business_hours'
)
->
width
(
4
);
$show
->
field
(
'lng'
)
->
width
(
4
);
$show
->
field
(
'lng'
)
->
width
(
4
);
$show
->
field
(
'lat'
)
->
width
(
4
);
$show
->
field
(
'lat'
)
->
width
(
4
);
$show
->
field
(
'status'
)
->
width
(
4
);
$show
->
field
(
'status'
)
->
width
(
4
);
...
@@ -116,10 +121,11 @@ protected function form()
...
@@ -116,10 +121,11 @@ protected function form()
$form
->
text
(
'area'
)
->
width
(
4
);
$form
->
text
(
'area'
)
->
width
(
4
);
$form
->
text
(
'address'
)
->
width
(
4
);
$form
->
text
(
'address'
)
->
width
(
4
);
$form
->
mobile
(
'mobile'
)
->
width
(
4
)
->
required
()
->
help
(
'药店登录账号'
);
$form
->
mobile
(
'mobile'
)
->
width
(
4
)
->
required
()
->
help
(
'药店登录账号'
);
$form
->
t
ext
(
'business_hours'
)
->
width
(
4
);
$form
->
t
imeRange
(
'business_start'
,
'business_end'
,
'营业时间'
)
->
required
(
);
$form
->
map
(
'lat'
,
'lng'
,
'经纬度坐标'
);
$form
->
map
(
'lat'
,
'lng'
,
'经纬度坐标'
);
$form
->
select
(
'user_id'
)
->
options
(
User
::
all
()
->
pluck
(
'openid'
,
'id'
))
->
width
(
4
)
->
help
(
'实际后台操作可以不用关联'
);
$form
->
select
(
'user_id'
)
->
options
(
User
::
all
()
->
pluck
(
'openid'
,
'id'
))
->
width
(
4
)
->
help
(
'实际后台操作可以不用关联'
);
$form
->
switch
(
'status'
)
->
width
(
4
);
$form
->
switch
(
'status'
)
->
width
(
4
);
$form
->
switch
(
'is_open'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'updated_at'
)
->
width
(
4
);
$form
->
display
(
'updated_at'
)
->
width
(
4
);
...
...
app/Admin/Controllers/PrescriptionController.php
View file @
6a6bbd65
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
use
App\Models\DoctorModel
;
use
App\Models\DoctorModel
;
use
App\Models\InquiryModel
;
use
App\Models\InquiryModel
;
use
App\Models\PatientModel
;
use
App\Models\PatientModel
;
use
App\Models\PharmacistModel
;
use
App\Models\PharmacyDrugModel
;
use
App\Models\PharmacyDrugModel
;
use
App\Models\PharmacyModel
;
use
App\Models\PharmacyModel
;
use
App\Models\PrescriptionModel
;
use
App\Models\PrescriptionModel
;
...
@@ -117,15 +118,36 @@ protected function form()
...
@@ -117,15 +118,36 @@ protected function form()
{
{
return
Form
::
make
(
new
PrescriptionRepository
(),
function
(
Form
$form
)
{
return
Form
::
make
(
new
PrescriptionRepository
(),
function
(
Form
$form
)
{
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
radio
(
'status'
)
->
options
(
PrescriptionModel
::
PRESCRIPTION_STATUS_MAP
);
$form
->
radio
(
'status'
)
->
options
(
PrescriptionModel
::
PRESCRIPTION_STATUS_MAP
)
->
default
(
PrescriptionModel
::
PRESCRIPTION_STATUS_PENDING
);
$form
->
select
(
'patient_id'
)
->
options
(
PatientModel
::
all
()
->
pluck
(
'name'
,
'id'
))
->
width
(
4
);
$form
->
select
(
'patient_id'
)
->
options
(
PatientModel
::
all
()
->
pluck
(
'name'
,
'id'
))
->
width
(
4
);
$form
->
hidden
(
'patient_name'
);
$form
->
hidden
(
'patient_age'
);
$form
->
hidden
(
'patient_gender'
);
$form
->
select
(
'diagnosis_id'
)
->
options
(
DiagnosiModel
::
all
()
->
pluck
(
'name'
,
'id'
))
->
width
(
4
);
$form
->
select
(
'diagnosis_id'
)
->
options
(
DiagnosiModel
::
all
()
->
pluck
(
'name'
,
'id'
))
->
width
(
4
);
$form
->
select
(
'doctor_id'
)
->
options
(
DoctorModel
::
all
()
->
pluck
(
'name'
,
'id'
))
->
width
(
4
);
$form
->
hidden
(
'diagnosis_name'
);
$form
->
select
(
'pharmacy_id'
)
->
options
(
PharmacyModel
::
all
()
->
pluck
(
'name'
,
'id'
))
->
width
(
4
);
$form
->
select
(
'pharmacist_id'
)
->
options
(
DoctorModel
::
all
()
->
pluck
(
'name'
,
'id'
))
->
width
(
4
);
$form
->
select
(
'doctor_id'
)
->
options
(
DoctorModel
::
where
(
'status'
,
1
)
->
pluck
(
'name'
,
'id'
))
->
width
(
4
);
$form
->
hidden
(
'doctor_name'
);
$form
->
hidden
(
'doctor_online_hospital_name'
);
$form
->
hidden
(
'doctor_department'
);
$form
->
hidden
(
'doctor_title'
);
$form
->
hidden
(
'doctor_license_no'
);
$form
->
hidden
(
'doctor_signed_pic'
);
$form
->
select
(
'pharmacy_id'
)
->
options
(
PharmacyModel
::
where
(
'status'
,
1
)
->
pluck
(
'name'
,
'id'
))
->
width
(
4
);
$form
->
hidden
(
'pharmacy_name'
);
$form
->
select
(
'pharmacist_id'
)
->
options
(
PharmacistModel
::
where
(
'status'
,
1
)
->
pluck
(
'name'
,
'id'
))
->
width
(
4
);
$form
->
hidden
(
'pharmacist_name'
);
$form
->
hidden
(
'pharmacist_license_number'
);
$form
->
hidden
(
'pharmacist_signed_pic'
);
$form
->
multipleSelect
(
'inquiry_info'
)
->
options
(
InquiryModel
::
all
()
->
pluck
(
'question'
,
'id'
))
->
width
(
4
)
->
saving
(
function
(
$v
)
{
$form
->
multipleSelect
(
'inquiry_info'
)
->
options
(
InquiryModel
::
all
()
->
pluck
(
'question'
,
'id'
))
->
width
(
4
)
->
saving
(
function
(
$v
)
{
return
json_encode
(
$v
);
return
json_encode
(
$v
);
});
});
$form
->
multipleSelect
(
'drug_info'
)
->
options
(
PharmacyDrugModel
::
with
(
'drug'
)
->
get
()
->
pluck
(
'drug'
)
->
pluck
(
'name'
,
'id'
))
->
width
(
4
)
->
saving
(
function
(
$v
)
{
$form
->
multipleSelect
(
'drug_info'
)
->
options
(
PharmacyDrugModel
::
with
(
'drug'
)
->
get
()
->
pluck
(
'drug'
)
->
pluck
(
'name'
,
'id'
))
->
width
(
4
)
->
saving
(
function
(
$v
)
{
return
json_encode
(
$v
);
return
json_encode
(
$v
);
});
});
...
@@ -133,9 +155,54 @@ protected function form()
...
@@ -133,9 +155,54 @@ protected function form()
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'updated_at'
)
->
width
(
4
);
$form
->
display
(
'updated_at'
)
->
width
(
4
);
// 添加隐藏字段以保存冗余数据
$form
->
saving
(
function
(
Form
$form
)
{
$patient
=
PatientModel
::
find
(
$form
->
input
(
'patient_id'
));
$doctor
=
DoctorModel
::
find
(
$form
->
input
(
'doctor_id'
));
$pharmacist
=
PharmacistModel
::
find
(
$form
->
input
(
'pharmacist_id'
));
$diagnosis
=
DiagnosiModel
::
find
(
$form
->
input
(
'diagnosis_id'
));
$pharmacy
=
PharmacyModel
::
find
(
$form
->
input
(
'pharmacy_id'
));
// 根据身份证计算年龄和性别
if
(
$patient
)
{
$form
->
patient_name
=
$patient
->
name
;
$form
->
patient_age
=
getAgeByIdCard
(
$patient
->
id_card
);
$form
->
patient_gender
=
$patient
->
gender
;
}
if
(
$diagnosis
)
{
$form
->
diagnosis_name
=
$diagnosis
->
name
;
// 假设有诊断名称字段
}
if
(
$doctor
)
{
$form
->
doctor_name
=
$doctor
->
name
;
$form
->
doctor_online_hospital_name
=
$doctor
->
online_hospital_name
;
// 假设有在线医院名称字段
$form
->
doctor_department
=
$doctor
->
department
;
$form
->
doctor_title
=
$doctor
->
doctor_title
;
$form
->
doctor_license_no
=
$doctor
->
license_no
;
$form
->
doctor_signed_pic
=
$doctor
->
signed_pic
;
}
if
(
$pharmacist
)
{
$form
->
pharmacist_name
=
$pharmacist
->
name
;
$form
->
pharmacist_license_number
=
$pharmacist
->
license_number
;
$form
->
pharmacist_signed_pic
=
$pharmacist
->
signed_pic
;
}
if
(
$pharmacy
)
{
$form
->
pharmacy_name
=
$pharmacy
->
name
;
}
});
// 右上角按钮控制
// 右上角按钮控制
$form
->
disableDeleteButton
();
// 去掉删除按钮
$form
->
disableDeleteButton
();
// 去掉删除按钮
});
});
}
}
// 计算年龄的辅助方法
private
function
calculateAge
(
$id_card
)
{
// 根据身份证计算年龄的逻辑
// 返回计算出的年龄
}
}
}
database/migrations/2024_11_18_112046_add_is_open_to_pharmacy_table.php
0 → 100644
View file @
6a6bbd65
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
return
new
class
extends
Migration
{
/**
* Run the migrations.
*/
public
function
up
()
:
void
{
Schema
::
table
(
'pharmacy'
,
function
(
Blueprint
$table
)
{
$table
->
boolean
(
'is_open'
)
->
default
(
0
)
->
comment
(
'是否开店[0=闭店,1=开店]'
);
});
}
/**
* Reverse the migrations.
*/
public
function
down
()
:
void
{
Schema
::
table
(
'pharmacy'
,
function
(
Blueprint
$table
)
{
//
});
}
};
database/migrations/2024_11_18_114538_add_business_to_pharmacy_table.php
0 → 100644
View file @
6a6bbd65
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
return
new
class
extends
Migration
{
/**
* Run the migrations.
*/
public
function
up
()
:
void
{
Schema
::
table
(
'pharmacy'
,
function
(
Blueprint
$table
)
{
$table
->
time
(
'business_start'
)
->
comment
(
'营业开始时间'
);
$table
->
time
(
'business_end'
)
->
comment
(
'营业结束时间'
);
$table
->
dropColumn
(
'business_hours'
);
});
}
/**
* Reverse the migrations.
*/
public
function
down
()
:
void
{
Schema
::
table
(
'pharmacy'
,
function
(
Blueprint
$table
)
{
//
});
}
};
lang/zh_CN/pharmacy.php
View file @
6a6bbd65
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
'lat'
=>
'纬度'
,
'lat'
=>
'纬度'
,
'status'
=>
'启用'
,
'status'
=>
'启用'
,
'user_id'
=>
'关联用户'
,
'user_id'
=>
'关联用户'
,
'is_open'
=>
'开店状态'
,
],
],
'options'
=>
[
'options'
=>
[
],
],
...
...
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