bug 699
This commit is contained in:
@@ -99,4 +99,20 @@ public interface IInHospitalRegisterAppService {
|
||||
* @return 病区列表
|
||||
*/
|
||||
List<LocationDto> getWardList(Long orgId);
|
||||
|
||||
/**
|
||||
* 修改住院登记信息
|
||||
*
|
||||
* @param inHospitalInfoDto 登记dto
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> updateRegistration(InHospitalInfoDto inHospitalInfoDto);
|
||||
|
||||
/**
|
||||
* 作废住院登记
|
||||
*
|
||||
* @param encounterId 住院就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> voidRegistration(Long encounterId);
|
||||
}
|
||||
|
||||
@@ -84,6 +84,9 @@ public class InHospitalRegisterAppServiceImpl implements IInHospitalRegisterAppS
|
||||
@Resource
|
||||
private YbManager ybManager;
|
||||
|
||||
@Resource
|
||||
private IChargeItemService iChargeItemService;
|
||||
|
||||
/**
|
||||
* 门诊医生开住院申请
|
||||
*
|
||||
@@ -362,6 +365,183 @@ public class InHospitalRegisterAppServiceImpl implements IInHospitalRegisterAppS
|
||||
return locationDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改住院登记信息
|
||||
*
|
||||
* @param inHospitalInfoDto 登记dto
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> updateRegistration(InHospitalInfoDto inHospitalInfoDto) {
|
||||
Long encounterId = inHospitalInfoDto.getEncounterId();
|
||||
if (encounterId == null) {
|
||||
throw new ServiceException("就诊ID不能为空");
|
||||
}
|
||||
Encounter encounter = iEncounterService.getById(encounterId);
|
||||
if (encounter == null) {
|
||||
throw new ServiceException("未找到该住院登记记录");
|
||||
}
|
||||
// 仅"待入科"状态可修改
|
||||
if (!EncounterZyStatus.REGISTERED.getValue().equals(encounter.getStatusEnum())) {
|
||||
throw new ServiceException("患者已入科接收,无法修改登记信息");
|
||||
}
|
||||
|
||||
// 更新就诊信息
|
||||
encounter.setOrganizationId(inHospitalInfoDto.getInHospitalOrgId()); // 住院科室
|
||||
encounter.setPriorityEnum(inHospitalInfoDto.getPriorityEnum()); // 优先级(患者病情)
|
||||
encounter.setAdmitSourceCode(inHospitalInfoDto.getAdmitSourceCode()); // 入院类型
|
||||
encounter.setInWayCode(inHospitalInfoDto.getInWayCode()); // 入院方式
|
||||
encounter.setStartTime(inHospitalInfoDto.getStartTime()); // 入院日期
|
||||
encounter.setRegistrarId(SecurityUtils.getLoginUser().getPractitionerId()); // 登记员
|
||||
iEncounterService.saveOrUpdate(encounter);
|
||||
|
||||
// 更新病区信息
|
||||
EncounterLocation encounterLocation = iEncounterLocationService.getOne(
|
||||
new LambdaQueryWrapper<EncounterLocation>()
|
||||
.eq(EncounterLocation::getEncounterId, encounterId)
|
||||
.eq(EncounterLocation::getFormEnum, LocationForm.WARD.getValue()));
|
||||
if (inHospitalInfoDto.getWardLocationId() != null) {
|
||||
EncounterLocation encounterLocationReg = new EncounterLocation();
|
||||
if (encounterLocation != null) {
|
||||
encounterLocationReg.setId(encounterLocation.getId());
|
||||
}
|
||||
encounterLocationReg.setEncounterId(encounterId);
|
||||
encounterLocationReg.setLocationId(inHospitalInfoDto.getWardLocationId());
|
||||
encounterLocationReg.setFormEnum(LocationForm.WARD.getValue());
|
||||
iEncounterLocationService.saveOrUpdate(encounterLocationReg);
|
||||
}
|
||||
|
||||
// 更新费用性质(contractNo)对应的账户信息
|
||||
if (inHospitalInfoDto.getContractNo() != null) {
|
||||
boolean selfFunded = CommonConstants.BusinessName.DEFAULT_CONTRACT_NO.equals(inHospitalInfoDto.getContractNo());
|
||||
|
||||
// 查找自费账户(type_code='04')
|
||||
Account cashAccount = iAccountService.getOne(
|
||||
new LambdaQueryWrapper<Account>()
|
||||
.eq(Account::getEncounterId, encounterId)
|
||||
.eq(Account::getTypeCode, AccountType.PERSONAL_CASH_ACCOUNT.getCode()));
|
||||
|
||||
// 查找非自费账户
|
||||
Account contractAccount = iAccountService.getOne(
|
||||
new LambdaQueryWrapper<Account>()
|
||||
.eq(Account::getEncounterId, encounterId)
|
||||
.ne(Account::getTypeCode, AccountType.PERSONAL_CASH_ACCOUNT.getCode()));
|
||||
|
||||
if (selfFunded) {
|
||||
// 改为自费
|
||||
if (cashAccount != null) {
|
||||
cashAccount.setContractNo(CommonConstants.BusinessName.DEFAULT_CONTRACT_NO);
|
||||
cashAccount.setEncounterFlag(Whether.YES.getValue());
|
||||
iAccountService.saveOrUpdate(cashAccount);
|
||||
} else {
|
||||
// 不存在自费账户时,创建一个
|
||||
Account newCashAccount = new Account();
|
||||
newCashAccount.setTypeCode(AccountType.PERSONAL_CASH_ACCOUNT.getCode());
|
||||
newCashAccount.setPatientId(encounter.getPatientId());
|
||||
newCashAccount.setEncounterId(encounterId);
|
||||
newCashAccount.setContractNo(CommonConstants.BusinessName.DEFAULT_CONTRACT_NO);
|
||||
newCashAccount.setEncounterFlag(Whether.YES.getValue());
|
||||
newCashAccount.setBalanceAmount(BigDecimal.ZERO);
|
||||
iAccountService.save(newCashAccount);
|
||||
}
|
||||
// 删除非自费账户
|
||||
if (contractAccount != null) {
|
||||
iAccountService.removeById(contractAccount.getId());
|
||||
}
|
||||
} else {
|
||||
// 改为非自费
|
||||
if (cashAccount != null) {
|
||||
cashAccount.setEncounterFlag(Whether.NO.getValue());
|
||||
iAccountService.saveOrUpdate(cashAccount);
|
||||
} else {
|
||||
// 不存在自费账户时,创建一个
|
||||
Account newCashAccount = new Account();
|
||||
newCashAccount.setTypeCode(AccountType.PERSONAL_CASH_ACCOUNT.getCode());
|
||||
newCashAccount.setPatientId(encounter.getPatientId());
|
||||
newCashAccount.setEncounterId(encounterId);
|
||||
newCashAccount.setContractNo(CommonConstants.BusinessName.DEFAULT_CONTRACT_NO);
|
||||
newCashAccount.setEncounterFlag(Whether.NO.getValue());
|
||||
newCashAccount.setBalanceAmount(BigDecimal.ZERO);
|
||||
iAccountService.save(newCashAccount);
|
||||
}
|
||||
// 更新或创建非自费账户
|
||||
String typeCode = StringUtils.isNotEmpty(inHospitalInfoDto.getTypeCoce())
|
||||
? inHospitalInfoDto.getTypeCoce()
|
||||
: AccountType.PERSONAL_CASH_ACCOUNT.getCode();
|
||||
if (contractAccount != null) {
|
||||
contractAccount.setContractNo(inHospitalInfoDto.getContractNo());
|
||||
iAccountService.saveOrUpdate(contractAccount);
|
||||
} else {
|
||||
Account newAccount = new Account();
|
||||
newAccount.setTypeCode(typeCode);
|
||||
newAccount.setPatientId(encounter.getPatientId());
|
||||
newAccount.setEncounterId(encounterId);
|
||||
newAccount.setContractNo(inHospitalInfoDto.getContractNo());
|
||||
newAccount.setEncounterFlag(Whether.YES.getValue());
|
||||
iAccountService.save(newAccount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"住院登记"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 作废住院登记
|
||||
*
|
||||
* @param encounterId 住院就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> voidRegistration(Long encounterId) {
|
||||
if (encounterId == null) {
|
||||
throw new ServiceException("就诊ID不能为空");
|
||||
}
|
||||
Encounter encounter = iEncounterService.getById(encounterId);
|
||||
if (encounter == null) {
|
||||
throw new ServiceException("未找到该住院登记记录");
|
||||
}
|
||||
// 仅"待入科"状态可作废
|
||||
if (!EncounterZyStatus.REGISTERED.getValue().equals(encounter.getStatusEnum())) {
|
||||
throw new ServiceException("该患者已入科,请先通知护士站办理退科处理!");
|
||||
}
|
||||
|
||||
// 检查预交金余额
|
||||
Account cashAccount = iAccountService.getOne(
|
||||
new LambdaQueryWrapper<Account>()
|
||||
.eq(Account::getEncounterId, encounterId)
|
||||
.eq(Account::getTypeCode, AccountType.PERSONAL_CASH_ACCOUNT.getCode()));
|
||||
if (cashAccount != null && cashAccount.getBalanceAmount() != null
|
||||
&& cashAccount.getBalanceAmount().compareTo(BigDecimal.ZERO) > 0) {
|
||||
throw new ServiceException("该患者存在未退清的预交金,请先前往预交金页面办理退款!");
|
||||
}
|
||||
|
||||
// 检查是否已产生计费
|
||||
long chargeCount = iChargeItemService.count(
|
||||
new LambdaQueryWrapper<ChargeItem>()
|
||||
.eq(ChargeItem::getEncounterId, encounterId));
|
||||
if (chargeCount > 0) {
|
||||
throw new ServiceException("该患者已产生计费记录,无法作废登记!");
|
||||
}
|
||||
|
||||
// 设置状态为已作废
|
||||
encounter.setStatusEnum(EncounterZyStatus.VOIDED.getValue());
|
||||
encounter.setRegistrarId(SecurityUtils.getLoginUser().getPractitionerId()); // 作废操作人
|
||||
iEncounterService.saveOrUpdate(encounter);
|
||||
|
||||
// 清理账户记录
|
||||
if (cashAccount != null) {
|
||||
iAccountService.removeById(cashAccount.getId());
|
||||
}
|
||||
// 清理非自费账户
|
||||
iAccountService.remove(
|
||||
new LambdaQueryWrapper<Account>()
|
||||
.eq(Account::getEncounterId, encounterId)
|
||||
.ne(Account::getTypeCode, AccountType.PERSONAL_CASH_ACCOUNT.getCode()));
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"作废操作"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理入院登记信息
|
||||
*
|
||||
|
||||
@@ -142,4 +142,26 @@ public class InHospitalRegisterController {
|
||||
return R.ok(iInHospitalRegisterAppService.getWardList(orgId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改住院登记信息
|
||||
*
|
||||
* @param inHospitalInfoDto 登记dto
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping(value = "/update-registration")
|
||||
public R<?> updateRegistration(@RequestBody InHospitalInfoDto inHospitalInfoDto) {
|
||||
return iInHospitalRegisterAppService.updateRegistration(inHospitalInfoDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 作废住院登记
|
||||
*
|
||||
* @param encounterId 住院就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping(value = "/void-registration")
|
||||
public R<?> voidRegistration(@RequestParam(value = "encounterId") Long encounterId) {
|
||||
return iInHospitalRegisterAppService.voidRegistration(encounterId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -95,4 +95,9 @@ public class InHospitalRegisterQueryDto {
|
||||
private String admitSourceCode;
|
||||
private String admitSourceCode_dictText;
|
||||
|
||||
/**
|
||||
* 住院状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
|
||||
}
|
||||
|
||||
@@ -155,6 +155,8 @@ public class WesternMedicineDispenseAppServiceImpl implements IWesternMedicineDi
|
||||
|
||||
// 发药状态
|
||||
List<DispenseStatusOption> dispenseStatusOptions = new ArrayList<>();
|
||||
dispenseStatusOptions.add(new DispenseStatusOption(DispenseStatus.SUBMITTED.getValue(),
|
||||
DispenseStatus.SUBMITTED.getInfo()));
|
||||
dispenseStatusOptions.add(new DispenseStatusOption(DispenseStatus.IN_PROGRESS.getValue(),
|
||||
DispenseStatus.IN_PROGRESS.getInfo()));
|
||||
dispenseStatusOptions.add(new DispenseStatusOption(DispenseStatus.COMPLETED.getValue(),
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
ihri.ward_name,
|
||||
ihri.contract_no,
|
||||
ihri.bus_no,
|
||||
ihri.admit_source_code
|
||||
ihri.admit_source_code,
|
||||
ihri.status_enum
|
||||
from (SELECT ae.tenant_id,
|
||||
ae.ID AS encounter_id,
|
||||
ae.amb_encounter_id AS amb_encounter_id,
|
||||
@@ -32,7 +33,8 @@
|
||||
al.NAME AS ward_name,
|
||||
aa.contract_no,
|
||||
ae.bus_no,
|
||||
ae.admit_source_code
|
||||
ae.admit_source_code,
|
||||
ae.status_enum
|
||||
FROM adm_encounter AS ae
|
||||
LEFT JOIN adm_encounter AS ambae ON ae.amb_encounter_id = ambae.
|
||||
ID
|
||||
|
||||
@@ -22,7 +22,9 @@ public enum EncounterZyStatus implements HisEnumInterface {
|
||||
|
||||
PENDING_TRANSFER(6, "pending-transfer", "待转科"),
|
||||
|
||||
ALREADY_SETTLED(7, "already-settled", "已结算出院");
|
||||
ALREADY_SETTLED(7, "already-settled", "已结算出院"),
|
||||
|
||||
VOIDED(8, "voided", "已作废");
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
@@ -18,17 +18,13 @@
|
||||
查询
|
||||
</el-button>
|
||||
</el-space>
|
||||
<el-space>
|
||||
<!-- <el-button>读卡</el-button> -->
|
||||
<!-- <el-button type="primary">无档登记</el-button> -->
|
||||
</el-space>
|
||||
</div>
|
||||
<div class="table-container">
|
||||
<vxe-table
|
||||
:data="treatHospitalizedData"
|
||||
style="width: 100%"
|
||||
height="100%"
|
||||
show-overflow
|
||||
show-overflow="title"
|
||||
>
|
||||
<vxe-column
|
||||
type="seq"
|
||||
@@ -104,20 +100,68 @@
|
||||
align="center"
|
||||
title="登记员"
|
||||
/>
|
||||
<vxe-column
|
||||
align="center"
|
||||
title="登记状态"
|
||||
width="100"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span :style="{ color: scope.row.statusEnum == 8 ? '#F56C6C' : '#67C23A' }">
|
||||
{{ scope.row.statusEnum == 8 ? '已作废' : '已登记' }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column
|
||||
fixed="right"
|
||||
align="center"
|
||||
title="操作"
|
||||
width="88"
|
||||
width="280"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
@click="doEdit(scope.row)"
|
||||
@click="doView(scope.row)"
|
||||
>
|
||||
查看
|
||||
</el-button>
|
||||
<el-tooltip
|
||||
v-if="scope.row.statusEnum == 5"
|
||||
content="患者已入科接收,无法修改登记信息"
|
||||
placement="top"
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
disabled
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-button
|
||||
v-else-if="scope.row.statusEnum == 8"
|
||||
type="primary"
|
||||
text
|
||||
disabled
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
type="primary"
|
||||
text
|
||||
@click="doModify(scope.row)"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
text
|
||||
:disabled="scope.row.statusEnum == 5 || scope.row.statusEnum == 8"
|
||||
@click="doVoid(scope.row)"
|
||||
>
|
||||
作废
|
||||
</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
@@ -134,35 +178,32 @@
|
||||
v-model:dialog-visible="patientRegisterVisible"
|
||||
:patient-info="patient"
|
||||
:in-hospital-info="inHospitalInfo"
|
||||
title="登记"
|
||||
:title="dialogTitle"
|
||||
:registration-type="registrationType"
|
||||
:already-edit="alreadyEdit"
|
||||
:no-file="noFile"
|
||||
:is-registered="true"
|
||||
:is-registered="!isEditMode"
|
||||
:is-edit-mode="isEditMode"
|
||||
@ok-act="patientRegisterOK"
|
||||
@cancel-act="cancelAct"
|
||||
/>
|
||||
</template>
|
||||
<script setup>
|
||||
import PatientRegister from './patientRegister.vue';
|
||||
import {getAdmissionPage, getContractList, getInHospitalInfo, getPatientBasicInfo} from './api';
|
||||
import {ElMessage, ElMessageBox} from 'element-plus';
|
||||
import {getAdmissionPage, getContractList, getInHospitalInfo, getPatientBasicInfo, voidRegistration} from './api';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { admit_source_code } = proxy.useDict('admit_source_code');
|
||||
//const { proxy } = getCurrentInstance();
|
||||
const emits = defineEmits([]);
|
||||
// const props = defineProps({});
|
||||
const searchForm = reactive({
|
||||
searchType: 'name',
|
||||
searchKey: '',
|
||||
});
|
||||
const total = ref();
|
||||
const inHospitalInfo = ref({});
|
||||
const alreadyEdit = ref(true);
|
||||
const isEditMode = ref(false);
|
||||
const dialogTitle = ref('登记');
|
||||
const queryParams = ref({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
searchKey: undefined,
|
||||
registeredFlag: '1',
|
||||
searchKey: '',
|
||||
});
|
||||
@@ -173,22 +214,58 @@ const noFile = ref(false);
|
||||
const registrationType = ref(true);
|
||||
const patient = ref({});
|
||||
const priceTypeList = ref({});
|
||||
const doEdit = (row) => {
|
||||
getPatientBasicInfo(row.patientId).then((res) => {
|
||||
patient.value = res.data;
|
||||
});
|
||||
getInHospitalInfo(row.encounterId).then((res) => {
|
||||
inHospitalInfo.value = res.data;
|
||||
patientRegisterVisible.value = true;
|
||||
noFile.value = false;
|
||||
});
|
||||
const doView = async (row) => {
|
||||
isEditMode.value = false;
|
||||
dialogTitle.value = '查看';
|
||||
const [patientRes, hospitalRes] = await Promise.all([
|
||||
getPatientBasicInfo(row.patientId),
|
||||
getInHospitalInfo(row.encounterId),
|
||||
]);
|
||||
patient.value = patientRes.data;
|
||||
inHospitalInfo.value = hospitalRes.data;
|
||||
patientRegisterVisible.value = true;
|
||||
noFile.value = false;
|
||||
};
|
||||
|
||||
const doModify = async (row) => {
|
||||
isEditMode.value = true;
|
||||
dialogTitle.value = '修改登记';
|
||||
const [patientRes, hospitalRes] = await Promise.all([
|
||||
getPatientBasicInfo(row.patientId),
|
||||
getInHospitalInfo(row.encounterId),
|
||||
]);
|
||||
patient.value = patientRes.data;
|
||||
inHospitalInfo.value = hospitalRes.data;
|
||||
patientRegisterVisible.value = true;
|
||||
noFile.value = false;
|
||||
};
|
||||
|
||||
const doVoid = (row) => {
|
||||
ElMessageBox.confirm(
|
||||
'确认作废该患者的住院登记信息吗?作废后不可撤销',
|
||||
'作废确认',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
voidRegistration(row.encounterId).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage.success('作废成功');
|
||||
getList();
|
||||
} else {
|
||||
ElMessage.error(res.msg || '作废失败');
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
onBeforeMount(() => {});
|
||||
getContract();
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
const activeName = ref('first');
|
||||
|
||||
const patientRegisterOK = () => {
|
||||
patientRegisterVisible.value = false;
|
||||
@@ -211,7 +288,6 @@ function resetQuery() {
|
||||
queryParams.value = {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
searchKey: undefined,
|
||||
registeredFlag: '1',
|
||||
searchKey: '',
|
||||
};
|
||||
@@ -262,7 +338,6 @@ const getList = () => {
|
||||
}
|
||||
|
||||
treatHospitalizedData.value = dataList;
|
||||
// treatHospitalizedData.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
});
|
||||
};
|
||||
|
||||
@@ -132,6 +132,23 @@ export function registerInHospital(data) {
|
||||
});
|
||||
}
|
||||
|
||||
// 修改住院登记
|
||||
export function updateRegistration(data) {
|
||||
return request({
|
||||
url: '/inhospital-charge/register/update-registration',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 作废住院登记
|
||||
export function voidRegistration(encounterId) {
|
||||
return request({
|
||||
url: `/inhospital-charge/register/void-registration?encounterId=${encounterId}`,
|
||||
method: 'put',
|
||||
});
|
||||
}
|
||||
|
||||
// 无档登记
|
||||
export function noFilesRegister(data) {
|
||||
return request({
|
||||
|
||||
@@ -39,7 +39,10 @@
|
||||
/>
|
||||
</el-scrollbar>
|
||||
<template #footer>
|
||||
<div class="advance-container">
|
||||
<div
|
||||
v-if="!props.isEditMode"
|
||||
class="advance-container"
|
||||
>
|
||||
<div
|
||||
v-if="currentFeeType !== 'hipCash'"
|
||||
class="payment-item"
|
||||
@@ -110,13 +113,21 @@
|
||||
取消
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!props.isRegistered"
|
||||
v-if="!props.isRegistered && !props.isEditMode"
|
||||
size="fixed"
|
||||
type="primary"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
登记
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="props.isEditMode"
|
||||
size="fixed"
|
||||
type="primary"
|
||||
@click="handleEditSubmit"
|
||||
>
|
||||
保存
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -125,7 +136,7 @@ const { proxy } = getCurrentInstance();
|
||||
import {ElMessage, ElMessageBox} from 'element-plus';
|
||||
import PatientInfoComp from './patientInfo.vue';
|
||||
import RegisterForm from './registerForm.vue';
|
||||
import {noFilesRegister, registerInHospital} from './api';
|
||||
import {noFilesRegister, registerInHospital, updateRegistration} from './api';
|
||||
import {getInit} from '@/views/doctorstation/components/api';
|
||||
import {useRouter} from 'vue-router';
|
||||
import {wxPay, WxPayResult} from '../../../../charge/cliniccharge/components/api';
|
||||
@@ -161,6 +172,10 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false, // false 表示待登记,true 表示已登记
|
||||
},
|
||||
isEditMode: {
|
||||
type: Boolean,
|
||||
default: false, // true 表示修改已登记的记录
|
||||
},
|
||||
});
|
||||
|
||||
watch(
|
||||
@@ -283,6 +298,7 @@ const handleSubmit = () => {
|
||||
ElMessage.success(res.msg);
|
||||
// 打印预交金收据
|
||||
printDepositReceipt(props.patientInfo, params.inHospitalInfo);
|
||||
emits('okAct');
|
||||
cancelAct();
|
||||
// 询问是否需要医保登记
|
||||
// ElMessageBox.confirm('是否需要进行医保登记?', '医保登记确认', {
|
||||
@@ -392,19 +408,25 @@ const handleSubmit = () => {
|
||||
})
|
||||
.then(() => {
|
||||
console.log('路由跳转成功');
|
||||
emits('okAct');
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('路由跳转失败:', error);
|
||||
ElMessage.error('跳转到医保登记页面失败');
|
||||
emits('okAct');
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('跳转异常:', error);
|
||||
emits('okAct');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
// 用户取消医保登记,关闭当前弹窗
|
||||
emits('okAct');
|
||||
});
|
||||
} else {
|
||||
// 自费患者,直接通知刷新列表
|
||||
emits('okAct');
|
||||
}
|
||||
cancelAct();
|
||||
} else {
|
||||
@@ -430,6 +452,34 @@ const handleSubmit = () => {
|
||||
}
|
||||
};
|
||||
|
||||
/* 修改登记 */
|
||||
const handleEditSubmit = () => {
|
||||
RegisterFormRef.value.validateData(async () => {
|
||||
const formData = RegisterFormRef.value.submitForm;
|
||||
const params = {
|
||||
encounterId: props.inHospitalInfo.encounterId,
|
||||
patientId: props.patientInfo.patientId,
|
||||
inHospitalOrgId: formData.inHospitalOrgId,
|
||||
wardLocationId: formData.wardLocationId,
|
||||
priorityEnum: formData.priorityEnum,
|
||||
admitSourceCode: formData.admitSourceCode,
|
||||
inWayCode: formData.inWayCode,
|
||||
startTime: formData.startTime,
|
||||
contractNo: formData.contractNo,
|
||||
typeCoce: formData.typeCoce,
|
||||
};
|
||||
updateRegistration(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage.success(res.msg);
|
||||
emits('okAct');
|
||||
cancelAct();
|
||||
} else {
|
||||
ElMessage.error(res.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const openAct = () => {
|
||||
console.log(props.patientInfo, 'patientRegister.vue');
|
||||
console.log(props.inHospitalInfo, 'inHospitalInfo.vue');
|
||||
|
||||
@@ -364,7 +364,7 @@ const medicalInsuranceTitle = ref('');
|
||||
// });
|
||||
const getProvincesAndCitiesInfo = async () => {
|
||||
try {
|
||||
if (inHospitalInfo.encounterId) {
|
||||
if (props.inHospitalInfo.encounterId) {
|
||||
const res = await getProvincesAndCities(props.inHospitalInfo.encounterId);
|
||||
// console.log('获取省市医保字符串', res);
|
||||
if (res && res.code == 200) {
|
||||
@@ -388,8 +388,7 @@ watch(
|
||||
if (newEncounterId) {
|
||||
getProvincesAndCitiesInfo();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
}
|
||||
);
|
||||
|
||||
/* 提交表单 */
|
||||
@@ -463,8 +462,8 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
getInitOptions();
|
||||
onMounted(async () => {
|
||||
await getInitOptions();
|
||||
setValue();
|
||||
setDefaultAdmitSource();
|
||||
if (submitForm.inHospitalOrgId) {
|
||||
@@ -505,7 +504,7 @@ function getInitOptions() {
|
||||
// 获取所有病区
|
||||
const wardPromise = getPractitionerWard();
|
||||
|
||||
Promise.all([orgPromise, wardPromise]).then(([orgRes, wardRes]) => {
|
||||
const initPromise = Promise.all([orgPromise, wardPromise]).then(([orgRes, wardRes]) => {
|
||||
// 入院科室:展示所有 typeEnum=2(科室) + classEnum含"2"(住院) 的科室
|
||||
organization.value = orgRes.data.records.filter(
|
||||
(record) => record.typeEnum === 2 && checkClassEnumValue(record.classEnum, 2)
|
||||
@@ -529,19 +528,15 @@ function getInitOptions() {
|
||||
}
|
||||
});
|
||||
|
||||
// if (!props.noFile) {
|
||||
// wardList().then((res) => {
|
||||
// wardListOptions.value = res.data;
|
||||
// });
|
||||
// }
|
||||
diagnosisInit().then((res) => {
|
||||
verificationStatusOptions.value = res.data.verificationStatusOptions;
|
||||
});
|
||||
getContractList().then((response) => {
|
||||
contractList.value = response.data;
|
||||
setValue();
|
||||
});
|
||||
getDiagnosisInfo(undefined);
|
||||
|
||||
return initPromise;
|
||||
}
|
||||
function getDiagnosisInfo(value) {
|
||||
getDiagnosisDefinitionList({ pageSize: 500, pageNo: 1, searchKey: value }).then((res) => {
|
||||
@@ -550,6 +545,7 @@ function getDiagnosisInfo(value) {
|
||||
}
|
||||
|
||||
function handleNodeClick(orgInfo) {
|
||||
const savedWardId = props.inHospitalInfo?.wardLocationId; // 保存原始病区ID,用于编辑模式恢复
|
||||
submitForm.wardLocationId = undefined; // 切换科室时,先清空原有病区
|
||||
submitForm.totalBedsNum = undefined;
|
||||
submitForm.idleBedsNum = undefined;
|
||||
@@ -558,13 +554,20 @@ function handleNodeClick(orgInfo) {
|
||||
wardList({ orgId: orgInfo.id })
|
||||
.then((res) => {
|
||||
wardListOptions.value = res.data || [];
|
||||
if (wardListOptions.value.length > 0 && !props.inHospitalInfo.wardLocationId) {
|
||||
submitForm.wardLocationId = wardListOptions.value[0].id;
|
||||
const defaultWard = wardListOptions.value.find(
|
||||
(item) => item.id === submitForm.wardLocationId
|
||||
);
|
||||
if (defaultWard) {
|
||||
handleWardClick(defaultWard);
|
||||
if (wardListOptions.value.length > 0) {
|
||||
// 编辑模式:尝试恢复之前保存的病区
|
||||
if (savedWardId) {
|
||||
const savedWard = wardListOptions.value.find((item) => String(item.id) === String(savedWardId));
|
||||
if (savedWard) {
|
||||
submitForm.wardLocationId = savedWardId;
|
||||
handleWardClick(savedWard);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 新增模式 或 原病区不在新科室下:自动选中第一个病区
|
||||
if (!submitForm.wardLocationId) {
|
||||
submitForm.wardLocationId = wardListOptions.value[0].id;
|
||||
handleWardClick(wardListOptions.value[0]);
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -619,6 +622,19 @@ function setValue() {
|
||||
submitForm.inWayCode_dictText = props.inHospitalInfo?.inWayCode_dictText;
|
||||
}
|
||||
|
||||
// 编辑模式下,API 数据异步到达后重新赋值表单字段并加载病区
|
||||
watch(
|
||||
() => props.inHospitalInfo.encounterId,
|
||||
(newEncounterId, oldEncounterId) => {
|
||||
if (newEncounterId && newEncounterId !== oldEncounterId) {
|
||||
setValue();
|
||||
if (submitForm.inHospitalOrgId) {
|
||||
handleNodeClick({ id: submitForm.inHospitalOrgId });
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const registerRef = ref();
|
||||
/* 登记 */
|
||||
const validateData = async (callback) => {
|
||||
|
||||
8
node_modules/.vite/deps/_metadata.json
generated
vendored
8
node_modules/.vite/deps/_metadata.json
generated
vendored
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"hash": "5905b5e1",
|
||||
"configHash": "4d078017",
|
||||
"lockfileHash": "9e11ee45",
|
||||
"browserHash": "09dcaa6f",
|
||||
"optimized": {},
|
||||
"chunks": {}
|
||||
}
|
||||
3
node_modules/.vite/deps/package.json
generated
vendored
3
node_modules/.vite/deps/package.json
generated
vendored
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
Reference in New Issue
Block a user