|
@@ -130,6 +130,11 @@ export default {
|
|
|
this.uploadData = null
|
|
|
}
|
|
|
},
|
|
|
+ resetSearchForm () {
|
|
|
+ this.$refs.table.clearTable() // 清空列表数据
|
|
|
+ this.$refs.importUpload.setFileList() // 清空导入文件
|
|
|
+ this.uploadData = null // 清空上传数据
|
|
|
+ },
|
|
|
// 确认导入
|
|
|
handleConfirm () {
|
|
|
const _this = this
|
|
@@ -142,9 +147,7 @@ export default {
|
|
|
stockImportFinish({ stockImportSn: _this.uploadData && _this.uploadData.stockImportSn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
- _this.$refs.table.clearTable() // 清空列表数据
|
|
|
- _this.$refs.importUpload.setFileList() // 清空导入文件
|
|
|
- _this.uploadData = null // 清空上传数据
|
|
|
+ _this.resetSearchForm()
|
|
|
_this.spinning = false
|
|
|
} else {
|
|
|
_this.spinning = false
|
|
@@ -165,9 +168,7 @@ export default {
|
|
|
stockImportCancel({ stockImportSn: _this.uploadData && _this.uploadData.stockImportSn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
- _this.$refs.table.clearTable() // 清空列表数据
|
|
|
- _this.$refs.importUpload.setFileList() // 清空导入文件
|
|
|
- _this.uploadData = null // 清空上传数据
|
|
|
+ _this.resetSearchForm()
|
|
|
_this.spinning = false
|
|
|
} else {
|
|
|
_this.spinning = false
|
|
@@ -229,6 +230,12 @@ export default {
|
|
|
}, 400)
|
|
|
}
|
|
|
},
|
|
|
+ activated () {
|
|
|
+ // 如果是新页签打开,则重置当前页面
|
|
|
+ if (this.$store.state.app.isNewTab) {
|
|
|
+ this.resetSearchForm()
|
|
|
+ }
|
|
|
+ },
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
next(vm => {})
|
|
|
}
|