李林
2024-02-26 8d817b3847f9a96850c1a28f7923940697df7235
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<style scoped>
    .title {
        height: 60px;
        line-height: 60px;
    }
 
    .search {
        background-color: #fff;
        height: 80px;
        display: flex;
        align-items: center;
    }
 
    .search_thing {
        width: 350px;
        display: flex;
        align-items: center;
    }
 
    .search_label {
        width: 110px;
        font-size: 14px;
        text-align: right;
    }
 
    .search_input {
        width: calc(100% - 110px);
    }
 
    .table {
        margin-top: 10px;
        background-color: #fff;
        width: calc(100% - 40px);
        height: calc(100% - 60px - 80px - 10px - 40px);
        padding: 20px;
    }
</style>
<style>
    .registrant_count .el-table__row{
        height: 41px;
    }
</style>
 
<template>
    <div class="registrant_count">
        <div>
            <el-row class="title">
                <el-col :span="12" style="padding-left: 20px;">员工数据统计</el-col>
                <el-col :span="12" style="text-align: right;">
                    <el-button size="small" @click="$refs.ValueTable.openDownDia()" v-if="outPower">
                        <i class="el-icon-download" style="color: #3A7BFA;"></i>
                        <span style="color: #3A7BFA;">导出</span>
                    </el-button>
                </el-col>
            </el-row>
        </div>
        <div class="search">
            <div class="search_thing">
                <div class="search_label">客户名称:</div>
                <div class="search_input">
                    <el-select size="small" style="width: 100%;" placeholder="请选择" v-model="componentData.entity.name">
                        <el-option :value="null" label="全部"></el-option>
                        <el-option v-for="(a, ai) in custom" :key="ai" :label="a.name" :value="a.name"></el-option>
                    </el-select>
                </div>
            </div>
            <div class="search_thing">
                <div class="search_label">项目:</div>
                <div class="search_input">
                    <el-select size="small" style="width: 100%;" placeholder="请选择" v-model="componentData.entity.product">
                        <el-option :value="null" label="全部"></el-option>
                        <el-option v-for="(a, ai) in product" :key="ai" :label="a.product" :value="a.product"></el-option>
                    </el-select>
                </div>
            </div>
            <div class="search_thing" style="padding-left: 30px;">
                <el-button size="small" @click="refresh()">重 置</el-button>
                <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
            </div>
        </div>
        <div class="table">
            <ValueTable ref="ValueTable" :url="$api.dataReporting.selectRegistrantCountDtoPageList" :componentData="componentData" :key="upIndex" :downUrl="$api.dataReporting.downRegistrantCountFile"/>
        </div>
    </div>
</template>
 
<script>
    import ValueTable from '../tool/value-table.vue'
    export default {
        components: {
            ValueTable
        },
        data() {
            return {
                componentData: {
                    entity: {
                        name: null,
                        product: null,
                        orderBy: {
                            field: 'create_time',
                            order: 'desc'
                        }
                    },
                    isIndex: false,
                    showSelect: false,
                    select: true,
                    do: [],
                    tagField: {}
                },
                entityCopy: {},
                upIndex: 0,
                addDia: false,
                product: [],
                custom:[],
                outPower: true
            }
        },
        mounted() {
            this.entityCopy = this.HaveJson(this.componentData.entity)
            this.selectProductEnumList()
            this.selectCustomEnumList()
            this.getPower()
        },
        methods: {
            refreshTable() {
                this.$refs['ValueTable'].selectList()
            },
            refresh() {
                this.componentData.entity = this.HaveJson(this.entityCopy)
                this.upIndex++
            },
            selectProductEnumList(){
                this.$axios.get(this.$api.enums.selectProductEnumList).then(res=>{
                    this.product = res.data
                })
            },
            selectCustomEnumList(){
                this.$axios.get(this.$api.enums.selectCustomEnumList).then(res=>{
                    this.custom = res.data
                })
            },
            // 权限分配
            getPower() {
                let power = JSON.parse(sessionStorage.getItem('power'))
                let outPower = false
                for (var i = 0; i < power.length; i++) {
                    if (power[i].menuMethod == 'downRegistrantCountFile') {
                        outPower = true
                    }
                }
                this.outPower = outPower
            }
        }
    }
</script>