doum
2026-06-16 77094dd01f0c6ff59b4fb4fa1105addf34b2398c
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 {