diff --git a/admin/src/views/tcm/diagnosis/index.vue b/admin/src/views/tcm/diagnosis/index.vue index d5445ec3..efb84732 100644 --- a/admin/src/views/tcm/diagnosis/index.vue +++ b/admin/src/views/tcm/diagnosis/index.vue @@ -15,7 +15,7 @@
- + 查询
@@ -111,7 +111,7 @@
{{ row.gender_desc || '-' }} · {{ row.age ?? '-' }}岁
- + - + - + @@ -567,7 +567,7 @@ const maskIdCard = (idCard: string) => { } const formData = reactive({ - patient_name: '', + keyword: '', diagnosis_type: '', syndrome_type: '', assistant_id: '', @@ -761,7 +761,7 @@ const refreshListAfterPopupSave = () => getLists({ silent: true }) // 重置 const handleReset = () => { activeTab.value = 'all' - formData.patient_name = '' + formData.keyword = '' formData.diagnosis_type = '' formData.syndrome_type = '' formData.assistant_id = '' diff --git a/server/app/adminapi/lists/tcm/DiagnosisLists.php b/server/app/adminapi/lists/tcm/DiagnosisLists.php index 459bfd19..a372649a 100644 --- a/server/app/adminapi/lists/tcm/DiagnosisLists.php +++ b/server/app/adminapi/lists/tcm/DiagnosisLists.php @@ -65,6 +65,15 @@ class DiagnosisLists extends BaseAdminDataLists implements ListsSearchInterface $query->where('assistant_id', $this->adminId); } + // 关键字搜索:支持患者姓名或手机号(模糊匹配) + if (isset($this->params['keyword']) && trim((string) $this->params['keyword']) !== '') { + $keyword = trim((string) $this->params['keyword']); + $query->where(function ($q) use ($keyword) { + $q->whereLike('patient_name', '%' . $keyword . '%') + ->whereOr('phone', 'like', '%' . $keyword . '%'); + }); + } + // 是否确认诊单:1=已确认 0=未确认 if (isset($this->params['diagnosis_confirmed']) && $this->params['diagnosis_confirmed'] !== '') { $confirmed = (int)$this->params['diagnosis_confirmed']; @@ -409,6 +418,15 @@ class DiagnosisLists extends BaseAdminDataLists implements ListsSearchInterface $query->where('assistant_id', $this->adminId); } + // 关键字搜索:支持患者姓名或手机号(模糊匹配) + if (isset($this->params['keyword']) && trim((string) $this->params['keyword']) !== '') { + $keyword = trim((string) $this->params['keyword']); + $query->where(function ($q) use ($keyword) { + $q->whereLike('patient_name', '%' . $keyword . '%') + ->whereOr('phone', 'like', '%' . $keyword . '%'); + }); + } + // 是否确认诊单 if (isset($this->params['diagnosis_confirmed']) && $this->params['diagnosis_confirmed'] !== '') { $confirmed = (int)$this->params['diagnosis_confirmed'];