根因: - Bug #请修复 Bug #591 存在的问题 修复: - ### 变更摘要 - 全链路数据流分析**:录取(弹窗输入)→ 保存(API传入)→ 查询(Mapper返回)→ 修改(Service记录)→ 删除/停止(状态变更)→ 关联(列表展示) - ### 后端变更(4个文件) - 1. `AdviceBatchOpParam.java`** — 停嘱参数添加 `stopTime` 字段 - 新增 `@JsonFormat Date stopTime`,支持前端传入停嘱时间 - 2. `RequestBaseDto.java`** — 查询DTO添加 `stopUserName`、`stopTime` 字段 - 新增 `String stopUserName`(停嘱医生姓名) - 新增 `Date stopTime`(停嘱时间) - 3. `AdviceManageAppServiceImpl.java`** — 停嘱Service增强 - 优先使用前端传入的 `stopTime`,兜底用当前时间 - 通过 `SecurityUtils.getNickName()` 获取当前操作用户昵称,记录到 `updateBy` - 药品和诊疗两个更新入口均已同步修改 - 4. `AdviceManageAppMapper.xml`** — 三个UNION ALL子查询添加字段 - 药品子查询:`T1.effective_dose_end AS stop_time` + `T1.update_by AS stop_user_name` - 耗材子查询:`NULL AS stop_time` + `'' AS stop_user_name` - 诊疗子查询:`T1.occurrence_end_time AS stop_time` + `T1.update_by AS stop_user_name` - ### 前端变更(1个文件) - `order/index.vue`**: - 1. **停嘱时间弹窗** — 点击「停嘱」后弹出 `el-dialog`,内含 `el-date-picker`(datetime类型,默认当前时间),确定后才调用API - 2. **表格列** — 在「皮试」列后面、「诊断」列前面新增两列: - 「停嘱医生」`prop="stopUserName"`,宽度120px - 「停嘱时间」`prop="stopTime"`,宽度170px - 3. **`handleStopAdvice`** — 保留原有校验(未保存/未签发/已停止检查),校验通过后弹出时间选择弹窗而非直接调API - 4. **`confirmStopAdvice`** — 新增确认函数,将 `stopTime` 拼入请求参数后调用 `stopAdvice` API - ### 验证结果 - ✅ 前端 Lint 检查通过(仅1个预存的 `vue/no-dupe-keys` 警告) - ✅ 后端 Maven 编译通过(BUILD SUCCESS)
112 lines
2.8 KiB
Vue
Executable File
112 lines
2.8 KiB
Vue
Executable File
<template>
|
|
<Graphics
|
|
v-if="graphicsDataDone"
|
|
:value="resInfo"
|
|
print
|
|
@done="printPage"
|
|
/>
|
|
</template>
|
|
|
|
<script setup>
|
|
import Graphics from '../../../views/inpatientNurse/tprChart/index';
|
|
import data from '../../../action/nurseStation/temperatureSheet/datas';
|
|
// 迁移到 hiprint
|
|
import { previewPrint } from '@/utils/printUtils.js';
|
|
|
|
const printData = ref({});
|
|
const resInfo = ref({});
|
|
const graphicsDataDone = ref(false);
|
|
const printPromiseReslove = ref(null);
|
|
const dateClosed = ref({
|
|
stopTime: true, // 控制结束日期
|
|
stopNumber: true, // 控制住院天数
|
|
});
|
|
|
|
const route = useRoute();
|
|
|
|
function removeIframe(id) {
|
|
const child = window.parent.document.getElementById(id);
|
|
if (child) {
|
|
child.parentElement.removeChild(child);
|
|
}
|
|
}
|
|
function setTime(num) {
|
|
return new Promise((resolve) => {
|
|
setTimeout(resolve, num);
|
|
});
|
|
}
|
|
// export default {
|
|
// components: {
|
|
// Graphics,
|
|
// },
|
|
// data() {
|
|
// return {
|
|
// printData: {},
|
|
// resInfo: {},
|
|
// graphicsDataDone: false,
|
|
// // 当前页面是否完成打印的reslove函数
|
|
// printPromiseReslove: null,
|
|
// dateClosed: {
|
|
// stopTime: true, // 控制结束日期
|
|
// stopNumber: true, // 控制住院天数
|
|
// },
|
|
// };
|
|
// },
|
|
// mounted() {
|
|
// const printData = window.localStorage.getItem('printItemData');
|
|
// this.printData = JSON.parse(printData);
|
|
// this.addPrintEvent();
|
|
// this.runTask();
|
|
// },
|
|
// methods: {
|
|
function addPrintEvent() {
|
|
window.addEventListener('afterprint', () => {
|
|
if (printPromiseReslove.value) {
|
|
printPromiseReslove.value();
|
|
}
|
|
});
|
|
}
|
|
async function runTask() {
|
|
// const weeks = this.printData.weekList;
|
|
const weeks = [];
|
|
for (let index = 0; index < weeks.length; index++) {
|
|
const week = weeks[index];
|
|
await this.getData(week);
|
|
}
|
|
try {
|
|
removeIframe(this.$route.query.id);
|
|
} catch (error) {
|
|
// window.location.href = './compTemperature';
|
|
var child = window.parent.document.getElementById('my_dataviz');
|
|
child.parentElement.appendChild(child);
|
|
}
|
|
}
|
|
function printPage() {
|
|
// 使用 hiprint 预览打印
|
|
const printDom = document.querySelector('.tpr-chart-container') || document.body;
|
|
previewPrint(printDom);
|
|
}
|
|
// 获取每周数据
|
|
async function getData(curWeekInfo) {
|
|
this.resInfo = data;
|
|
if (this.graphicsDataDone) {
|
|
this.graphicsDataDone = false;
|
|
}
|
|
await setTime(10);
|
|
this.graphicsDataDone = true;
|
|
return new Promise((resolve) => {
|
|
this.printPromiseReslove = resolve;
|
|
});
|
|
}
|
|
// },
|
|
// };
|
|
</script>
|
|
|
|
<style>
|
|
@page {
|
|
margin-top: 30;
|
|
margin-bottom: 0;
|
|
background-color: #1890ff;
|
|
}
|
|
</style>
|