|
|
@@ -35,7 +35,13 @@
|
|
|
:http-request="uploadRequest"
|
|
|
:show-file-list="false"
|
|
|
style="margin: 0 10px 10px 0 !important">
|
|
|
- <el-button v-permissions="['contract/target/import']" icon="el-icon-upload2" type="primary">导入</el-button>
|
|
|
+ <el-button
|
|
|
+ v-permissions="['contract/target/import']"
|
|
|
+ icon="el-icon-upload2"
|
|
|
+ :loading="importLoading"
|
|
|
+ type="primary">
|
|
|
+ 导入
|
|
|
+ </el-button>
|
|
|
</el-upload>
|
|
|
</vab-query-form-left-panel>
|
|
|
<vab-query-form-right-panel :span="12">
|
|
|
@@ -54,7 +60,7 @@
|
|
|
show-overflow-tooltip
|
|
|
:sortable="item.sortable">
|
|
|
<template #default="{ row }">
|
|
|
- <span v-if="item.prop.indexOf('完成率') >= 0">
|
|
|
+ <span v-if="item.label.indexOf('完成率') >= 0">
|
|
|
{{ row[item.prop] + '%' }}
|
|
|
</span>
|
|
|
<span v-else>{{ row[item.prop] }}</span>
|
|
|
@@ -86,6 +92,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ importLoading: false,
|
|
|
height: this.$baseTableHeight(3),
|
|
|
listLoading: false,
|
|
|
layout: 'total, sizes, prev, pager, next, jumper',
|
|
|
@@ -359,6 +366,7 @@
|
|
|
},
|
|
|
// 上传
|
|
|
uploadRequest(option) {
|
|
|
+ this.importLoading = true
|
|
|
let _this = this
|
|
|
let url = process.env.VUE_APP_UPLOAD_WEED
|
|
|
axios
|
|
|
@@ -372,8 +380,12 @@
|
|
|
excelUrl: fileUrl,
|
|
|
}
|
|
|
const [err, res] = await to(targetApi.importSaleTarget(params))
|
|
|
- if (err) return
|
|
|
+ if (err) {
|
|
|
+ this.importLoading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
if (res.code == 200) {
|
|
|
+ this.importLoading = false
|
|
|
_this.$message({
|
|
|
type: 'success',
|
|
|
message: '操作成功',
|
|
|
@@ -382,6 +394,7 @@
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
+ this.importLoading = false
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
message: '未上传成功!请刷新界面重新上传!',
|
|
|
@@ -389,6 +402,7 @@
|
|
|
}
|
|
|
})
|
|
|
.catch(function () {
|
|
|
+ this.importLoading = false
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
message: '未上传成功!请重新上传!',
|