This commit is contained in:
2026-05-20 13:47:36 +08:00
parent 1e77c0756b
commit ed7e4bbeb3
3 changed files with 114 additions and 32 deletions

View File

@@ -115,20 +115,20 @@
</template>
</el-table-column>
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
<el-table-column label="操作" align="center" fixed="right" width="220">
<el-table-column label="操作" align="center" fixed="right" width="280">
<template #default="scope">
<!-- 待签发可修改删除 -->
<template v-if="isPendingStatus(scope.row)">
<el-button link type="primary" @click="handleEdit(scope.row)">修改</el-button>
<el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
<template v-if="canManageRow(scope.row)">
<template v-if="isPendingStatus(scope.row)">
<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="isWithdrawableStatus(scope.row)">
<el-button link type="warning" @click="handleWithdraw(scope.row)">撤回</el-button>
</template>
</template>
<!-- 已签发可撤回 -->
<template v-else-if="isIssuedStatus(scope.row)">
<el-button link type="warning" @click="handleWithdraw(scope.row)">撤回</el-button>
</template>
<!-- 已采证已送检报告已出已作废仅查看详情 -->
<template v-else>
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
<template v-if="isReportStatus(scope.row)">
<el-button link type="success" @click="handleViewReport(scope.row)">查看报告</el-button>
</template>
</template>
</el-table-column>
@@ -228,7 +228,10 @@ import {patientInfo} from '../../store/patient.js';
import {getInspection, deleteRequestForm, withdrawRequestForm, getProofResult} from './api';
import {getDepartmentList} from '@/api/public.js';
import LaboratoryTests from '../order/applicationForm/laboratoryTests.vue';
import {saveInspection} from '../order/applicationForm/api.js';
import useUserStore from '@/store/modules/user';
import auth from '@/plugins/auth';
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
@@ -378,10 +381,25 @@ const isPendingStatus = (row) => {
return status === undefined || status === null || status === '' || String(status) === '0';
};
const isIssuedStatus = (row) => String(getBillStatus(row)) === '1';
const isWithdrawableStatus = (row) => String(getBillStatus(row)) === '1';
const isReportStatus = (row) => ['6', '8'].includes(String(getBillStatus(row)));
/**
* 是否可管理该申请单:申请者本人或管理员
*/
const canManageRow = (row) => {
if (auth.hasRole('admin')) {
return true;
}
const currentPractitionerId = userStore.practitionerId;
const requesterId = row?.requesterId;
if (!currentPractitionerId || !requesterId) {
return false;
}
return String(currentPractitionerId) === String(requesterId);
};
const sortByCreateTimeDesc = (a, b) => {
const aTime = a?.createTime ? new Date(a.createTime).getTime() : 0;
const bTime = b?.createTime ? new Date(b.createTime).getTime() : 0;
@@ -586,9 +604,9 @@ const submitEditForm = () => {
*/
const handleDelete = async (row) => {
try {
await proxy.$modal?.confirm?.(`确定要删除申请单 "${row.prescriptionNo}" 吗?此操作不可恢复。`);
await proxy.$modal?.confirm?.('确认作废该申请单吗?作废后不可撤销');
} catch {
return; // 用户取消
return;
}
try {
@@ -605,13 +623,15 @@ const handleDelete = async (row) => {
};
/**
* 撤回检验申请单(已签发状态撤回至待签发
* 撤回检验申请单(已签发且未采证状态撤回)
*/
const handleWithdraw = async (row) => {
try {
await proxy.$modal?.confirm?.(`确定要撤回申请单 "${row.prescriptionNo}" 吗?撤回后将恢复为待签发状态。`);
await proxy.$modal?.confirm?.(
'确认撤回该申请单吗?撤回后申请单及关联医嘱将恢复为待签发状态,护士站将同步更新。'
);
} catch {
return; // 用户取消
return;
}
try {
@@ -740,6 +760,10 @@ defineExpose({
.report-status-tag {
cursor: pointer;
background-color: #f0f9eb !important;
border-color: #67c23a !important;
color: #529b2e !important;
font-weight: 600;
}
@keyframes rotating {