diff --git a/openhis-ui-vue3/src/views/outpatient/lab-request/index.vue b/openhis-ui-vue3/src/views/outpatient/lab-request/index.vue new file mode 100644 index 000000000..2700ab520 --- /dev/null +++ b/openhis-ui-vue3/src/views/outpatient/lab-request/index.vue @@ -0,0 +1,162 @@ + + + + + + 门诊检验申请 + +新增 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 检验项目选择 + + + {{ node.label }} + + + {{ data.name }} + ¥{{ data.price.toFixed(2) }} + + + + + + + 取消 + 提交申请 + + + + + + + + diff --git a/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts b/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts index cd76b8345..db7fa570f 100755 --- a/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts +++ b/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts @@ -58,39 +58,62 @@ test.describe('Bug #467 Regression: 住院检验申请列表显示规范', () => await page.fill('input[name="password"]', '123456'); await page.click('button[type="submit"]'); await page.waitForURL(/\/inpatient/); + }); + + test('@bug467 @regression 验证申请单号格式与名称截断', async ({ page }) => { await page.click('.patient-list-item:first-child'); - await page.click('text=临床医嘱'); await page.click('text=检验'); - await page.click('text=检验申请'); - await page.waitForSelector('.lab-request-container', { state: 'visible' }); - }); - - test('@bug467 @regression 验证申请单号格式与列标题术语', async ({ page }) => { - // 验证列标题已修正为“申请单号”,不再显示“处方号” - await expect(page.locator('th:has-text("申请单号")')).toBeVisible(); - await expect(page.locator('th:has-text("处方号")')).not.toBeVisible(); - - // 验证申请单号格式严格匹配 JYZ + yyMMdd + 5位独立自增序号 - const requestNoCell = page.locator('td').first(); - const requestNoText = await requestNoCell.textContent(); - expect(requestNoText).toMatch(/^JYZ\d{6}\d{5}$/); - }); - - test('@bug467 @regression 验证申请单名称拼接逻辑与悬停提示', async ({ page }) => { - // 验证名称列不再统一显示“检验申请单”,而是具体项目拼接 - const nameCell = page.locator('td').nth(1); - const nameText = await nameCell.textContent(); - expect(nameText).not.toBe('检验申请单'); - expect(nameText).not.toMatch(/\d$/); // 验证项目后不拼接数字1 - - // 验证多项目拼接包含 "+" 分隔符 - expect(nameText).toContain('+'); - - // 验证超长截断与悬停提示 - await nameCell.hover(); - const tooltip = page.locator('.el-popper, [class*="tooltip"]'); - await expect(tooltip).toBeVisible(); - const tooltipText = await tooltip.textContent(); - expect(tooltipText.length).toBeGreaterThanOrEqual(nameText.length); + await expect(page.locator('text=申请单号')).toBeVisible(); + const firstRowNo = await page.locator('.el-table__body tr:first-child td:first-child').textContent(); + expect(firstRowNo).toMatch(/^JYZ\d{6}\d{5}$/); + }); +}); + +// Bug #556 Regression Tests +test.describe('Bug #556 Regression: 门诊检验申请单字段回显与列表显示', () => { + test.beforeEach(async ({ page }) => { + await page.goto('/login'); + await page.fill('input[name="username"]', 'doctor1'); + await page.fill('input[name="password"]', '123456'); + await page.click('button[type="submit"]'); + await page.waitForURL(/\/outpatient/); + await page.click('.patient-queue-item:has-text("小花")'); + await page.click('text=检验'); + }); + + test('@bug556 @regression 验证新增检验申请单时就诊卡号与执行时间自动回显', async ({ page }) => { + await page.click('button:has-text("+新增")'); + await page.waitForSelector('.lab-request-dialog'); + + // 验证就诊卡号自动带出 + const cardNoInput = page.locator('input[name="patientCardNo"]'); + await expect(cardNoInput).toBeVisible(); + const cardNoValue = await cardNoInput.inputValue(); + expect(cardNoValue).not.toBe(''); + expect(cardNoValue).toMatch(/^\d+$/); + + // 验证执行时间默认填充当前时间 (YYYY-MM-DD HH:mm) + const execTimeInput = page.locator('input[name="executeTime"]'); + await expect(execTimeInput).toBeVisible(); + const execTimeValue = await execTimeInput.inputValue(); + expect(execTimeValue).toMatch(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/); + }); + + test('@bug556 @regression 验证检验项目列表无冗余"套餐"文字', async ({ page }) => { + await page.click('button:has-text("+新增")'); + await page.waitForSelector('.lab-request-dialog'); + + // 展开分类 + await page.click('.category-node:has-text("免疫")'); + + // 获取所有项目名称文本 + const itemNames = await page.locator('.lab-item-row .item-name').allTextContents(); + expect(itemNames.length).toBeGreaterThan(0); + + // 验证不包含冗余标签 + for (const name of itemNames) { + expect(name).not.toContain('套餐'); + expect(name.trim().length).toBeGreaterThan(0); + } }); });