增加日期查询

This commit is contained in:
Euni4U 2025-04-04 15:00:20 +08:00
parent 03c8a05b21
commit a1db42580d
2 changed files with 42 additions and 23 deletions

View File

@ -30,7 +30,9 @@ export interface PatientVO {
ncgcode: string // 尿常规编号 ncgcode: string // 尿常规编号
shqx: string // 生化编号 shqx: string // 生化编号
isprint: number // 是否打印 isprint: number // 是否打印
printtime: Date // 打印时间
chiefinspectorid: string // 总检医生ID chiefinspectorid: string // 总检医生ID
chiefinspector: string // 总检医生
} }
// 患者信息 API // 患者信息 API
@ -131,7 +133,9 @@ export const PatientApi = {
return await request.get({ url: `/inspect/patient/GetApiPatientInfo?idCard=` + idCard }) return await request.get({ url: `/inspect/patient/GetApiPatientInfo?idCard=` + idCard })
}, },
//更新打印状态 //更新打印状态
updatePrintStatus: async (medicalSn: string) => { updatePrintStatus: async (medicalSn: string, printtime: Date) => {
return await request.put({ url: `/inspect/patient/updatePrintStatus?medicalSn=` + medicalSn }) return await request.put({
url: `/inspect/patient/updatePrintStatus?medicalSn=${medicalSn}&printtime=${printtime.toISOString()}`
})
} }
} }

View File

@ -8,7 +8,7 @@ v-loading.fullscreen.lock="fullscreenLoading"
element-loading-background="rgba(0, 0, 0, 0.8)"> element-loading-background="rgba(0, 0, 0, 0.8)">
</div> </div>
<ContentWrap style="height: 70px; display: flex; align-items: center;"> <ContentWrap style="height: 120px; display: flex; align-items: center; padding: 20px 0;">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form
class="-mb-15px" class="-mb-15px"
@ -16,6 +16,7 @@ v-loading.fullscreen.lock="fullscreenLoading"
ref="queryFormRef" ref="queryFormRef"
:inline="true" :inline="true"
label-width="68px" label-width="68px"
style="width: 100%;"
> >
<el-form-item label="体检编号" prop="medicalSn"> <el-form-item label="体检编号" prop="medicalSn">
<el-input <el-input
@ -41,12 +42,25 @@ v-loading.fullscreen.lock="fullscreenLoading"
class="!w-200px" class="!w-200px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="打印日期" prop="printTimeRange">
<el-date-picker
v-model="queryParams.printTimeRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD HH:mm:ss"
class="!w-300px"
@change="handleDateChange"
/>
</el-form-item>
<el-form-item label="状态" prop="isprint"> <el-form-item label="状态" prop="isprint">
<el-select v-model="queryParams.isprint" placeholder="请选择状态" clearable class="!w-200px"> <el-select v-model="queryParams.isprint" placeholder="请选择状态" clearable class="!w-200px">
<el-option label="已打印" value="1" /> <el-option label="已打印" value="1" />
<el-option label="未打印" value="0" /> <el-option label="未打印" value="0" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleQuery"> <el-button type="primary" @click="handleQuery">
<Icon icon="ep:search" class="mr-5px" /> 查询 <Icon icon="ep:search" class="mr-5px" /> 查询
@ -65,6 +79,7 @@ v-loading.fullscreen.lock="fullscreenLoading"
@change="uploadFile" @change="uploadFile"
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -164,12 +179,10 @@ import { PatientApi, type PatientVO } from '@/api/inspect/inspectpatient'
import * as SummaryApi from "@/api/summary"; import * as SummaryApi from "@/api/summary";
import { newHiprintPrintTemplate } from "@/views/summary/utils/template-helper"; import { newHiprintPrintTemplate } from "@/views/summary/utils/template-helper";
import template from "@/views/summary/print/template"; import template from "@/views/summary/print/template";
import { ElMessageBox } from 'element-plus';
defineOptions({ name: 'Department' }) defineOptions({ name: 'Department' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) // const loading = ref(true) //
const importLoading = ref(false) // Excel const importLoading = ref(false) // Excel
const fullscreenLoading = ref(false) // const fullscreenLoading = ref(false) //
@ -180,11 +193,11 @@ const queryParams = reactive({
pageSize: 10, pageSize: 10,
medicalSn: undefined as string | undefined, medicalSn: undefined as string | undefined,
pname: undefined as string | undefined, pname: undefined as string | undefined,
medicalDateTime: [],
cardId: undefined as string | undefined, cardId: undefined as string | undefined,
phoneNum: undefined as string | undefined, phoneNum: undefined as string | undefined,
domicileaddress: 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 queryFormRef = ref() //
const fileInputRef = ref<HTMLInputElement | null>(null) // const fileInputRef = ref<HTMLInputElement | null>(null) //
@ -222,7 +235,8 @@ const getList = async () => {
const data = await PatientApi.getPatientPage({ const data = await PatientApi.getPatientPage({
...queryParams, ...queryParams,
pName: queryParams.pname?.trim() || undefined, pName: queryParams.pname?.trim() || undefined,
isprint: queryParams.isprint || undefined // isprint isprint: queryParams.isprint || undefined,
printTimeRange: queryParams.printTimeRange
}) })
list.value = data.list list.value = data.list
@ -240,11 +254,6 @@ const handleQuery = () => {
getList() getList()
} }
/** 重置操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields()
handleQuery()
}
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
@ -265,8 +274,8 @@ const handlePrint = async (row: PatientVO) => {
} }
await PatientApi.syncinspectApplyTj(row.medicalSn) await PatientApi.syncinspectApplyTj(row.medicalSn)
await createPrint(row.medicalSn) await createPrint(row.medicalSn)
// //
await PatientApi.updatePrintStatus(row.medicalSn) await PatientApi.updatePrintStatus(row.medicalSn, new Date())
// //
await getList() await getList()
message.success('打印成功') 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 () => { const handleGwPatientInfo = async () => {
@ -503,4 +505,17 @@ const handleGwPatientInfo = async () => {
loading.value = false 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
}
}
</script> </script>