doum
2026-06-16 77094dd01f0c6ff59b4fb4fa1105addf34b2398c
admin/src/views/business/components/YwCustomerDeviceWindow.vue
@@ -1,5 +1,6 @@
<template>
  <GlobalWindow title="关联设备" :visible.sync="visible" width="920px" :show-confirm="false">
    <div v-if="readonly" class="readonly-tip">设备由租赁合同自动关联,仅支持查看</div>
    <div class="merchant-info">
      <div class="merchant-info__item">
        <span class="merchant-info__label">客户类型</span>
@@ -20,10 +21,10 @@
    </div>
    <el-tabs v-model="activeTab" class="device-tabs">
      <el-tab-pane label="关联电表" name="electrical">
        <YwCustomerElectricalTab :customer-id="customer.id" :active="activeTab === 'electrical'" @success="$emit('success')"/>
        <YwCustomerElectricalTab :customer-id="customer.id" :active="activeTab === 'electrical'" :readonly="readonly"/>
      </el-tab-pane>
      <el-tab-pane label="关联空调" name="conditioner">
        <YwCustomerConditionerTab :customer-id="customer.id" :active="activeTab === 'conditioner'" @success="$emit('success')"/>
        <YwCustomerConditionerTab :customer-id="customer.id" :active="activeTab === 'conditioner'" :readonly="readonly"/>
      </el-tab-pane>
    </el-tabs>
  </GlobalWindow>
@@ -37,6 +38,13 @@
export default {
  name: 'YwCustomerDeviceWindow',
  components: { GlobalWindow, YwCustomerElectricalTab, YwCustomerConditionerTab },
  props: {
    /** 只读查看(合同自动关联,不可手动增删) */
    readonly: {
      type: Boolean,
      default: true
    }
  },
  data () {
    return {
      visible: false,
@@ -94,4 +102,12 @@
.device-tabs {
  margin-top: 4px;
}
.readonly-tip {
  margin-bottom: 12px;
  padding: 8px 12px;
  font-size: 13px;
  color: #909399;
  background: #fdf6ec;
  border-radius: 4px;
}
</style>