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
b1da0b77
authored
Dec 30, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加580处方单导入模板
parent
cdba2e8a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
app/Admin/Controllers/ExternalPrescriptionController.php
+26
-0
app/Admin/Extensions/ToolBar/Forms/ExternalPrescriptionImportForm.php
+2
-2
app/Admin/routes.php
+2
-0
No files found.
app/Admin/Controllers/ExternalPrescriptionController.php
View file @
b1da0b77
...
@@ -10,6 +10,12 @@
...
@@ -10,6 +10,12 @@
use
App\Models\PharmacyModel
;
use
App\Models\PharmacyModel
;
use
App\Models\ExternalPrescriptionModel
;
use
App\Models\ExternalPrescriptionModel
;
use
App\Admin\Extensions\ToolBar\Actions\ExternalPrescriptionImportAction
;
use
App\Admin\Extensions\ToolBar\Actions\ExternalPrescriptionImportAction
;
use
Box\Spout\Common\Entity\Style\Color
;
use
Box\Spout\Writer\Common\Creator\Style\StyleBuilder
;
use
Box\Spout\Writer\Common\Creator\WriterEntityFactory
;
use
Dcat\EasyExcel\Excel
;
use
Illuminate\Http\Request
;
class
ExternalPrescriptionController
extends
AdminController
class
ExternalPrescriptionController
extends
AdminController
{
{
/**
/**
...
@@ -175,4 +181,24 @@ protected function form()
...
@@ -175,4 +181,24 @@ protected function form()
$form
->
display
(
'updated_at'
);
$form
->
display
(
'updated_at'
);
});
});
}
}
public
function
exportPrescriptionTemplate
(
Request
$request
)
{
$sheet1Head
=
[
'处方编号'
,
'处方开具时间'
,
'处方状态'
,
'企业名称'
,
'门店名称'
,
'会员/代理人'
,
'就诊人姓名'
,
'就诊人电话'
,
'就诊人性别'
,
'就诊人年龄'
,
'就诊人身份证号'
,
'接诊医师姓名'
,
'诊断'
,
'药品名称'
,
'药品规格'
,
'药品数量'
,
'审核药师'
,
'药师审核时间'
,
'药师属性'
,
'调配人'
,
'核对人'
,
'发药人'
];
$sheet1Data
=
[
[
'P1734339107979HN0'
,
'2024-12-16 16:51:48'
,
'正常'
,
'国药控股国大药房河南连锁有限公司'
,
'江阴市正鑫医药有限公司'
,
'会员_1085'
,
'赵海英'
,
'13335150001'
,
'女'
,
'34'
,
''
,
'陆海'
,
'维生素D缺乏症,急性上呼吸道感染'
,
'维生素AD滴剂'
,
'10粒*3板'
,
'1'
,
'林俊杰'
,
'2024-12-16 16:51:58'
,
'总部药师'
,
''
,
''
,
''
],
[
'P1734339107979HN0'
,
'2024-12-16 16:51:48'
,
'正常'
,
'国药控股国大药房河南连锁有限公司'
,
'江阴市正鑫医药有限公司'
,
'会员_1085'
,
'赵海英'
,
'13335150001'
,
'女'
,
'34'
,
''
,
'陆海'
,
'维生素D缺乏症,急性上呼吸道感染'
,
'飞扬胃肠炎片'
,
'24片'
,
'1'
,
'林俊杰'
,
'2024-12-16 16:51:58'
,
'总部药师'
,
''
,
''
,
''
],
];
$sheet1
=
Excel
::
createSheet
(
$sheet1Data
,
'处方明细列表'
,
$sheet1Head
)
->
row
(
function
(
array
$row
)
{
$style
=
(
new
StyleBuilder
)
->
setBackgroundColor
(
Color
::
YELLOW
)
->
build
();
return
WriterEntityFactory
::
createRowFromArray
(
$row
,
$style
);
});
return
Excel
::
export
([
$sheet1
])
->
headings
(
false
)
->
download
(
'580-处方明细.xlsx'
);
}
}
}
app/Admin/Extensions/ToolBar/Forms/ExternalPrescriptionImportForm.php
View file @
b1da0b77
...
@@ -120,8 +120,8 @@ public function form()
...
@@ -120,8 +120,8 @@ public function form()
<span style='color:red;'>
<span style='color:red;'>
1、仅支持xlsx格式
1、仅支持xlsx格式
</span>"
);
</span>"
);
// $downloadUrl = admin_url('dosage
-template');
$downloadUrl
=
admin_url
(
'prescription
-template'
);
// $this->html("<a target='_blank' href='{$downloadUrl}'>下载用法用量
导入模板</a>");
$this
->
html
(
"<a target='_blank' href='
{
$downloadUrl
}
'>下载580处方单
导入模板</a>"
);
}
}
...
...
app/Admin/routes.php
View file @
b1da0b77
...
@@ -51,6 +51,8 @@
...
@@ -51,6 +51,8 @@
$router
->
resource
(
'prescription-log'
,
'PrescriptionLogController'
);
$router
->
resource
(
'prescription-log'
,
'PrescriptionLogController'
);
// 处方-外部处方列表
// 处方-外部处方列表
$router
->
resource
(
'external-prescription'
,
'ExternalPrescriptionController'
);
$router
->
resource
(
'external-prescription'
,
'ExternalPrescriptionController'
);
// 下载导出模板
$router
->
get
(
'prescription-template'
,
'ExternalPrescriptionController@exportPrescriptionTemplate'
);
// 系统-设置
// 系统-设置
$router
->
resource
(
'site-config'
,
'SiteConfigController'
);
$router
->
resource
(
'site-config'
,
'SiteConfigController'
);
...
...
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