413 460 513 514

This commit is contained in:
Ranyunqiao
2026-05-12 17:27:25 +08:00
committed by 赵云
parent 288f2133ca
commit 116734f1f8
10 changed files with 183 additions and 137 deletions

View File

@@ -349,11 +349,17 @@ async function getList() {
if (res.code == 200) {
// 过滤掉中医诊断,只保留西医诊断
form.value.diagnosisList = res.data.filter(item => item.typeName !== '中医诊断');
// 为旧数据添加默认分类
// 为旧数据添加默认分类和selectedDiseases
form.value.diagnosisList.forEach(item => {
if (!item.classification) {
item.classification = '西医';
}
// 如果ybNo诊断编码符合传染病编码格式添加到selectedDiseases
if (item.ybNo && /^(01|02|03)/.test(item.ybNo)) {
item.selectedDiseases = [item.ybNo];
} else {
item.selectedDiseases = item.selectedDiseases || [];
}
});
emits('diagnosisSave', false);
}
@@ -685,23 +691,78 @@ async function handleFoodDiseasesCheck() {
/**
* 传染病报告卡处理
* 通过诊断目录维护的'报卡类型'字段自动识别是否有需要填写的传染病报告卡
* 如果有则弹出诊断对应需登记的报告卡界面
* 通过诊断名称自动识别并勾选传染病报告卡中的疾病
*/
function handleInfectiousDiseaseReport() {
// 查找所有有报卡类型的诊断reportTypeCode不为空
const diagnosesWithReportType = form.value.diagnosisList.filter(d => d.reportTypeCode);
// 疾病名称到报卡编码的映射(根据传染病报告卡弹窗中的疾病列表
const diseaseNameToCode = {
// 甲类
'鼠疫': '0101',
'霍乱': '0102',
// 乙类
'传染性非典型肺炎': '0201',
'艾滋病': '0202',
'病毒性肝炎': '0203',
'脊髓灰质炎': '0204',
'人感染高致病性禽流感': '0205',
'麻疹': '0206',
'流行性出血热': '0207',
'狂犬病': '0208',
'流行性乙型脑炎': '0209',
'登革热': '0210',
'炭疽': '0211',
'细菌性和阿米巴性痢疾': '0212',
'肺结核': '0213',
'伤寒和副伤寒': '0214',
'流行性脑脊髓膜炎': '0215',
'百日咳': '0216',
'白喉': '0217',
'新生儿破伤风': '0218',
'猩红热': '0219',
'布鲁氏菌病': '0220',
'淋病': '0221',
'梅毒': '0222',
'钩端螺旋体病': '0223',
'血吸虫病': '0224',
'疟疾': '0225',
'新型冠状病毒肺炎': '0226',
'甲型H1N1流感': '0227',
'人感染H7N9禽流感': '0228',
// 丙类
'流行性感冒': '0301',
'流行性腮腺炎': '0302',
'风疹': '0303',
'急性出血性结膜炎': '0304',
'麻风病': '0305',
'流行性和地方性斑疹伤寒': '0306',
'黑热病': '0307',
'包虫病': '0308',
'丝虫病': '0309',
'除霍乱/菌痢/伤寒副伤寒以外的感染性腹泻病': '0310',
'其它感染性腹泻病': '0310',
'手足口病': '0311',
};
if (diagnosesWithReportType.length === 0) {
// 获取所有诊断名称对应的报卡编码
const allSelectedDiseases = form.value.diagnosisList
.map(d => diseaseNameToCode[d.name] || null)
.filter(code => code);
if (allSelectedDiseases.length === 0) {
return;
}
// 优先使用主诊断,如果没有主诊断有报卡类型则使用第一个有报卡类型的诊断
const mainDiagnosisWithReport = diagnosesWithReportType.find(d => d.maindiseFlag === 1);
const targetDiagnosis = mainDiagnosisWithReport || diagnosesWithReportType[0];
// 优先使用主诊断
const mainDiagnosis = form.value.diagnosisList.find(d => d.maindiseFlag === 1);
const firstDiagnosis = form.value.diagnosisList[0];
const diagnosisToShow = {
...(mainDiagnosis || firstDiagnosis),
selectedDiseases: allSelectedDiseases
};
// 弹出传染病报告卡弹窗
proxy.$refs.infectiousDiseaseReportRef?.show(targetDiagnosis);
proxy.$refs.infectiousDiseaseReportRef?.show(diagnosisToShow);
}
/**
@@ -814,7 +875,8 @@ form.value.diagnosisList.push({
classification: '西医', // 默认为西医
onsetDate: getCurrentDate(),
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
diagnosisTime: getCurrentDate()
diagnosisTime: getCurrentDate(),
selectedDiseases: data.ybNo ? [data.ybNo] : [], // 用于传染病报告卡自动勾选
});
// 添加后按排序号排序

View File

@@ -16,15 +16,15 @@
v-model="form.cardNo"
class="card-number-input"
placeholder="单位自编,与网络直报一致"
maxlength="12"
:disabled="readOnly"
maxlength="20"
:disabled="readOnly || dialogReadOnly"
/>
</el-space>
</el-card>
</template>
<el-card class="report-form" shadow="never">
<el-form ref="formRef" :model="form" :rules="rules" label-position="top" :disabled="readOnly">
<el-form ref="formRef" :model="form" :rules="rules" label-position="top" :disabled="readOnly || dialogReadOnly">
<!-- 患者姓名家长姓名身份证号 -->
<el-row :gutter="16" class="form-row">
<el-col :span="8" class="form-item">
@@ -476,9 +476,9 @@
<template #footer>
<slot name="footer" :close="handleClose" :submit-loading="submitLoading">
<el-space :size="16" justify="center" class="dialog-footer-space" style="display: flex; justify-content: center; width: 100%;">
<el-button v-if="!readOnly" type="primary" @click="handleSubmit" :loading="submitLoading" class="blue-button">保 存</el-button>
<el-button v-if="!(readOnly || dialogReadOnly)" type="primary" @click="handleSubmit" :loading="submitLoading" class="blue-button">保 存</el-button>
<el-button type="info" @click="handleClose">关 闭</el-button>
<el-button v-if="!readOnly" type="danger" @click="handleReset"> </el-button>
<el-button v-if="!(readOnly || dialogReadOnly)" type="danger" @click="handleReset"> </el-button>
</el-space>
</slot>
</template>
@@ -510,6 +510,7 @@ const DISEASE_NAMES = {
};
const dialogVisible = ref(false);
const dialogReadOnly = ref(false);
const formRef = ref(null);
// 保存按钮加载状态,防止重复提交
const submitLoading = ref(false);
@@ -1037,8 +1038,9 @@ function resetAddressSelector() {
* 以只读详情方式打开报卡弹窗,供报卡管理等页面复用医生站报卡样式。
* @param {Object} reportData - 报卡详情数据
*/
function showReport(reportData = {}) {
function showReport(reportData = {}, readOnly = true) {
dialogVisible.value = true;
dialogReadOnly.value = readOnly;
resetAddressSelector();
initProvinceOptions();
@@ -1205,6 +1207,7 @@ function calculateAge() {
*/
async function show(diagnosisData) {
dialogVisible.value = true;
dialogReadOnly.value = false;
// 重置地址选择器状态
resetAddressSelector();
@@ -1238,14 +1241,13 @@ async function show(diagnosisData) {
let cardNo = '';
try {
const res = await getNextCardNo(orgCode);
if (res.code === 200 && res.data) {
if (res.code === 200 && res.data && res.data.length >= 12) {
cardNo = res.data;
} else {
cardNo = 'TEMP_' + Date.now();
}
// API失败或返回不合规时保持为空字符串由用户手动填写或后端自动生成
} catch (err) {
console.error('获取卡片编号失败:', err);
cardNo = 'TEMP_' + Date.now();
// 保持为空,不使用不合规的临时值
}
form.value = {
@@ -1424,9 +1426,9 @@ async function buildSubmitData() {
function validateFormManually() {
const errors = [];
// 卡片编号验证(可选但如果填写了必须是12位
if (form.value.cardNo && form.value.cardNo.length !== 12) {
errors.push('卡片编号必须为12位');
// 卡片编号验证(至少12位后端自动生成16位编号
if (form.value.cardNo && form.value.cardNo.length < 12) {
errors.push('卡片编号至少12位');
}
// 身份证号验证

View File

@@ -2495,11 +2495,13 @@ function handleSave(prescriptionId) {
// 🔧 BugFix#318: 从 parsedContent 提取标准医嘱字段,排除手术特有字段
const standardFields = [
'accountId', 'chargeItemId', 'conditionDefinitionId', 'conditionId',
'contentJson', 'definitionDetailId', 'definitionId', 'diagnosisName',
'dosageInstruction', 'effectiveOrgId', 'encounterDiagnosisId',
'encounterId', 'lotNumber', 'patientId', 'practitionerId',
'prescriptionNo', 'skinTestFlag', 'unitPrice', 'volume', 'ybClassEnum'
'accountId', 'chargeItemId', 'conditionDefinitionId', 'conditionId',
'contentJson', 'definitionDetailId', 'definitionId', 'diagnosisName',
'dosageInstruction', 'effectiveOrgId', 'encounterDiagnosisId',
'encounterId', 'lotNumber', 'patientId', 'practitionerId',
'prescriptionNo', 'skinTestFlag', 'unitPrice', 'volume', 'ybClassEnum',
// 🔧 Bug Fix: 添加 therapyEnum 字段医嘱类型1=长期, 2=临时)
'therapyEnum'
];
let filteredContent = {};
standardFields.forEach(field => {
@@ -3143,7 +3145,9 @@ function handleSaveBatch(prescriptionId) {
// 🔧 Bug Fix: 添加 definitionId 和 definitionDetailId 字段
'definitionId', 'definitionDetailId',
// 🔧 Bug Fix: 添加 categoryEnum 字段(耗材必填)
'categoryEnum'
'categoryEnum',
// 🔧 Bug Fix: 添加 therapyEnum 字段医嘱类型1=长期, 2=临时)
'therapyEnum'
];
let filteredItem = {};
standardItemFields.forEach(field => {