Compare commits
5 Commits
关羽
...
fa3fb44b14
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa3fb44b14 | ||
|
|
0c98ca2485 | ||
|
|
b5b490dabb | ||
|
|
b13ab03912 | ||
|
|
3819be1636 |
@@ -261,8 +261,10 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
|
||||
// 设置创建时间,避免数据库约束错误
|
||||
encounterDiagnosis.setCreateTime(new Date());
|
||||
iEncounterDiagnosisService.saveOrUpdate(encounterDiagnosis);
|
||||
// 回写就诊诊断ID,供前端后续更新使用
|
||||
saveDiagnosisChildParam.setEncounterDiagnosisId(encounterDiagnosis.getId());
|
||||
}
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊断"}));
|
||||
return R.ok(saveDiagnosisParam, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊断"}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -583,6 +583,9 @@
|
||||
LEFT JOIN adm_location AS AL ON AL.id = DR.perform_location AND AL.delete_flag = '0'
|
||||
WHERE CI.delete_flag = '0'
|
||||
AND CI.service_table = 'wor_device_request'
|
||||
<if test="generateSourceEnum != null">
|
||||
AND (DR.generate_source_enum IS NULL OR DR.generate_source_enum = #{generateSourceEnum})
|
||||
</if>
|
||||
<if test="historyFlag == '0'.toString()">
|
||||
AND CI.encounter_id = #{encounterId}
|
||||
</if>
|
||||
|
||||
@@ -1059,7 +1059,12 @@ function handleSave() {
|
||||
groupIndexList.value = []
|
||||
groupList.value = []
|
||||
nextId.value = 1;
|
||||
} else {
|
||||
proxy.$modal.msgError(res?.msg || '签发失败,请重试');
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('签发失败:', error);
|
||||
proxy.$modal.msgError(error?.response?.data?.msg || error?.message || '签发失败,请重试');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1136,17 +1136,19 @@ function handleRowClick(row) {
|
||||
selectedItems.value = [];
|
||||
activeDetailTab.value = 'applyForm';
|
||||
request({ url: `/exam/apply/${row.applyNo}`, method: 'get' }).then(async res => {
|
||||
const resp = res.data || res;
|
||||
// Bug #408修复: items 在 AjaxResult 顶层(res.items / resp.items),不在 ExamApply 对象内
|
||||
// 防御性提取:优先取顶层 items,兼容嵌套在 resp.data.items 的情况
|
||||
let rawItems = res.items || resp.items;
|
||||
if (!rawItems && resp.data && typeof resp.data === 'object') {
|
||||
rawItems = resp.data.items;
|
||||
}
|
||||
rawItems = rawItems || [];
|
||||
const d = resp.data || resp;
|
||||
if (d) Object.assign(form, d);
|
||||
if (Array.isArray(rawItems) && rawItems.length > 0) {
|
||||
// 响应结构判定:Axios拦截器对 code===200 返回 res.data(AjaxResult体),
|
||||
// 但某些情况下可能返回完整 Axios 响应 {data: AjaxResult}。
|
||||
// 用 res.code 判定是否已是 AjaxResult 体,避免二次解包导致 items 丢失。
|
||||
const isAjaxResult = res && typeof res === 'object' && res.code !== undefined;
|
||||
const ajaxBody = isAjaxResult ? res : (res.data || res);
|
||||
|
||||
// items 在 AjaxResult 顶层,data 字段是 ExamApply 实体
|
||||
const rawItems = Array.isArray(ajaxBody.items) ? ajaxBody.items : [];
|
||||
const detailData = ajaxBody.data || {};
|
||||
|
||||
if (detailData && typeof detailData === 'object') Object.assign(form, detailData);
|
||||
|
||||
if (rawItems.length > 0) {
|
||||
try {
|
||||
// 为每个项目加载检查方法
|
||||
const itemsWithMethods = await Promise.all(rawItems.map(async m => {
|
||||
|
||||
@@ -568,6 +568,11 @@ function handleMaindise(value, index) {
|
||||
* 保存诊断
|
||||
*/
|
||||
function handleSaveDiagnosis() {
|
||||
// 防止重复点击保存
|
||||
if (isSaving.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let index = 0; index < (form.value.diagnosisList || []).length; index++) {
|
||||
const item = form.value.diagnosisList[index];
|
||||
if (!item.diagSrtNo) {
|
||||
@@ -600,7 +605,7 @@ function handleSaveDiagnosis() {
|
||||
|
||||
// 步骤2:重新分配连续的序号(从1开始)
|
||||
sortedList.forEach((item, index) => {
|
||||
item.diagSrtNo = index + 1; // 这里是关键!把“诊断排序”改成新顺序
|
||||
item.diagSrtNo = index + 1; // 这里是关键!把”诊断排序”改成新顺序
|
||||
});
|
||||
|
||||
// 步骤3:提交排序后的数据
|
||||
@@ -610,12 +615,12 @@ function handleSaveDiagnosis() {
|
||||
diagnosisChildList: sortedList,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
// 步骤4:更新本地数据,使用全新对象防止响应式问题
|
||||
form.value.diagnosisList = sortedList.map(item => ({ ...item }));
|
||||
|
||||
emits('diagnosisSave', false);
|
||||
proxy.$modal.msgSuccess('诊断已保存');
|
||||
|
||||
// 保存成功后从服务器重新加载数据,确保前后端数据一致
|
||||
getList();
|
||||
|
||||
// 食源性疾病逻辑
|
||||
isFoodDiseasesNew({ encounterId: props.patientInfo.encounterId }).then((res2) => {
|
||||
if (res2.code === 20 && res2.data) {
|
||||
|
||||
@@ -1477,11 +1477,18 @@ function handleSaveBatch() {
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
proxy.$modal.msgSuccess('保存成功');
|
||||
// 修复【#405】:保存成功后重置所有待保存行的 isEdit 为 false,锁定医嘱不再编辑
|
||||
// 修复 Bug #405:保存成功后锁定所有待保存行,避免医嘱条目仍处于可编辑状态
|
||||
// saveList 中的 item 与 prescriptionList 是同一对象引用,直接修改即可
|
||||
saveList.forEach(item => {
|
||||
const row = prescriptionList.value.find(r => r.uniqueKey === item.uniqueKey);
|
||||
if (row) row.isEdit = false;
|
||||
item.isEdit = false;
|
||||
});
|
||||
// 兜底:锁定所有 statusEnum == 1 的行,确保没有遗漏
|
||||
prescriptionList.value.forEach(row => {
|
||||
if (row.statusEnum == 1) {
|
||||
row.isEdit = false;
|
||||
}
|
||||
});
|
||||
expandOrder.value = [];
|
||||
getListInfo(false);
|
||||
nextId.value = 1;
|
||||
isSaving.value = false;
|
||||
|
||||
@@ -1528,7 +1528,11 @@ function handleMedicalAdvice(row) {
|
||||
// 先清空旧数据
|
||||
temporaryBillingMedicines.value = []
|
||||
temporaryAdvices.value = []
|
||||
temporarySigned.value = false // 🔧 重置签名状态
|
||||
// 🔧 修复 Bug #446: 如果是同一 encounter 且已有提交的医嘱(有 requestId),保留签名状态
|
||||
const hasSubmittedAdvices = temporaryAdvices.value.length > 0 &&
|
||||
temporaryAdvices.value[0]?.originalMedicine?.encounterId === row.visitId &&
|
||||
temporaryAdvices.value.some(a => a.originalMedicine?.requestId);
|
||||
temporarySigned.value = hasSubmittedAdvices; // 修复:根据已有数据状态设置,而非盲目重置
|
||||
temporaryMedicalLoading.value = true // 🔧 新增:开始加载
|
||||
|
||||
// 调用计费接口获取数据
|
||||
|
||||
@@ -147,9 +147,10 @@
|
||||
<el-button class="cancel-btn" @click="handleCancel">取消</el-button>
|
||||
<el-button
|
||||
class="sign-btn"
|
||||
:disabled="allItemsSubmitted"
|
||||
@click="handleSignAndSubmit"
|
||||
>
|
||||
{{ isSigned ? '提交医嘱' : '一键签名并生成医嘱' }}
|
||||
{{ allItemsSubmitted ? '已签发' : (isSigned ? '提交医嘱' : '一键签名并生成医嘱') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -310,6 +311,12 @@ const getMethodCodeDict = computed(() => {
|
||||
return dict
|
||||
})
|
||||
|
||||
// 🔧 修复 Bug #446: 检查计费药品是否已全部提交(有 requestId),用于区分"首次签名"和"已提交重开"
|
||||
const allItemsSubmitted = computed(() => {
|
||||
const meds = props.billingMedicines || []
|
||||
return meds.length > 0 && meds.every(m => m.requestId)
|
||||
})
|
||||
|
||||
// 响应式数据 - isSigned 从父组件传入的 prop 初始化
|
||||
const isSigned = ref(props.isSignedProp)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user