From 77094dd01f0c6ff59b4fb4fa1105addf34b2398c Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期二, 16 六月 2026 18:49:03 +0800
Subject: [PATCH] 新增智能电表、空调管理

---
 admin/src/views/business/components/YwCustomerConditionerTab.vue |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/admin/src/views/business/components/YwCustomerConditionerTab.vue b/admin/src/views/business/components/YwCustomerConditionerTab.vue
index 7a1e404..f0e4219 100644
--- a/admin/src/views/business/components/YwCustomerConditionerTab.vue
+++ b/admin/src/views/business/components/YwCustomerConditionerTab.vue
@@ -12,6 +12,7 @@
                   :min="0"
                   :precision="2"
                   :step="10"
+                  :disabled="readonly"
                   controls-position="right"
                   class="stop-money-input"
                 />
@@ -23,12 +24,12 @@
         <el-row :gutter="24">
           <el-col :span="12">
             <el-form-item label="璁¤垂寮�鍏�" prop="isPwr">
-              <el-switch v-model="form.isPwr" :active-value="1" :inactive-value="0" active-text="寮�鍚�" inactive-text="鍏抽棴"/>
+              <el-switch v-model="form.isPwr" :active-value="1" :inactive-value="0" :disabled="readonly" active-text="寮�鍚�" inactive-text="鍏抽棴"/>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="18:00-09:00 涓嶅仠鏈�" prop="isRestStop">
-              <el-switch v-model="form.isRestStop" :active-value="1" :inactive-value="0" active-text="鏄�" inactive-text="鍚�"/>
+              <el-switch v-model="form.isRestStop" :active-value="1" :inactive-value="0" :disabled="readonly" active-text="鏄�" inactive-text="鍚�"/>
             </el-form-item>
           </el-col>
         </el-row>
@@ -38,6 +39,7 @@
             type="textarea"
             :rows="2"
             maxlength="500"
+            :disabled="readonly"
             show-word-limit
             placeholder="璇疯緭鍏ュ娉紙閫夊~锛�"
           />
@@ -46,11 +48,11 @@
 
       <section class="config-section">
         <div class="section-header">
-          <span class="section-title required-title">鍏宠仈鍐呮満</span>
-          <el-button type="primary" size="small" icon="el-icon-plus" @click="openSelector">娣诲姞鍐呮満</el-button>
+          <span class="section-title" :class="{ 'required-title': !readonly }">鍏宠仈鍐呮満</span>
+          <el-button v-if="!readonly" type="primary" size="small" icon="el-icon-plus" @click="openSelector">娣诲姞鍐呮満</el-button>
         </div>
         <el-form-item prop="conditioners" label-width="0" class="conditioners-form-item">
-          <el-table :data="form.conditioners" stripe size="small" class="device-table" empty-text="鏆傛湭鍏宠仈鍐呮満锛岃鐐瑰嚮娣诲姞">
+          <el-table :data="form.conditioners" stripe size="small" class="device-table" :empty-text="readonly ? '鏆傛棤鍏宠仈鍐呮満' : '鏆傛湭鍏宠仈鍐呮満锛岃鐐瑰嚮娣诲姞'">
             <el-table-column label="璁惧" min-width="200" align="left" show-overflow-tooltip>
               <template slot-scope="{ row }">{{ deviceLabel(row) }}</template>
             </el-table-column>
@@ -62,10 +64,11 @@
             </el-table-column>
             <el-table-column label="鐢佃垂鍗犳瘮%" min-width="130" align="center">
               <template slot-scope="{ row }">
-                <el-input-number v-model="row.devRatio" :min="1" :max="100" size="small" controls-position="right"/>
+                <el-input-number v-if="!readonly" v-model="row.devRatio" :min="1" :max="100" size="small" controls-position="right"/>
+                <span v-else>{{ row.devRatio != null ? row.devRatio : '-' }}</span>
               </template>
             </el-table-column>
-            <el-table-column label="鎿嶄綔" width="80" align="center" fixed="right">
+            <el-table-column v-if="!readonly" label="鎿嶄綔" width="80" align="center" fixed="right">
               <template slot-scope="{ $index }">
                 <el-button type="text" class="red" @click="removeConditioner($index)">绉婚櫎</el-button>
               </template>
@@ -75,11 +78,11 @@
       </section>
     </el-form>
 
-    <div class="footer-btns">
+    <div v-if="!readonly" class="footer-btns">
       <el-button type="primary" :loading="saving" v-permissions="['business:ywcustomerrecharge:bindDevice']" @click="save">淇濆瓨閰嶇疆</el-button>
     </div>
 
-    <GlobalWindow title="閫夋嫨绌鸿皟鍐呮満" :visible.sync="selectorVisible" width="780px" @confirm="confirmSelect">
+    <GlobalWindow v-if="!readonly" title="閫夋嫨绌鸿皟鍐呮満" :visible.sync="selectorVisible" width="780px" @confirm="confirmSelect">
       <el-form inline @submit.native.prevent class="selector-form">
         <el-form-item label="鍏抽敭瀛�">
           <el-input v-model="selectorKeyword" placeholder="鍚嶇О/缂栧彿" clearable @keypress.enter.native="searchDevices"/>
@@ -110,7 +113,11 @@
   components: { GlobalWindow, Pagination },
   props: {
     customerId: Number,
-    active: Boolean
+    active: Boolean,
+    readonly: {
+      type: Boolean,
+      default: false
+    }
   },
   data () {
     return {

--
Gitblit v1.9.3