获取公卫患者信息
This commit is contained in:
parent
68e72a07a8
commit
c83d9b4976
@ -119,5 +119,9 @@ export const PatientApi = {
|
||||
//根据体检编号&姓名&身份证号获取患者信息
|
||||
getPatientInfoByMedicalSn: async (searchKey: string) => {
|
||||
return await request.get({ url: `/inspect/patient/PatientBySearchKey?searchKey=` + searchKey })
|
||||
},
|
||||
//获取公卫患者信息
|
||||
getGwPatientInfo: async (idCard: string) => {
|
||||
return await request.get({ url: `/inspect/patient/GetApiPatientInfo?idCard=` + idCard })
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +120,10 @@ v-loading.fullscreen.lock="fullscreenLoading"
|
||||
<el-input v-model="addForm.name" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证号" prop="cardId">
|
||||
<el-input v-model="addForm.cardId" placeholder="请输入身份证号" @blur="handleCardIdBlur" />
|
||||
<div style="display: flex; align-items: center;">
|
||||
<el-input v-model="addForm.cardId" placeholder="请输入身份证号" @blur="handleCardIdBlur" style="width: 75%;" />
|
||||
<el-button type="primary" @click="handleGwPatientInfo" style="margin-left: 10px;">获取公卫患者信息</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="出生日期" prop="birthDate">
|
||||
<el-date-picker
|
||||
@ -472,4 +475,32 @@ const formatDate = (date: Date): string => {
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
}
|
||||
|
||||
// 处理获取公卫患者信息
|
||||
const handleGwPatientInfo = async () => {
|
||||
if (!addForm.cardId) {
|
||||
message.warning('请先输入身份证号')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
// 调用API获取公卫患者信息
|
||||
const result = await PatientApi.getGwPatientInfo(addForm.cardId)
|
||||
console.log('获取到的公卫患者信息:', result);
|
||||
if (result) {
|
||||
// 填充表单数据
|
||||
addForm.name = result.name || ''
|
||||
addForm.phone = result.telephone || ''
|
||||
addForm.address = result.addree || ''
|
||||
message.success('成功获取公卫患者信息')
|
||||
} else {
|
||||
message.warning('未找到该患者的公卫信息')
|
||||
}
|
||||
} catch (error) {
|
||||
message.error('获取公卫患者信息失败: ' + (error.message || '未知错误'))
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user