Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
2026-06-17 15:19:58 +08:00
11 changed files with 139 additions and 42 deletions

View File

@@ -39,7 +39,7 @@ public interface IInHospitalRegisterAppService {
*/
IPage<InHospitalRegisterQueryDto> getRegisterInfo(InHospitalRegisterQueryDto inHospitalRegisterQueryDto,
String searchKey, String registeredFlag, Integer pageNo, Integer pageSize,
Date startTime, Date endTime, Long organizationId, HttpServletRequest request);
Date startTime, Date endTime, Long organizationId, String idCard, HttpServletRequest request);
/**
* 查询患者基本信息

View File

@@ -174,16 +174,19 @@ public class InHospitalRegisterAppServiceImpl implements IInHospitalRegisterAppS
@Override
public IPage<InHospitalRegisterQueryDto> getRegisterInfo(InHospitalRegisterQueryDto inHospitalRegisterQueryDto,
String searchKey, String registeredFlag, Integer pageNo, Integer pageSize,
Date startTime, Date endTime, Long organizationId, HttpServletRequest request) {
Date startTime, Date endTime, Long organizationId, String idCard, HttpServletRequest request) {
Integer encounterStatus = EncounterZyStatus.TO_BE_REGISTERED.getValue(); // 待登记
// startTime/endTime 直接传给 Mapper XML 参数,不通过 QueryWrapper
inHospitalRegisterQueryDto.setStartTime(null);
inHospitalRegisterQueryDto.setEndTime(null);
// 构建查询条件
QueryWrapper<InHospitalRegisterQueryDto> queryWrapper
= HisQueryUtils.buildQueryWrapper(inHospitalRegisterQueryDto, searchKey,
new HashSet<>(Arrays.asList("registrar", "source_name", "patient_name", "id_card")), request);
new HashSet<>(Arrays.asList("registrar", "source_name", "patient_name")), request);
IPage<InHospitalRegisterQueryDto> inHospitalRegisterInfo = inHospitalRegisterAppMapper
.getInHospitalRegisterInfo(new Page<>(pageNo, pageSize), EncounterClass.IMP.getValue(), encounterStatus,
registeredFlag, LocationForm.WARD.getValue(), startTime, endTime, organizationId,
registeredFlag, LocationForm.WARD.getValue(), startTime, endTime, organizationId, idCard,
queryWrapper);
inHospitalRegisterInfo.getRecords().forEach(e -> {
// 性别

View File

@@ -8,6 +8,7 @@ import com.healthlink.his.web.inhospitalcharge.appservice.IInHospitalRegisterApp
import com.healthlink.his.web.inhospitalcharge.dto.*;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
@@ -67,12 +68,13 @@ public class InHospitalRegisterController {
@RequestParam(value = "registeredFlag") String registeredFlag,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
@RequestParam(value = "startTime", required = false) Date startTime,
@RequestParam(value = "endTime", required = false) Date endTime,
@RequestParam(value = "startTime", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
@RequestParam(value = "endTime", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime,
@RequestParam(value = "organizationId", required = false) Long organizationId,
@RequestParam(value = "idCard", required = false) String idCard,
HttpServletRequest request) {
return R.ok(iInHospitalRegisterAppService.getRegisterInfo(inHospitalRegisterQueryDto, searchKey, registeredFlag,
pageNo, pageSize, startTime, endTime, organizationId, request));
pageNo, pageSize, startTime, endTime, organizationId, idCard, request));
}
/**

View File

@@ -93,4 +93,9 @@ public class AdvancePaymentInfoDto {
*/
private BigDecimal balanceAmount;
/**
* 费用类型(医保类型,如:职工医保)
*/
private String feeType;
}

View File

@@ -120,4 +120,14 @@ public class InHospitalRegisterQueryDto {
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long organizationId;
/**
* 身份证号
*/
private String idCard;
/**
* 入院科室名称
*/
private String organizationName;
}

View File

@@ -39,6 +39,7 @@ public interface InHospitalRegisterAppMapper {
@Param("registeredFlag") String registeredFlag, @Param("formEnum") Integer formEnum,
@Param("startTime") Date startTime, @Param("endTime") Date endTime,
@Param("organizationId") Long organizationId,
@Param("idCard") String idCard,
@Param(Constants.WRAPPER) QueryWrapper<InHospitalRegisterQueryDto> queryWrapper);
/**

View File

@@ -18,7 +18,8 @@
api.inHospital_org_name,
api.account_id,
api.total_amount,
api.balance_amount
api.balance_amount,
api.fee_type
from (SELECT ae.tenant_id,
ae.ID AS encounter_id,
ae.bus_no AS bus_no,
@@ -34,7 +35,8 @@
aa.id AS account_id,
COALESCE(payment.total_amount, 0) AS total_amount,
COALESCE(payment.total_amount, 0) - COALESCE(consumption.consumption_amount, 0) +
COALESCE(return_pay.return_amount, 0) AS balance_amount
COALESCE(return_pay.return_amount, 0) AS balance_amount,
fee_info.fee_type AS fee_type
FROM adm_encounter AS ae
LEFT JOIN adm_patient AS ap ON ap.ID = ae.patient_id
AND ap.delete_flag = '0'
@@ -83,6 +85,14 @@
AND aci.status_enum IN (#{status3})
AND aci.encounter_id = ae.ID
) AS return_pay ON TRUE
LEFT JOIN LATERAL (
SELECT fc.contract_name AS fee_type
FROM adm_account AS aa2
LEFT JOIN fin_contract AS fc ON fc.bus_no = aa2.contract_no AND fc.delete_flag = '0'
WHERE aa2.encounter_id = ae.ID AND aa2.delete_flag = '0'
AND aa2.type_code != #{accountTypeCode}
LIMIT 1
) AS fee_info ON TRUE
WHERE ae.delete_flag = '0'
AND ae.status_enum != #{registeredFlag}
AND ae.class_enum = #{classEnum}

View File

@@ -53,6 +53,9 @@
<if test="organizationId != null">
AND ae.organization_id = #{organizationId}
</if>
<if test="idCard != null and idCard != ''">
AND ap.id_card LIKE concat('%', #{idCard}, '%')
</if>
<if test='registeredFlag == "0"'>
AND ae.status_enum = #{encounterStatus}
</if>

View File

@@ -8,29 +8,28 @@
<el-row
:gutter="20"
align="middle"
justify="space-between"
>
<el-col :span="6">
<span class="descriptions-item-label">住院号</span>
<el-input
v-model="queryParams.searchKey"
placeholder="请输入内容"
clearable
style="width: 300px"
@keyup.enter="getPatientInfo"
/>
<el-button
type="primary"
style="margin-left: 10px"
@click="getPatientInfo"
>
查询
</el-button>
</el-col>
<el-col
:span="18"
style="text-align: right"
>
<el-col :span="16">
<el-space>
<span class="descriptions-item-label">住院号</span>
<el-input
v-model="queryParams.searchKey"
placeholder="请输入住院号"
clearable
style="width: 260px"
@keyup.enter="getPatientInfo"
/>
<el-button
type="primary"
@click="getPatientInfo"
>
查询
</el-button>
</el-space>
</el-col>
<el-col :span="8">
<el-space style="float: right">
<el-button
type="primary"
@click="confirmCharge()"
@@ -107,21 +106,32 @@
:gutter="24"
style="margin-top: 10px"
>
<el-col :span="23">
<el-col :span="6">
<span class="descriptions-item-label">在院科室/病区: </span>
<span
v-if="patientInfo.inHospitalOrgName"
class="descriptions-item-value"
>
{{ patientInfo.inHospitalOrgName }} /
{{
patientInfo.wardName +
formatValue(patientInfo.houseName) +
formatValue(patientInfo.bedName)
}}
{{ patientInfo.wardName + formatValue(patientInfo.houseName) }}
</span>
</el-col>
<el-col :span="1">
<el-col :span="4">
<span class="descriptions-item-label">床号: </span>
<span class="descriptions-item-value">
{{ patientInfo.bedName || '--' }}
</span>
</el-col>
<el-col :span="4">
<span class="descriptions-item-label">费用类型: </span>
<span class="descriptions-item-value">
{{ patientInfo.feeType || '自费' }}
</span>
</el-col>
<el-col
:span="9"
style="text-align: right"
>
<el-button
type="primary"
@click="refund()"
@@ -366,7 +376,7 @@ async function handlePrint(row) {
// 科室信息
inHospitalOrgName: patientInfo.value.inHospitalOrgName || "",
bedName: patientInfo.value.bedName || "",
contractName: patientInfo.value.contractName || "自费",
contractName: patientInfo.value.feeType || patientInfo.value.contractName || "自费",
// 费用信息
chargeItem: "住院预缴款",
paymentMethod: row.payWayEnum_enumText || row.paymentMethod || row.paymentEnum_enumText || "现金",

View File

@@ -4,11 +4,29 @@
<el-space>
<el-input
v-model="queryParams.searchKey"
style="max-width: 600px"
placeholder="请输入内容"
style="width: 160px"
placeholder="请输入患者姓名"
clearable
class="input-with-select"
@keydown.enter="handleQuery"
/>
<el-input
v-model="queryParams.idCard"
style="width: 180px"
placeholder="请输入身份证号码"
clearable
@keydown.enter="handleQuery"
/>
<el-date-picker
v-model="dateRange"
type="daterange"
range-separator="~"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD HH:mm:ss"
:default-time="[new Date(0, 0, 0, 0, 0, 0), new Date(0, 0, 0, 23, 59, 59)]"
style="width: 260px"
/>
<el-button @click="resetQuery">
重置
</el-button>
@@ -59,9 +77,15 @@
align="center"
>
<template #default="scope">
{{ scope.row.age ? `${scope.row.age}` : '-' }}
{{ scope.row.age || '-' }}
</template>
</vxe-column>
<vxe-column
field="idCard"
min-width="160"
align="center"
title="身份证号"
/>
<vxe-column
align="center"
title="登记状态"
@@ -88,6 +112,12 @@
align="center"
title="申请来源"
/>
<vxe-column
field="organizationName"
min-width="140"
align="center"
title="入院科室"
/>
<vxe-column
field="wardName"
min-width="120"
@@ -135,6 +165,7 @@
</div>
</template>
<script setup>
import dayjs from 'dayjs';
import PatientRegister from './patientRegister.vue';
import {getAdmissionPage, getInHospitalInfo, getPatientBasicInfo} from './api';
import { ElMessage } from 'element-plus';
@@ -146,10 +177,18 @@ const patient = ref({});
const inHospitalInfo = ref({});
const noFile = ref(false);
const registrationType = ref(true);
// 默认查询当前一周时间段
const dateRange = ref([
dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'),
dayjs().format('YYYY-MM-DD HH:mm:ss'),
]);
const queryParams = ref({
pageNo: 1,
pageSize: 10,
searchKey: '',
idCard: '',
registeredFlag: '0',
});
@@ -223,6 +262,13 @@ const doRegistering = async (row) => {
};
const getList = () => {
if (dateRange.value && dateRange.value.length === 2) {
queryParams.value.startTime = dateRange.value[0];
queryParams.value.endTime = dateRange.value[1];
} else {
queryParams.value.startTime = '';
queryParams.value.endTime = '';
}
getAdmissionPage(queryParams.value).then((res) => {
treatHospitalizedData.value = res.data?.records || [];
total.value = res.data?.total || 0;
@@ -236,10 +282,15 @@ function handleQuery() {
}
function resetQuery() {
dateRange.value = [
dayjs().subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'),
dayjs().format('YYYY-MM-DD HH:mm:ss'),
];
queryParams.value = {
pageNo: 1,
pageSize: 10,
searchKey: '',
idCard: '',
registeredFlag: '0',
};
getList();

View File

@@ -149,7 +149,9 @@ const router = useRouter();
const emits = defineEmits(['okAct', 'cancelAct']);
const props = defineProps({
title: { type: String, default: '' },
title:
{ type: String, default: '' },
registrationType: {
type: [String, Boolean, Number], // 根据实际类型调整
default: null, // 或者 false、'' 等