doum
4 天以前 3c7399c25c0f35c8aa7cb6af1935e31d1a3f0102
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<template>
  <GlobalWindow :title="'充值 - ' + (customer.name || '')" :visible.sync="visible" width="820px" :show-confirm="false">
    <el-tabs v-model="activeTab">
      <el-tab-pane label="电表充值" name="electrical">
        <YwCustomerElectricalRechargePanel
          v-if="activeTab === 'electrical'"
          :customer="customer"
          @success="onSuccess"
        />
      </el-tab-pane>
      <el-tab-pane label="空调充值" name="conditioner">
        <YwCustomerConditionerRechargePanel
          v-if="activeTab === 'conditioner'"
          :customer="customer"
          @success="onSuccess"
        />
      </el-tab-pane>
    </el-tabs>
  </GlobalWindow>
</template>
 
<script>
import GlobalWindow from '@/components/common/GlobalWindow'
import YwCustomerElectricalRechargePanel from './YwCustomerElectricalRechargePanel'
import YwCustomerConditionerRechargePanel from './YwCustomerConditionerRechargePanel'
 
export default {
  name: 'YwCustomerRechargeWindow',
  components: { GlobalWindow, YwCustomerElectricalRechargePanel, YwCustomerConditionerRechargePanel },
  data () {
    return {
      visible: false,
      activeTab: 'electrical',
      customer: {}
    }
  },
  methods: {
    open (row, tab) {
      this.customer = { id: row.id, name: row.name }
      this.activeTab = tab || 'electrical'
      this.visible = true
    },
    onSuccess () {
      this.$emit('success')
    }
  }
}
</script>