Blame view

src/components/owner/ownerDetailAccount.vue 4.05 KB
c85e0853   wuxw   业主详情开发完成
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
  <template>
    <div class="margin-top">
      <el-row>
        <el-col :span="24" class="text-right">
          <el-button type="primary" size="small" style="margin-left:10px"
            v-if="ownerDetailAccountInfo.accounts.length <1 && hasPrivilege('502023032809461736')"
            @click="_prestoreAccount1()">
            {{ $t('ownerDetailAccount.prestore') }}
          </el-button>
        </el-col>
      </el-row>
      <div class="margin-top">
        <el-table :data="ownerDetailAccountInfo.accounts" style="width: 100%">
          <el-table-column prop="acctId" :label="$t('ownerDetailAccount.acctId')" align="center"></el-table-column>
          <el-table-column prop="acctName" :label="$t('ownerDetailAccount.acctName')" align="center"></el-table-column>
          <el-table-column prop="link" :label="$t('ownerDetailAccount.phone')" align="center"></el-table-column>
          <el-table-column prop="acctTypeName" :label="$t('ownerDetailAccount.acctType')" align="center"></el-table-column>
          <el-table-column prop="amount" :label="$t('ownerDetailAccount.amount')" align="center"></el-table-column>
          <el-table-column prop="createTime" :label="$t('ownerDetailAccount.createTime')" align="center"></el-table-column>
          <el-table-column :label="$t('common.operation')" align="center" width="200">
            <template slot-scope="scope">
              <el-button-group>
                <el-button size="mini" @click="_prestoreAccount(scope.row)"
                  v-if="hasPrivilege('502023032809461736')">
                  {{ $t('ownerDetailAccount.prestore') }}
                </el-button>
                <el-button size="mini" @click="_accountDetail(scope.row)">
                  {{ $t('ownerDetailAccount.detail') }}
                </el-button>
              </el-button-group>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          @current-change="handleCurrentChange"
          :current-page="pagination.currentPage"
          :page-size="pagination.pageSize"
          :total="pagination.total"
          layout="total, prev, pager, next, jumper">
        </el-pagination>
      </div>
  
dd88fe5d   wuxw   优化业主详情页面
43
      <prestore-account ref="prestoreAccount" @success="_loadOwnerDetailAccountData"></prestore-account>
c85e0853   wuxw   业主详情开发完成
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
    </div>
  </template>
  
  <script>
  import PrestoreAccount from '@/components/account/prestoreAccount'
  import { queryCommunityOwnerAccount } from '@/api/owner/ownerDetailAccountApi'
  import { getCommunityId } from '@/api/community/communityApi'
  
  export default {
    name: 'OwnerDetailAccount',
    components: {
      PrestoreAccount
    },
    data() {
      return {
        ownerDetailAccountInfo: {
          accounts: [],
          ownerId: '',
          name: '',
        },
        pagination: {
          currentPage: 1,
          pageSize: 10,
          total: 0
        }
      }
    },
    methods: {
      open(ownerId, ownerName, link) {
        this.ownerDetailAccountInfo.ownerId = ownerId
        this.ownerDetailAccountInfo.ownerName = ownerName
        this.ownerDetailAccountInfo.link = link
        this._loadOwnerDetailAccountData(1, this.pagination.pageSize)
      },
      _loadOwnerDetailAccountData(page, row) {
        const params = {
          communityId: getCommunityId(),
          ownerId: this.ownerDetailAccountInfo.ownerId,
          page: page,
          row: row
        }
  
        queryCommunityOwnerAccount(params).then(response => {
          this.ownerDetailAccountInfo.accounts = response.data
          this.pagination.total = response.records
        }).catch(error => {
          console.error('请求失败处理', error)
        })
      },
      _accountDetail(account) {
dd88fe5d   wuxw   优化业主详情页面
94
        this.$router.push(`/views/account/accountDetailManage?acctId=${account.acctId}`)
c85e0853   wuxw   业主详情开发完成
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
      },
      _prestoreAccount(account) {
        this.$refs.prestoreAccount.open({
          ownerId: this.ownerDetailAccountInfo.ownerId,
          acctType: account.acctType,
          tel: account.link,
          roomId: account.roomId
        })
      },
      _prestoreAccount1() {
        this.$refs.prestoreAccount.open({})
      },
      handleCurrentChange(val) {
        this._loadOwnerDetailAccountData(val, this.pagination.pageSize)
      },
    },
    created() {
c85e0853   wuxw   业主详情开发完成
112
113
114
115
116
117
118
    }
  }
  </script>
  
  <style scoped>
  /* 样式同上一个组件 */
  </style>