feat(surgicalschedule): 将手术安排日期查询改为日期范围选择 BUG#305
- 将前端日期选择器从单日期改为日期范围选择器 - 修改查询参数从 scheduleDate 改为 scheduleDateRange 数组 - 新增 scheduleDateStart 和 scheduleDateEnd 参数用于后端查询 - 在后端 DTO 中添加日期范围查询字段并配置格式化注解 - 更新 MyBatis XML 映射文件中的日期查询条件逻辑 - 实现前端日期范围到查询参数的转换处理逻辑
This commit is contained in:
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.openhis.surgicalschedule.domain.OpSchedule;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@@ -18,6 +19,20 @@ import java.time.LocalDate;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class OpScheduleDto extends OpSchedule {
|
||||
|
||||
/**
|
||||
* 手术安排日期开始(查询用)
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate scheduleDateStart;
|
||||
|
||||
/**
|
||||
* 手术安排日期结束(查询用)
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate scheduleDateEnd;
|
||||
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
|
||||
@@ -47,8 +47,11 @@
|
||||
<if test="dto.applyDeptId != null and dto.applyDeptId != ''">
|
||||
AND cs.apply_dept_id = #{dto.applyDeptId}
|
||||
</if>
|
||||
<if test="dto.scheduleDate != null">
|
||||
AND os.schedule_date = #{dto.scheduleDate}
|
||||
<if test="dto.scheduleDateStart != null">
|
||||
AND DATE(os.schedule_date) >= #{dto.scheduleDateStart}
|
||||
</if>
|
||||
<if test="dto.scheduleDateEnd != null">
|
||||
AND DATE(os.schedule_date) <= #{dto.scheduleDateEnd}
|
||||
</if>
|
||||
<if test="dto.operCode != null and dto.operCode != ''">
|
||||
AND os.oper_code LIKE CONCAT('%', #{dto.operCode}, '%')
|
||||
@@ -134,7 +137,8 @@
|
||||
<if test="dto.applyId != null"> AND os.apply_id = #{dto.applyId}</if>
|
||||
<if test="dto.operCode != null and dto.operCode != ''"> AND os.oper_code = #{dto.operCode}</if>
|
||||
<if test="dto.operName != null and dto.operName != ''"> AND os.oper_name LIKE CONCAT('%', #{dto.operName}, '%')</if>
|
||||
<if test="dto.scheduleDate != null"> AND os.schedule_date = #{dto.scheduleDate}</if>
|
||||
<if test="dto.scheduleDateStart != null"> AND DATE(os.schedule_date) >= #{dto.scheduleDateStart}</if>
|
||||
<if test="dto.scheduleDateEnd != null"> AND DATE(os.schedule_date) <= #{dto.scheduleDateEnd}</if>
|
||||
<if test="dto.orgId != null and dto.orgId != ''"> AND cs.org_id = #{dto.orgId}</if>
|
||||
<if test="dto.applyDeptId != null and dto.applyDeptId != ''"> AND cs.apply_dept_id = #{dto.applyDeptId}</if>
|
||||
<if test="dto.patientName != null and dto.patientName != ''"> AND ap.name LIKE CONCAT('%', #{dto.patientName}, '%')</if>
|
||||
|
||||
@@ -11,16 +11,16 @@
|
||||
style="width: 200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="安排时间" prop="scheduleDate">
|
||||
<el-tooltip :content="queryParams.scheduleDate" placement="top" :disabled="!queryParams.scheduleDate">
|
||||
<el-form-item label="安排时间" prop="scheduleDateRange">
|
||||
<el-date-picker
|
||||
v-model="queryParams.scheduleDate"
|
||||
type="date"
|
||||
placeholder="请选择安排时间"
|
||||
v-model="queryParams.scheduleDateRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 200px"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
<el-form-item label="卫生机构" prop="tenantId">
|
||||
<el-select v-model="queryParams.tenantId" placeholder="请选择卫生机构" style="width: 200px">
|
||||
@@ -872,7 +872,9 @@ const surgeryList = ref([])
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
scheduleDate: undefined,
|
||||
scheduleDateRange: [],
|
||||
scheduleDateStart: undefined,
|
||||
scheduleDateEnd: undefined,
|
||||
tenantId: undefined,
|
||||
applyDeptId: undefined,
|
||||
patientName: undefined,
|
||||
@@ -1166,7 +1168,18 @@ function loadOperatingRoomList() {
|
||||
// 获取手术安排列表
|
||||
function getList() {
|
||||
loading.value = true
|
||||
getSurgerySchedulePage(queryParams).then((res) => {
|
||||
// 处理日期范围
|
||||
const params = { ...queryParams }
|
||||
if (params.scheduleDateRange && params.scheduleDateRange.length === 2) {
|
||||
params.scheduleDateStart = params.scheduleDateRange[0]
|
||||
params.scheduleDateEnd = params.scheduleDateRange[1]
|
||||
} else {
|
||||
params.scheduleDateStart = undefined
|
||||
params.scheduleDateEnd = undefined
|
||||
}
|
||||
delete params.scheduleDateRange
|
||||
|
||||
getSurgerySchedulePage(params).then((res) => {
|
||||
surgeryList.value = res.data.records
|
||||
total.value = res.data.total
|
||||
}).catch(error => {
|
||||
@@ -1192,7 +1205,9 @@ function resetQuery() {
|
||||
Object.assign(queryParams, {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
scheduleDate: undefined,
|
||||
scheduleDateRange: [],
|
||||
scheduleDateStart: undefined,
|
||||
scheduleDateEnd: undefined,
|
||||
tenantId: undefined,
|
||||
applyDeptId: undefined,
|
||||
patientName: undefined,
|
||||
|
||||
Reference in New Issue
Block a user