Commit 9130c523 by lujunyi

药店菜单功能

parent 41461ab5
......@@ -19,6 +19,8 @@ class DoctorController extends AdminController
protected function grid()
{
return Grid::make(new DoctorRepository(), function (Grid $grid) {
$grid->model()->orderBy('id', 'DESC');
$grid->column('id')->sortable();
$grid->column('name');
$grid->column('mobile');
......
......@@ -18,6 +18,8 @@ class DoctorCorrectionController extends AdminController
protected function grid()
{
return Grid::make(new DoctorCorrection(), function (Grid $grid) {
$grid->model()->orderBy('id', 'DESC');
$grid->column('id')->sortable();
$grid->column('doctor_id');
$grid->column('doctor_name');
......
<?php
namespace App\Admin\Controllers;
use App\Admin\Repositories\DosageRepository;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Http\Controllers\AdminController;
use Dcat\Admin\Show;
class DosageController extends AdminController
{
/**
* Make a grid builder.
*
* @return Grid
*/
protected function grid()
{
return Grid::make(new DosageRepository(), function (Grid $grid) {
$grid->model()->orderBy('id', 'DESC');
$grid->column('id')->sortable();
$grid->column('dosage_desc');
$grid->column('dosage_show');
$grid->filter(function (Grid\Filter $filter) {
$filter->panel(); // 更改为 panel 布局
$filter->expand(); // 默认展开搜索框
$filter->like('dosage_desc')->width(3);
});
// 行按钮控制
$grid->disableDeleteButton(); // 禁用删除按钮
// 工具栏按钮控制
$grid->disableBatchDelete(); // 禁用批量删除
});
}
/**
* Make a show builder.
*
* @param mixed $id
* @return Show
*/
protected function detail($id)
{
return Show::make($id, new DosageRepository(), function (Show $show) {
$show->field('id');
$show->field('dosage_desc');
$show->field('dosage_show');
$show->field('created_at');
$show->field('updated_at');
$show->panel()->tools(function ($tools) {
$tools->disableDelete(); // 禁止删除按钮
});
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
return Form::make(new DosageRepository(), function (Form $form) {
$form->display('id')->width(4);
$form->text('dosage_desc')->width(4)->required();
$form->textarea('dosage_show')->width(4);
$form->display('created_at')->width(4);
$form->display('updated_at')->width(4);
// 右上角按钮控制
$form->disableDeleteButton(); // 去掉删除按钮
});
}
}
......@@ -21,6 +21,7 @@ protected function grid()
{
return Grid::make(new DrugRepository(), function (Grid $grid) {
$grid->model()->orderBy('id', 'DESC');
$grid->column('id')->sortable();
$grid->column('name');
$grid->column('code');
......
......@@ -21,6 +21,7 @@ protected function grid()
{
return Grid::make(new InquiryRepository(), function (Grid $grid) {
$grid->model()->orderBy('id', 'DESC');
$grid->column('id')->sortable();
$grid->column('question');
$grid->column('is_common')->using(InquiryModel::INQUIRY_COMMON_MAP);
......
......@@ -21,6 +21,7 @@ protected function grid()
{
return Grid::make(new PatientRepository(), function (Grid $grid) {
$grid->model()->orderBy('id', 'DESC');
$grid->column('id')->sortable();
$grid->column('name');
$grid->column('id_card');
......
......@@ -18,6 +18,8 @@ class PharmacyCorrectionController extends AdminController
protected function grid()
{
return Grid::make(new PharmacyCorrection(), function (Grid $grid) {
$grid->model()->orderBy('id', 'DESC');
$grid->column('id')->sortable();
$grid->column('pharmacy_id');
$grid->column('pharmacy_name');
......
......@@ -18,6 +18,8 @@ class TagController extends AdminController
protected function grid()
{
return Grid::make(new Tag(), function (Grid $grid) {
$grid->model()->orderBy('id', 'DESC');
$grid->column('id')->sortable();
$grid->column('tag_name');
$grid->column('created_at');
......
<?php
namespace App\Admin\Repositories;
use App\Models\DosageModel as Model;
use Dcat\Admin\Repositories\EloquentRepository;
class DosageRepository extends EloquentRepository
{
/**
* Model.
*
* @var string
*/
protected $eloquentClass = Model::class;
}
......@@ -14,6 +14,7 @@
$router->resource('auth/users', 'AdminUserController');
$router->get('/', 'HomeController@index');
/** 平台菜单-start **/
// 药品
$router->resource('drug', 'DrugController');
// 诊断
......@@ -31,12 +32,17 @@
// 标签
$router->resource('tag', 'TagController');
//医师纠错
$router->resource('doctor_correction', 'DoctorCorrectionController');
$router->resource('doctor-correction', 'DoctorCorrectionController');
//药店纠错
$router->resource('pharmacy_correction', 'PharmacyCorrectionController');
$router->resource('pharmacy-correction', 'PharmacyCorrectionController');
// 设置
$router->resource('site-config', 'SiteConfigController');
// 导入日志
$router->resource('/import-log', 'Common\ImportLogController')->names('import-log');
/** 平台菜单-end **/
/** 药店菜单-start **/
// 用法用量
$router->resource('dosage', 'DosageController');
/** 药店菜单-end **/
});
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class DosageModel extends Model
{
use HasDateTimeFormatter;
use SoftDeletes;
protected $table = 'dosage';
}
......@@ -14,6 +14,7 @@
public function up()
{
Schema::create('drug', function (Blueprint $table) {
$table->comment('药品');
$table->bigIncrements('id');
$table->string('name')->index('idx_name')->comment('药品名称');
$table->string('code')->index('idx_code')->comment('简码');
......@@ -28,7 +29,6 @@ public function up()
$table->timestamps();
$table->softDeletes();
});
\DB::statement("ALTER TABLE `drug` comment '药品'");
}
/**
......
......@@ -14,6 +14,7 @@
public function up()
{
Schema::create('diagnosis', function (Blueprint $table) {
$table->comment('诊断');
$table->bigIncrements('id');
$table->string('name')->comment('诊断');
$table->string('content')->comment('显示内容');
......@@ -21,7 +22,6 @@ public function up()
$table->timestamps();
$table->softDeletes();
});
\DB::statement("ALTER TABLE `diagnosis` comment '诊断'");
}
/**
......
......@@ -12,6 +12,7 @@
public function up(): void
{
Schema::create('patient', function (Blueprint $table) {
$table->comment('问诊人');
$table->bigIncrements('id');
$table->string('name', 50)->nullable()->comment('姓名');
$table->tinyInteger('gender')->default(0)->comment('性别。[1=男性,2=女性,0=未知]');
......@@ -23,7 +24,6 @@ public function up(): void
$table->timestamps();
$table->softDeletes();
});
\DB::statement("ALTER TABLE `patient` comment '问诊人'");
}
/**
......
......@@ -14,13 +14,13 @@
public function up()
{
Schema::create('inquiry', function (Blueprint $table) {
$table->comment('问诊问题');
$table->bigIncrements('id');
$table->string('question')->index('idx_question')->comment('问诊问题');
$table->boolean('is_common')->default(1)->comment('通用[0=不是通用,1=通用]');
$table->timestamps();
$table->softDeletes();
});
\DB::statement("ALTER TABLE `inquiry` comment '问诊问题'");
}
/**
......
......@@ -14,6 +14,7 @@
public function up()
{
Schema::create('doctor', function (Blueprint $table) {
$table->comment('医师');
$table->bigIncrements('id');
$table->string('name', 50)->index('idx_name')->comment('姓名');
$table->string('mobile', 11)->index('idx_mobile')->comment('手机号');
......@@ -34,7 +35,6 @@ public function up()
$table->timestamps();
$table->softDeletes();
});
\DB::statement("ALTER TABLE `doctor` comment '医师'");
}
/**
......
......@@ -14,6 +14,7 @@
public function up()
{
Schema::create('pharmacy', function (Blueprint $table) {
$table->comment('药店');
$table->bigIncrements('id');
$table->string('name', 64)->comment('药店名称');
$table->string('business_license')->comment('营业执照');
......@@ -32,7 +33,6 @@ public function up()
$table->timestamps();
$table->softDeletes();
});
\DB::statement("ALTER TABLE `pharmacy` comment '药店'");
}
/**
......
......@@ -14,6 +14,7 @@
public function up()
{
Schema::create('pharmacist', function (Blueprint $table) {
$table->comment('药师');
$table->bigIncrements('id');
$table->string('name', 50)->comment('姓名');
$table->string('id_card', 18)->comment('身份证号');
......@@ -27,7 +28,6 @@ public function up()
$table->timestamps();
$table->softDeletes();
});
\DB::statement("ALTER TABLE `pharmacist` comment '药师'");
}
/**
......
......@@ -14,6 +14,7 @@ class CreateTagTable extends Migration
public function up()
{
Schema::create('tag', function (Blueprint $table) {
$table->comment('药品标签');
$table->bigIncrements('id');
$table->string('tag_name')->default('')->comment('标签名称');
$table->timestamps();
......
......@@ -14,12 +14,14 @@ class CreateDoctorCorrectionTable extends Migration
public function up()
{
Schema::create('doctor_correction', function (Blueprint $table) {
$table->comment('医师');
$table->bigIncrements('id');
$table->integer('doctor_id')->comment('医师编号');
$table->string('doctor_name')->default('')->comment('医师姓名');
$table->tinyInteger('is_handle')->comment('是否处理 0 待处理 1 已处理');
$table->longText('content')->comment('纠错内容');
$table->timestamps();
$table->softDeletes();
});
}
......
......@@ -14,12 +14,14 @@ class CreatePharmacyCorrectionTable extends Migration
public function up()
{
Schema::create('pharmacy_correction', function (Blueprint $table) {
$table->comment('药店纠错');
$table->bigIncrements('id');
$table->integer('pharmacy_id')->comment('药店编号');
$table->string('pharmacy_name')->default('')->comment('药店名称');
$table->tinyInteger('is_handle')->comment('是否处理');
$table->string('content')->default('')->comment('纠错内容');
$table->timestamps();
$table->softDeletes();
});
}
......
<?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::create('dosage', function (Blueprint $table) {
$table->comment('用法用量');
$table->id();
$table->string('dosage_desc', 128)->comment('用法用量');
$table->string('dosage_show')->comment('显示内容');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('dosage');
}
};
......@@ -325,11 +325,11 @@ public function run()
'order' => 23,
'title' => '用法用量',
'icon' => null,
'uri' => null,
'uri' => 'dosage',
'extension' => '',
'show' => 1,
'created_at' => '2024-11-03 23:39:10',
'updated_at' => '2024-11-06 16:21:16',
'updated_at' => '2024-11-10 16:16:37',
],
[
'id' => 27,
......@@ -373,11 +373,11 @@ public function run()
'order' => 11,
'title' => '医师纠错',
'icon' => null,
'uri' => null,
'uri' => 'doctor-correction',
'extension' => '',
'show' => 1,
'created_at' => '2024-11-06 16:19:46',
'updated_at' => '2024-11-06 16:21:16',
'updated_at' => '2024-11-10 16:22:24',
],
[
'id' => 31,
......@@ -385,11 +385,11 @@ public function run()
'order' => 15,
'title' => '药店纠错',
'icon' => null,
'uri' => null,
'uri' => 'pharmacy-correction',
'extension' => '',
'show' => 1,
'created_at' => '2024-11-06 16:20:36',
'updated_at' => '2024-11-06 16:21:16',
'updated_at' => '2024-11-10 16:22:34',
],
[
'id' => 32,
......@@ -421,11 +421,11 @@ public function run()
'order' => 34,
'title' => '设置',
'icon' => null,
'uri' => null,
'uri' => 'site-config',
'extension' => '',
'show' => 1,
'created_at' => '2024-11-06 16:23:54',
'updated_at' => '2024-11-06 16:23:54',
'updated_at' => '2024-11-10 16:21:59',
],
]
);
......
<?php
return [
'labels' => [
'Dosage' => '用法用量',
'dosage' => '用法用量',
],
'fields' => [
'dosage_desc' => '用法用量',
'dosage_show' => '显示内容',
],
'options' => [
],
];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment