From ea689dd91eaa72425dc01759042c3b4eb2186512 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 17 六月 2026 10:14:44 +0800
Subject: [PATCH] 新增智能电表、空调管理

---
 admin/src/views/client/components/OperaYwCustomerWindow.vue |   89 +++++++++++++++++++++++++++++++-------------
 1 files changed, 63 insertions(+), 26 deletions(-)

diff --git a/admin/src/views/client/components/OperaYwCustomerWindow.vue b/admin/src/views/client/components/OperaYwCustomerWindow.vue
index d3c0941..bc8ada4 100644
--- a/admin/src/views/client/components/OperaYwCustomerWindow.vue
+++ b/admin/src/views/client/components/OperaYwCustomerWindow.vue
@@ -45,7 +45,9 @@
           <el-form-item label="璇佷欢鍙风爜" prop="member.idcardNo">
             <el-input v-model="form.member.idcardNo" placeholder="璇疯緭鍏�" v-trim />
           </el-form-item>
-          <el-form-item label="閭" prop="email">
+          <el-form-item label="閭" prop="member.email" :rules="[
+            { required: false, type: 'email', message: '璇疯緭鍏ユ纭殑閭鏍煎紡'}
+          ]">
             <el-input v-model="form.member.email" placeholder="璇疯緭鍏ラ偖绠�" v-trim />
           </el-form-item>
         </template>
@@ -169,6 +171,47 @@
     })
   },
   methods: {
+    defaultForm() {
+      return {
+        id: null,
+        validity: '',
+        creator: '',
+        createDate: '',
+        editor: '',
+        editDate: '',
+        isdeleted: '',
+        remark: '',
+        industryId: '',
+        type: 1,
+        name: '',
+        phone: '',
+        idcardNo: '',
+        idcardDecode: '',
+        code: '',
+        status: '',
+        memberName: '',
+        lastLoginDate: '',
+        loginNum: '',
+        userId: '',
+        memberId: '',
+        accountBank: '',
+        accountNo: '',
+        accountPhone: '',
+        creditCard: '',
+        fpType: '',
+        accountAddr: '',
+        email: '',
+        selLangTime: false,
+        member: {
+          name: '',
+          phone: '',
+          highCheckor: 0,
+          idcardType: 0,
+          idcardNo: '',
+          email: ''
+        }
+      }
+    },
     openTrade() {
       this.$refs.OperaCategoryWindowRef.open('鏂板琛屼笟')
     },
@@ -187,37 +230,31 @@
         this.cateList = res
       })
     },
+    applyDetail(res) {
+      const base = this.defaultForm()
+      this.form = Object.assign(base, res, {
+        member: Object.assign({}, base.member, res.member || {})
+      })
+      this.form.selLangTime = this.form.validity === '2099-12-31'
+    },
     open(title, target) {
       this.title = title
       this.visible = true
       this.initData()
-      // 鏂板缓
+      this.form = this.defaultForm()
+      this.clientList = []
+      this.$nextTick(() => {
+        this.$refs.form && this.$refs.form.clearValidate()
+      })
       if (target == null) {
-        this.$nextTick(() => {
-          this.$refs.form.resetFields()
-          this.form.validity = ''
-          this.form.id = ''
-          this.form.member = {
-            name: "",
-            phone: "",
-            highCheckor: 0,
-            idcardType: 0,
-            idcardNo: '',
-            email: '',
-          }
-        })
-        this.form.type = 1
         return
       }
-      // 缂栬緫
-      this.$nextTick(() => {
-        if (title == '缂栬緫瀹㈡埛') {
-          this.getClient(target.id)
-          detailById(target.id).then(res => {
-            this.form = res
-          })
-        }
-      })
+      if (title === '缂栬緫瀹㈡埛') {
+        this.getClient(target.id)
+        detailById(target.id).then(res => {
+          this.applyDetail(res)
+        })
+      }
     },
     getClient(customerId) {
       fetchList({
@@ -264,4 +301,4 @@
     }
   }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3