bug362 413 498 504 507
This commit is contained in:
@@ -92,45 +92,42 @@
|
||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||
<el-table-column label="申请单状态" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ parseStatus(scope.row.status) }}</span>
|
||||
<el-tag :type="getStatusTagType(scope.row.status)" effect="plain" round>
|
||||
{{ parseStatus(scope.row.status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="280" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<!-- 待签发:详情、修改、删除 -->
|
||||
<!-- 详情 - 所有状态都显示 -->
|
||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||
<!-- 待签发:修改、删除 -->
|
||||
<template v-if="scope.row.status === '0' || scope.row.status === 0">
|
||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||
<el-button link type="primary" @click="handleModify(scope.row)">修改</el-button>
|
||||
<el-button link type="primary" @click="handleEdit(scope.row)">修改</el-button>
|
||||
<el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
<!-- 已签发:详情、撤回 -->
|
||||
<!-- 已签发:撤回 -->
|
||||
<template v-else-if="scope.row.status === '1' || scope.row.status === 1">
|
||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||
<el-button link type="warning" @click="handleWithdraw(scope.row)">撤回</el-button>
|
||||
<el-button link type="warning" @click="handleRecall(scope.row)">撤回</el-button>
|
||||
</template>
|
||||
<!-- 已校对/待接收:详情、打印 -->
|
||||
<!-- 已校对/待接收:打印 -->
|
||||
<template v-else-if="scope.row.status === '2' || scope.row.status === 2 || scope.row.status === '3' || scope.row.status === 3">
|
||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||
<el-button link type="primary" @click="handlePrint(scope.row)">打印</el-button>
|
||||
</template>
|
||||
<!-- 已接收/已检查:详情、看报告 -->
|
||||
<!-- 已接收/已检查:看报告 -->
|
||||
<template v-else-if="scope.row.status === '4' || scope.row.status === 4 || scope.row.status === '5' || scope.row.status === 5">
|
||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||
<el-button link type="success" @click="handleViewReport(scope.row)">看报告</el-button>
|
||||
</template>
|
||||
<!-- 已出报告:详情、打印、看报告 -->
|
||||
<!-- 已出报告:打印、看报告 -->
|
||||
<template v-else-if="scope.row.status === '6' || scope.row.status === 6">
|
||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||
<el-button link type="primary" @click="handlePrint(scope.row)">打印</el-button>
|
||||
<el-button link type="success" @click="handleViewReport(scope.row)">看报告</el-button>
|
||||
</template>
|
||||
<!-- 已作废:详情 -->
|
||||
<!-- 已作废:无额外按钮 -->
|
||||
<template v-else-if="scope.row.status === '7' || scope.row.status === 7">
|
||||
<el-button link type="info" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
<!-- 其他/未知状态:仅详情 -->
|
||||
<template v-else>
|
||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -203,15 +200,102 @@
|
||||
<el-button @click="detailDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 修改申请单弹窗 - 复用检查申请单组件 -->
|
||||
<el-dialog
|
||||
v-model="editDialogVisible"
|
||||
title="修改检查申请"
|
||||
width="1200px"
|
||||
destroy-on-close
|
||||
top="5vh"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<MedicalExaminations
|
||||
v-if="editDialogVisible"
|
||||
ref="editFormRef"
|
||||
:is-edit-mode="true"
|
||||
:edit-data="editingRow"
|
||||
:external-patient-info="patientInfo"
|
||||
/>
|
||||
<template #footer>
|
||||
<el-button @click="editDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="handleEditSubmit">确认</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 查看报告弹窗 -->
|
||||
<el-dialog
|
||||
v-model="reportDialogVisible"
|
||||
:title="'检查报告 - ' + (reportData?.prescriptionNo || '')"
|
||||
width="900px"
|
||||
destroy-on-close
|
||||
top="5vh"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div v-loading="reportLoading" class="report-viewer">
|
||||
<!-- 报告基本信息 -->
|
||||
<div v-if="reportData" class="report-viewer-container">
|
||||
<el-descriptions title="报告信息" :column="2" border size="small">
|
||||
<el-descriptions-item label="患者姓名">{{ reportData.patientName || reportRow?.patientName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单号">{{ reportData.prescriptionNo || reportRow?.prescriptionNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请单名称">{{ reportData.name || reportRow?.name || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="报告时间">{{ reportData.reportTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="诊断意见" :span="2">{{ reportData.diagnosis || reportData.conclusion || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<!-- 报告详细内容 -->
|
||||
<div v-if="reportData.content" class="report-content-section">
|
||||
<div class="section-title">报告内容</div>
|
||||
<div class="report-content-text">{{ reportData.content }}</div>
|
||||
</div>
|
||||
|
||||
<!-- 影像预览 - PACS链接 -->
|
||||
<div v-if="reportData.imageUrl || reportData.pacsUrl" class="report-image-section">
|
||||
<div class="section-title">
|
||||
影像预览
|
||||
<el-button
|
||||
v-if="reportData.imageUrl || reportData.pacsUrl"
|
||||
type="primary"
|
||||
size="small"
|
||||
plain
|
||||
style="margin-left: 12px;"
|
||||
@click="openPacsLink"
|
||||
>
|
||||
<el-icon><Link /></el-icon>
|
||||
打开PACS影像
|
||||
</el-button>
|
||||
</div>
|
||||
<iframe
|
||||
v-if="reportData.imageUrl"
|
||||
:src="reportData.imageUrl"
|
||||
class="report-iframe"
|
||||
frameborder="0"
|
||||
/>
|
||||
<el-empty v-else-if="!reportData.imageUrl && reportData.pacsUrl" description="点击上方按钮打开PACS影像" :image-size="60" />
|
||||
</div>
|
||||
|
||||
<!-- 完全无数据时的提示 -->
|
||||
<el-empty v-if="!reportData.content && !reportData.imageUrl && !reportData.pacsUrl" description="暂无详细报告数据" :image-size="60" />
|
||||
</div>
|
||||
|
||||
<!-- 未获取到报告 -->
|
||||
<el-empty v-else description="暂未生成报告" :image-size="80" />
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="reportDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {computed, getCurrentInstance, ref, watch} from 'vue';
|
||||
import {Refresh, Search} from '@element-plus/icons-vue';
|
||||
import {computed, getCurrentInstance, ref, watch, nextTick} from 'vue';
|
||||
import {Refresh, Search, Link} from '@element-plus/icons-vue';
|
||||
import {patientInfo} from '../../store/patient.js';
|
||||
import {getCheck, deleteRequestForm, withdrawRequestForm, getTestResult} from './api';
|
||||
import {getDepartmentList} from '@/api/public.js';
|
||||
import {getApplicationList, saveCheckd} from '../order/applicationForm/api';
|
||||
import MedicalExaminations from '../order/applicationForm/medicalExaminations.vue';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
@@ -221,6 +305,24 @@ const detailDialogVisible = ref(false);
|
||||
const currentDetail = ref(null);
|
||||
const descJsonData = ref(null);
|
||||
const orgOptions = ref([]);
|
||||
const editForm = ref({
|
||||
name: '',
|
||||
targetDepartment: '',
|
||||
symptom: '',
|
||||
sign: '',
|
||||
clinicalDiagnosis: '',
|
||||
otherDiagnosis: '',
|
||||
relatedResult: '',
|
||||
attention: '',
|
||||
examinationPurpose: '',
|
||||
medicalHistorySummary: '',
|
||||
});
|
||||
|
||||
// 报告弹窗相关
|
||||
const reportDialogVisible = ref(false);
|
||||
const reportLoading = ref(false);
|
||||
const reportData = ref(null);
|
||||
const reportRow = ref(null);
|
||||
|
||||
// 获取近7天的日期范围作为默认值
|
||||
const getDefaultDateRange = () => {
|
||||
@@ -268,7 +370,9 @@ const fetchData = async () => {
|
||||
if (res.code === 200 && res.data) {
|
||||
const raw = res.data?.records || res.data;
|
||||
const list = Array.isArray(raw) ? raw : [raw];
|
||||
console.log('API返回的原始数据:', JSON.stringify(list, null, 2));
|
||||
tableData.value = list.filter(Boolean);
|
||||
console.log('tableData设置后的第一条:', tableData.value[0]);
|
||||
} else {
|
||||
tableData.value = [];
|
||||
}
|
||||
@@ -325,6 +429,25 @@ const parseStatus = (status) => {
|
||||
return statusMap[String(status)] || '-';
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取状态标签类型 - 参考临床医嘱样式
|
||||
* @param {string|number} status - 状态码
|
||||
* @returns {string} el-tag type
|
||||
*/
|
||||
const getStatusTagType = (status) => {
|
||||
const typeMap = {
|
||||
'0': 'primary', // 待签发 - 蓝色
|
||||
'1': 'success', // 已签发 - 绿色
|
||||
'2': 'success', // 已校对 - 绿色
|
||||
'3': 'primary', // 待接收 - 蓝色
|
||||
'4': 'primary', // 已接收 - 蓝色
|
||||
'5': 'success', // 已检查 - 绿色
|
||||
'6': 'success', // 已出报告 - 绿色
|
||||
'7': 'danger', // 已作废 - 红色
|
||||
};
|
||||
return typeMap[String(status)] || 'info';
|
||||
};
|
||||
|
||||
const labelMap = {
|
||||
categoryType: '项目类别',
|
||||
targetDepartment: '发往科室',
|
||||
@@ -418,87 +541,391 @@ const handleViewDetail = async (row) => {
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改申请单(仅待签发状态)
|
||||
* 删除申请单 - 仅待签发状态可用
|
||||
*/
|
||||
const handleModify = (row) => {
|
||||
proxy.$modal?.msgWarning?.('修改功能需后端支持,请联系管理员');
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除申请单(仅待签发状态)
|
||||
*/
|
||||
const handleDelete = (row) => {
|
||||
proxy.$confirm?.('确认删除该检查申请单吗?删除后不可恢复。', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(async () => {
|
||||
try {
|
||||
const res = await deleteRequestForm({ requestFormId: row.requestFormId || row.id });
|
||||
if (res?.code === 200) {
|
||||
proxy.$modal?.msgSuccess?.('删除成功');
|
||||
await fetchData();
|
||||
} else {
|
||||
proxy.$modal?.msgError?.(res?.msg || '删除失败');
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('删除申请单失败(可能后端未实现):', e.message);
|
||||
proxy.$modal?.msgError?.('删除失败,后端服务可能未支持此功能');
|
||||
}
|
||||
}).catch(() => {});
|
||||
};
|
||||
|
||||
/**
|
||||
* 撤回申请单(已签发状态撤回至待签发)
|
||||
*/
|
||||
const handleWithdraw = (row) => {
|
||||
proxy.$confirm?.('确认撤回该检查申请单吗?撤回后状态将变为待签发。', '撤回确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(async () => {
|
||||
try {
|
||||
const res = await withdrawRequestForm({ requestFormId: row.requestFormId || row.id });
|
||||
if (res?.code === 200) {
|
||||
proxy.$modal?.msgSuccess?.('撤回成功');
|
||||
await fetchData();
|
||||
} else {
|
||||
proxy.$modal?.msgError?.(res?.msg || '撤回失败');
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('撤回申请单失败(可能后端未实现):', e.message);
|
||||
proxy.$modal?.msgError?.('撤回失败,后端服务可能未支持此功能');
|
||||
}
|
||||
}).catch(() => {});
|
||||
};
|
||||
|
||||
/**
|
||||
* 打印申请单
|
||||
*/
|
||||
const handlePrint = (row) => {
|
||||
// 使用浏览器原生打印功能
|
||||
window.print();
|
||||
};
|
||||
|
||||
/**
|
||||
* 查看检查报告
|
||||
*/
|
||||
const handleViewReport = async (row) => {
|
||||
const handleDelete = async (row) => {
|
||||
try {
|
||||
const res = await getTestResult({ encounterId: row.encounterId || patientInfo.value?.encounterId });
|
||||
if (res?.code === 200 && res.data) {
|
||||
const reportUrl = Array.isArray(res.data) ? res.data[0]?.reportUrl : res.data?.reportUrl;
|
||||
if (reportUrl) {
|
||||
window.open(reportUrl, '_blank');
|
||||
} else {
|
||||
proxy.$modal?.msgWarning?.('暂无检查报告');
|
||||
}
|
||||
await proxy.$modal?.confirm?.('确认删除该检查申请单?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
});
|
||||
const res = await deleteRequestForm({ requestFormId: row.requestFormId });
|
||||
if (res.code === 200) {
|
||||
proxy.$modal?.msgSuccess?.('删除成功');
|
||||
fetchData();
|
||||
} else {
|
||||
proxy.$modal?.msgWarning?.('暂无检查报告');
|
||||
proxy.$modal?.msgError?.(res.msg || '删除失败');
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('查看检查报告失败:', e.message);
|
||||
proxy.$modal?.msgError?.('获取检查报告失败');
|
||||
// 用户取消操作,不做处理
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 撤回申请单 - 仅已签发状态可用
|
||||
*/
|
||||
const handleRecall = async (row) => {
|
||||
try {
|
||||
await proxy.$modal?.confirm?.('确认撤回该申请单?撤回后状态将变更为"待签发"。', '提示', {
|
||||
confirmButtonText: '确定撤回',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
});
|
||||
const res = await withdrawRequestForm({ requestFormId: row.requestFormId });
|
||||
if (res.code === 200) {
|
||||
proxy.$modal?.msgSuccess?.('撤回成功');
|
||||
fetchData();
|
||||
} else {
|
||||
proxy.$modal?.msgError?.(res.msg || '撤回失败');
|
||||
}
|
||||
} catch (e) {
|
||||
// 用户取消操作,不做处理
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 打印申请单 - 已校对/待接收/已接收/已检查状态可用
|
||||
* 打印内容与详情展示一致,并包含申请单条码
|
||||
*/
|
||||
const handlePrint = async (row) => {
|
||||
try {
|
||||
proxy.$modal?.msgInfo?.('正在生成打印预览...');
|
||||
|
||||
// 确保科室数据已加载,用于解析发往科室名称
|
||||
if (!orgOptions.value || orgOptions.value.length === 0) {
|
||||
await new Promise((resolve) => {
|
||||
getDepartmentList().then((res) => {
|
||||
orgOptions.value = res.data || [];
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 解析 descJson
|
||||
let descData = {};
|
||||
if (row.descJson) {
|
||||
try {
|
||||
const obj = JSON.parse(row.descJson);
|
||||
// 将发往科室ID转换为名称
|
||||
if (obj.targetDepartment) {
|
||||
obj.targetDepartment = recursionFun(obj.targetDepartment);
|
||||
}
|
||||
descData = obj;
|
||||
} catch (e) {
|
||||
console.error('解析 descJson 失败:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// 构建诊疗项目表格行
|
||||
let detailRowsHtml = '';
|
||||
const detailList = row.requestFormDetailList || [];
|
||||
if (detailList.length > 0) {
|
||||
detailList.forEach((item, index) => {
|
||||
detailRowsHtml += `
|
||||
<tr>
|
||||
<td style="text-align:center;padding:6px 8px;border:1px solid #ddd;">${index + 1}</td>
|
||||
<td style="padding:6px 8px;border:1px solid #ddd;">${item.adviceName || '-'}</td>
|
||||
<td style="text-align:center;padding:6px 8px;border:1px solid #ddd;">${item.quantity || '-'}</td>
|
||||
<td style="padding:6px 8px;border:1px solid #ddd;">${item.unitCode_dictText || '-'}</td>
|
||||
<td style="text-align:right;padding:6px 8px;border:1px solid #ddd;">${item.totalPrice != null ? '¥' + Number(item.totalPrice).toFixed(2) : '-'}</td>
|
||||
</tr>`;
|
||||
});
|
||||
}
|
||||
|
||||
// 构建 descJson 字段行(与详情弹窗展示的字段一致)
|
||||
const fieldKeys = ['targetDepartment', 'symptom', 'sign', 'clinicalDiagnosis', 'otherDiagnosis', 'relatedResult', 'attention'];
|
||||
let descFieldsHtml = '';
|
||||
fieldKeys.forEach((key) => {
|
||||
const label = labelMap[key] || key;
|
||||
if (descData[key] != null && descData[key] !== '') {
|
||||
descFieldsHtml += `
|
||||
<div class="info-row">
|
||||
<span class="label">${label}:</span>
|
||||
<span class="value">${descData[key]}</span>
|
||||
</div>`;
|
||||
}
|
||||
});
|
||||
|
||||
// 构建完整打印HTML
|
||||
const printContent = `
|
||||
<div class="print-wrapper">
|
||||
<!-- 标题 -->
|
||||
<div class="print-header">
|
||||
<div class="print-title">检查申请单</div>
|
||||
<div class="print-meta">打印时间:${new Date().toLocaleString()}</div>
|
||||
</div>
|
||||
|
||||
<!-- 基本信息 -->
|
||||
<div class="print-section">
|
||||
<div class="section-title">基本信息</div>
|
||||
<div class="info-grid">
|
||||
<div class="info-row"><span class="label">患者姓名:</span><span class="value">${row.patientName || '-'}</span></div>
|
||||
<div class="info-row"><span class="label">申请单名称:</span><span class="value">${row.name || '-'}</span></div>
|
||||
<div class="info-row"><span class="label">申请单状态:</span><span class="value">${parseStatus(row.status)}</span></div>
|
||||
<div class="info-row"><span class="label">创建时间:</span><span class="value">${row.createTime || '-'}</span></div>
|
||||
<div class="info-row"><span class="label">申请单号:</span><span class="value">${row.prescriptionNo || '-'}</span></div>
|
||||
<div class="info-row"><span class="label">申请者:</span><span class="value">${row.requesterId_dictText || '-'}</span></div>
|
||||
<div class="info-row"><span class="label">就诊ID:</span><span class="value">${row.encounterId || '-'}</span></div>
|
||||
<div class="info-row"><span class="label">申请单ID:</span><span class="value">${row.requestFormId || '-'}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
${descFieldsHtml ? `
|
||||
<!-- 申请单描述 -->
|
||||
<div class="print-section">
|
||||
<div class="section-title">申请单描述</div>
|
||||
${descFieldsHtml}
|
||||
</div>` : ''}
|
||||
|
||||
${detailRowsHtml ? `
|
||||
<!-- 诊疗项目 -->
|
||||
<div class="print-section">
|
||||
<div class="section-title">诊疗项目</div>
|
||||
<table class="detail-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:50px;padding:8px;border:1px solid #ddd;background:#f5f7fa;text-align:center;">序号</th>
|
||||
<th style="padding:8px;border:1px solid #ddd;background:#f5f7fa;text-align:left;">医嘱名称</th>
|
||||
<th style="width:60px;padding:8px;border:1px solid #ddd;background:#f5f7fa;text-align:center;">数量</th>
|
||||
<th style="width:60px;padding:8px;border:1px solid #ddd;background:#f5f7fa;text-align:center;">单位</th>
|
||||
<th style="width:80px;padding:8px;border:1px solid #ddd;background:#f5f7fa;text-align:right;">总价</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>${detailRowsHtml}</tbody>
|
||||
</table>
|
||||
</div>` : ''}
|
||||
|
||||
<!-- 条码区 -->
|
||||
<div class="barcode-section">
|
||||
<div class="barcode-container">
|
||||
<div class="barcode-number">${row.prescriptionNo || ''}</div>
|
||||
<div class="barcode-label">申请单号 / 扫码核验</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="print-footer">
|
||||
<div class="footer-line">本申请单仅供院内使用,请勿外传</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
// 打开新窗口打印
|
||||
const printWindow = window.open('', '_blank');
|
||||
if (!printWindow) {
|
||||
proxy.$modal?.msgError?.('无法打开打印窗口,请检查浏览器弹窗设置');
|
||||
return;
|
||||
}
|
||||
|
||||
printWindow.document.write(`
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>检查申请单 - 打印</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
padding: 20px;
|
||||
}
|
||||
.print-wrapper {
|
||||
max-width: 210mm;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.print-header {
|
||||
text-align: center;
|
||||
padding-bottom: 12px;
|
||||
margin-bottom: 16px;
|
||||
border-bottom: 2px solid #333;
|
||||
}
|
||||
.print-title {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
letter-spacing: 4px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.print-meta {
|
||||
font-size: 11px;
|
||||
color: #666;
|
||||
}
|
||||
.print-section {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.section-title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
padding-bottom: 4px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
.info-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 6px 16px;
|
||||
}
|
||||
.info-row {
|
||||
font-size: 12px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
.info-row .label {
|
||||
font-weight: 600;
|
||||
color: #555;
|
||||
}
|
||||
.info-row .value {
|
||||
color: #333;
|
||||
}
|
||||
.detail-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-top: 6px;
|
||||
}
|
||||
.detail-table th {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: #555;
|
||||
}
|
||||
.detail-table td {
|
||||
font-size: 12px;
|
||||
}
|
||||
.barcode-section {
|
||||
margin-top: 24px;
|
||||
padding-top: 16px;
|
||||
border-top: 1px dashed #ccc;
|
||||
text-align: center;
|
||||
}
|
||||
.barcode-container {
|
||||
display: inline-block;
|
||||
padding: 12px 24px;
|
||||
border: 2px solid #333;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
}
|
||||
.barcode-number {
|
||||
font-family: 'Libre Barcode 128', 'Libre Barcode 39', 'Code128', 'C', monospace;
|
||||
font-size: 42px;
|
||||
letter-spacing: 4px;
|
||||
color: #000;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.barcode-label {
|
||||
font-size: 10px;
|
||||
color: #888;
|
||||
margin-top: 4px;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
.print-footer {
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.footer-line {
|
||||
font-size: 10px;
|
||||
color: #aaa;
|
||||
}
|
||||
@media print {
|
||||
body { padding: 0; }
|
||||
.print-wrapper { max-width: none; }
|
||||
.barcode-section { page-break-inside: avoid; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
${printContent}
|
||||
</body>
|
||||
</html>
|
||||
`);
|
||||
|
||||
printWindow.document.close();
|
||||
// 等待内容渲染后打印
|
||||
printWindow.onload = function() {
|
||||
setTimeout(() => {
|
||||
printWindow.print();
|
||||
proxy.$modal?.closeAll?.();
|
||||
}, 300);
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('打印失败:', error);
|
||||
proxy.$modal?.msgError?.('打印失败: ' + (error.message || '未知错误'));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 查看报告 - 仅已出报告状态可用
|
||||
* 调用报告查询接口,弹窗展示结构化报告或影像预览(PACS链接)
|
||||
*/
|
||||
const handleViewReport = async (row) => {
|
||||
reportRow.value = row;
|
||||
reportDialogVisible.value = true;
|
||||
reportLoading.value = true;
|
||||
reportData.value = null;
|
||||
try {
|
||||
const res = await getTestResult({ prescriptionNo: row.prescriptionNo });
|
||||
if (res.code === 200) {
|
||||
if (res.data) {
|
||||
// 支持两种返回格式:
|
||||
// 1. res.data 为对象(结构化报告):含 patientName, prescriptionNo, reportTime, diagnosis/content, imageUrl/pacsUrl
|
||||
// 2. res.data 为字符串(报告URL):映射到 imageUrl 以支持iframe预览
|
||||
if (typeof res.data === 'string') {
|
||||
reportData.value = {
|
||||
prescriptionNo: row.prescriptionNo,
|
||||
imageUrl: res.data,
|
||||
};
|
||||
} else if (typeof res.data === 'object') {
|
||||
reportData.value = {
|
||||
...res.data,
|
||||
prescriptionNo: res.data.prescriptionNo || row.prescriptionNo,
|
||||
};
|
||||
}
|
||||
} else {
|
||||
reportData.value = null;
|
||||
}
|
||||
} else {
|
||||
reportData.value = null;
|
||||
proxy.$modal?.msgWarning?.(res.msg || '暂未生成报告');
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('获取报告失败:', e);
|
||||
reportData.value = null;
|
||||
proxy.$modal?.msgError?.('获取报告失败');
|
||||
} finally {
|
||||
reportLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 打开PACS影像链接
|
||||
*/
|
||||
const openPacsLink = () => {
|
||||
const url = reportData.value?.pacsUrl || reportData.value?.imageUrl;
|
||||
if (url) {
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
};
|
||||
|
||||
// ========== 修改申请单相关 ==========
|
||||
const editDialogVisible = ref(false);
|
||||
const editFormRef = ref(null);
|
||||
const editingRow = ref(null);
|
||||
|
||||
// 修改申请单 - 复用检查申请单弹窗
|
||||
const handleEdit = (row) => {
|
||||
editingRow.value = { ...row };
|
||||
editDialogVisible.value = true;
|
||||
// 弹窗打开后,手动调用getList确保数据加载
|
||||
nextTick(() => {
|
||||
editFormRef.value?.getList?.();
|
||||
editFormRef.value?.getLocationInfo?.();
|
||||
editFormRef.value?.getDiagnosisList?.();
|
||||
});
|
||||
};
|
||||
|
||||
// 编辑弹窗确认提交
|
||||
const handleEditSubmit = () => {
|
||||
// 调用MedicalExaminations组件的submit方法
|
||||
if (editFormRef.value?.submit) {
|
||||
editFormRef.value.submit();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -626,4 +1053,96 @@ defineExpose({
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
// 报告弹窗样式
|
||||
.report-viewer {
|
||||
min-height: 200px;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.report-viewer-container {
|
||||
.report-content-section {
|
||||
margin-top: 16px;
|
||||
padding: 12px;
|
||||
background: #fafafa;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #eee;
|
||||
|
||||
.section-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 10px;
|
||||
color: #303133;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.report-content-text {
|
||||
font-size: 13px;
|
||||
line-height: 1.8;
|
||||
color: #606266;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
}
|
||||
|
||||
.report-image-section {
|
||||
margin-top: 16px;
|
||||
|
||||
.section-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 10px;
|
||||
color: #303133;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.report-iframe {
|
||||
width: 100%;
|
||||
height: 480px;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 状态标签样式 - 参考临床医嘱
|
||||
:deep(.el-tag) {
|
||||
border-radius: 2px;
|
||||
padding: 0 8px;
|
||||
height: 24px;
|
||||
line-height: 22px;
|
||||
font-size: 12px;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
:deep(.el-tag--info.is-plain) {
|
||||
background: #f4f4f5;
|
||||
border-color: #e9e9eb;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
:deep(.el-tag--primary.is-plain) {
|
||||
background: #ecf5ff;
|
||||
border-color: #d9ecff;
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
:deep(.el-tag--success.is-plain) {
|
||||
background: #f0f9eb;
|
||||
border-color: #e1f3d8;
|
||||
color: #67c23a;
|
||||
}
|
||||
|
||||
:deep(.el-tag--warning.is-plain) {
|
||||
background: #fdf6ec;
|
||||
border-color: #faecd8;
|
||||
color: #e6a23c;
|
||||
}
|
||||
|
||||
:deep(.el-tag--danger.is-plain) {
|
||||
background: #fef0f0;
|
||||
border-color: #fde2e2;
|
||||
color: #f56c6c;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user