MrShi
2024-11-12 5ec088f7b2c1281a1874ef6ba4e783a64acb8079
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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<template>
    <GlobalWindow
        :title="title"
        width="100%"
        :withFooter="false"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
    >
        <el-table
            :data="tableData"
            border
            style="width: 100%">
            <el-table-column
                prop="username"
                label="账号">
            </el-table-column>
            <el-table-column
                prop="realname"
                label="姓名">
            </el-table-column>
            <el-table-column
                prop="mobile"
                label="联系方式">
            </el-table-column>
            <el-table-column
                width="200"
                prop="companyName"
                label="授权企业名称">
            </el-table-column>
            <el-table-column
                prop="auditName"
                label="授权人">
            </el-table-column>
            <el-table-column
                width="170"
                prop="createDate"
                label="授权时间">
            </el-table-column>
            <el-table-column
                label="操作">
                <template slot-scope="{row}">
                    <el-button type="text" @click="cancel(row.id)">取消授权</el-button>
                </template>
            </el-table-column>
        </el-table>
        <div style="width: 100%; height: 15px;"></div>
        <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="form.page"
            :page-sizes="[10, 30, 50, 100]"
            :page-size="form.size"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total">
        </el-pagination>
    </GlobalWindow>
</template>
 
<script>
  import BaseOpera from '@/components/base/BaseOpera'
  import GlobalWindow from '@/components/common/GlobalWindow'
  import { page, deleteById } from '@/api/business/companyPermission'
  export default {
    name: 'authorizedEnterprise',
    extends: BaseOpera,
    components: { GlobalWindow },
    data () {
      return {
        model: {},
        tableData: [],
        form: {
          page: 1,
          capacity: 10,
          model: {
            userId: null
          }
        },
        total: 0
      }
    },
    methods: {
      cancel(id) {
        this.$confirm('确定取消授权该企业吗?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          deleteById(id)
            .then(res => {
              this.getList()
            })
        }).catch(() => {
 
        });
      },
      handleSizeChange(e) {
        this.form.capacity = e
        this.getList()
      },
      handleCurrentChange(e) {
        this.form.page = e
        this.getList()
      },
      open (title, id) {
        this.title = title
        this.visible = true
        this.form.page = 1
        this.form.capacity = 10
        this.form.model.userId = id
        this.getList()
      },
      getList() {
        page(this.form)
          .then(res => {
            console.log(res)
            this.total = res.total
            this.tableData = res.records
          })
      }
    }
  }
</script>
 
<style lang="scss" scoped>
 
</style>