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
58581021
authored
Nov 28, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://git.imohe.com/zhaozengyu/tzt-admin
into develop
parents
ed09f8df
1dbeb327
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
94 additions
and
5 deletions
+94
-5
app/Admin/Controllers/DrugController.php
+8
-1
app/Admin/Controllers/PrescriptionController.php
+3
-0
app/Admin/Renderable/DrugTable.php
+6
-2
app/Api/Controllers/DoctorController.php
+1
-1
app/Api/Controllers/PharmacistController.php
+1
-1
app/Api/Controllers/PrescriptionController.php
+1
-0
app/Models/DrugModel.php
+5
-0
app/Models/PrescriptionModel.php
+11
-0
database/migrations/2024_11_28_222121_add_excluded_drug_ids_to_drug_table.php
+28
-0
database/migrations/2024_11_28_223219_add_prescription_type_to_prescription_table.php
+28
-0
lang/zh_CN/drug.php
+1
-0
lang/zh_CN/prescription.php
+1
-0
No files found.
app/Admin/Controllers/DrugController.php
View file @
58581021
...
...
@@ -3,6 +3,7 @@
namespace
App\Admin\Controllers
;
use
App\Admin\Extensions\ToolBar\Actions\DrugImportAction
;
use
App\Admin\Renderable\DrugTable
;
use
App\Admin\Repositories\DrugRepository
;
use
App\Models\DrugModel
;
use
App\Models\DrugTagModel
;
...
...
@@ -140,7 +141,13 @@ protected function form()
->
customFormat
(
function
(
$v
)
{
return
array_column
(
$v
,
'id'
);
});
// if ($form->isEditing()) {
$form
->
multipleSelectTable
(
'excluded_drug_ids'
,
'选择互斥药品'
)
->
title
(
'选择药品'
)
->
dialogWidth
(
'70%'
)
// 弹窗宽度,默认 800px
->
from
(
DrugTable
::
make
()
->
payload
([
'drug_id'
=>
$form
->
getKey
()]))
->
model
(
DrugModel
::
class
,
'id'
,
'name'
);
// }
$form
->
display
(
'created_at'
);
$form
->
display
(
'updated_at'
);
});
...
...
app/Admin/Controllers/PrescriptionController.php
View file @
58581021
...
...
@@ -31,6 +31,7 @@ protected function grid()
$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
(
'patient_name'
);
$grid
->
column
(
'patient_age'
);
$grid
->
column
(
'patient_gender'
)
->
using
(
PatientModel
::
SEX_MAP
);
...
...
@@ -83,6 +84,7 @@ protected function grid()
$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
);
});
// $show->field('is_voided')->width(3)->using(PrescriptionModel::IS_VOIDED_MAP);
...
...
@@ -151,6 +153,7 @@ protected function detail($id)
$show
->
field
(
'is_voided'
)
->
width
(
3
)
->
using
(
PrescriptionModel
::
IS_VOIDED_MAP
);
$show
->
field
(
'is_abnormal'
)
->
width
(
3
)
->
using
([
0
=>
'否'
,
1
=>
'是'
]);
$show
->
field
(
'prescription_type'
)
->
width
(
3
)
->
using
(
PrescriptionModel
::
PRESCRIPTION_TYPE_MAP
);
$show
->
panel
()
->
tools
(
function
(
$tools
)
{
$tools
->
disableEdit
();
...
...
app/Admin/Renderable/DrugTable.php
View file @
58581021
...
...
@@ -10,9 +10,13 @@ class DrugTable extends LazyRenderable
{
public
function
grid
()
:
Grid
{
return
Grid
::
make
(
new
DrugModel
(),
function
(
Grid
$grid
)
{
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$ownerDrugId
=
$this
->
payload
[
'drug_id'
]
??
0
;
return
Grid
::
make
(
new
DrugModel
(),
function
(
Grid
$grid
)
use
(
$ownerDrugId
)
{
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
if
(
$ownerDrugId
)
{
$grid
->
model
()
->
where
(
'id'
,
'!='
,
$ownerDrugId
);
}
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'name'
,
'药品名称'
);
$grid
->
column
(
'code'
,
'简码'
);
...
...
app/Api/Controllers/DoctorController.php
View file @
58581021
...
...
@@ -49,7 +49,7 @@ public function upload(Request $request)
// 签名图片地址记录到数据库
$authInfo
=
auth
(
'api'
)
->
user
();
$doctor
=
DoctorModel
::
where
(
'user_id'
,
$authInfo
->
id
)
->
first
();
$doctor
->
signed_pic
=
$
imageUrl
;
$doctor
->
signed_pic
=
$
path
;
if
(
$doctor
->
save
())
{
return
$this
->
success
([
'message'
=>
'ok'
,
'url'
=>
$imageUrl
]);
...
...
app/Api/Controllers/PharmacistController.php
View file @
58581021
...
...
@@ -185,7 +185,7 @@ public function upload(Request $request)
$imageUrl
=
Storage
::
url
(
$path
);
// 签名图片地址记录到数据库
$pharmacist
->
signed_pic
=
$
imageUrl
;
$pharmacist
->
signed_pic
=
$
path
;
if
(
$pharmacist
->
save
())
{
return
$this
->
success
([
'message'
=>
'ok'
,
'url'
=>
$imageUrl
]);
}
...
...
app/Api/Controllers/PrescriptionController.php
View file @
58581021
...
...
@@ -119,6 +119,7 @@ public function create(Request $request)
$pharmacy_id
=
$pharmacy
->
id
;
$open_source
=
1
;
}
elseif
(
$authInfo
->
last_login_type
==
User
::
LOGIN_TYPE_USER
)
{
return
$this
->
failed
(
'用户端暂时无法开处方'
);
$pharmacy
=
PharmacyModel
::
find
(
$pharmacy_id
);
if
(
!
$pharmacy
)
{
return
$this
->
failed
(
'你查询的药店信息不存在!'
);
...
...
app/Models/DrugModel.php
View file @
58581021
...
...
@@ -34,6 +34,11 @@ class DrugModel extends Model
'code'
,
];
// 数组json相互转换
protected
$casts
=
[
'excluded_drug_ids'
=>
'array'
,
];
// 是否处方药[0=否,1=是]
const
RX_TRUE
=
1
;
...
...
app/Models/PrescriptionModel.php
View file @
58581021
...
...
@@ -87,6 +87,17 @@ class PrescriptionModel extends Model
self
::
IS_VOIDED_TRUE
=>
'danger'
,
];
// 处方类型[0=中药,1=西药]
const
PRESCRIPTION_TYPE_TCM
=
0
;
const
PRESCRIPTION_TYPE_WM
=
1
;
// 处方类型-文字映射
const
PRESCRIPTION_TYPE_MAP
=
[
self
::
PRESCRIPTION_TYPE_TCM
=>
'中药'
,
self
::
PRESCRIPTION_TYPE_WM
=>
'西药'
,
];
public
function
getDoctorSignedPicAttribute
(
$value
)
{
if
(
Str
::
contains
(
$value
,
'//'
)
||
!
$value
)
{
...
...
database/migrations/2024_11_28_222121_add_excluded_drug_ids_to_drug_table.php
0 → 100644
View file @
58581021
<?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
(
'drug'
,
function
(
Blueprint
$table
)
{
$table
->
text
(
'excluded_drug_ids'
)
->
nullable
()
->
comment
(
'互斥的药品id'
);
});
}
/**
* Reverse the migrations.
*/
public
function
down
()
:
void
{
Schema
::
table
(
'drug'
,
function
(
Blueprint
$table
)
{
//
});
}
};
database/migrations/2024_11_28_223219_add_prescription_type_to_prescription_table.php
0 → 100644
View file @
58581021
<?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
(
'prescription'
,
function
(
Blueprint
$table
)
{
$table
->
tinyInteger
(
'prescription_type'
)
->
default
(
0
)
->
comment
(
'处方类型[0=中药,1=西药]'
);
});
}
/**
* Reverse the migrations.
*/
public
function
down
()
:
void
{
Schema
::
table
(
'prescription'
,
function
(
Blueprint
$table
)
{
//
});
}
};
lang/zh_CN/drug.php
View file @
58581021
...
...
@@ -24,6 +24,7 @@
'is_si'
=>
'是否医保药'
,
'limit_buy_7'
=>
'7天限购'
,
'tag'
=>
'标签'
,
'excluded_drug_ids'
=>
'互斥药品id组'
,
],
'options'
=>
[
],
...
...
lang/zh_CN/prescription.php
View file @
58581021
...
...
@@ -37,6 +37,7 @@
'prescription_at'
=>
'开方时间'
,
'review_at'
=>
'审方时间'
,
'is_abnormal'
=>
'异常处方单'
,
'prescription_type'
=>
'处方类型'
,
],
'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