diff --git a/public/templates/report-template.html b/public/templates/report-template.html index 05e0a42..0c94f5e 100644 --- a/public/templates/report-template.html +++ b/public/templates/report-template.html @@ -1061,8 +1061,6 @@ 兴和县卫生健康委员会 - -
第1页
@@ -1099,7 +1097,7 @@
-
第2页
+
第1页

@@ -1133,7 +1131,7 @@ -
第3页
+
第2页

@@ -1167,7 +1165,7 @@ -
第4页
+
第3页

@@ -1234,7 +1232,7 @@ -
第5页
+
第4页
@@ -1275,7 +1273,7 @@ -
第6页
+
第5页
@@ -1310,7 +1308,7 @@ -
第7页
+
第6页
-
第8页
+
第7页
@@ -1427,7 +1425,7 @@ -
第9页
+
第10页
@@ -1450,7 +1448,7 @@ -
第10页
+
第11页
@@ -1480,7 +1478,7 @@ -
第10页
+
第11页
@@ -1507,7 +1505,7 @@
-
第11页
+
第12页
@@ -2043,14 +2041,14 @@ const biochemistryPage2Visible = document.getElementById('biochemistry-page-2').style.display !== 'none'; const bloodPage2Visible = document.getElementById('blood-page-2').style.display !== 'none'; - // 计算实际总页数 - let totalPages = document.querySelectorAll('.report-item').length; + // 计算实际总页数(从前言页开始计算) + let totalPages = document.querySelectorAll('.report-item').length - 1; // 减去首页 if (!summaryPage2Visible) totalPages--; if (!urinePage2Visible) totalPages--; if (!biochemistryPage2Visible) totalPages--; if (!bloodPage2Visible) totalPages--; - // 从第1页开始计数 + // 从第1页开始计数(前言页作为第1页) let pageIndex = 1; pageNumbers.forEach((element) => { diff --git a/src/components/IDCardReader.vue b/src/components/IDCardReader.vue index f2c4c9c..6782771 100644 --- a/src/components/IDCardReader.vue +++ b/src/components/IDCardReader.vue @@ -94,8 +94,6 @@ export default defineComponent({ ElMessage.success('读卡器连接成功'); } - // 通知用户正在读取身份证 - // 读取身份证信息 const result = await sdk.read_card(); @@ -103,7 +101,10 @@ export default defineComponent({ // 添加调试信息 console.log('组件接收到的身份证信息:', result); - // 发送成功事件,触发查询,并传递身份证号 + // 将身份证号更新到表单 + emit('update:cardId', result.idNumber); + + // 发送成功事件,触发查询,并传递身份证信息 emit('success', result); // 读取成功后断开连接 diff --git a/src/views/Department-entry/Medical-examination-vehicle.vue b/src/views/Department-entry/Medical-examination-vehicle.vue index fbb5b0c..64019f9 100644 --- a/src/views/Department-entry/Medical-examination-vehicle.vue +++ b/src/views/Department-entry/Medical-examination-vehicle.vue @@ -110,7 +110,7 @@
{ pageNo: pageNo.value, pageSize: pageSize.value } + + // 根据当前状态筛选值设置不同的查询参数 + if (statusFilter.value === '2') { + // 已打印状态,查询 isprint 为 1 的数据 + params.isprint = 1 + + // 在已打印状态下,如果有日期范围,则添加日期条件 + if (dateRange.value && dateRange.value.length === 2) { + const [startDate, endDate] = dateRange.value + params.printTimeRange = [ + startDate ? `${startDate} 00:00:00` : null, + endDate ? `${endDate} 23:59:59` : null + ] + } + } else { + // 其他状态,使用 status 字段查询 + params.status = statusFilter.value + } const res = await PatientApi.getPatientPage(params) @@ -1248,8 +1266,8 @@ onMounted(async () => { patients.value = [] selectedPatient.value = null - // 设置合理的分页大小 - pageSize.value = 20 // 或其他合适的数值 + // 已经在定义时设置为20,这里不需要再设置 + // pageSize.value = 20 pageNo.value = 1 // 获取医生列表 @@ -1783,6 +1801,7 @@ const isReadOnly = computed(() => { const handleCurrentChange = async (val) => { pageNo.value = val try { + loading.value = true const params = { pageNo: pageNo.value, pageSize: pageSize.value, @@ -1793,6 +1812,15 @@ const handleCurrentChange = async (val) => { if (statusFilter.value === '2') { // 已打印状态,查询 isprint 为 1 的数据 params.isprint = 1 + + // 在已打印状态下,如果有日期范围,则添加日期条件 + if (dateRange.value && dateRange.value.length === 2) { + const [startDate, endDate] = dateRange.value + params.printTimeRange = [ + startDate ? `${startDate} 00:00:00` : null, + endDate ? `${endDate} 23:59:59` : null + ] + } } else { // 其他状态,使用 status 字段查询 params.status = statusFilter.value @@ -1801,9 +1829,11 @@ const handleCurrentChange = async (val) => { const res = await PatientApi.getPatientPage(params) patients.value = res.list total.value = res.total + loading.value = false } catch (error) { console.error('获取患者列表失败:', error) ElMessage.error('获取患者列表失败') + loading.value = false } } @@ -2299,20 +2329,9 @@ const statusFilter = ref('0') // 默认选择待检查 // 修改过滤后的患者列表计算属性 const filteredPatients = computed(() => { - let result = patients.value - - // 根据状态筛选 - if (statusFilter.value !== '') { - if (statusFilter.value === '2') { - // 已打印状态,使用 isprint 字段 - result = result.filter((patient) => patient.isprint === 1) - } else { - // 其他状态,使用 status 字段 - result = result.filter((patient) => String(patient.status) === statusFilter.value) - } - } - - return result + // 直接返回API获取的患者列表,不再进行二次过滤 + // 由于API请求时已经传递了status参数进行过滤 + return patients.value }) // 添加加载状态 @@ -2365,11 +2384,17 @@ const debouncedStatusChange = debounce(async (value) => { const handleStatusFilterChange = (value) => { statusFilter.value = value - // 如果选择的是"已打印"状态,自动将日期范围设置为今天 + // 重置页码为1 + pageNo.value = 1 + + // 如果选择的是"已打印"状态 if (value === '2') { - const today = new Date().toISOString().split('T')[0] // 获取当前日期,格式为YYYY-MM-DD - dateRange.value = [today, today] // 设置日期范围为今天到今天 - // 直接使用dateRange进行筛选,不调用debouncedStatusChange以避免重复请求 + // 如果日期范围为空,则默认设置为今天 + if (!dateRange.value || dateRange.value.length === 0) { + const today = new Date().toISOString().split('T')[0] // 获取当前日期,格式为YYYY-MM-DD + dateRange.value = [today, today] // 设置日期范围为今天到今天 + } + // 使用当前日期范围进行筛选 handleDateRangeChange(dateRange.value) } else { // 非已打印状态清空日期范围 @@ -2683,6 +2708,11 @@ const dateRange = ref([]) // 添加日期范围变化处理函数 const handleDateRangeChange = async (val) => { try { + loading.value = true + + // 重置页码为1 + pageNo.value = 1 + const params = { pageNo: pageNo.value, pageSize: pageSize.value, @@ -2704,6 +2734,8 @@ const handleDateRangeChange = async (val) => { } catch (error) { console.error('按日期获取患者列表失败:', error) ElMessage.error('获取患者列表失败') + } finally { + loading.value = false } } diff --git a/src/views/Inspection-checklist/Inspection-checklist.vue b/src/views/Inspection-checklist/Inspection-checklist.vue index da08f77..216c801 100644 --- a/src/views/Inspection-checklist/Inspection-checklist.vue +++ b/src/views/Inspection-checklist/Inspection-checklist.vue @@ -262,12 +262,10 @@ const handleQuery = () => { /** 处理身份证读卡成功事件 */ const handleIdCardSuccess = (cardInfo) => { - // 直接使用身份证号进行查询,不更新搜索框 - const tempCardId = queryParams.cardId; + // 将身份证号赋值给搜索框 queryParams.cardId = cardInfo.idNumber; - getList(); - // 查询完成后恢复原来的值 - queryParams.cardId = tempCardId; + // 执行查询操作 + handleQuery(); } /** 添加/修改操作 */ diff --git a/src/views/summary/print/barcode.js b/src/views/summary/print/barcode.js new file mode 100644 index 0000000..adc47a9 --- /dev/null +++ b/src/views/summary/print/barcode.js @@ -0,0 +1,161 @@ +export default { + "panels": [ + { + "index": 0, + "paperType": "A7", + "height": 30, + "width": 50, + "paperHeader": -6, + "paperFooter": 85.03937007874016, + "printElements": [ + { + "tid": "defaultModule.text", + "options": { + "left": 48, + "top": 3, + "height": 9.75, + "width": 9, + "title": "性别", + "field": "patientGender", + "hideTitle": true + } + }, + { + "tid": "defaultModule.vline", + "options": { + "left": 43.5, + "top": 3, + "height": 10.5, + "width": 9, + "borderWidth": "0.75", + "borderStyle": "solid" + } + }, + { + "tid": "defaultModule.vline", + "options": { + "left": 60, + "top": 3, + "height": 10.5, + "width": 9, + "borderStyle": "solid" + } + }, + { + "tid": "defaultModule.vline", + "options": { + "left": 79.5, + "top": 3, + "height": 10.5, + "width": 9 + } + }, + { + "tid": "defaultModule.text", + "options": { + "left": 82.5, + "top": 3, + "height": 9.75, + "width": 31.5, + "title": "检验类别", + "field": "checkTypeId", + "hideTitle": true + } + }, + { + "tid": "defaultModule.text", + "options": { + "left": 64.5, + "top": 3, + "height": 9.75, + "width": 12, + "title": "年龄", + "field": "patientAge", + "hideTitle": true + } + }, + { + "tid": "defaultModule.text", + "options": { + "left": 115.5, + "top": 3, + "height": 9.75, + "width": 21, + "field": "sampleTypeId", + "hideTitle": true + } + }, + { + "tid": "defaultModule.text", + "options": { + "left": 4.5, + "top": 3, + "height": 9.75, + "width": 37.5, + "title": "姓名", + "field": "patientName", + "hideTitle": true, + "textAlign": "right" + } + }, + { + "tid": "defaultModule.text", + "options": { + "left": 16.5, + "top": 15, + "height": 34.5, + "width": 115.5, + "field": "barCode", + "testData": "202401270838", + "textAlign": "center", + "textType": "barcode" + } + }, + { + "tid": "defaultModule.text", + "options": { + "left": 6, + "top": 16.5, + "height": 31.5, + "width": 7.5, + "title": "就诊类别", + "field": "sampleSource", + "textContentVerticalAlign": "middle", + "hideTitle": true, + "lineHeight": 15 + } + }, + { + "tid": "defaultModule.text", + "options": { + "left": 9, + "top": 57, + "height": 9.75, + "width": 120, + "title": "项目", + "field": "billingItem", + "hideTitle": true, + "textAlign": "center" + } + }, + { + "tid": "defaultModule.text", + "options": { + "left": 9, + "top": 67.5, + "height": 9.75, + "width": 120, + "title": "开单日期", + "field": "billingTime", + "hideTitle": true, + "textAlign": "center" + } + } + ], + "paperNumberLeft": 111, + "paperNumberTop": 63, + "paperNumberDisabled": true + } + ] +} + \ No newline at end of file diff --git a/src/views/summary/reprot-print/report-print.vue b/src/views/summary/reprot-print/report-print.vue index ec3b913..0df7487 100644 --- a/src/views/summary/reprot-print/report-print.vue +++ b/src/views/summary/reprot-print/report-print.vue @@ -22,7 +22,6 @@ v-model="queryParams.pname" placeholder="请输入姓名" clearable - @input="handleQuery" class="!w-200px" /> @@ -135,8 +134,8 @@ const total = ref(0) // 列表的总页数 const queryParams = reactive({ pageNo: 1, pageSize: 10, - medicalSn: undefined, - pname: undefined, + medicalSn: undefined as string | undefined, + pname: undefined as string | undefined, medicalDateTime: [], status: 1 }) @@ -150,7 +149,7 @@ const getList = async () => { pageNo: queryParams.pageNo, pageSize: queryParams.pageSize, medicalSn: queryParams.medicalSn, - pname: queryParams.pname, + pName: queryParams.pname?.trim() || undefined, medicalDateTime: queryParams.medicalDateTime, status: queryParams.status })