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
8723006f
authored
Apr 01, 2025
by
赵增煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
药店处方列表
parent
e0b579a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
27 deletions
+31
-27
app/Admin/Controllers/PharmacyPrescriptionController.php
+31
-27
No files found.
app/Admin/Controllers/PharmacyPrescriptionController.php
View file @
8723006f
...
...
@@ -21,6 +21,13 @@
// 处方列表
class
PharmacyPrescriptionController
extends
AdminController
{
public
function
index
(
Content
$content
)
{
return
$content
->
header
(
'处方列表'
)
// 设置 content-header 的标题
->
description
(
'列表'
)
// 可选,设置 content-header 的副标题
->
body
(
$this
->
grid
());
// 设置页面主体为 Grid
}
/**
* Make a grid builder.
*
...
...
@@ -35,16 +42,16 @@ protected function grid()
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$grid
->
column
(
'id'
,
'处方单编号'
)
->
sortable
();
$grid
->
column
(
'status'
)
->
using
(
PrescriptionModel
::
PRESCRIPTION_STATUS_MAP
)
->
badge
(
PrescriptionModel
::
PRESCRIPTION_STATUS_MAP_COLOR
);
$grid
->
column
(
'prescription_type'
)
->
using
(
PrescriptionModel
::
PRESCRIPTION_TYPE_MAP
);
$grid
->
column
(
'reject_status'
)
->
using
(
PrescriptionModel
::
REJECT_STSATUS_MAP
);
$grid
->
column
(
'patient_name'
);
$grid
->
column
(
'patient_age'
);
$grid
->
column
(
'patient_gender'
)
->
using
(
PatientModel
::
SEX_MAP
);
$grid
->
column
(
'diagnosis_name'
);
$grid
->
column
(
'doctor_name'
);
$grid
->
column
(
'pharmacist_name'
);
$grid
->
column
(
'drug_info'
);
$grid
->
column
(
'status'
,
'处方状态'
)
->
using
(
PrescriptionModel
::
PRESCRIPTION_STATUS_MAP
)
->
badge
(
PrescriptionModel
::
PRESCRIPTION_STATUS_MAP_COLOR
);
$grid
->
column
(
'prescription_type'
,
'处方类型'
)
->
using
(
PrescriptionModel
::
PRESCRIPTION_TYPE_MAP
);
$grid
->
column
(
'reject_status'
,
'是否驳回'
)
->
using
(
PrescriptionModel
::
REJECT_STSATUS_MAP
);
$grid
->
column
(
'patient_name'
,
'患者姓名'
);
$grid
->
column
(
'patient_age'
,
'患者年龄'
);
$grid
->
column
(
'patient_gender'
,
'患者性别'
)
->
using
(
PatientModel
::
SEX_MAP
);
$grid
->
column
(
'diagnosis_name'
,
'诊断'
);
$grid
->
column
(
'doctor_name'
,
'医生姓名'
);
$grid
->
column
(
'pharmacist_name'
,
''
);
$grid
->
column
(
'drug_info'
,
'用药信息'
);
$grid
->
column
(
'drug_info'
)
->
pluck
(
'drug_name'
)
->
label
();
$grid
->
column
(
'drug_info'
)
->
display
(
function
(
$drugInfo
)
{
$answerMap
=
[
1
=>
'是'
,
0
=>
'否'
];
...
...
@@ -53,12 +60,12 @@ protected function grid()
return
$item
[
'drug_name'
]
.
' : '
.
(
$item
[
'spec'
]
??
''
)
.
' : '
.
$item
[
'num'
]
.
(
$item
[
'unit'
]
??
''
)
.
' : '
.
(
$item
[
'dosage_desc'
]
??
''
);
},
$drugInfo
);
})
->
label
();
$grid
->
column
(
'pharmacy_name'
);
$grid
->
column
(
'open_source'
)
->
using
(
PrescriptionModel
::
OPEN_SOURCE_MAP
);
$grid
->
column
(
'prescription_at'
);
$grid
->
column
(
'review_at'
);
$grid
->
column
(
'pharmacy_name'
,
'药店名称'
);
$grid
->
column
(
'open_source'
,
'开方来源'
)
->
using
(
PrescriptionModel
::
OPEN_SOURCE_MAP
);
$grid
->
column
(
'prescription_at'
,
'开方时间'
);
$grid
->
column
(
'review_at'
,
'审方时间'
);
// $grid->column('diagnosis_id');
$grid
->
column
(
'inquiry_info'
)
->
display
(
function
(
$inquiryInfo
)
{
$grid
->
column
(
'inquiry_info'
,
'问诊问题'
)
->
display
(
function
(
$inquiryInfo
)
{
$answerMap
=
[
1
=>
'是'
,
0
=>
'否'
];
return
array_map
(
function
(
$item
)
use
(
$answerMap
)
{
...
...
@@ -74,24 +81,21 @@ protected function grid()
// $grid->column('pharmacy_id');
// $grid->column('pharmacist_id');
// $grid->column('pharmacist_license_number');
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'is_abnormal'
)
->
using
(
PrescriptionModel
::
IS_ABNORMAL_MAP
)
->
badge
(
PrescriptionModel
::
IS_ABNORMAL_MAP_COLOR
);
$grid
->
column
(
'is_voided'
)
->
using
(
PrescriptionModel
::
IS_VOIDED_MAP
)
->
badge
(
PrescriptionModel
::
IS_VOIDED_MAP_COLOR
);
$grid
->
column
(
'created_at'
,
'创建时间'
);
$grid
->
column
(
'is_abnormal'
,
'是否异常'
)
->
using
(
PrescriptionModel
::
IS_ABNORMAL_MAP
)
->
badge
(
PrescriptionModel
::
IS_ABNORMAL_MAP_COLOR
);
$grid
->
column
(
'is_voided'
,
'是否作废'
)
->
using
(
PrescriptionModel
::
IS_VOIDED_MAP
)
->
badge
(
PrescriptionModel
::
IS_VOIDED_MAP_COLOR
);
// $grid->column('updated_at')->sortable();
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
expand
();
// 默认展开搜索框
$filter
->
equal
(
'pharmacy_id'
)
->
select
(
PharmacyModel
::
all
()
->
pluck
(
'name'
,
'id'
))
->
width
(
3
);
$filter
->
like
(
'id'
,
'处方单编号'
)
->
width
(
3
);
$filter
->
like
(
'patient_name'
)
->
width
(
3
);
$filter
->
like
(
'diagnosis_name'
)
->
width
(
3
);
$filter
->
in
(
'status'
)
->
checkbox
(
PrescriptionModel
::
PRESCRIPTION_STATUS_MAP
)
->
width
(
3
);
$filter
->
in
(
'is_abnormal'
)
->
checkbox
([
0
=>
'否'
,
1
=>
'是'
])
->
width
(
3
);
$filter
->
in
(
'is_voided'
)
->
checkbox
(
PrescriptionModel
::
IS_VOIDED_MAP
)
->
width
(
3
);
$filter
->
in
(
'open_source'
)
->
checkbox
(
PrescriptionModel
::
OPEN_SOURCE_MAP
)
->
width
(
3
);
$filter
->
in
(
'prescription_type'
)
->
checkbox
(
PrescriptionModel
::
PRESCRIPTION_TYPE_MAP
)
->
width
(
3
);
$filter
->
like
(
'patient_name'
,
'患者姓名'
)
->
width
(
3
);
$filter
->
like
(
'diagnosis_name'
,
'诊断'
)
->
width
(
3
);
$filter
->
in
(
'status'
,
'处方状态'
)
->
checkbox
(
PrescriptionModel
::
PRESCRIPTION_STATUS_MAP
)
->
width
(
3
);
$filter
->
in
(
'is_voided'
,
'是否作废'
)
->
checkbox
(
PrescriptionModel
::
IS_VOIDED_MAP
)
->
width
(
3
);
$filter
->
in
(
'open_source'
,
'开方来源'
)
->
checkbox
(
PrescriptionModel
::
OPEN_SOURCE_MAP
)
->
width
(
3
);
$filter
->
in
(
'prescription_type'
,
'处方类型'
)
->
checkbox
(
PrescriptionModel
::
PRESCRIPTION_TYPE_MAP
)
->
width
(
3
);
});
// $show->field('is_voided')->width(3)->using(PrescriptionModel::IS_VOIDED_MAP);
...
...
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