浏览代码

fix: 编辑会员资料弹窗直接从已有数据回显,无需重新请求

Developer 4 天之前
父节点
当前提交
eb4f6d5b21
共有 2 个文件被更改,包括 16 次插入1 次删除
  1. 二进制
      dist.zip
  2. 16 1
      src/views/modules/member/detail.vue

二进制
dist.zip


+ 16 - 1
src/views/modules/member/detail.vue

@@ -278,8 +278,23 @@ export default {
       this.tabIndex = index
     },
     handleEdit () {
+      // 直接从已加载的 userInfo 填充表单,无需再次请求
+      const d = this.userInfo
+      this.form = {
+        id: d.id,
+        nickName: d.nickName || '',
+        uniqueNo: d.uniqueNo || '',
+        channelIds: d.channelIds ? d.channelIds.split(',').map(id => Number(id.trim())).filter(Boolean) : [],
+        realName: d.realName || '',
+        idCard: d.idCard || '',
+        welfareName: d.welfareName || '',
+        welfareSlogan: d.welfareSlogan || '',
+        totalInvoicedAmount: d.totalInvoicedAmount || 0,
+        loveValue: d.loveValue || 0,
+        welfareCount: d.welfareCount || 0,
+        userLevel: d.userLevel || 1
+      }
       this.show = true
-      this.getDetail()
     },
     submitForm () {
       this.$refs['memberRef'].validate((valid) => {