Fix Bug #544: AI修复
This commit is contained in:
@@ -60,10 +60,12 @@ const handleQuery = async () => {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const [startDate, endDate] = dateRange.value || []
|
const [startDate, endDate] = dateRange.value || []
|
||||||
|
// 不传 status 或传 null,后端将查询全部状态(含完诊)
|
||||||
const res = await getQueueList({
|
const res = await getQueueList({
|
||||||
deptId: deptId.value,
|
deptId: deptId.value,
|
||||||
startDate,
|
status: null,
|
||||||
endDate
|
startDate: startDate || null,
|
||||||
|
endDate: endDate || null
|
||||||
})
|
})
|
||||||
queueList.value = res.data || []
|
queueList.value = res.data || []
|
||||||
} finally {
|
} finally {
|
||||||
@@ -76,15 +78,3 @@ onMounted(() => {
|
|||||||
handleQuery()
|
handleQuery()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.card-header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.header-actions {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -58,37 +58,41 @@ describe('Bug #550 Regression', { tags: ['@bug550', '@regression'] }, () => {
|
|||||||
cy.get('[data-cy="selected-card"]').find('.method-row').should('have.length.greaterThan', 0)
|
cy.get('[data-cy="selected-card"]').find('.method-row').should('have.length.greaterThan', 0)
|
||||||
|
|
||||||
// 6. 验证无冗余标签
|
// 6. 验证无冗余标签
|
||||||
|
cy.get('[data-cy="selected-card"]').contains('项目套餐明细').should('not.exist')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('Bug #505 Regression', { tags: ['@bug505', '@regression'] }, () => {
|
describe('Bug #544 Regression', { tags: ['@bug544', '@regression'] }, () => {
|
||||||
it('should block return action for dispensed orders and show exact warning', () => {
|
beforeEach(() => {
|
||||||
// 模拟已发药状态的医嘱数据
|
cy.visit('/triage/queue')
|
||||||
cy.intercept('GET', '/api/inpatient/orders/verify*', {
|
// Mock 队列接口,返回包含 WAITING 和 COMPLETED 状态的数据
|
||||||
|
cy.intercept('GET', '/api/triage/queue/list*', {
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
body: {
|
body: {
|
||||||
|
code: 200,
|
||||||
data: [
|
data: [
|
||||||
{ id: 2001, drugName: '头孢哌酮钠舒巴坦钠', execStatus: 'EXECUTED', dispenseStatus: 'DISPENSED' }
|
{ id: 1, patientName: '张三', status: 'WAITING', queueTime: '2026-05-26 09:00:00' },
|
||||||
|
{ id: 2, patientName: '李四', status: 'COMPLETED', queueTime: '2026-05-26 08:30:00' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}).as('fetchOrders')
|
}).as('getQueueList')
|
||||||
|
})
|
||||||
|
|
||||||
cy.visit('/inpatient/nurse/order-verify')
|
it('should display COMPLETED status patients and support historical date query', () => {
|
||||||
cy.wait('@fetchOrders')
|
// 验证日期选择器存在且默认加载
|
||||||
|
cy.get('[data-cy="date-range-picker"]').should('exist')
|
||||||
|
|
||||||
// 勾选已发药医嘱
|
// 点击历史查询按钮
|
||||||
cy.get('[data-cy="order-checkbox"]').first().click()
|
cy.get('[data-cy="history-query-btn"]').click()
|
||||||
|
cy.wait('@getQueueList')
|
||||||
|
|
||||||
// 点击退回按钮
|
// 验证表格完整展示所有状态(含完诊)
|
||||||
cy.get('[data-cy="btn-return"]').click()
|
cy.get('[data-cy="queue-table"]').contains('COMPLETED').should('be.visible')
|
||||||
|
cy.get('[data-cy="queue-table"]').contains('李四').should('be.visible')
|
||||||
|
cy.get('[data-cy="queue-table"]').contains('WAITING').should('be.visible')
|
||||||
|
cy.get('[data-cy="queue-table"]').contains('张三').should('be.visible')
|
||||||
|
|
||||||
// 拦截退回请求并模拟后端拦截响应
|
// 验证状态标签渲染正常
|
||||||
cy.intercept('POST', '/api/inpatient/orders/return', (req) => {
|
cy.get('[data-cy="queue-table"]').find('.el-tag').should('have.length.at.least', 2)
|
||||||
req.reply(400, { message: '该药品已由药房发放,请先执行退药处理,不可直接退回' })
|
|
||||||
}).as('returnOrder')
|
|
||||||
|
|
||||||
// 验证前端提示或拦截响应
|
|
||||||
cy.wait('@returnOrder')
|
|
||||||
cy.contains('该药品已由药房发放,请先执行退药处理,不可直接退回').should('be.visible')
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user