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
24961383
authored
Nov 24, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加筛选和状态显示
parent
dbf57255
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
7 deletions
+48
-7
app/Admin/Controllers/PatientController.php
+1
-1
app/Admin/Controllers/PrescriptionController.php
+4
-3
app/Models/PatientModel.php
+17
-0
app/Models/PrescriptionModel.php
+26
-3
No files found.
app/Admin/Controllers/PatientController.php
View file @
24961383
...
@@ -35,7 +35,7 @@ protected function grid()
...
@@ -35,7 +35,7 @@ protected function grid()
$grid
->
column
(
'mobile'
)
->
display
(
function
(
$content
)
{
$grid
->
column
(
'mobile'
)
->
display
(
function
(
$content
)
{
return
data_masking
(
$content
,
'mobile'
);
return
data_masking
(
$content
,
'mobile'
);
});
});
$grid
->
column
(
'is_default'
)
->
using
(
[
0
=>
'否'
,
1
=>
'是'
]
);
$grid
->
column
(
'is_default'
)
->
using
(
PatientModel
::
IS_DEFAULT_MAP
)
->
dot
(
PatientModel
::
IS_DEFAULT_MAP_COLOR
);
$grid
->
column
(
'user.id'
,
'关联用户'
);
$grid
->
column
(
'user.id'
,
'关联用户'
);
$grid
->
column
(
'pharmacy.name'
,
'关联药店'
);
$grid
->
column
(
'pharmacy.name'
,
'关联药店'
);
...
...
app/Admin/Controllers/PrescriptionController.php
View file @
24961383
...
@@ -68,20 +68,21 @@ protected function grid()
...
@@ -68,20 +68,21 @@ protected function grid()
// $grid->column('pharmacist_id');
// $grid->column('pharmacist_id');
// $grid->column('pharmacist_license_number');
// $grid->column('pharmacist_license_number');
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'is_abnormal'
)
->
using
(
[
0
=>
'否'
,
1
=>
'是'
]
);
$grid
->
column
(
'is_abnormal'
)
->
using
(
PrescriptionModel
::
IS_ABNORMAL_MAP
)
->
badge
(
PrescriptionModel
::
IS_ABNORMAL_MAP_COLOR
);
$grid
->
column
(
'is_voided'
)
->
using
(
PrescriptionModel
::
IS_VOIDED_MAP
);
$grid
->
column
(
'is_voided'
)
->
using
(
PrescriptionModel
::
IS_VOIDED_MAP
)
->
badge
(
PrescriptionModel
::
IS_VOIDED_MAP_COLOR
)
;
// $grid->column('updated_at')->sortable();
// $grid->column('updated_at')->sortable();
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
expand
();
// 默认展开搜索框
$filter
->
expand
();
// 默认展开搜索框
$filter
->
equal
(
'pharmacy_id'
)
->
select
(
PharmacyModel
::
all
()
->
pluck
(
'name'
,
'id'
))
->
width
(
3
);
$filter
->
like
(
'patient_name'
)
->
width
(
3
);
$filter
->
like
(
'patient_name'
)
->
width
(
3
);
$filter
->
like
(
'diagnosis_name'
)
->
width
(
3
);
$filter
->
like
(
'diagnosis_name'
)
->
width
(
3
);
$filter
->
equal
(
'pharmacy_id'
)
->
select
(
PharmacyModel
::
all
()
->
pluck
(
'name'
,
'id'
))
->
width
(
3
);
$filter
->
in
(
'status'
)
->
checkbox
(
PrescriptionModel
::
PRESCRIPTION_STATUS_MAP
)
->
width
(
3
);
$filter
->
in
(
'status'
)
->
checkbox
(
PrescriptionModel
::
PRESCRIPTION_STATUS_MAP
)
->
width
(
3
);
$filter
->
in
(
'is_abnormal'
)
->
checkbox
([
0
=>
'否'
,
1
=>
'是'
])
->
width
(
3
);
$filter
->
in
(
'is_abnormal'
)
->
checkbox
([
0
=>
'否'
,
1
=>
'是'
])
->
width
(
3
);
$filter
->
in
(
'is_voided'
)
->
checkbox
(
PrescriptionModel
::
IS_VOIDED_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
);
});
});
// $show->field('is_voided')->width(3)->using(PrescriptionModel::IS_VOIDED_MAP);
// $show->field('is_voided')->width(3)->using(PrescriptionModel::IS_VOIDED_MAP);
...
...
app/Models/PatientModel.php
View file @
24961383
...
@@ -27,6 +27,23 @@ class PatientModel extends Model
...
@@ -27,6 +27,23 @@ class PatientModel extends Model
self
::
SEX_FEMALE
=>
'女'
,
self
::
SEX_FEMALE
=>
'女'
,
];
];
// 是否默认[0=否,1=是]
const
IS_DEFAULT_FALSE
=
0
;
const
IS_DEFAULT_TRUE
=
1
;
// 是否默认-文字映射
const
IS_DEFAULT_MAP
=
[
self
::
IS_DEFAULT_FALSE
=>
'否'
,
self
::
IS_DEFAULT_TRUE
=>
'是'
,
];
// 是否默认-颜色映射
const
IS_DEFAULT_MAP_COLOR
=
[
self
::
IS_DEFAULT_FALSE
=>
'gray'
,
self
::
IS_DEFAULT_TRUE
=>
'success'
,
];
/**
/**
* 根据身份证设置性别
* 根据身份证设置性别
*/
*/
...
...
app/Models/PrescriptionModel.php
View file @
24961383
...
@@ -46,15 +46,38 @@ class PrescriptionModel extends Model
...
@@ -46,15 +46,38 @@ class PrescriptionModel extends Model
self
::
OPEN_SOURCE_PHARMACY
=>
'店开'
,
self
::
OPEN_SOURCE_PHARMACY
=>
'店开'
,
];
];
// 作废状态[0=未作废,1=作废]
// 异常处方单状态[0=否,1=是]
const
IS_ABNORMAL_FALSE
=
0
;
const
IS_ABNORMAL_TRUE
=
1
;
// 异常处方单状态-文字映射
const
IS_ABNORMAL_MAP
=
[
self
::
IS_VOIDED_FALSE
=>
'否'
,
self
::
IS_VOIDED_TRUE
=>
'是'
,
];
// 异常处方单状态-颜色映射
const
IS_ABNORMAL_MAP_COLOR
=
[
self
::
IS_VOIDED_FALSE
=>
'gray'
,
self
::
IS_VOIDED_TRUE
=>
'danger'
,
];
// 作废状态[0=否,1=是]
const
IS_VOIDED_FALSE
=
0
;
const
IS_VOIDED_FALSE
=
0
;
const
IS_VOIDED_TRUE
=
1
;
const
IS_VOIDED_TRUE
=
1
;
// 作废状态-文字映射
// 作废状态-文字映射
const
IS_VOIDED_MAP
=
[
const
IS_VOIDED_MAP
=
[
self
::
IS_VOIDED_FALSE
=>
'未作废'
,
self
::
IS_VOIDED_FALSE
=>
'否'
,
self
::
IS_VOIDED_TRUE
=>
'作废'
,
self
::
IS_VOIDED_TRUE
=>
'是'
,
];
// 作废状态-颜色映射
const
IS_VOIDED_MAP_COLOR
=
[
self
::
IS_VOIDED_FALSE
=>
'gray'
,
self
::
IS_VOIDED_TRUE
=>
'danger'
,
];
];
public
function
getDoctorSignedPicAttribute
(
$value
)
public
function
getDoctorSignedPicAttribute
(
$value
)
...
...
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