住院护士站-》医嘱执行页面:勾选医嘱后点击“执行选中”按钮无反应,无法完成执行操作.

疾病报告管理-》报告卡管理:审核报卡界面内容与门诊医生站登记界面不一致
This commit is contained in:
2026-04-30 13:33:03 +08:00
parent b536eadd92
commit 82ef66794b
5 changed files with 328 additions and 83 deletions

View File

@@ -14,8 +14,8 @@
<el-date-picker
v-model="deadline"
type="datetime"
format="YYYY/MM/DD HH:mm:ss"
value-format="YYYY/MM/DD HH:mm:ss"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
:clearable="false"
@change="handleGetPrescription"
/>
@@ -33,8 +33,8 @@
<el-date-picker
v-model="exeDate"
type="datetime"
format="YYYY/MM/DD HH:mm:ss"
value-format="YYYY/MM/DD HH:mm:ss"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
:clearable="false"
@change="handleGetPrescription"
/>
@@ -254,6 +254,20 @@ function handleRadioChange() {
handleGetPrescription();
}
/** 频次时间规整为 HH:mm与 formatDateStr 得到的时分一致,避免 8:00 vs 08:00 对不上) */
function normalizeDayTimeHm(part) {
if (part == null || String(part).trim() === '') {
return '00:00';
}
const s = String(part).trim();
const [hRaw, mRaw = '0'] = s.split(':').map((x) => String(x).trim());
const hNum = Number.parseInt(hRaw || '0', 10);
const mNum = Number.parseInt(mRaw || '0', 10);
const h = Number.isNaN(hNum) ? '00' : String(hNum).padStart(2, '0');
const m = Number.isNaN(mNum) ? '00' : String(mNum).padStart(2, '0');
return `${h}:${m}`;
}
function handleGetPrescription() {
if (patientInfoList.value.length > 0) {
loading.value = true;
@@ -273,8 +287,12 @@ function handleGetPrescription() {
let rate;
let times;
if (prescription.therapyEnum == 1) {
// 长期医嘱 后台返回执行时间点字符串,直接拆分取时间点
rate = prescription.dayTimes?.split(',');
// 长期医嘱dayTimes 可能为「8:00,12:00」未补零需与后端 occurrenceTime 格式化后对齐
rate = prescription.dayTimes
?.split(',')
.map((x) => x.trim())
.filter((x) => x !== '')
.map((x) => normalizeDayTimeHm(x));
// 用截止时间和医嘱签发时间算出全部执行日期
times = getDateRange(prescription.requestTime, deadline.value);
} else {
@@ -390,6 +408,11 @@ function handleGetPrescription() {
}
});
}
// 「待执行」tab 下医嘱所有时间点都已执行/不执行时,跳过该医嘱
// (后端待执行查询未做该过滤,需要前端补充;其他 tab 后端已按记录列表过滤,不再处理)
if (props.exeStatus === 1 && (!prescription.times || prescription.times.length === 0)) {
return groups;
}
// 把相同encounterId的医嘱放在同一个数组中
const encounterId = prescription.encounterId;
if (!groups[encounterId]) {
@@ -435,8 +458,13 @@ function handleExecute() {
console.log(list, 'list');
adviceExecute({ exeDate: exeDate.value, adviceExecuteDetailList: list }).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess(res.msg || '医嘱执行成功');
handleGetPrescription();
lotNumberMatch({ encounterIdList: encounterIds });
lotNumberMatch({ encounterIdList: encounterIds }, { skipErrorMsg: true }).catch((error) => {
console.warn('lotNumberMatch failed after adviceExecute:', error);
});
} else {
proxy.$modal.msgError(res.msg || '医嘱执行失败');
}
});
}
@@ -456,7 +484,10 @@ function handleNoExecute() {
console.log(list, 'list');
adviceNoExecute({ adviceExecuteDetailList: list }).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess(res.msg || '操作成功');
handleGetPrescription();
} else {
proxy.$modal.msgError(res.msg || '操作失败');
}
});
}
@@ -477,7 +508,10 @@ function handleCancel() {
});
adviceCancel({ adviceExecuteDetailList: producerIds }).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess(res.msg || '取消执行成功');
handleGetPrescription();
} else {
proxy.$modal.msgError(res.msg || '取消执行失败');
}
});
}
@@ -761,4 +795,4 @@ defineExpose({
font-size: 15px;
font-weight: 500;
}
</style>
</style>