门诊医生站-》开立诊断 页面调整

This commit is contained in:
itcast
2026-01-16 15:46:43 +08:00
parent 2b3add4808
commit be0514bc08
86 changed files with 2224 additions and 3929 deletions

View File

@@ -342,7 +342,6 @@
<script setup name="PatientAddDialog">
import pcas from 'china-division/dist/pcas-code.json';
import {addPatient, getOutpatientRegistrationList, patientlLists} from './outpatientregistration';
import {updatePatient} from '@/views/patientmanagement/patientmanagement/component/api';
import {getGenderAndAge, isValidCNidCardNumber, isValidCNPhoneNumber,} from '../../../../utils/validate';
import {ElMessage} from 'element-plus';
@@ -1201,7 +1200,6 @@ function submitForm() {
form.value.patientIdInfoList = [
{
typeCode: form.value.typeCode,
identifierNo: form.value.identifierNo,
},
];
if (form.value.idCard) {
@@ -1226,28 +1224,13 @@ function submitForm() {
}
form.value.address = getAddress(form);
// 判断是修改还是新增
if (form.value.busNo != undefined) {
// 修改患者
updatePatient(form.value).then((response) => {
proxy.$modal.msgSuccess('修改成功');
visible.value = false;
// 触发提交成功事件,让父组件刷新列表
emits('submit', 'update');
});
} else {
// console.log('患者就诊卡号:', form.value.identifierNo)
// console.log('患者就诊信息:', form.value.patientIdInfoList)
// 新增患者
addPatient(form.value).then((response) => {
proxy.$modal.msgSuccess('新增成功');
getPatientInfo(response.data.idCard);
visible.value = false;
reset();
// 触发提交成功事件,让父组件刷新列表
emits('submit', 'add');
});
}
// 提交新增患者请求
addPatient(form.value).then((response) => {
proxy.$modal.msgSuccess('新增成功');
getPatientInfo(response.data.idCard);
visible.value = false;
reset();
});
}
});
}
@@ -1287,66 +1270,8 @@ const typeChange = () => {
form.value.genderEnum = info.gender;
}
};
// 设置查看模式
function setViewMode(isView) {
isViewMode.value = isView;
}
// 设置表单数据
function setFormData(rowData) {
// 深拷贝数据以避免引用问题
form.value = JSON.parse(JSON.stringify(rowData));
// 如果有地址信息,设置级联选择器
if (rowData.addressProvince || rowData.addressCity || rowData.addressDistrict) {
// 构建地址数组
const addressParts = [
rowData.addressProvince,
rowData.addressCity,
rowData.addressDistrict,
rowData.addressStreet,
].filter(part => part); // 过滤空值
if (addressParts.length > 0) {
const codes = convertAddressToCodes(addressParts);
selectedOptions.value = codes.filter((code) => code !== null);
}
}
// 设置患者ID信息 - 如果没有patientIdInfoList则创建一个
if (!form.value.patientIdInfoList || form.value.patientIdInfoList.length === 0) {
form.value.patientIdInfoList = [
{
typeCode: '01',
},
];
}
// 确保必要字段有默认值
if (!form.value.typeCode) {
form.value.typeCode = '01';
}
// 设置活动标识 - 根据activeFlag设置tempFlag
if (form.value.activeFlag) {
form.value.tempFlag = form.value.activeFlag === 2 ? '1' : '0';
}
}
// 将地址转换为级联选择器所需的代码
function convertAddressToCodes(addressParts) {
return addressParts.map((part) => {
if (!part) return null;
// 这里需要根据实际的地址名称找到对应的代码
// 由于数据结构的复杂性,这里先返回空值
return null;
});
}
defineExpose({
show,
setViewMode,
setFormData,
});
</script>
<style scoped>