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
4883b7d1
authored
Nov 18, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处方打印
parent
e8005877
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
10 deletions
+9
-10
app/Admin/Controllers/PrescriptionController.php
+6
-8
app/Admin/Controllers/PrescriptionPrintController.php
+0
-0
app/Admin/Extensions/ToolBar/Forms/AddPharmacyDrugForm.php
+2
-1
app/Models/PharmacyDrugModel.php
+1
-1
No files found.
app/Admin/Controllers/PrescriptionController.php
View file @
4883b7d1
...
...
@@ -144,17 +144,15 @@ protected function form()
$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) {
// return json_encode($v);
// });
$form
->
table
(
'inquiry_info'
,
function
(
$table
)
{
$table
->
select
(
'inquiry'
,
'问题项'
)
->
options
(
InquiryModel
::
all
()
->
pluck
(
'question'
,
'id'
))
->
width
(
3
)
;
$table
->
radio
(
'selected'
,
'选择项'
)
->
options
([
1
=>
'是'
,
0
=>
'否'
])
->
width
(
43
)
;
$table
->
select
(
'inquiry'
,
'问题项'
)
->
options
(
InquiryModel
::
all
()
->
pluck
(
'question'
,
'id'
));
$table
->
radio
(
'selected'
,
'选择项'
)
->
options
([
1
=>
'是'
,
0
=>
'否'
]);
})
->
saveAsJson
();
$form
->
multipleSelect
(
'drug_info'
)
->
options
(
PharmacyDrugModel
::
with
(
'drug'
)
->
get
()
->
pluck
(
'drug'
)
->
pluck
(
'name'
,
'id'
))
->
width
(
4
)
->
saving
(
function
(
$v
)
{
return
json_encode
(
$v
);
});
$form
->
table
(
'drug_info'
,
function
(
$table
)
{
$table
->
select
(
'pharmacy_drug'
,
'药品'
)
->
options
(
PharmacyDrugModel
::
with
(
'drug'
)
->
get
()
->
pluck
(
'drug.name'
,
'id'
))
->
width
(
3
);
$table
->
number
(
'num'
,
'数量'
)
->
min
(
1
)
->
default
(
1
)
->
width
(
4
);
})
->
saveAsJson
();
$form
->
switch
(
'is_voided'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
...
...
app/Admin/Controllers/PrescriptionPrintController.php
View file @
4883b7d1
This diff is collapsed.
Click to expand it.
app/Admin/Extensions/ToolBar/Forms/AddPharmacyDrugForm.php
View file @
4883b7d1
...
...
@@ -35,11 +35,12 @@ public function handle(array $input)
return
$this
->
response
()
->
error
(
'请选择药品'
)
->
refresh
();
}
foreach
(
$ids
as
$id
)
{
//
$drug = DrugModel::find($id);
$drug
=
DrugModel
::
find
(
$id
);
$where
=
[
'drug_id'
=>
$id
];
$data
=
[
'pharmacy_id'
=>
Admin
::
user
()
->
pharmacy_id
,
'drug_id'
=>
$id
,
'unit'
=>
$drug
->
unit
,
];
PharmacyDrugModel
::
updateOrCreate
(
$where
,
$data
);
}
...
...
app/Models/PharmacyDrugModel.php
View file @
4883b7d1
...
...
@@ -13,7 +13,7 @@ class PharmacyDrugModel extends Model
protected
$table
=
'pharmacy_drug'
;
public
$fillable
=
[
'pharmacy_id'
,
'drug_id'
];
public
$fillable
=
[
'pharmacy_id'
,
'drug_id'
,
'unit'
];
// 关联药品池
public
function
drug
()
...
...
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