作者 小范

进港快件数据导入界面新增loading

... ... @@ -18,7 +18,12 @@
:limit=1
:on-exceed="fileExceed"
accept="application/vnd.ms-excel,application/vnd.ms-excels"
ref="fileupload">
ref="fileupload"
v-loading.fullscreen.lock="loading"
element-loading-text="正在上传原始数据"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0,0,0,0.3)"
>
<el-button size="medium" type="primary">点击上传原始数据</el-button>
<div slot="tip" class="el-upload__tip">只能上传excel文件</div>
</el-upload>
... ... @@ -31,7 +36,11 @@
:limit=1
:on-exceed="fileExceed2"
accept="application/vnd.ms-excel,application/vnd.ms-excels"
ref="fileupload">
ref="fileupload"
v-loading.fullscreen.lock="loadings"
element-loading-text="正在上传理货数据"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0,0,0,0.3)">
<el-button size="medium" type="success">点击上传理货数据</el-button>
<div slot="tip" class="el-upload__tip">只能上传excel文件</div>
</el-upload>
... ... @@ -47,6 +56,10 @@
p{font-size:25px;font-weight: bold;}
.row-bg{padding:30px 0;}
.el-form-item {margin-bottom: 0px;}
.el-loading-spinner{
top:60%;
width: 120%;
}
</style>
<script>
... ... @@ -54,6 +67,8 @@
export default {
data() {
return {
loading:false,
loadings:false,
fileList: [],
};
},
... ... @@ -64,12 +79,15 @@
},
// 自定义上传 excel
uploadOri (item) {
this.loading = true;
const form = new FormData()
form.append('file', item.file);
upfile(form).then(res =>{
if(res.data.count >0){
this.loading = false;
return this.$message.error('主单导入失败')
}else {
this.loading = false;
this.$message.success('主单导入成功')
}
}).catch((e) => {})
... ... @@ -80,12 +98,15 @@
},
// 自定义上传 excel
uploadTal (item) {
this.loadings = true;
const form = new FormData()
form.append('file', item.file);
upfiles(form).then(res =>{
if(res.data.count >0){
this.loadings = false;
return this.$message.error('主单导入失败')
}else {
this.loadings = false;
this.$message.success('主单导入成功')
}
}).catch((e) => {})
... ...