diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue index 48107699..391036a6 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue @@ -1671,6 +1671,13 @@ function handleSaveGroup(orderGroupList) { if (newRows.length > 0) { prescriptionList.value.splice(originalLength); // 移除循环中追加到末尾的临时行 prescriptionList.value.unshift(...newRows); + // 排序:确保没有 requestTime 的新行始终排在最前面 + prescriptionList.value.sort((a, b) => { + if (!a.requestTime && !b.requestTime) return 0; + if (!a.requestTime) return -1; + if (!b.requestTime) return 1; + return new Date(b.requestTime) - new Date(a.requestTime); + }); proxy.$modal.msgSuccess(`成功添加 ${successCount} 个医嘱项`); } }