# 客户缴费方式开户地址前端必填校验修复验证记录 日期:2026-06-09 ## 问题现象 客户资料页面修改缴费方式时,前端代扣/托收表单展示了“开户地址”字段,但未做必填校验;提交到后端后,后端在保存代扣或托收资料时返回“开户地址不能为空”。 ## 结论 本问题应由前端补齐校验。原因是后端代扣、托收资料保存对象均将 `accountAddress` 定义为必填字段,客户缴费方式修改链路会复用这两个保存对象。 ## 修复范围 仓库:`../water-frontend` 基线:`35aa0fbb` 修改文件: - `src/views/custData/custInfo/components/PayMethodForm.vue` - `src/views/custData/custCreate/components/WithHold.vue` - `src/views/custData/custInfo/components/PayMethodForm.contract.test.mjs` ## 修复内容 - 客户详情“缴费方式”弹窗: - 托收资料 `collectionFormRules` 增加 `accountAddress` 必填。 - 代扣资料 `withHoldingFormRules` 增加 `accountAddress` 必填。 - 新户建档代扣弹窗: - `formRules` 增加 `accountAddress` 必填。 - 补充 node:test 契约测试,锁定上述规则。 ## 验证命令与结果 ```bash cd /Volumes/Dpan/github/water-workspace/water-frontend node --test src/views/custData/custInfo/components/PayMethodForm.contract.test.mjs ``` 结果:通过。 - `tests 2` - `pass 2` - `fail 0` ```bash cd /Volumes/Dpan/github/water-workspace/water-frontend git diff --check -- src/views/custData/custInfo/components/PayMethodForm.vue src/views/custData/custCreate/components/WithHold.vue src/views/custData/custInfo/components/PayMethodForm.contract.test.mjs ``` 结果:通过,无空白错误。 ## 备注 当前前端仓库存在其他未提交的 expect 相关改动,本次未触碰。