Fix Bug #571: fallback修复

This commit is contained in:
2026-05-26 23:03:15 +08:00
parent 3e785784b0
commit b6c05fecdc
6 changed files with 135 additions and 19 deletions

View File

@@ -0,0 +1,19 @@
import request from '@/utils/request'
export function getLabRequestListApi() {
return request({
url: '/inpatient/lab-request/list',
method: 'get'
})
}
/**
* 撤回检验申请 (Bug #571)
* @param {Number} requestId
*/
export function revokeLabRequestApi(requestId) {
return request({
url: `/inpatient/lab-request/revoke/${requestId}`,
method: 'post'
})
}

View File

@@ -28,6 +28,14 @@
<el-table-column prop="createTime" label="申请时间" width="180" />
<el-table-column prop="status" label="状态" width="100" />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button type="primary" link @click="handleRevoke(row)" v-if="row.status !== 'REVOKED'">
撤回
</el-button>
<el-tag v-else type="info">已撤回</el-tag>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
@@ -35,7 +43,7 @@
<script setup>
import { ref, onMounted } from 'vue'
import { getLabRequestListApi } from '@/api/inpatient/labRequest'
import { getLabRequestListApi, revokeLabRequestApi } from '@/api/inpatient/labRequest'
const loading = ref(false)
const tableData = ref([])
@@ -52,13 +60,15 @@ const fetchData = async () => {
}
}
onMounted(() => {
fetchData()
})
</script>
const handleRevoke = async (row) => {
try {
await revokeLabRequestApi(row.id)
// 更新前端状态
row.status = 'REVOKED'
} catch (e) {
console.error('撤回失败', e)
}
}
<style scoped>
.lab-request-container { padding: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; }
.request-name-text { cursor: pointer; color: #303133; }
</style>
onMounted(fetchData)
</script>