pangu-user-platform/pangu-ui
神码-方晓辉 288193b957 fix: 修复会员管理三个bug - 编号/出生日期/新增按钮
## Bug描述
1. 会员编号列空白无数据
2. 出生日期显示"未知"
3. 点击"新增"按钮无反应

## 问题分析

### Bug1: 会员编号空白
**原因**: 前后端字段名不匹配
- 前端: `prop="memberNo"`
- 后端: `memberCode`

### Bug2: 出生日期显示"未知"
**原因**: 后端返回`birthday: null`时,前端直接显示为空单元格,用户体验差

### Bug3: 新增按钮无反应
**原因**: `MemberDialog.vue`组件没有暴露`open`方法
- 父组件调用: `memberDialogRef.value?.open()`
- 子组件未定义: 缺少`defineExpose({ open })`

## 修复内容

### 1. 修正会员编号字段名 (index.vue)
```vue
<!-- 修复前 -->
<el-table-column prop="memberNo" label="会员编号" />

<!-- 修复后  -->
<el-table-column prop="memberCode" label="会员编号" />
```

### 2. 修正出生日期显示 (index.vue)
```vue
<!-- 修复前 -->
<el-table-column prop="birthday" label="出生日期" />

<!-- 修复后  -->
<el-table-column prop="birthday" label="出生日期">
  <template #default="{ row }">
    {{ row.birthday || '-' }}
  </template>
</el-table-column>
```

### 3. 修正弹窗组件架构 (MemberDialog.vue)
```javascript
// 1. 移除未使用的props
- const props = defineProps({ modelValue, memberId })

// 2. 添加内部状态
+ const visible = ref(false)
+ const memberId = ref(null)

// 3. 暴露open方法
+ const open = (row) => {
+   memberId.value = row?.memberId || null
+   visible.value = true
+ }
+ defineExpose({ open })

// 4. 修正handleOpen逻辑
- if (props.memberId) {
+ if (memberId.value) {

// 5. 添加handleClose清理
+ const handleClose = () => {
+   formRef.value?.resetFields()
+   memberId.value = null
+ }
```

## 验证结果
-  会员编号正常显示: MEM20260101
-  出生日期为空时显示"-"
-  点击"新增"按钮弹出表单
-  编辑功能正常

---
作者:湖北新华业务中台研发团队
2026-02-01 13:11:45 +08:00
..
public feat: 初始化盘古用户平台项目 2026-01-31 16:48:20 +08:00
src fix: 修复会员管理三个bug - 编号/出生日期/新增按钮 2026-02-01 13:11:45 +08:00
.gitignore feat: 初始化盘古用户平台项目 2026-01-31 16:48:20 +08:00
README.md feat: 初始化盘古用户平台项目 2026-01-31 16:48:20 +08:00
index.html feat: 初始化盘古用户平台项目 2026-01-31 16:48:20 +08:00
package-lock.json refactor: 完全移除Mock,100%使用真实DB数据和API 2026-02-01 00:21:28 +08:00
package.json refactor: 完全移除Mock,100%使用真实DB数据和API 2026-02-01 00:21:28 +08:00
vite.config.js fix: UI自动化测试并修复前后端集成关键问题 2026-02-01 00:56:57 +08:00

README.md

Vue 3 + Vite

This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.

Learn more about IDE Support for Vue in the Vue Docs Scaling up Guide.