Fix Bug #498: 【住院医生工作站-检查申请】检查申请列表操作项过于单一,缺失修改/作废/打印/看报告等核心临床操作
根据申请单状态动态展示操作按钮: - 待签发:详情、修改、删除 - 已签发:详情、撤回 - 已校对/待接收:详情、打印 - 已接收/已检查:详情、看报告 - 已出报告:详情、打印、看报告 - 已作废:详情 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -86,9 +86,43 @@
|
|||||||
<span>{{ parseStatus(scope.row.status) }}</span>
|
<span>{{ parseStatus(scope.row.status) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" fixed="right">
|
<el-table-column label="操作" width="280" align="center" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
<!-- 待签发:详情、修改、删除 -->
|
||||||
|
<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="handleViewDetail(scope.row)">详情</el-button>
|
||||||
|
<el-button link type="primary" @click="handleModify(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>
|
||||||
|
</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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -167,7 +201,7 @@
|
|||||||
import {computed, getCurrentInstance, ref, watch} from 'vue';
|
import {computed, getCurrentInstance, ref, watch} from 'vue';
|
||||||
import {Refresh, Search} from '@element-plus/icons-vue';
|
import {Refresh, Search} from '@element-plus/icons-vue';
|
||||||
import {patientInfo} from '../../store/patient.js';
|
import {patientInfo} from '../../store/patient.js';
|
||||||
import {getCheck} from './api';
|
import {getCheck, deleteRequestForm, withdrawRequestForm, getTestResult} from './api';
|
||||||
import {getDepartmentList} from '@/api/public.js';
|
import {getDepartmentList} from '@/api/public.js';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
@@ -359,6 +393,91 @@ const handleViewDetail = async (row) => {
|
|||||||
detailDialogVisible.value = true;
|
detailDialogVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改申请单(仅待签发状态)
|
||||||
|
*/
|
||||||
|
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) => {
|
||||||
|
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?.('暂无检查报告');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
proxy.$modal?.msgWarning?.('暂无检查报告');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('查看检查报告失败:', e.message);
|
||||||
|
proxy.$modal?.msgError?.('获取检查报告失败');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => patientInfo.value?.encounterId,
|
() => patientInfo.value?.encounterId,
|
||||||
(val) => {
|
(val) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user