Fix Bug #561: AI修复
This commit is contained in:
105
openhis-ui-vue3/src/views/outpatient/order/DoctorOrder.vue
Normal file
105
openhis-ui-vue3/src/views/outpatient/order/DoctorOrder.vue
Normal file
@@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<div class="doctor-order-container">
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<div class="header-actions">
|
||||
<span>门诊医嘱</span>
|
||||
<el-button type="primary" @click="handleAddOrder">新增医嘱</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table
|
||||
:data="orderList"
|
||||
v-loading="loading"
|
||||
class="order-table"
|
||||
border
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="orderNo" label="医嘱号" width="120" />
|
||||
<el-table-column prop="itemName" label="项目名称" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="frequency" label="频次" width="100" />
|
||||
<el-table-column prop="totalQuantity" label="总量" width="120">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.totalQuantity }} {{ row.quantityUnit || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getStatusType(row.status)">{{ row.statusLabel }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" @click="handleEdit(row)">编辑</el-button>
|
||||
<el-button link type="danger" @click="handleDelete(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import request from '@/utils/request'
|
||||
|
||||
const loading = ref(false)
|
||||
const orderList = ref<any[]>([])
|
||||
|
||||
const fetchOrders = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await request.get('/outpatient/order/list')
|
||||
orderList.value = res.data || []
|
||||
} catch (error) {
|
||||
ElMessage.error('获取医嘱列表失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const getStatusType = (status: string) => {
|
||||
const map: Record<string, string> = {
|
||||
DRAFT: 'info',
|
||||
SUBMITTED: 'warning',
|
||||
EXECUTED: 'success',
|
||||
CANCELLED: 'danger'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
const handleAddOrder = () => {
|
||||
ElMessage.info('跳转至医嘱开立页面')
|
||||
}
|
||||
|
||||
const handleEdit = (row: any) => {
|
||||
ElMessage.info(`编辑医嘱: ${row.orderNo}`)
|
||||
}
|
||||
|
||||
const handleDelete = async (row: any) => {
|
||||
try {
|
||||
await ElMessageBox.confirm('确定删除该医嘱吗?', '提示', { type: 'warning' })
|
||||
await request.delete(`/outpatient/order/${row.id}`)
|
||||
ElMessage.success('删除成功')
|
||||
fetchOrders()
|
||||
} catch {
|
||||
// 用户取消
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchOrders()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.doctor-order-container {
|
||||
padding: 16px;
|
||||
}
|
||||
.header-actions {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user