Fix Bug #503: AI修复

This commit is contained in:
2026-05-27 07:21:51 +08:00
parent 7dcb2489c6
commit 1dfebb766e
2 changed files with 109 additions and 102 deletions

View File

@@ -64,43 +64,35 @@ describe('Bug #566: 体温单数据录入后图表与表格同步渲染', () =>
// @bug503 @regression
describe('Bug #503: 住院发退药明细与汇总单数据触发时机同步', () => {
beforeEach(() => {
// 模拟字典配置为“需申请模式”
cy.intercept('GET', '/api/dict/value?key=WARD_NURSE_EXECUTION_MODE', {
statusCode: 200,
body: { code: 200, data: 'APPLY_REQUIRED' }
}).as('getDictMode');
cy.intercept('GET', '/api/pharmacy/dispensing/details*', { fixture: 'dispensing-empty.json' }).as('getDetails');
cy.intercept('GET', '/api/pharmacy/dispensing/summaries*', { fixture: 'dispensing-empty.json' }).as('getSummaries');
});
it('1. 需申请模式下:护士执行医嘱后,药房明细与汇总均不显示', () => {
cy.intercept('POST', '/api/orders/execute-dispensing', { statusCode: 200, body: { code: 200, msg: '执行成功' } }).as('executeOrder');
cy.intercept('GET', '/api/pharmacy/dispensing-details*', { fixture: 'empty-list.json' }).as('getDetails');
cy.intercept('GET', '/api/pharmacy/dispensing-summary*', { fixture: 'empty-list.json' }).as('getSummary');
cy.visit('/nurse/execution');
cy.get('.execute-btn').first().click();
it('1. 护士执行医嘱后,药房明细与汇总均不显示(需申请模式)', () => {
cy.visit('/inpatient/nurse/execution');
cy.intercept('POST', '/api/orders/execute', { statusCode: 200, body: { code: 200, msg: '执行成功' } }).as('executeOrder');
cy.get('.order-row').first().find('.execute-btn').click();
cy.wait('@executeOrder');
cy.visit('/inpatient/pharmacy/dispensing');
cy.wait(['@getDetails', '@getSummary']);
cy.get('.detail-table').should('contain.text', '暂无数据');
cy.get('.summary-table').should('contain.text', '暂无数据');
cy.wait(['@getDetails', '@getSummaries']);
cy.get('.detail-table tbody').should('be.empty');
cy.get('.summary-table tbody').should('be.empty');
});
it('2. 护士提交汇总申请后,明细与汇总同步显示', () => {
cy.intercept('POST', '/api/pharmacy/apply-summary', {
statusCode: 200,
body: { code: 200, msg: '申请成功', summaryId: 1001 }
}).as('applySummary');
cy.intercept('GET', '/api/pharmacy/dispensing-details*', { fixture: 'details-after-apply.json' }).as('getDetailsAfter');
cy.intercept('GET', '/api/pharmacy/dispensing-summary*', { fixture: 'summary-after-apply.json' }).as('getSummaryAfter');
cy.visit('/nurse/summary-apply');
it('2. 护士提交汇总发药申请后,明细与汇总单应同时显示', () => {
cy.visit('/inpatient/nurse/summary-apply');
cy.intercept('POST', '/api/pharmacy/apply-summary', { statusCode: 200, body: { code: 200, msg: '申请成功' } }).as('applySummary');
cy.get('.apply-btn').click();
cy.wait('@applySummary');
cy.visit('/inpatient/pharmacy/dispensing');
cy.wait(['@getDetailsAfter', '@getSummaryAfter']);
cy.get('.detail-table').should('not.contain.text', '暂无数据');
cy.get('.summary-table').should('not.contain.text', '暂无数据');
cy.intercept('GET', '/api/pharmacy/dispensing/details*', { fixture: 'dispensing-details-filled.json' }).as('getDetails');
cy.intercept('GET', '/api/pharmacy/dispensing/summaries*', { fixture: 'dispensing-summaries-filled.json' }).as('getSummaries');
cy.wait(['@getDetails', '@getSummaries']);
cy.get('.detail-table tbody tr').should('have.length.greaterThan', 0);
cy.get('.summary-table tbody tr').should('have.length.greaterThan', 0);
cy.get('.detail-table tbody tr').first().find('.summary-id').should('not.be.empty');
});
});