refactor(doctorstation): 优化传染病报卡管理功能

- 将前端表单字段 diseaseCategory 统一改为 diseaseType
- 修复统计数据获取失败时的错误处理逻辑
- 完善数据列表查询的错误提示和调试日志
- 优化后端日期时间格式化处理方式
- 增强统计数据返回的安全性检查
- 移除冗余的报卡状态验证代码并修复更新时间格式
This commit is contained in:
2026-03-10 10:28:13 +08:00
parent f515b90c43
commit e46e2be830
2 changed files with 34 additions and 43 deletions

View File

@@ -245,8 +245,8 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="传染病类别" prop="diseaseCategory">
<el-select v-model="editForm.diseaseCategory" placeholder="请选择传染病类别" style="width: 100%">
<el-form-item label="传染病类别" prop="diseaseType">
<el-select v-model="editForm.diseaseType" placeholder="请选择传染病类别" style="width: 100%">
<el-option label="甲类传染病" value="A" />
<el-option label="乙类传染病" value="B" />
<el-option label="丙类传染病" value="C" />
@@ -392,11 +392,16 @@ function getAgeUnit(unit) {
async function getStatistics() {
try {
const res = await getDoctorCardStatistics();
console.log('统计数据响应:', res);
if (res.code === 200) {
statistics.value = res.data || {};
statistics.value = res.data || { totalCount: 0, pendingFailedCount: 0, reportedCount: 0 };
} else {
console.error('获取统计数据失败:', res.msg);
ElMessage.error(res.msg || '获取统计数据失败');
}
} catch (error) {
console.error('获取统计数据失败:', error);
console.error('获取统计数据异常:', error);
ElMessage.error('获取统计数据失败');
}
}
@@ -410,13 +415,19 @@ async function getList() {
}
delete params.dateRange;
console.log('查询参数:', params);
const res = await getDoctorCardList(params);
console.log('列表数据响应:', res);
if (res.code === 200) {
cardList.value = res.data?.list || [];
total.value = res.data?.total || 0;
console.log('列表数据:', cardList.value, '总数:', total.value);
} else {
console.error('获取列表失败:', res.msg);
ElMessage.error(res.msg || '获取数据失败');
}
} catch (error) {
console.error('获取列表失败:', error);
console.error('获取列表异常:', error);
ElMessage.error('获取数据失败');
} finally {
loading.value = false;
@@ -491,7 +502,7 @@ async function handleSaveEdit() {
phone: editForm.phone,
onsetDate: editForm.onsetDate,
diagDate: editForm.diagDate,
diseaseCategory: editForm.diseaseCategory,
diseaseType: editForm.diseaseType,
addressProv: editForm.addressProv,
addressCity: editForm.addressCity,
addressCounty: editForm.addressCounty,