Compare commits
1 Commits
赵云-fix-476
...
develop-赵云
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77374a5889 |
@@ -728,12 +728,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理耗材请求
|
* 处理耗材请求
|
||||||
* 🔧 BugFix #443: 签发时跳过 handDevice,避免重复创建 DeviceDispense 并覆盖关键字段(如 performLocation)
|
|
||||||
* 签发时只需更新状态(下方 sign-advice 批量更新逻辑已处理)
|
|
||||||
*/
|
*/
|
||||||
if (AdviceOpType.SAVE_ADVICE.getCode().equals(adviceOpType)) {
|
this.handDevice(deviceList, curDate, adviceOpType);
|
||||||
this.handDevice(deviceList, curDate, adviceOpType);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 签发时,把草稿状态的账单更新为待收费
|
// 签发时,把草稿状态的账单更新为待收费
|
||||||
if (AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType) && !adviceSaveList.isEmpty()) {
|
if (AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType) && !adviceSaveList.isEmpty()) {
|
||||||
@@ -2107,9 +2103,11 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
|
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
|
||||||
sourceEnum, sourceBillNo);
|
sourceEnum, sourceBillNo);
|
||||||
// 🔧 修复 Bug #444: 移除手术计费场景的药品过滤。
|
// 手术计费场景:sourceBillNo 不为空时,过滤掉药品(1),保留耗材(2)和诊疗(3/6)
|
||||||
// 原过滤会导致门诊手术医嘱界面无法获取手术计费创建的药品记录。
|
if (sourceBillNo != null && !sourceBillNo.isEmpty()) {
|
||||||
// 前端各组件已根据自身业务逻辑做了正确的 adviceType 过滤。
|
requestBaseInfo.removeIf(dto -> dto.getAdviceType() != null
|
||||||
|
&& dto.getAdviceType() == 1);
|
||||||
|
}
|
||||||
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
||||||
// 请求状态
|
// 请求状态
|
||||||
requestBaseDto
|
requestBaseDto
|
||||||
|
|||||||
@@ -246,8 +246,7 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
|
|||||||
EncounterDiagnosis encounterDiagnosis;
|
EncounterDiagnosis encounterDiagnosis;
|
||||||
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
||||||
encounterDiagnosis = new EncounterDiagnosis();
|
encounterDiagnosis = new EncounterDiagnosis();
|
||||||
// 注意:不设置 encounterDiagnosisId,因为上面已经删除了所有记录
|
encounterDiagnosis.setId(saveDiagnosisChildParam.getEncounterDiagnosisId());
|
||||||
// 如果设置旧的 ID,saveOrUpdate 会尝试 UPDATE 不存在的记录导致失败或重复插入
|
|
||||||
encounterDiagnosis.setEncounterId(encounterId);
|
encounterDiagnosis.setEncounterId(encounterId);
|
||||||
encounterDiagnosis.setConditionId(saveDiagnosisChildParam.getConditionId());
|
encounterDiagnosis.setConditionId(saveDiagnosisChildParam.getConditionId());
|
||||||
encounterDiagnosis.setMaindiseFlag(saveDiagnosisChildParam.getMaindiseFlag());
|
encounterDiagnosis.setMaindiseFlag(saveDiagnosisChildParam.getMaindiseFlag());
|
||||||
|
|||||||
@@ -42,8 +42,8 @@
|
|||||||
T5.package_name,
|
T5.package_name,
|
||||||
T6.name as sub_item_name
|
T6.name as sub_item_name
|
||||||
FROM wor_activity_definition T1
|
FROM wor_activity_definition T1
|
||||||
/* 价格表使用LEFT JOIN,避免因缺少价格记录导致搜索不到项目 */
|
/* 只JOIN必要的价格表,使用INNER JOIN避免笛卡尔积 */
|
||||||
LEFT JOIN adm_charge_item_definition T2
|
INNER JOIN adm_charge_item_definition T2
|
||||||
ON T1.id = T2.instance_id
|
ON T1.id = T2.instance_id
|
||||||
AND T2.instance_table = 'wor_activity_definition'
|
AND T2.instance_table = 'wor_activity_definition'
|
||||||
/* 检验类型关联 */
|
/* 检验类型关联 */
|
||||||
|
|||||||
@@ -45,6 +45,18 @@
|
|||||||
<if test="endDate != null and endDate != ''">
|
<if test="endDate != null and endDate != ''">
|
||||||
AND drf.create_time <= (#{endDate}::date + INTERVAL '1 day' - INTERVAL '1 second')
|
AND drf.create_time <= (#{endDate}::date + INTERVAL '1 day' - INTERVAL '1 second')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="status != null and status != ''">
|
||||||
|
AND CASE
|
||||||
|
WHEN MIN(wsr.status_enum) = 1 THEN 0
|
||||||
|
WHEN MIN(wsr.status_enum) = 2 THEN 1
|
||||||
|
WHEN MIN(wsr.status_enum) = 3 AND MAX(CASE WHEN wsr.performer_check_id IS NOT NULL THEN 1 ELSE 0 END) = 1 THEN 2
|
||||||
|
WHEN MIN(wsr.status_enum) = 3 THEN 4
|
||||||
|
WHEN MIN(wsr.status_enum) = 4 THEN 3
|
||||||
|
WHEN MIN(wsr.status_enum) = 5 OR MIN(wsr.status_enum) = 6 OR MIN(wsr.status_enum) = 7 THEN 7
|
||||||
|
WHEN MIN(wsr.status_enum) = 8 THEN 6
|
||||||
|
ELSE NULL
|
||||||
|
END = #{status}::integer
|
||||||
|
</if>
|
||||||
<if test="keyword != null and keyword != ''">
|
<if test="keyword != null and keyword != ''">
|
||||||
AND (drf.prescription_no ILIKE '%' || #{keyword} || '%'
|
AND (drf.prescription_no ILIKE '%' || #{keyword} || '%'
|
||||||
OR EXISTS (
|
OR EXISTS (
|
||||||
@@ -60,19 +72,6 @@
|
|||||||
</if>
|
</if>
|
||||||
GROUP BY drf.id, drf.encounter_id, drf.prescription_no, drf.name, drf.desc_json,
|
GROUP BY drf.id, drf.encounter_id, drf.prescription_no, drf.name, drf.desc_json,
|
||||||
drf.requester_id, drf.create_time, ap.name
|
drf.requester_id, drf.create_time, ap.name
|
||||||
<if test="status != null and status != ''">
|
|
||||||
HAVING CASE MIN(wsr.status_enum)
|
|
||||||
WHEN 1 THEN 0
|
|
||||||
WHEN 2 THEN 1
|
|
||||||
WHEN 3 THEN 4
|
|
||||||
WHEN 4 THEN 4
|
|
||||||
WHEN 5 THEN 5
|
|
||||||
WHEN 6 THEN 5
|
|
||||||
WHEN 7 THEN 5
|
|
||||||
WHEN 8 THEN 6
|
|
||||||
ELSE NULL
|
|
||||||
END = #{status}::integer
|
|
||||||
</if>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getRequestFormDetail" resultType="com.openhis.web.regdoctorstation.dto.RequestFormDetailQueryDto">
|
<select id="getRequestFormDetail" resultType="com.openhis.web.regdoctorstation.dto.RequestFormDetailQueryDto">
|
||||||
|
|||||||
@@ -1582,7 +1582,7 @@ async function loadMethodPackageDetails(item, method) {
|
|||||||
const packageId = packages[0].id;
|
const packageId = packages[0].id;
|
||||||
// 查询套餐明细
|
// 查询套餐明细
|
||||||
const detailRes = await request({
|
const detailRes = await request({
|
||||||
url: `/system/check-type/package/${packageId}/details`,
|
url: `/system/package/${packageId}/details`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
if (detailRes.code === 200 && detailRes.data) {
|
if (detailRes.code === 200 && detailRes.data) {
|
||||||
|
|||||||
@@ -1026,7 +1026,7 @@ const mapAdviceTypeLabel = (type, adviceTableName) => {
|
|||||||
return found.label;
|
return found.label;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🔧 Bug #458 Fix: 诊疗/手术类型字典缺失或标签为空时的兜底
|
// 🔧 Bug #458 Fix: 诊疗/手术类型字典缺失时的兜底,避免保存后"医嘱类型"列显示为空
|
||||||
if (adviceTableName === 'wor_activity_definition' || adviceTableName === 'wor_service_request') {
|
if (adviceTableName === 'wor_activity_definition' || adviceTableName === 'wor_service_request') {
|
||||||
if (type === 6) return '手术';
|
if (type === 6) return '手术';
|
||||||
if (type === 4) return '手术';
|
if (type === 4) return '手术';
|
||||||
@@ -1036,15 +1036,6 @@ const mapAdviceTypeLabel = (type, adviceTableName) => {
|
|||||||
return '诊疗';
|
return '诊疗';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🔧 Bug #458 Fix: 兜底映射,确保所有有效 adviceType 都有显示标签
|
|
||||||
// 不依赖字典数据和表名,直接返回标准类型名称
|
|
||||||
if (type === 3) return '诊疗';
|
|
||||||
if (type === 6) return '手术';
|
|
||||||
if (type === 4) return '耗材';
|
|
||||||
if (type === 1) return '西药';
|
|
||||||
if (type === 2) return '中成药';
|
|
||||||
if (type === 5) return '会诊';
|
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1667,16 +1658,12 @@ function getListInfo(addNewRow) {
|
|||||||
contentJson?.consultationRequestId;
|
contentJson?.consultationRequestId;
|
||||||
|
|
||||||
let adviceType = item.adviceType;
|
let adviceType = item.adviceType;
|
||||||
|
|
||||||
// 🔧 Bug Fix: 后端保存时将耗材(4)转换为中成药(2),显示时需要转换回来
|
// 🔧 Bug Fix: 后端保存时将耗材(4)转换为中成药(2),显示时需要转换回来
|
||||||
// 检查 adviceTableName,如果是耗材表则应该是耗材类型
|
// 检查 adviceTableName,如果是耗材表则应该是耗材类型
|
||||||
const adviceTableName = contentJson?.adviceTableName || item.adviceTableName;
|
const adviceTableName = contentJson?.adviceTableName || item.adviceTableName;
|
||||||
|
|
||||||
// 🔧 Bug #458 Fix: 后端可能返回空字符串的 adviceType_dictText,需重新计算
|
let adviceType_dictText = item.adviceType_dictText || mapAdviceTypeLabel(adviceType, adviceTableName);
|
||||||
const backendDictText = item.adviceType_dictText;
|
|
||||||
let adviceType_dictText = (backendDictText && backendDictText.trim())
|
|
||||||
? backendDictText
|
|
||||||
: mapAdviceTypeLabel(adviceType, adviceTableName);
|
|
||||||
|
|
||||||
// 如果是会诊类型,设置为会诊类型
|
// 如果是会诊类型,设置为会诊类型
|
||||||
if (isConsultation) {
|
if (isConsultation) {
|
||||||
|
|||||||
@@ -636,11 +636,12 @@ function getList() {
|
|||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
surgeryList.value = res.data?.records || []
|
surgeryList.value = res.data?.records || []
|
||||||
} else {
|
} else {
|
||||||
console.warn('手术列表加载失败(可能无权限或数据异常):', res.msg)
|
proxy.$modal.msgError(res.msg || '数据加载失败,请稍后重试')
|
||||||
surgeryList.value = []
|
surgeryList.value = []
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.warn('手术列表请求异常:', error)
|
console.error('获取手术列表失败:', error)
|
||||||
|
proxy.$modal.msgError('数据加载失败,请稍后重试')
|
||||||
surgeryList.value = []
|
surgeryList.value = []
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
@@ -1141,8 +1142,8 @@ function submitForm() {
|
|||||||
// 保存麻醉方式
|
// 保存麻醉方式
|
||||||
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
||||||
open.value = false
|
open.value = false
|
||||||
// 由父组件 @saved 事件负责刷新列表(带延迟确保后端事务已提交)
|
getList() // 提交成功后直接刷新列表
|
||||||
emit('saved')
|
emit('saved') // 通知父组件刷新医嘱列表
|
||||||
} else {
|
} else {
|
||||||
proxy.$modal.msgError(res.msg || '新增手术失败,请检查表单信息')
|
proxy.$modal.msgError(res.msg || '新增手术失败,请检查表单信息')
|
||||||
}
|
}
|
||||||
@@ -1158,8 +1159,8 @@ function submitForm() {
|
|||||||
// 保存麻醉方式
|
// 保存麻醉方式
|
||||||
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
||||||
open.value = false
|
open.value = false
|
||||||
// 由父组件 @saved 事件负责刷新列表
|
getList() // 修改成功后直接刷新列表
|
||||||
emit('saved')
|
emit('saved') // 通知父组件刷新医嘱列表
|
||||||
} else {
|
} else {
|
||||||
proxy.$modal.msgError(res.msg || '更新手术失败,请检查表单信息')
|
proxy.$modal.msgError(res.msg || '更新手术失败,请检查表单信息')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,7 +153,7 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="手术申请" name="surgery">
|
<el-tab-pane label="手术申请" name="surgery">
|
||||||
<surgeryApplication :patientInfo="patientInfo" :activeTab="activeTab" ref="surgeryRef"
|
<surgeryApplication :patientInfo="patientInfo" :activeTab="activeTab" ref="surgeryRef"
|
||||||
@saved="() => { prescriptionRef?.getListInfo(); setTimeout(() => surgeryRef?.getList(), 500) }" />
|
@saved="() => { prescriptionRef?.getListInfo(); surgeryRef?.getList() }" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="电子处方" name="eprescription">
|
<el-tab-pane label="电子处方" name="eprescription">
|
||||||
<eprescriptionlist :patientInfo="patientInfo" ref="eprescriptionRef" />
|
<eprescriptionlist :patientInfo="patientInfo" ref="eprescriptionRef" />
|
||||||
|
|||||||
@@ -678,16 +678,15 @@ const handlePrint = async (row) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 构建 descJson 字段行(与详情弹窗展示的字段一致)
|
// 构建 descJson 字段行(与详情弹窗展示的字段一致)
|
||||||
const fieldKeys = ['targetDepartment', 'urgencyLevel', 'expectedExaminationTime', 'allergyHistory', 'examinationPurpose', 'medicalHistorySummary', 'symptom', 'sign', 'clinicalDiagnosis', 'otherDiagnosis', 'relatedResult', 'attention'];
|
const fieldKeys = ['targetDepartment', 'symptom', 'sign', 'clinicalDiagnosis', 'otherDiagnosis', 'relatedResult', 'attention'];
|
||||||
let descFieldsHtml = '';
|
let descFieldsHtml = '';
|
||||||
fieldKeys.forEach((key) => {
|
fieldKeys.forEach((key) => {
|
||||||
const label = labelMap[key] || key;
|
const label = labelMap[key] || key;
|
||||||
const value = transformField(key, descData[key]);
|
if (descData[key] != null && descData[key] !== '') {
|
||||||
if (value != null && value !== '') {
|
|
||||||
descFieldsHtml += `
|
descFieldsHtml += `
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="label">${label}:</span>
|
<span class="label">${label}:</span>
|
||||||
<span class="value">${value}</span>
|
<span class="value">${descData[key]}</span>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -289,62 +289,43 @@ function getList() {
|
|||||||
return obj;
|
return obj;
|
||||||
});
|
});
|
||||||
form.value.diagnosisList = datas;
|
form.value.diagnosisList = datas;
|
||||||
// 去重:按 conditionId 去重,防止后端重复插入导致重复记录
|
// form.value.diagnosisList = res.data;
|
||||||
deduplicateDiagnosisList();
|
|
||||||
emits('diagnosisSave', false);
|
emits('diagnosisSave', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
getTcmDiagnosis({ encounterId: props.patientInfo.encounterId }).then((res) => {
|
getTcmDiagnosis({ encounterId: props.patientInfo.encounterId }).then((res) => {
|
||||||
console.log('getTcmDiagnosis=======>', JSON.stringify(res.data?.illness));
|
console.log('getTcmDiagnosis=======>', JSON.stringify(res.data.illness));
|
||||||
|
|
||||||
if (res.code == 200 && res.data?.illness?.length > 0) {
|
if (res.code == 200) {
|
||||||
diagnosisNetDatas.value = res.data.illness;
|
if (res.data.illness.length > 0) {
|
||||||
res.data.illness.forEach((item, index) => {
|
diagnosisNetDatas.value = res.data.illness;
|
||||||
newList.push({
|
res.data.illness.forEach((item, index) => {
|
||||||
name: item.name + '-' + (res.data.symptom?.[index]?.name || ''),
|
newList.push({
|
||||||
ybNo: item.ybNo,
|
name: item.name + '-' + (res.data.symptom[index]?.name || ''),
|
||||||
medTypeCode: item.medTypeCode,
|
ybNo: item.ybNo,
|
||||||
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
medTypeCode: item.medTypeCode,
|
||||||
diagnosisTime: new Date().toLocaleString('zh-CN')
|
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
||||||
|
diagnosisTime: new Date().toLocaleString('zh-CN')
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
// 将新数据添加到现有列表中
|
||||||
// 将新数据添加到现有列表中
|
form.value.diagnosisList.push(...newList);
|
||||||
form.value.diagnosisList.push(...newList);
|
|
||||||
|
// 重新排序整个列表
|
||||||
// 重新排序整个列表
|
form.value.diagnosisList.sort((a, b) => {
|
||||||
form.value.diagnosisList.sort((a, b) => {
|
const aNo = typeof a.diagSrtNo === 'number' ? a.diagSrtNo : 9999;
|
||||||
const aNo = typeof a.diagSrtNo === 'number' ? a.diagSrtNo : 9999;
|
const bNo = typeof b.diagSrtNo === 'number' ? b.diagSrtNo : 9999;
|
||||||
const bNo = typeof b.diagSrtNo === 'number' ? b.diagSrtNo : 9999;
|
return aNo - bNo;
|
||||||
return aNo - bNo;
|
});
|
||||||
});
|
}
|
||||||
// TCM 数据添加后也去重
|
emits('diagnosisSave', false);
|
||||||
deduplicateDiagnosisList();
|
|
||||||
}
|
}
|
||||||
emits('diagnosisSave', false);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
getTree();
|
getTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 诊断列表去重:按 ybNo + name 组合去重,保留第一条记录
|
|
||||||
* 防止后端 saveOrUpdate 在删除后误 INSERT 导致重复
|
|
||||||
*/
|
|
||||||
function deduplicateDiagnosisList() {
|
|
||||||
const seen = new Set();
|
|
||||||
const dedupedList = [];
|
|
||||||
for (const item of form.value.diagnosisList) {
|
|
||||||
// 使用 ybNo 和 name 组合作为唯一标识(中医诊断没有 ybNo,用 name 去重)
|
|
||||||
const key = item.ybNo ? `${item.ybNo}` : `name_${item.name}`;
|
|
||||||
if (!seen.has(key)) {
|
|
||||||
seen.add(key);
|
|
||||||
dedupedList.push(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
form.value.diagnosisList = dedupedList;
|
|
||||||
}
|
|
||||||
|
|
||||||
init();
|
init();
|
||||||
function init() {
|
function init() {
|
||||||
diagnosisInit().then((res) => {
|
diagnosisInit().then((res) => {
|
||||||
@@ -622,18 +603,6 @@ function handleSaveDiagnosis() {
|
|||||||
return aNo - bNo;
|
return aNo - bNo;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 步骤1.5:确保每条诊断都有诊断医生和诊断时间(元数据补全)
|
|
||||||
const doctorName = props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name;
|
|
||||||
const now = new Date().toLocaleString('zh-CN');
|
|
||||||
sortedList.forEach((item) => {
|
|
||||||
if (!item.diagnosisDoctor) {
|
|
||||||
item.diagnosisDoctor = doctorName;
|
|
||||||
}
|
|
||||||
if (!item.diagnosisTime) {
|
|
||||||
item.diagnosisTime = now;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 步骤2:重新分配连续的序号(从1开始)
|
// 步骤2:重新分配连续的序号(从1开始)
|
||||||
sortedList.forEach((item, index) => {
|
sortedList.forEach((item, index) => {
|
||||||
item.diagSrtNo = index + 1; // 这里是关键!把”诊断排序”改成新顺序
|
item.diagSrtNo = index + 1; // 这里是关键!把”诊断排序”改成新顺序
|
||||||
|
|||||||
@@ -1131,15 +1131,15 @@ function handleLocationClick(item, row, index) {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
const list = res.data || [];
|
const list = res.data || [];
|
||||||
const d = pickBestOrgQuantityRow(list);
|
const d = pickBestOrgQuantityRow(list);
|
||||||
|
const strictOk = d && Number(d.orgQuantity ?? 0) > 0;
|
||||||
// 严格批号查询有库存(orgQuantity > 0)
|
if (strictOk) {
|
||||||
if (d && Number(d.orgQuantity ?? 0) > 0) {
|
|
||||||
applyFromDto(d, false);
|
applyFromDto(d, false);
|
||||||
|
if (Number(r.totalQuantity) <= 0) {
|
||||||
|
proxy.$message.warning('仓库数量为0,无法调用!');
|
||||||
|
}
|
||||||
persistStore();
|
persistStore();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 严格查询无库存或数量为0 → 回退到非严格查询(查同仓库其他批号)
|
|
||||||
if (lotTrimmed) {
|
if (lotTrimmed) {
|
||||||
return runGet(false).then((res2) => {
|
return runGet(false).then((res2) => {
|
||||||
const list2 = res2.data || [];
|
const list2 = res2.data || [];
|
||||||
@@ -1157,8 +1157,6 @@ function handleLocationClick(item, row, index) {
|
|||||||
persistStore();
|
persistStore();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 没有指定批号,直接提示
|
|
||||||
r.totalQuantity = 0;
|
r.totalQuantity = 0;
|
||||||
r.price = 0;
|
r.price = 0;
|
||||||
proxy.$message.warning('仓库数量为0,无法调用!');
|
proxy.$message.warning('仓库数量为0,无法调用!');
|
||||||
|
|||||||
@@ -1535,8 +1535,8 @@ function handleMedicalAdvice(row) {
|
|||||||
temporarySigned.value = hasSubmittedAdvices; // 修复:根据已有数据状态设置,而非盲目重置
|
temporarySigned.value = hasSubmittedAdvices; // 修复:根据已有数据状态设置,而非盲目重置
|
||||||
temporaryMedicalLoading.value = true // 🔧 新增:开始加载
|
temporaryMedicalLoading.value = true // 🔧 新增:开始加载
|
||||||
|
|
||||||
// 调用计费接口获取数据(使用手术计费来源参数,匹配 surgery billing 创建的记录)
|
// 调用计费接口获取数据
|
||||||
getPrescriptionList(row.visitId, 6, row.operCode).then((res) => {
|
getPrescriptionList(row.visitId).then((res) => {
|
||||||
console.log('=== 拉取计费数据返回结果 ===', res)
|
console.log('=== 拉取计费数据返回结果 ===', res)
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 200 && res.data) {
|
||||||
// 🔧 修复:显示所有药品请求数据,不管有没有计费项目
|
// 🔧 修复:显示所有药品请求数据,不管有没有计费项目
|
||||||
@@ -1741,39 +1741,27 @@ function handleTemporaryMedicalSubmit(data) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 🔧 修复 Bug #445: 使用稳定可靠的字段组合匹配已提交项目,从已生成列表中剔除待生成项
|
// 🔧 修复 Bug #445: 使用稳定的字段组合匹配已提交项目,而不是依赖可能为空的 requestId/chargeItemId
|
||||||
// 匹配键:优先使用 chargeItemId(后端费用项目ID,最可靠),其次使用 名称+规格+数量 组合
|
// 构建已提交项目的匹配键集合(药品名称 + 规格 + 数量)
|
||||||
const submittedKeys = new Set()
|
const submittedKeys = new Set(
|
||||||
const submittedChargeIds = new Set()
|
(data.temporaryAdvices || [])
|
||||||
|
.map(a => {
|
||||||
|
const om = a.originalMedicine || {}
|
||||||
|
const name = om.medicineName || om.adviceName || om.advice_name || a.adviceName || ''
|
||||||
|
const spec = om.specification || om.volume || ''
|
||||||
|
const qty = om.quantity || 0
|
||||||
|
return `${name}|||${spec}|||${qty}`
|
||||||
|
})
|
||||||
|
.filter(k => k !== '|||0') // 过滤掉空项
|
||||||
|
)
|
||||||
|
|
||||||
;(data.temporaryAdvices || []).forEach(a => {
|
if (submittedKeys.size > 0) {
|
||||||
const om = a.originalMedicine || {}
|
|
||||||
// 收集 chargeItemId(最可靠的匹配标识)
|
|
||||||
if (om.chargeItemId) {
|
|
||||||
submittedChargeIds.add(om.chargeItemId)
|
|
||||||
}
|
|
||||||
// 构建名称+规格+数量的匹配键(用于无 chargeItemId 的兜底匹配)
|
|
||||||
// 注意:originalMedicine 中的名称字段是 adviceName(来自 billingMedicines.map 时的字段)
|
|
||||||
const name = om.medicineName || om.adviceName || om.advice_name || a.adviceName || ''
|
|
||||||
const spec = om.specification || om.volume || ''
|
|
||||||
const qty = om.quantity || 0
|
|
||||||
if (name) {
|
|
||||||
submittedKeys.add(`${name}|||${spec}|||${qty}`)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if (submittedChargeIds.size > 0 || submittedKeys.size > 0) {
|
|
||||||
temporaryBillingMedicines.value = (temporaryBillingMedicines.value || []).filter(m => {
|
temporaryBillingMedicines.value = (temporaryBillingMedicines.value || []).filter(m => {
|
||||||
// 优先用 chargeItemId 匹配
|
const key = `${m.medicineName || ''}|||${m.specification || ''}|||${m.quantity || 0}`
|
||||||
if (m.chargeItemId && submittedChargeIds.has(m.chargeItemId)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 兜底用 名称+规格+数量 匹配
|
|
||||||
const key = `${m.medicineName || m.adviceName || ''}|||${m.specification || m.volume || ''}|||${m.quantity || 0}`
|
|
||||||
return !submittedKeys.has(key)
|
return !submittedKeys.has(key)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// 如果没有任何匹配标识,清空待生成列表(保守策略:认为所有项目都已提交)
|
// 如果没有任何匹配键,清空待生成列表(所有项目都已提交)
|
||||||
temporaryBillingMedicines.value = []
|
temporaryBillingMedicines.value = []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user