根因: - 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)
159 lines
4.6 KiB
Vue
Executable File
159 lines
4.6 KiB
Vue
Executable File
<template>
|
||
<div ref="print">
|
||
<div class="printInjectCard">
|
||
<div :id="printData.id + 'div1'">
|
||
<div style="display:block; height: 60px; width: 280px; float:left;">
|
||
<span style="font-weight: bolder; font-size: 16px; line-height: 36px; margin-left: 160px;">急诊输液贴</span>
|
||
<div>
|
||
<span style="margin-left: 8px;">{{ printData.patient.hisNo }}</span>
|
||
<span style="margin-left: 8px;">{{ printData.patient.name }}</span>
|
||
<span style="margin-left: 8px;">{{ printData.patient.sexName }}</span>
|
||
<span style="margin-left: 8px;">{{ printData.patient.patientAge }}</span>
|
||
</div>
|
||
</div>
|
||
<div style="display: block; width: 120px; height: 60px; float:left; ">
|
||
<div
|
||
:id="getId(printData.id)"
|
||
style="float: left; margin: 5px;"
|
||
/>
|
||
<span style="float: left; margin: 5px">{{ printData.priority }}</span>
|
||
</div>
|
||
</div>
|
||
<div :id="printData.id + 'div2'">
|
||
<table
|
||
border="1"
|
||
cellSpacing="0"
|
||
width="390px"
|
||
cellPadding="1"
|
||
style="margin-left: 8px; border-collapse:collapse; table-layout: fixed; font-size: 14px"
|
||
bordercolor="#333333"
|
||
>
|
||
<thead>
|
||
<TR>
|
||
<Th
|
||
style="width: 160px"
|
||
v-html="'药品名称'"
|
||
/>
|
||
<Th
|
||
style="width: 75px"
|
||
v-html="'用量'"
|
||
/>
|
||
<Th
|
||
style="width: 10px"
|
||
v-html="''"
|
||
/>
|
||
<Th
|
||
style="width: 50px"
|
||
v-html="'频次'"
|
||
/>
|
||
<Th
|
||
style="width: 75px"
|
||
v-html="'用法'"
|
||
/>
|
||
</TR>
|
||
</thead>
|
||
<tbody>
|
||
<tr
|
||
v-for="item in printData.orderDetail"
|
||
:key="item.id"
|
||
>
|
||
<td v-html="item.orderName" />
|
||
<td v-html="item.doseOnce + item.doseUnit" />
|
||
<td v-html="item.flag" />
|
||
<td v-html="item.frequency" />
|
||
<td v-html="item.usageName" />
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div :id="printData.id + 'div3'">
|
||
<span>日期:</span>
|
||
<span>{{ moment().format('YYYY-MM-DD HH:mm') }}</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
<script>
|
||
// 迁移到 hiprint
|
||
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
|
||
import moment from 'moment'
|
||
|
||
export default {
|
||
name: 'VuePrintNb',
|
||
props: {
|
||
printData: {
|
||
type: Object,
|
||
default() {
|
||
return {}
|
||
}
|
||
}
|
||
},
|
||
data() {
|
||
return {
|
||
lastId: '',
|
||
qrCode: ''
|
||
}
|
||
},
|
||
mounted() {},
|
||
methods: {
|
||
/**
|
||
* 使用 hiprint 执行打印
|
||
* @param {string} printerName 打印机名称
|
||
*/
|
||
async print(printerName) {
|
||
console.log(this.printData, 'printData')
|
||
try {
|
||
// 构建打印数据
|
||
const orderDetail = this.printData.orderDetail || []
|
||
const qrCode = orderDetail[0] ? (orderDetail[0].comboNo + orderDetail[0].executionSeq) : ''
|
||
|
||
// 转换药品明细数据
|
||
const formattedOrderDetail = orderDetail.map(item => ({
|
||
orderName: item.orderName,
|
||
doseOnceUnit: (item.doseOnce || '') + (item.doseUnit || ''),
|
||
flag: item.flag || '',
|
||
frequency: item.frequency || '',
|
||
usageName: item.usageName || ''
|
||
}))
|
||
|
||
const printData = {
|
||
hisNo: this.printData.patient ? this.printData.patient.hisNo : '',
|
||
name: this.printData.patient ? this.printData.patient.name : '',
|
||
sexName: this.printData.patient ? this.printData.patient.sexName : '',
|
||
patientAge: this.printData.patient ? this.printData.patient.patientAge : '',
|
||
priority: this.printData.priority || '',
|
||
qrCode: qrCode,
|
||
orderDetail: formattedOrderDetail,
|
||
printDate: moment().format('YYYY-MM-DD HH:mm')
|
||
}
|
||
// 使用 hiprint 打印
|
||
await simplePrint(PRINT_TEMPLATE.INJECT_LABEL, printData, printerName)
|
||
} catch (error) {
|
||
console.error('输液标签打印失败:', error)
|
||
if (this.openMesBox) {
|
||
this.openMesBox('6', '打印失败: ' + (error.message || '未知错误'))
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
<style lang="less">
|
||
.printInjectCard{
|
||
display: grid;
|
||
width: 400px;
|
||
grid-template-rows: 60px 205px 30px;
|
||
border: solid #555 1px;
|
||
background-color: #FFFFFF;
|
||
|
||
td{
|
||
padding-left: 3px;
|
||
}
|
||
}
|
||
@page{
|
||
size: auto;
|
||
margin: 32px;
|
||
}
|
||
</style>
|
||
|