Fix Bug #505: AI修复

This commit is contained in:
2026-05-27 07:18:19 +08:00
parent e195747136
commit 633e6bf4c4
2 changed files with 140 additions and 67 deletions

View File

@@ -58,11 +58,62 @@ describe('Bug #566: 体温单数据录入后图表与表格同步渲染', () =>
cy.get('.patient-selector').click();
cy.contains('123').click();
cy.get('.add-btn').click();
cy.get('.vital-form input').first().type('36.5');
cy.contains('保存').click();
cy.get('.temp-input').type('36.5');
cy.get('.save-btn').click();
cy.wait('@saveVitalSigns');
cy.wait('@fetchChartData');
cy.get('.chart-container').should('be.visible');
cy.get('.el-table tbody tr').should('have.length.greaterThan', 0);
cy.get('.table-card .el-table__body-wrapper').should('contain', '36.5');
});
});
// @bug505 @regression
describe('Bug #505: 已发药医嘱禁止直接退回', () => {
beforeEach(() => {
cy.visit('/inpatient/order-verify');
// 模拟获取已发药状态的医嘱列表
cy.intercept('GET', '/api/order/verify/list*', {
statusCode: 200,
body: {
code: 200,
data: [
{ id: 1001, drugName: '头孢哌酮钠舒巴坦钠', status: '已校对', dispenseStatus: '已发药', executed: true }
]
}
}).as('getDispensedOrders');
// 模拟后端拦截退回请求并返回业务异常
cy.intercept('POST', '/api/order/return', {
statusCode: 400,
body: { code: 400, msg: '该药品已由药房发放,请先执行退药处理,不可直接退回' }
}).as('returnOrderApi');
});
it('1. 已发药医嘱点击退回应拦截并弹出标准警示', () => {
cy.wait('@getDispensedOrders');
// 勾选已发药医嘱
cy.get('.order-table .el-table__row').first().find('.el-checkbox__inner').click();
// 点击退回按钮
cy.get('.btn-return').click();
cy.wait('@returnOrderApi');
// 验证前端提示
cy.contains('该药品已由药房发放,请先执行退药处理,不可直接退回').should('be.visible');
});
it('2. 已执行未发药医嘱点击退回应提示先取消执行', () => {
cy.intercept('GET', '/api/order/verify/list*', {
statusCode: 200,
body: { code: 200, data: [{ id: 1002, drugName: '阿莫西林', status: '已执行', dispenseStatus: '未发药', executed: true }] }
}).as('getExecutedOrders');
cy.intercept('POST', '/api/order/return', {
statusCode: 400,
body: { code: 400, msg: '该医嘱已执行,请先在【医嘱执行】模块取消执行后再操作退回' }
}).as('returnExecutedApi');
cy.wait('@getExecutedOrders');
cy.get('.order-table .el-table__row').first().find('.el-checkbox__inner').click();
cy.get('.btn-return').click();
cy.wait('@returnExecutedApi');
cy.contains('该医嘱已执行,请先在【医嘱执行】模块取消执行后再操作退回').should('be.visible');
});
});