gaoshp
2024-06-03 6f1ac1da6b6cba5c74f2fb6be82f7e472c4116ee
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
<template>
    <span>
        <el-button type="primary" @click="openimport">导入</el-button>
        <el-dialog title="导入" v-model="visible" :width="900">
            <h6><span>1</span>准备数据</h6>
            <span class="desc">导入的数据个数需小于200,所有允许导入的字段请参考模板;
                <span class="bolder">字段不符合规则,整条数据不予以导入</span>
                <span class="more" @click="showDest = !showDest">更多字段导入规则&gt</span>
            </span>
            <div class="text-desc" :class="{showDest: showDest}">
                <ul class="tip">
                    <li>1、员工工号:必填;工号不可重复;支持大小写字母、数字组合;</li>
                    <li>2、员工姓名:必填;如果重名,建议加数字区分,如“张三1”;</li>
                    <li>3、状态:必填;选择在职/离职;</li>
                    <li>4、电话:必填;在本企业内不可重复;</li>
                    <li>5、PIN码:必填;支持4-6位数字;</li>
                    <li>6、岗位:非必填;可以填入多个岗位,以英文逗号‘,’间隔;不可重名;</li>
                    <li>7、邮箱:非必填;邮箱格式校验,比如“***@126.com”;</li>
                    <li>8、部门:非必填;请填写部门完整层级;中间间隔,请用英文符号”-“间隔。如”xx公司-xx部门-xx“</li>
                    <li>9、入职日期:非必填;日期格式“YY-MM-DD”</li>
                </ul>
            </div>
            <div class="exportBtn" @click="exportBtn">下载模板</div>
            <h6 class="marTop8"><span>2</span>上传数据文件</h6>
            <div class="uploadBtn">
                <el-upload class="upload" :action="uploadUrl">
                    <el-button type="primary">上传文件</el-button>
                </el-upload>
                <div class="uploadBtn-desc">目前支持的文件类型为.xls,.xlsx</div>
            </div>
              <template #footer>
                <el-button @click="visible=false" >取 消</el-button>
            </template>
        </el-dialog>
    </span>
</template>
 
<script>
    export default {
        data() {
            return {
                visible: false,
                showDest: true
            }
        },
        mounted() {
            
        },
        props: {
            exportUrl: {type: String, default: true },
            uploadUrl: {type: String, default: true }
        },
        methods: {
            exportBtn() {
                this.$HTTP.get(this.exportUrl).then(res=> {
                    if(res.code == 200) {
                        window.open(res.data.link);
                    }
                })
            },
            openimport() {
                this.visible = true;
            }
        }
    }
</script>
 
<style scoped>
.showDest {
    display: none;
}
.desc {
    color: #333;
    font-size: 14px;
    padding-left: 25px;
}
.tip {
    list-style: none;
    margin-left: 40px;
    margin-top: 8px;
    font-size: 12px;
}
.desc .bolder {
    font-weight: bolder;
}
h6 {
    font-size: 14px;
    margin-bottom:8px;
}
h6 span:nth-child(1) {
    border-radius: 50%;
    border: 1px solid;
    text-align: center;
    background: #fff;
    width: 20px;
    height: 20px;
    font-size: 14px;
    display: inline-block;
    margin-right:8px;
}
.more {
    color:#62a5a5;
    cursor: pointer;
}
.marTop8 {
    margin-top: 8px;
}
.uploadBtn {
    padding-left: 25px;
    padding-top: 4px;
}
.uploadBtn-desc {
    margin-top:6px;
    font-size: 12px;
}
.exportBtn {
    color: #4f9999;
    cursor: pointer;
    margin-left: 40px;
    margin-top: 8px;
}
</style>