k94314517
2024-11-29 d1c205d29b5eacf1de22a7af29329ca370d1c2d3
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
<template>
    <TableLayout :permissions="['business:companyuserapply:query']">
        <!-- 搜索表单 -->
        <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
            <el-form-item label="申请状态" prop="status">
                <el-select v-model="searchForm.status" @change="search" placeholder="请选择">
                    <el-option label="待审核" :value="0"></el-option>
                    <el-option label="审核通过" :value="1"></el-option>
                    <el-option label="审核不通过" :value="2"></el-option>
                </el-select>
            </el-form-item>
            <section>
                <el-button type="primary" @click="search">搜索</el-button>
                <el-button @click="reset">重置</el-button>
            </section>
        </el-form>
        <!-- 表格和分页 -->
        <template v-slot:table-wrap>
            <ul class="toolbar" v-permissions="['business:companyuserapply:create']" v-if="userInfo.type === 1">
                <li><el-button type="primary" @click="$refs.operaCompanyUserApplyWindow.open('新建申请')" icon="el-icon-plus" v-permissions="['business:companyuserapply:create']">新建</el-button></li>
            </ul>
            <el-table
                v-loading="isWorking.search"
                :data="tableData.list"
                stripe
            >
                <el-table-column label="序号" width="80px">
                    <template slot-scope="scope">
                        <span>{{scope.$index + 1}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="realName" label="申请人"></el-table-column>
                <el-table-column prop="userName" label="授权账号"></el-table-column>
                <el-table-column prop="content" label="申请说明"></el-table-column>
                <el-table-column prop="createDate" label="申请时间"></el-table-column>
                <el-table-column label="申请状态">
                    <template slot-scope="{row}">
                        <span style="color: #216EEE;" v-if="row.status === 0">待审核</span>
                        <span style="color: #00BA92;" v-if="row.status === 1">审核通过</span>
                        <span style="color: red;" v-if="row.status === 2">审核不通过</span>
                    </template>
                </el-table-column>
                <el-table-column
                    label="操作"
                    min-width="120"
                    fixed="right"
                >
                    <template slot-scope="{row}">
                        <el-button type="text" @click="$refs.operaCompanyUserApplyDescWindow.open('申请记录详情', row.id)" icon="el-icon-view">查看</el-button>
                        <el-button type="text" v-if="userInfo.type === 0 && row.status === 0" @click="$refs.operaCompanyUserApplyCarefulWindow.open('集团申请记录审核', row.id)">审核</el-button>
                        <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-if="userInfo.type === 1 && row.status === 0" v-permissions="['business:companyuserapply:delete']">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <pagination
                @size-change="handleSizeChange"
                @current-change="handlePageChange"
                :pagination="tableData.pagination"
            >
            </pagination>
        </template>
        <!-- 新建/修改 -->
        <OperaCompanyUserApplyWindow ref="operaCompanyUserApplyWindow" @success="handlePageChange"/>
        <!--    查看    -->
        <operaCompanyUserApplyDescWindow ref="operaCompanyUserApplyDescWindow" />
        <!--    审核    -->
        <OperaCompanyUserApplyCarefulWindow ref="operaCompanyUserApplyCarefulWindow" @success="handlePageChange"/>
    </TableLayout>
</template>
 
<script>
  import BaseTable from '@/components/base/BaseTable'
  import TableLayout from '@/layouts/TableLayout'
  import Pagination from '@/components/common/Pagination'
  import OperaCompanyUserApplyCarefulWindow from '@/components/business/OperaCompanyUserApplyCarefulWindow'
  import OperaCompanyUserApplyWindow from '@/components/business/OperaCompanyUserApplyWindow'
  import operaCompanyUserApplyDescWindow from '@/components/business/operaCompanyUserApplyDescWindow'
  import { mapState } from 'vuex'
  export default {
    name: 'CompanyUserApply',
    extends: BaseTable,
    components: { TableLayout, Pagination, OperaCompanyUserApplyWindow, operaCompanyUserApplyDescWindow, OperaCompanyUserApplyCarefulWindow },
    computed: {
      ...mapState(['userInfo'])
    },
    data () {
      return {
        // 搜索
        searchForm: {
          status: ''
        }
      }
    },
    created () {
      this.config({
        module: '集团申请记录表',
        api: '/business/companyUserApply',
        'field.id': 'id',
        'field.main': 'id'
      })
      this.search()
    }
  }
</script>