You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bsdgy-front/src/pages/shop/IncreaseStaffManagerBatchAd...

71 lines
2.1 KiB
Vue

<template>
<div>
<Row style="text-align: center;margin-bottom: 20px;">
<p>
导入说明请下载模板然后将资料填到模板中
<a @click="downLoadImportExcel"></a>
</p>
</Row>
<Upload
multiple
type="drag"
:action="uploadUrl" :on-success="upSuccess" :on-error="upError">
<div style="padding: 20px 0">
<Icon type="ios-cloud-upload" size="70" style="color: #3399ff"></Icon>
<p>将文件拖拽到此区域</p>
</div>
</Upload>
<Table style="margin-top: 30px" :columns="columns1" :data="data1"></Table>
</div>
</template>
<script>
import http from '../../services/CommonHttp';
export default {
name: "IncreaseStaffManagerBatchAdd",
data() {
return {
uploadUrl: http.getBaseUrl()+"/store/staff/upload",
data:{
},
columns1: [
{
title: '序号',
type: 'index',
width: 100,
align: 'center',
}, {
title: '错误信息',
key: 'error',
align: 'center',
},],
data1: []
}
},
mounted() {
},
methods: {
downLoadImportExcel(){
window.location.href = '/推广人员批量添加.xlsx'
},
upSuccess(response, res, file) {
console.log("1111");
if (!response.results) {
this.$message.info("上传成功")
} else {
let data = response.results;
this.data1 = data;
this.$message.info("上传失败,请查看错误信息")
}
},
upError(response) {
this.$message.info("上传失败,请稍后再试")
},
}
}
</script>
<style scoped>
</style>