docs: record charge then topup verification

This commit is contained in:
tangweijie 2026-07-14 16:22:17 +08:00
parent 3040b1c375
commit 8617af66fd

View File

@ -0,0 +1,70 @@
# 柜台收费缴费后连续预存修复验证
## 根因
单客户账单收费成功后,页面保留收讫展示行,并将其标记为 `displayChargeState: 'settled'`;同时已缴账单仍保留在 `selectedChargeRows` 中。
`noArrearsTopupMode` 要求不存在 `settled` 展示行,因此收费按钮持续禁用,用户无法在缴清账单后立即继续办理预存。保留的选中行还会让上一次账单金额继续参与金额计算。
## 修复
- 单客户普通账单收费成功后,将收讫行标记为只读 `history` 展示。
- 保留 `payState: 1``payStateName: '收讫'``displayChargeType: 'bill'`,确保账单不可重复选择且详情链路不变。
- 收费成功后清空 `selectedChargeRows`,由现有金额同步逻辑清空上一次实收金额。
- 页面无待缴账单且仅存在历史展示行时,自动进入 `noArrearsTopupMode`,后续提交调用预存接口。
- 集收号收费成功后的 `settled` 展示和选中状态保持原样,未改变其批量收费约束。
## TDD 证据
### RED
```bash
node --test tests/operatingCharges/counterChargingPersistentTopup.test.mjs
```
结果:退出码 `1`9 个测试中 7 个通过、2 个失败。失败分别证明单客户收费成功后未切换为历史展示,以及已缴账单未从选中数据中清除。
### GREEN
```bash
node --test tests/operatingCharges/counterChargingPersistentTopup.test.mjs
```
结果:退出码 `0`9/9 通过。
## 回归验证
### 柜台收费既有测试
```bash
pnpm test:counter-charging
```
结果:退出码 `0`4/4 通过。
### 组合测试
```bash
node --test tests/operatingCharges/counterChargingPersistentTopup.test.mjs tests/operatingCharges/counterChargingInventory.test.mjs
```
结果:退出码 `0`13/13 通过。
### 前端构建
```bash
NODE_OPTIONS=--max-old-space-size=8192 pnpm build:dev
```
结果:退出码 `0`,输出 `Build successful. Please see dist directory`。构建过程仅出现项目既有的 SVG symbolId 和 Rollup 注释警告。
## 代码基线
- 前端分支:`fix/counter-topup-detail`
- RED 测试提交:`188ba232`
- 连续预存修复提交:`3c5d6545`
- 验证日期2026-07-14
## 约束
按用户要求,未运行 `vue-tsc``pnpm ts:check` 或任何会调用 `vue-tsc` 的命令。