Blame view

src/components/owner/ownerDetailAppUser.vue 4.83 KB
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
1
  <template>
c85e0853   wuxw   业主详情开发完成
2
3
    <div class="margin-top">
      <el-table :data="ownerDetailAppUserInfo.appUsers" style="width: 100%">
0724714b   wuxw   优化业主详情页面
4
5
6
7
        <el-table-column prop="communityName" :label="$t('ownerDetailAppUser.communityName')"
          align="center"></el-table-column>
        <el-table-column prop="appUserName" :label="$t('ownerDetailAppUser.relatedOwner')"
          align="center"></el-table-column>
c85e0853   wuxw   业主详情开发完成
8
9
10
11
12
13
14
15
        <el-table-column prop="idCard" :label="$t('ownerDetailAppUser.idCard')" align="center"></el-table-column>
        <el-table-column prop="link" :label="$t('ownerDetailAppUser.phone')" align="center"></el-table-column>
        <el-table-column prop="stateName" :label="$t('ownerDetailAppUser.status')" align="center"></el-table-column>
        <el-table-column prop="createTime" :label="$t('ownerDetailAppUser.applyTime')" align="center"></el-table-column>
        <el-table-column prop="appTypeName" :label="$t('ownerDetailAppUser.appType')" align="center"></el-table-column>
        <el-table-column :label="$t('common.operation')" align="center" width="300">
          <template slot-scope="scope">
            <el-button-group>
0724714b   wuxw   优化业主详情页面
16
              <el-button size="mini" v-if="scope.row.state == '10000'"
c85e0853   wuxw   业主详情开发完成
17
18
19
20
                @click="_openAuditAppUserBindingOwnerModel(scope.row)">
                {{ $t('common.audit') }}
              </el-button>
              <el-button size="mini" @click="_deleteAppUserBindingOwnerModel(scope.row)">
d1f3b587   wuxw   v1.9 业主详情页面业主绑定按钮...
21
                {{ $t('common.delete') }}
c85e0853   wuxw   业主详情开发完成
22
23
              </el-button>
              <el-button size="mini" @click="_resetUserPwdModel(scope.row)">
d1f3b587   wuxw   v1.9 业主详情页面业主绑定按钮...
24
                {{ $t('auditAuthOwner.resetPwd') }}
c85e0853   wuxw   业主详情开发完成
25
26
27
28
29
              </el-button>
            </el-button-group>
          </template>
        </el-table-column>
      </el-table>
0724714b   wuxw   优化业主详情页面
30
31
      <el-pagination @current-change="handleCurrentChange" :current-page="pagination.currentPage"
        :page-size="pagination.pageSize" :total="pagination.total" layout="total, prev, pager, next, jumper">
c85e0853   wuxw   业主详情开发完成
32
33
34
      </el-pagination>
  
      <audit ref="audit" @auditMessage="auditMessage"></audit>
0724714b   wuxw   优化业主详情页面
35
36
      <delete-app-user-binding-owner ref="deleteAppUserBindingOwner"
        @refresh="_loadOwnerDetailAppUserData"></delete-app-user-binding-owner>
c85e0853   wuxw   业主详情开发完成
37
38
39
40
41
42
43
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
      <reset-staff-pwd ref="resetStaffPwd"></reset-staff-pwd>
    </div>
  </template>
  
  <script>
  import Audit from '@/components/staff/Audit'
  import DeleteAppUserBindingOwner from './DeleteAppUserBindingOwner'
  import ResetStaffPwd from '@/components/staff/resetStaffPwd'
  import { listAuditAppUserBindingOwners, updateAppUserBindingOwner } from '@/api/owner/ownerDetailAppUserApi'
  import { getCommunityId } from '@/api/community/communityApi'
  
  export default {
    name: 'OwnerDetailAppUser',
    components: {
      Audit,
      DeleteAppUserBindingOwner,
      ResetStaffPwd
    },
    data() {
      return {
        ownerDetailAppUserInfo: {
          appUsers: [],
          ownerId: '',
          name: '',
          currentAppUserId: ''
        },
        pagination: {
          currentPage: 1,
          pageSize: 10,
          total: 0
        }
      }
    },
    methods: {
      open(ownerId, ownerName, link) {
        this.ownerDetailAppUserInfo.ownerId = ownerId
        this.ownerDetailAppUserInfo.ownerName = ownerName
        this.ownerDetailAppUserInfo.link = link
        this._loadOwnerDetailAppUserData(1, this.pagination.pageSize)
      },
      _loadOwnerDetailAppUserData(page, row) {
        const params = {
          communityId: getCommunityId(),
          memberId: this.ownerDetailAppUserInfo.ownerId,
          name: this.ownerDetailAppUserInfo.name,
          page: page,
          row: row
        }
  
        listAuditAppUserBindingOwners(params).then(response => {
          this.ownerDetailAppUserInfo.appUsers = response.data
f9f29297   wuxw   v1.9 分页 record 传给...
88
          this.pagination.total = response.total
c85e0853   wuxw   业主详情开发完成
89
90
91
92
93
94
95
96
97
98
99
        }).catch(error => {
          console.error('请求失败处理', error)
        })
      },
      _openAuditAppUserBindingOwnerModel(auditAppUserBindingOwner) {
        this.ownerDetailAppUserInfo.currentAppUserId = auditAppUserBindingOwner.appUserId
        this.$refs.audit.open({})
      },
      _auditAppUserBindingOwner(auditInfo) {
        auditInfo.communityId = getCommunityId()
        auditInfo.appUserId = this.ownerDetailAppUserInfo.currentAppUserId
0724714b   wuxw   优化业主详情页面
100
  
c85e0853   wuxw   业主详情开发完成
101
        updateAppUserBindingOwner(auditInfo).then(() => {
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
102
          this.$message.success(this.$t('common.operationSuccess'))
c85e0853   wuxw   业主详情开发完成
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
          this._loadOwnerDetailAppUserData(1, this.pagination.pageSize)
        }).catch(error => {
          this.$message.error(this.$t('common.processFailed') + error)
        })
      },
      _deleteAppUserBindingOwnerModel(auditAppUserBindingOwner) {
        this.$refs.deleteAppUserBindingOwner.open(auditAppUserBindingOwner)
      },
      _resetUserPwdModel(staff) {
        this.$refs.resetStaffPwd.open(staff)
      },
      handleCurrentChange(val) {
        this._loadOwnerDetailAppUserData(val, this.pagination.pageSize)
      },
    },
    created() {
      this.$on('switch', (data) => {
        this.ownerDetailAppUserInfo.ownerId = data.ownerId
        this._loadOwnerDetailAppUserData(1, this.pagination.pageSize)
      })
    }
  }
  </script>