From 19c47c79a0af07ab3d1724f73d87d95508711953 Mon Sep 17 00:00:00 2001 From: Euni4U <958079825@qq.com> Date: Wed, 26 Mar 2025 13:08:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=A1=E6=81=AF=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Inspection-checklist.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/views/Inspection-checklist/Inspection-checklist.vue b/src/views/Inspection-checklist/Inspection-checklist.vue index 9d53b0c..6073cff 100644 --- a/src/views/Inspection-checklist/Inspection-checklist.vue +++ b/src/views/Inspection-checklist/Inspection-checklist.vue @@ -394,13 +394,17 @@ const submitForm = async () => { birthday: addForm.birthDate ? new Date(addForm.birthDate) : undefined } - await PatientApi.insertPatinetInfo(patientData as PatientVO) - message.success('添加成功') - dialogVisible.value = false - // 重置表单 - resetForm() - // 刷新列表 - await getList() + const data=await PatientApi.insertPatinetInfo(patientData as PatientVO) + if(data){ + message.success('添加成功') + dialogVisible.value = false + // 重置表单 + resetForm() + // 刷新列表 + await getList() + }else{ + message.error('患者已存在') + } } catch (error) { console.error('添加失败:', error) message.error('添加失败: ' + (error.message || '未知错误')) @@ -487,7 +491,6 @@ const handleGwPatientInfo = async () => { loading.value = true // 调用API获取公卫患者信息 const result = await PatientApi.getGwPatientInfo(addForm.cardId) - console.log('获取到的公卫患者信息:', result); if (result) { // 填充表单数据 addForm.name = result.name || ''