Fix Bug #595: AI修复
This commit is contained in:
@@ -1,96 +1,118 @@
|
||||
<template>
|
||||
<div class="order-verification-container">
|
||||
<el-tabs v-model="activeTab" @tab-click="handleTabChange">
|
||||
<el-tab-pane label="已校对" name="verified">
|
||||
<el-table :data="orderList" border class="order-table" v-loading="loading">
|
||||
<el-table-column prop="order_no" label="医嘱号" width="120" />
|
||||
<el-table-column prop="drug_name" label="药品名称" />
|
||||
<el-table-column prop="spec" label="规格" width="100" />
|
||||
<el-table-column prop="quantity" label="数量" width="80" />
|
||||
<el-table-column prop="execution_status" label="执行状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.execution_status === 'EXECUTED' ? 'success' : 'info'">
|
||||
{{ row.execution_status === 'EXECUTED' ? '已执行' : '未执行' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dispensing_status" label="发药状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.dispensing_status === 'DISPENSED' ? 'warning' : 'info'">
|
||||
{{ row.dispensing_status === 'DISPENSED' ? '已发药' : '未发药' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
class="btn-return"
|
||||
:disabled="isReturnDisabled(row)"
|
||||
@click="handleReturn(row)"
|
||||
>
|
||||
退回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-card shadow="never" class="panel-card">
|
||||
<template #header>
|
||||
<div class="header-row">
|
||||
<span>医嘱校对</span>
|
||||
<el-select v-model="selectedPatientId" placeholder="请选择患者" class="patient-selector" @change="loadOrders">
|
||||
<el-option v-for="p in patientList" :key="p.id" :label="`${p.bedNo}床 - ${p.name}`" :value="p.id" />
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table :data="orderList" border stripe style="width: 100%" v-loading="loading">
|
||||
<el-table-column prop="startTime" label="开始时间" width="160" />
|
||||
<el-table-column prop="singleDose" label="单次剂量" width="100" />
|
||||
<el-table-column prop="totalAmount" label="总量" width="100" />
|
||||
<el-table-column prop="totalCost" label="总金额" width="100" />
|
||||
<el-table-column prop="frequencyUsage" label="频次/用法" width="140" />
|
||||
<el-table-column prop="orderingDoctor" label="开嘱医生" width="100" />
|
||||
<el-table-column prop="stopTime" label="停嘱时间" width="160" />
|
||||
<el-table-column prop="stoppingDoctor" label="停嘱医生" width="100" />
|
||||
<el-table-column prop="isInjection" label="注射药品" width="90">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.isInjection ? 'warning' : 'info'" size="small">
|
||||
{{ row.isInjection ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="skinTestStatus" label="皮试" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
v-if="row.skinTestHighlight"
|
||||
class="skin-test-tag"
|
||||
type="danger"
|
||||
effect="dark"
|
||||
size="small"
|
||||
>
|
||||
需皮试
|
||||
</el-tag>
|
||||
<span v-else>{{ row.skinTestStatus || '无需' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="diagnosis" label="诊断" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="orderContent" label="医嘱内容" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="100" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link size="small" @click="handleVerify(row)">校对</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import axios from 'axios'
|
||||
import { getVerificationList, verifyOrder } from '@/api/inpatient/nurse'
|
||||
|
||||
const activeTab = ref('verified')
|
||||
const selectedPatientId = ref(null)
|
||||
const patientList = ref([])
|
||||
const orderList = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
// 核心约束:已执行、已发药、已计费状态下禁止退回
|
||||
const isReturnDisabled = (row) => {
|
||||
return row.execution_status === 'EXECUTED' ||
|
||||
row.dispensing_status === 'DISPENSED' ||
|
||||
row.billing_status === 'BILLED'
|
||||
}
|
||||
onMounted(() => {
|
||||
// 模拟获取当前病区患者列表
|
||||
patientList.value = [
|
||||
{ id: 1, bedNo: '011', name: '张三' },
|
||||
{ id: 2, bedNo: '012', name: '李四' }
|
||||
]
|
||||
})
|
||||
|
||||
const handleReturn = async (row) => {
|
||||
try {
|
||||
await axios.post(`/api/inpatient/order/return/${row.id}`)
|
||||
ElMessage.success('退回成功')
|
||||
fetchOrders()
|
||||
} catch (error) {
|
||||
const msg = error.response?.data?.message || error.message || '退回失败'
|
||||
ElMessage.error(msg)
|
||||
}
|
||||
}
|
||||
|
||||
const fetchOrders = async () => {
|
||||
const loadOrders = async () => {
|
||||
if (!selectedPatientId.value) return
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await axios.get('/api/inpatient/order/verified')
|
||||
const res = await getVerificationList(selectedPatientId.value)
|
||||
orderList.value = res.data || []
|
||||
} catch (error) {
|
||||
} catch (err) {
|
||||
ElMessage.error('获取医嘱列表失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleTabChange = () => {
|
||||
fetchOrders()
|
||||
const handleVerify = async (row) => {
|
||||
try {
|
||||
await verifyOrder(row.id)
|
||||
ElMessage.success('校对成功')
|
||||
loadOrders()
|
||||
} catch (err) {
|
||||
ElMessage.error('校对失败')
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(fetchOrders)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.order-verification-container {
|
||||
padding: 20px;
|
||||
padding: 16px;
|
||||
}
|
||||
.order-table {
|
||||
margin-top: 10px;
|
||||
.header-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.patient-selector {
|
||||
width: 240px;
|
||||
}
|
||||
.skin-test-tag {
|
||||
font-weight: bold;
|
||||
animation: pulse 1.5s infinite;
|
||||
}
|
||||
@keyframes pulse {
|
||||
0% { opacity: 1; }
|
||||
50% { opacity: 0.7; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user