Blame view

src/components/staff/AOwnerDetailAppUser.vue 3.83 KB
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
1
  <template>
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
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
49
50
51
52
53
54
    <div class="owner-detail-app-user-container">
      <el-table :data="appUsers" border style="width: 100%">
        <el-table-column prop="communityName" :label="$t('ownerDetailAppUser.communityName')" align="center"></el-table-column>
        <el-table-column prop="appUserName" :label="$t('ownerDetailAppUser.appUserName')" align="center"></el-table-column>
        <el-table-column prop="idCard" :label="$t('ownerDetailAppUser.idCard')" align="center"></el-table-column>
        <el-table-column prop="link" :label="$t('ownerDetailAppUser.link')" align="center"></el-table-column>
        <el-table-column prop="stateName" :label="$t('ownerDetailAppUser.state')" align="center"></el-table-column>
        <el-table-column prop="createTime" :label="$t('ownerDetailAppUser.createTime')" align="center"></el-table-column>
        <el-table-column prop="appTypeName" :label="$t('ownerDetailAppUser.appType')" align="center">
          <template slot-scope="scope">
            {{ scope.row.appTypeName || '-' }}
          </template>
        </el-table-column>
        <el-table-column prop="openId" :label="$t('ownerDetailAppUser.openId')" align="center"></el-table-column>
        <el-table-column :label="$t('common.operation')" align="center" width="150">
          <template slot-scope="scope">
            <el-button 
              v-if="scope.row.ownerId && scope.row.ownerId !== '-1'"
              size="mini" 
              @click="toOwnerDetail(scope.row)">
              {{ $t('ownerDetailAppUser.ownerDetail') }}
            </el-button>
          </template>
        </el-table-column>
      </el-table>
  
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="page.current"
        :page-sizes="[10, 20, 30, 50]"
        :page-size="page.size"
        layout="total, sizes, prev, pager, next, jumper"
        :total="page.total">
      </el-pagination>
    </div>
  </template>
  
  <script>
  import { listAdminAppUserOwners, updateAppUserBindingOwner } from '@/api/staff/systemUserDetailApi'
  
  export default {
    name: 'AOwnerDetailAppUser',
    props: {
      userId: {
        type: String,
        required: true
      }
    },
    data() {
      return {
        appUsers: [],
        currentAppUserId: '',
f6a81350   wuxw   运营 业主详情开发完成
55
        ownerId: '',
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
56
57
58
59
60
61
62
63
        page: {
          current: 1,
          size: 10,
          total: 0
        }
      }
    },
    methods: {
f6a81350   wuxw   运营 业主详情开发完成
64
65
66
67
      open(params) {
        this.ownerId = params.ownerId
        this.loadData()
      },
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
68
69
70
71
72
      async loadData() {
        try {
          const params = {
            page: this.page.current,
            row: this.page.size,
f6a81350   wuxw   运营 业主详情开发完成
73
74
            systemUserId: this.userId,
            ownerId: this.ownerId
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
          }
          const res = await listAdminAppUserOwners(params)
          if (res.code === 0) {
            this.appUsers = res.data
            this.page.total = res.total
          }
        } catch (error) {
          this.$message.error(this.$t('common.loadFailed'))
        }
      },
      handleSizeChange(val) {
        this.page.size = val
        this.loadData()
      },
      handleCurrentChange(val) {
        this.page.current = val
        this.loadData()
      },
      toOwnerDetail(row) {
f6a81350   wuxw   运营 业主详情开发完成
94
        window.open(`/#/views/aCommunity/adminOwnerDetail?ownerId=${row.ownerId}`)
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
95
96
97
98
99
100
101
102
103
104
105
106
107
      },
      openAuditModal(appUserId) {
        this.currentAppUserId = appUserId
        this.$emit('openAuditModal')
      },
      async handleAudit(auditInfo) {
        try {
          const data = {
            ...auditInfo,
            appUserId: this.currentAppUserId
          }
          const res = await updateAppUserBindingOwner(data)
          if (res.code === 0) {
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
108
            this.$message.success(this.$t('common.operationSuccess'))
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
            this.loadData()
          } else {
            this.$message.error(res.msg || this.$t('common.handleFailed'))
          }
        } catch (error) {
          this.$message.error(this.$t('common.handleFailed'))
        }
      }
    }
  }
  </script>
  
  <style scoped>
  .owner-detail-app-user-container {
    margin-top: 20px;
  }
  </style>