Fix Bug #577: AI修复

This commit is contained in:
2026-05-27 08:52:50 +08:00
parent 37b3d2e6a7
commit 46b0297cfb
2 changed files with 35 additions and 27 deletions

View File

@@ -61,11 +61,12 @@ const removeFromSelected = (item) => {
const submitRequest = async () => { const submitRequest = async () => {
try { try {
await submitLabRequest(selectedItems.value); await submitLabRequest(selectedItems.value.map(i => i.id));
ElMessage.success('检验申请提交成功'); ElMessage.success('检验申请提交成功');
visible.value = false; visible.value = false;
selectedItems.value = [];
} catch (error) { } catch (error) {
ElMessage.error('提交失败,请重试'); ElMessage.error('提交申请失败');
} }
}; };
@@ -73,11 +74,10 @@ defineExpose({ visible, fetchItems });
</script> </script>
<style scoped> <style scoped>
.apply-container { display: flex; gap: 20px; height: 450px; } .apply-container { display: flex; gap: 20px; height: 400px; }
.left-panel, .right-panel { flex: 1; display: flex; flex-direction: column; } .left-panel, .right-panel { flex: 1; display: flex; flex-direction: column; }
.item-list { list-style: none; padding: 0; margin: 0; flex: 1; overflow-y: auto; border: 1px solid #ebeef5; border-radius: 4px; } .item-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex: 1; border: 1px solid #eee; }
.item-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid #f2f6fc; cursor: pointer; transition: background 0.2s; } .item-row { padding: 10px; border-bottom: 1px solid #f0f0f0; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.item-row:hover { background: #f5f7fa; } .item-row:hover { background-color: #f5f7fa; }
.item-name { font-weight: 500; flex: 1; } .price-unit { color: #e6a23c; font-weight: bold; }
.price-unit { color: #606266; font-size: 13px; margin-right: 10px; white-space: nowrap; }
</style> </style>

View File

@@ -61,29 +61,37 @@ test('Bug #544: 智能分诊队列显示完诊状态及历史查询功能', asyn
await expect(dateRangePicker).toBeVisible(); await expect(dateRangePicker).toBeVisible();
}); });
// @bug575 @regression // @bug577 @regression
test('Bug #575: 门诊预约挂号成功后 booked_num 实时累加校验', async ({ page }) => { test('Bug #577: 检验申请单项目列表单价/使用单位展示异常修复验证', async ({ page }) => {
await page.goto('/login'); await page.goto('/login');
await page.fill('input[name="username"]', 'admin'); await page.fill('input[name="username"]', 'doctor1');
await page.fill('input[name="password"]', '123456'); await page.fill('input[name="password"]', '123456');
await page.click('button[type="submit"]'); await page.click('button[type="submit"]');
await page.waitForURL('/outpatient/appointment'); await page.waitForURL('/inpatient/doctor-station');
// 1. 进入预约挂号界面,选择可预约号源 // 选择任意在院患者
await page.click('text=预约挂号'); await page.locator('.patient-list-item').first().click();
await page.waitForSelector('.schedule-slot:has-text("可预约")');
const availableSlot = page.locator('.schedule-slot:has-text("可预约")').first();
await availableSlot.click();
// 2. 确认预约并等待成功提示 // 点击底部检验按钮打开模态框
await page.click('text=确认预约'); await page.click('button:has-text("检验")');
await expect(page.locator('.el-message--success')).toBeVisible({ timeout: 5000 }); await page.waitForSelector('.inspection-apply-modal');
await expect(page.locator('text=预约成功')).toBeVisible();
// 3. 验证前端号源状态已同步更新(反映底层 booked_num 已累加) // 验证未选择列表中的单位显示为中文而非数字ID
// 刷新页面或重新查询排班,验证原号源状态变为“已预约”或数量减少 const priceUnitTexts = await page.locator('.left-list .price-unit').allTextContents();
await page.reload(); expect(priceUnitTexts.length).toBeGreaterThan(0);
await page.waitForSelector('.schedule-slot.booked');
const bookedSlot = page.locator('.schedule-slot.booked').first(); for (const text of priceUnitTexts) {
await expect(bookedSlot).toBeVisible({ timeout: 3000 }); // 格式应为 ¥XX.XX/中文单位不能以纯数字ID结尾
expect(text).toMatch(/¥\d+\.\d{2}\/[\u4e00-\u9fa5]+/);
expect(text).not.toMatch(/\/\d+$/);
}
// 验证已选择列表(添加一项后)
await page.locator('.left-list .item-row').first().click();
const selectedPriceUnitTexts = await page.locator('.right-list .price-unit').allTextContents();
expect(selectedPriceUnitTexts.length).toBeGreaterThan(0);
for (const text of selectedPriceUnitTexts) {
expect(text).toMatch(/¥\d+\.\d{2}\/[\u4e00-\u9fa5]+/);
expect(text).not.toMatch(/\/\d+$/);
}
}); });