Commit e67d9d47 by lujunyi

详情

parent af92f046
......@@ -33,7 +33,7 @@ protected function grid()
$grid->column('status')->using(PrescriptionModel::PRESCRIPTION_STATUS_MAP);
$grid->column('patient_name');
$grid->column('patient_age');
$grid->column('patient_gender');
$grid->column('patient_gender')->using(PatientModel::SEX_MAP);
$grid->column('diagnosis_name');
$grid->column('doctor_name');
$grid->column('pharmacist_name');
......@@ -99,30 +99,55 @@ protected function grid()
protected function detail($id)
{
return Show::make($id, new PrescriptionRepository(), function (Show $show) {
$show->field('id')->width(4);
$show->field('status')->width(4);
$show->field('patient_name')->width(4);
$show->field('patient_age')->width(4);
$show->field('patient_gender')->width(4);
$show->field('diagnosis_id')->width(4);
$show->field('diagnosis_name')->width(4);
$show->field('inquiry_info')->width(4);
$show->field('drug_info')->width(4);
$show->field('doctor_id')->width(4);
$show->field('doctor_name')->width(4);
$show->field('doctor_online_hospital_name')->width(4);
$show->field('doctor_department')->width(4);
$show->field('doctor_title')->width(4);
$show->field('doctor_license_no')->width(4);
$show->field('pharmacy_id')->width(4);
$show->field('pharmacy_name')->width(4);
$show->field('pharmacist_id')->width(4);
$show->field('pharmacist_name')->width(4);
$show->field('pharmacist_license_number')->width(4);
$show->field('created_at')->width(4);
$show->field('updated_at')->width(4);
$show->field('id')->width(3);
$show->field('status')->width(3)->using(PrescriptionModel::PRESCRIPTION_STATUS_MAP);
$show->field('patient_name')->width(3);
$show->field('patient_age')->width(3);
$show->field('patient_gender')->using(PatientModel::SEX_MAP)->width(3);
$show->field('diagnosis_name')->width(3);
$show->field('inquiry_info')->width(3)->as(function ($inquiryInfo) {
$answerMap = [1 => '是', 0 => '否'];
return array_map(function ($item) use ($answerMap) {
return $item['question'].' : '.$answerMap[$item['answer']];
}, $inquiryInfo);
})->label();
$show->field('drug_info')->width(3)->as(function ($drugInfo) {
return array_map(function ($item) {
return $item['drug_name'].' : '.($item['spec'] ?? '').' : '.$item['num'].($item['unit'] ?? '').' : '.($item['dosage_desc'] ?? '');
}, $drugInfo);
})->label();
$show->field('doctor_name')->width(3);
$show->field('doctor_online_hospital_name')->width(3);
$show->field('doctor_department')->width(3);
$show->field('doctor_title')->width(3);
$show->field('doctor_license_no')->width(3);
$show->field('doctor_signed_pic')->image('', 100, 100)->width(3);
$show->field('doctor_introduction')->width(3);
$show->field('pharmacy_name')->width(3);
$show->field('pharmacist_name')->width(3);
$show->field('pharmacist_license_number')->width(3);
$show->field('pharmacist_signed_pic')->image('', 100, 100)->width(3);
$show->field('prescription_pic')->image('', 100, 100)->width(3);
$show->field('prescription_pic_eseal')->image('', 100, 100)->width(3);
$show->field('prescription_at')->width(3);
$show->field('review_at')->width(3);
$show->field('open_source')->width(3)->using(PrescriptionModel::OPEN_SOURCE_MAP);
$show->field('is_voided')->width(3)->using(PrescriptionModel::IS_VOIDED_MAP);
$show->field('is_abnormal')->width(3)->using([0 => '否', 1 => '是']);
$show->panel()->tools(function ($tools) {
$tools->disableEdit();
$tools->disableDelete(); // 禁止删除按钮
});
});
......
......@@ -46,6 +46,17 @@ class PrescriptionModel extends Model
self::OPEN_SOURCE_PHARMACY => '店开',
];
// 作废状态[0=未作废,1=作废]
const IS_VOIDED_FALSE = 0;
const IS_VOIDED_TRUE = 1;
// 作废状态-文字映射
const IS_VOIDED_MAP = [
self::IS_VOIDED_FALSE => '未作废',
self::IS_VOIDED_FALSE => '作废',
];
public function getDoctorSignedPicAttribute($value)
{
if (Str::contains($value, '//') || ! $value) {
......
......@@ -5,6 +5,7 @@
'prescription' => '处方',
],
'fields' => [
'id' => '处方单号',
'status' => '状态',
'patient_name' => '姓名',
'patient_age' => '年龄',
......@@ -19,12 +20,17 @@
'doctor_department' => '医师科室',
'doctor_title' => '医师职称',
'doctor_license_no' => '医师执照编号',
'doctor_signed_pic' => '医师签名',
'doctor_introduction' => '医师简介',
'pharmacy_id' => '药店',
'pharmacy_name' => '药店',
'pharmacist_id' => '药师',
'pharmacist_name' => '审方药师',
'pharmacist_license_number' => '药师执照编号',
'pharmacist_signed_pic' => '药师签名',
'prescriptio_number' => '处方单编号',
'prescription_pic' => '处方单',
'prescription_pic_eseal' => '处方单[电子章]',
'patient_id' => '问诊人',
'is_voided' => '作废',
'open_source' => '开方来源',
......
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