diff --git a/src/api/inspect/inspectpatient/index.ts b/src/api/inspect/inspectpatient/index.ts index 644c98a..2411fdd 100644 --- a/src/api/inspect/inspectpatient/index.ts +++ b/src/api/inspect/inspectpatient/index.ts @@ -30,7 +30,9 @@ export interface PatientVO { ncgcode: string // 尿常规编号 shqx: string // 生化编号 isprint: number // 是否打印 + printtime: Date // 打印时间 chiefinspectorid: string // 总检医生ID + chiefinspector: string // 总检医生 } // 患者信息 API @@ -131,7 +133,9 @@ export const PatientApi = { return await request.get({ url: `/inspect/patient/GetApiPatientInfo?idCard=` + idCard }) }, //更新打印状态 - updatePrintStatus: async (medicalSn: string) => { - return await request.put({ url: `/inspect/patient/updatePrintStatus?medicalSn=` + medicalSn }) + updatePrintStatus: async (medicalSn: string, printtime: Date) => { + return await request.put({ + url: `/inspect/patient/updatePrintStatus?medicalSn=${medicalSn}&printtime=${printtime.toISOString()}` + }) } } diff --git a/src/views/Inspection-checklist/Inspection-checklist.vue b/src/views/Inspection-checklist/Inspection-checklist.vue index a3cf047..327a956 100644 --- a/src/views/Inspection-checklist/Inspection-checklist.vue +++ b/src/views/Inspection-checklist/Inspection-checklist.vue @@ -8,7 +8,7 @@ v-loading.fullscreen.lock="fullscreenLoading" element-loading-background="rgba(0, 0, 0, 0.8)"> - + + + + + 查询 @@ -60,11 +74,12 @@ v-loading.fullscreen.lock="fullscreenLoading" + @@ -164,12 +179,10 @@ import { PatientApi, type PatientVO } from '@/api/inspect/inspectpatient' import * as SummaryApi from "@/api/summary"; import { newHiprintPrintTemplate } from "@/views/summary/utils/template-helper"; import template from "@/views/summary/print/template"; -import { ElMessageBox } from 'element-plus'; defineOptions({ name: 'Department' }) const message = useMessage() // 消息弹窗 -const { t } = useI18n() // 国际化 const loading = ref(true) // 列表的加载中 const importLoading = ref(false) // 导入Excel的加载状态 const fullscreenLoading = ref(false) // 全屏加载状态 @@ -180,11 +193,11 @@ const queryParams = reactive({ pageSize: 10, medicalSn: undefined as string | undefined, pname: undefined as string | undefined, - medicalDateTime: [], cardId: undefined as string | undefined, phoneNum: undefined as string | undefined, domicileaddress: undefined as string | undefined, - isprint: undefined as string | undefined + isprint: undefined as string | undefined, + printTimeRange: undefined as [string, string] | undefined }) const queryFormRef = ref() // 搜索的表单 const fileInputRef = ref(null) // 文件输入引用 @@ -222,7 +235,8 @@ const getList = async () => { const data = await PatientApi.getPatientPage({ ...queryParams, pName: queryParams.pname?.trim() || undefined, - isprint: queryParams.isprint || undefined // 确保isprint参数正确传递 + isprint: queryParams.isprint || undefined, + printTimeRange: queryParams.printTimeRange }) list.value = data.list @@ -240,11 +254,6 @@ const handleQuery = () => { getList() } -/** 重置操作 */ -const resetQuery = () => { - queryFormRef.value?.resetFields() - handleQuery() -} /** 添加/修改操作 */ const formRef = ref() @@ -265,8 +274,8 @@ const handlePrint = async (row: PatientVO) => { } await PatientApi.syncinspectApplyTj(row.medicalSn) await createPrint(row.medicalSn) - // 打印完成后更新状态 - await PatientApi.updatePrintStatus(row.medicalSn) + // 打印完成后更新状态,添加当前时间戳 + await PatientApi.updatePrintStatus(row.medicalSn, new Date()) // 刷新列表 await getList() message.success('打印成功') @@ -469,13 +478,6 @@ const handleCardIdBlur = () => { } } -// 添加日期格式化函数 -const formatDate = (date: Date): string => { - const year = date.getFullYear() - const month = String(date.getMonth() + 1).padStart(2, '0') - const day = String(date.getDate()).padStart(2, '0') - return `${year}-${month}-${day}` -} // 处理获取公卫患者信息 const handleGwPatientInfo = async () => { @@ -503,4 +505,17 @@ const handleGwPatientInfo = async () => { loading.value = false } } + +// 处理日期变化 +const handleDateChange = (val: [string, string] | null) => { + if (val) { + // 设置开始时间为当天的 00:00:00 + const startTime = `${val[0].split(' ')[0]} 00:00:00` + // 设置结束时间为当天的 23:59:59 + const endTime = `${val[1].split(' ')[0]} 23:59:59` + queryParams.printTimeRange = [startTime, endTime] + } else { + queryParams.printTimeRange = undefined + } +}