1
0
Fork 0
master
panliang 2023-09-22 18:02:22 +08:00
parent 32c8d2cae3
commit 9e3812f051
26 changed files with 37 additions and 18 deletions

View File

@ -57,7 +57,6 @@ class CategoryController extends AdminController
amisMake()->TableColumn()->name('key')->label(__('category.key')),
amisMake()->TableColumn()->name('name')->label(__('category.name')),
// amisMake()->TableColumn()->name('content')->label(__('category.content')),
amisMake()->TextareaControl()->static()->name('content')->label(__('category.content')),
$this->rowActions(true, 'lg'),
]);

View File

@ -10,6 +10,7 @@ use Slowlyo\OwlAdmin\Renderers\Form;
use Slowlyo\OwlAdmin\Renderers\Page;
use App\Models\{Keyword, Patient};
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
/**
* 病人管理
@ -57,6 +58,7 @@ class PatientController extends AdminController
amisMake()->DateControl()->name('birthday')->label(__('patient.birthday')),
amisMake()->DateControl()->name('treat_at')->label(__('patient.treat_at')),
Components::make()->adminUserSelectControl()->name('doctor_id')->label(__('patient.doctor_id')),
amisMake()->ImageControl()->multiple()->receiver(admin_url('upload_image') . '?full-url=1')->name('images')->label(__('patient.images')),
Components::make()->fuEditorControl()->name('illness')->label(__('patient.illness')),
]);
}
@ -118,6 +120,7 @@ class PatientController extends AdminController
amisMake()->TextControl()->name('address')->label(__('patient.address'))->static(),
amisMake()->DateControl()->name('birthday')->label(__('patient.birthday'))->static(),
amisMake()->DateControl()->name('treat_format')->label(__('patient.treat_at'))->static(),
amisMake()->TextControl()->name('images')->label(__('patient.images'))->static()->staticSchema(amisMake()->Images()),
amisMake()->TextControl()->name('doctor.name')->label(__('patient.doctor_id'))->static(),
Components::make()->fuEditorControl()->name('illness')->label(__('patient.illness'))->static(),
amisMake()->TextControl()->name('created_at')->label(__('patient.created_at'))->static(),
@ -125,11 +128,11 @@ class PatientController extends AdminController
amisMake()->Tab()->title('病历记录')->body(amisMake()->Service()
->api(admin_url('/record?_action=getData&page=1&patient_id='.$id.'&perPage=20'))
->body(amisMake()->Table()->columns([
amisMake()->TableColumn()->name('id')->label(__('patient_record.id')),
amisMake()->Mapping()->map($this->getTypeOptions()->pluck('label', 'value'))->name('type_id')->label(__('patient_record.type_id')),
amisMake()->TableColumn()->name('treat_at')->label(__('patient_record.treat_at')),
amisMake()->TableColumn()->name('next_treat_at')->label(__('patient_record.next_treat_at')),
amisMake()->TableColumn()->name('doctor.name')->label(__('patient_record.doctor_id')),
amisMake()->TableColumn()->name('id')->label(__('patient-record.id')),
amisMake()->Mapping()->map($this->getTypeOptions()->pluck('label', 'value'))->name('type_id')->label(__('patient-record.type_id')),
amisMake()->TableColumn()->name('treat_at')->label(__('patient-record.treat_at')),
amisMake()->TableColumn()->name('next_treat_at')->label(__('patient-record.next_treat_at')),
amisMake()->TableColumn()->name('doctor.name')->label(__('patient-record.doctor_id')),
])->affixRow([
amisMake()->Button()->level('link')->label('查看更多')->colSpan(5)->actionType('link')->link(admin_url('/record?patient_id=' . $id)),
])

View File

@ -74,6 +74,7 @@ class PatientRecordController extends AdminController
amisMake()->NumberControl()->name('origin_price')->label(__('patient-record.origin_price'))->required(),
amisMake()->NumberControl()->name('sell_price')->label(__('patient-record.sell_price'))->required(),
amisMake()->SelectControl()->options(OrderStatus::options())->name('order_status')->label(__('patient-record.order_status'))->default(OrderStatus::Success->value)->required(),
amisMake()->ImageControl()->multiple()->receiver(admin_url('upload_image') . '?full-url=1')->name('images')->label(__('patient-record.images')),
amisMake()->Service()
->className('cxd-Form-item')
->id('patient_record_form_content_service')
@ -98,6 +99,7 @@ class PatientRecordController extends AdminController
amisMake()->TextControl()->name('origin_price')->label(__('patient-record.origin_price'))->static(),
amisMake()->TextControl()->name('sell_price')->label(__('patient-record.sell_price'))->static(),
amisMake()->SelectControl()->options(OrderStatus::options())->name('order_status')->label(__('patient-record.order_status'))->static(),
amisMake()->TextControl()->name('images')->label(__('patient.images'))->static()->staticSchema(amisMake()->Images()),
Components::make()->fuEditorControl()->name('content')->label(__('patient-record.content'))->static(),
amisMake()->DateTimeControl()->name('next_treat_at')->label(__('patient-record.next_treat_at'))->static(),
amisMake()->TextControl()->name('notify_user.name')->label(__('patient-record.notify_user_id'))->static(),

View File

@ -38,6 +38,9 @@ class PatientRecordService extends BaseService
if (!$creator_id) {
$data['creator_id'] = data_get(Admin::user(), 'id');
}
if ($images = data_get($data, 'images')) {
$data['images'] = is_array($images) ? $images : explode(',', $images);
}
return $data;
}

View File

@ -3,7 +3,7 @@
namespace App\Admin\Services;
use App\ModelFilters\PatientFilter;
use App\Models\Patient;
use App\Models\{Patient, PatientRecord};
use Illuminate\Support\Facades\Validator;
class PatientService extends BaseService
@ -39,6 +39,9 @@ class PatientService extends BaseService
*/
public function resloveData($data)
{
if ($images = data_get($data, 'images')) {
$data['images'] = is_array($images) ? $images : explode(',', $images);
}
return $data;
}
@ -70,6 +73,8 @@ class PatientService extends BaseService
*/
public function preDelete(array $ids)
{
// 删除就诊记录
PatientRecord::whereIn('patient_id', $ids)->delete();
return true;
}
}

View File

@ -16,7 +16,7 @@ class Patient extends Model
{
use HasDateTimeFormatter, Filterable;
protected $fillable = ['name', 'sex', 'phone', 'address', 'birthday', 'treat_at', 'illness', 'doctor_id', 'remarks'];
protected $fillable = ['name', 'sex', 'phone', 'address', 'birthday', 'treat_at', 'illness', 'doctor_id', 'remarks', 'images'];
protected $appends = ['age', 'sex_text', 'treat_format', 'birthday_format'];
@ -24,6 +24,7 @@ class Patient extends Model
'sex' => Gender::class,
'treat_at' => 'date',
'birthday' => 'date',
'images' => 'json',
];
protected function age(): Attribute

View File

@ -16,7 +16,7 @@ class PatientRecord extends Model
{
use HasDateTimeFormatter, Filterable;
protected $fillable = ['patient_id', 'type_id', 'treat_at', 'doctor_id', 'content', 'origin_price', 'sell_price', 'order_status', 'notify_at', 'notify_user_id', 'notify_remarks', 'is_notified', 'next_treat_at', 'creator_id'];
protected $fillable = ['patient_id', 'type_id', 'treat_at', 'doctor_id', 'content', 'origin_price', 'sell_price', 'order_status', 'notify_at', 'notify_user_id', 'notify_remarks', 'is_notified', 'next_treat_at', 'creator_id', 'images'];
protected $casts = [
'order_status' => OrderStatus::class,
@ -25,6 +25,7 @@ class PatientRecord extends Model
'next_treat_at' => 'datetime',
'origin_price' => 'float',
'sell_price' => 'float',
'images' => 'json',
];
public function patient()

View File

@ -21,6 +21,7 @@ return new class extends Migration
$table->date('birthday')->nullable()->comment('出生年月');
$table->dateTime('treat_at')->nullable()->comment('初诊时间');
$table->text('illness')->nullable()->comment('病情描述');
$table->json('images')->nullable()->comment('图片');
$table->unsignedBigInteger('doctor_id')->nullable()->comment('坐诊医生, admin_users.id');
$table->string('remarks')->nullable()->comment('备注');
$table->timestamps();

View File

@ -18,6 +18,7 @@ return new class extends Migration
$table->timestamp('treat_at')->comment('就诊时间');
$table->unsignedBigInteger('doctor_id')->comment('医生, admin_users.id');
$table->text('content')->comment('就诊情况');
$table->json('images')->nullable()->comment('图片');
$table->decimal('origin_price')->default(0)->comment('划线价');
$table->decimal('sell_price')->default(0)->comment('实收价');
$table->unsignedTinyInteger('order_status')->default(0)->comment('状态(0: 未收, 1: 已收)');

View File

@ -17,4 +17,5 @@ return [
'next_treat_at' => '下次就诊时间',
'creator_id' => '操作人',
'created_at' => '录入时间',
'images' => '图片资料',
];

View File

@ -14,4 +14,5 @@ return [
'age' => '年龄',
'remarks' => '备注',
'created_at' => '录入时间',
'images' => '图片资料',
];

View File

@ -1,2 +1,2 @@
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>宝芝堂</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/h5/static/index.5841170f.css"/><script defer="defer" src="/h5/static/js/chunk-vendors.7032a432.js"></script><script defer="defer" src="/h5/static/js/index.8da149ba.js"></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>宝芝堂</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/h5/static/index.5841170f.css"/><script defer="defer" src="/h5/static/js/chunk-vendors.7eabb1da.js"></script><script defer="defer" src="/h5/static/js/index.fbd5122b.js"></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long