MrShi
2024-11-12 5ec088f7b2c1281a1874ef6ba4e783a64acb8079
company/src/components/business/authorizedEnterprise.vue
@@ -12,41 +12,55 @@
            border
            style="width: 100%">
            <el-table-column
                prop="date"
                prop="username"
                label="账号">
            </el-table-column>
            <el-table-column
                prop="name"
                prop="realname"
                label="姓名">
            </el-table-column>
            <el-table-column
                prop="address"
                prop="mobile"
                label="联系方式">
            </el-table-column>
            <el-table-column
                prop="address"
                width="200"
                prop="companyName"
                label="授权企业名称">
            </el-table-column>
            <el-table-column
                prop="address"
                prop="auditName"
                label="授权人">
            </el-table-column>
            <el-table-column
                prop="address"
                width="170"
                prop="createDate"
                label="授权时间">
            </el-table-column>
            <el-table-column
                prop="address"
                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 } from '@/api/business/companyUserApply'
  import { page, deleteById } from '@/api/business/companyPermission'
  export default {
    name: 'authorizedEnterprise',
    extends: BaseOpera,
@@ -54,22 +68,55 @@
    data () {
      return {
        model: {},
        tableData: []
        tableData: [],
        form: {
          page: 1,
          capacity: 10,
          model: {
            userId: null
          }
        },
        total: 0
      }
    },
    methods: {
      open (title, target) {
      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({
          capacity: 10,
          page: 1,
          model: {
            userId: ''
          }
        })
        page(this.form)
          .then(res => {
            console.log(res)
            this.total = res.total
            this.tableData = res.records
          })
      }
    }
  }