| xqd
@@ -0,0 +1,60 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace App\Community\Actions\Vaccine;
|
|
|
+
|
|
|
+use App\Models\OrganizationVaccine;
|
|
|
+use App\Models\Patient;
|
|
|
+use App\Models\Vaccine;
|
|
|
+use Encore\Admin\Actions\Action;
|
|
|
+use Encore\Admin\Actions\RowAction;
|
|
|
+use Encore\Admin\Grid\Tools\AbstractTool;
|
|
|
+use Illuminate\Support\Facades\Request;
|
|
|
+use Encore\Admin\Facades\Admin;
|
|
|
+
|
|
|
+class FasteOrder extends Action
|
|
|
+{
|
|
|
+ protected $selector = '.import-tenant';
|
|
|
+
|
|
|
+ public function handle(Request $request)
|
|
|
+ {
|
|
|
+ $request->file('file');
|
|
|
+ return $this->response()->success('导入完成!')->refresh();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public function form()
|
|
|
+ {
|
|
|
+ Admin::script($this->script());
|
|
|
+ Admin::js('select2.js');
|
|
|
+ $patient = Patient::pluck('name','id');
|
|
|
+ $org_id = Admin::user()->org_id;
|
|
|
+ $ids = OrganizationVaccine::where(['org_id'=>$org_id])->pluck('vaccine_id');
|
|
|
+ $vaccine = Vaccine::whereIn('id',$ids)->pluck('name','id');
|
|
|
+ $this->select('user', '接种人')->options($patient);
|
|
|
+ $this->select('vaccine', '疫苗')->options($vaccine);
|
|
|
+ $this->date('date','时间');
|
|
|
+ $this->select('timer','时间段');
|
|
|
+ }
|
|
|
+
|
|
|
+ public function html()
|
|
|
+ {
|
|
|
+ return <<<HTML
|
|
|
+ <a class="btn btn-sm btn-default import-tenant"><i class="fa fa-calendar-check-o"></i> 快速预约</a>
|
|
|
+HTML;
|
|
|
+ }
|
|
|
+
|
|
|
+ protected function script()
|
|
|
+ {
|
|
|
+
|
|
|
+ return <<<EOT
|
|
|
+
|
|
|
+ $('#date').blur(function () {
|
|
|
+ var url = '';
|
|
|
+ var date = $('#date').val();
|
|
|
+ console.log(date);
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+EOT;
|
|
|
+ }
|
|
|
+}
|