增加日期查询
This commit is contained in:
parent
03c8a05b21
commit
a1db42580d
@ -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()}`
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ v-loading.fullscreen.lock="fullscreenLoading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.8)">
|
||||
</div>
|
||||
|
||||
<ContentWrap style="height: 70px; display: flex; align-items: center;">
|
||||
<ContentWrap style="height: 120px; display: flex; align-items: center; padding: 20px 0;">
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
@ -16,6 +16,7 @@ v-loading.fullscreen.lock="fullscreenLoading"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-form-item label="体检编号" prop="medicalSn">
|
||||
<el-input
|
||||
@ -41,12 +42,25 @@ v-loading.fullscreen.lock="fullscreenLoading"
|
||||
class="!w-200px"
|
||||
/>
|
||||
</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-select v-model="queryParams.isprint" placeholder="请选择状态" clearable class="!w-200px">
|
||||
<el-option label="已打印" value="1" />
|
||||
<el-option label="未打印" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery">
|
||||
<Icon icon="ep:search" class="mr-5px" /> 查询
|
||||
@ -60,11 +74,12 @@ v-loading.fullscreen.lock="fullscreenLoading"
|
||||
<input
|
||||
type="file"
|
||||
ref="fileInputRef"
|
||||
accept=".xlsx,.xls"
|
||||
accept=".xlsx,.xls"
|
||||
style="display: none"
|
||||
@change="uploadFile"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
@ -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<HTMLInputElement | null>(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
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user