From 08a576cfe45f04abaaca0137d6ebe331327ea0e4 Mon Sep 17 00:00:00 2001 From: yuejiayang <146344614+YangLei105@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:58:18 +0800 Subject: [PATCH] 12.13 Part Export --- src/views/modules/part/external.vue | 42 ++++++++++++++++++----------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/src/views/modules/part/external.vue b/src/views/modules/part/external.vue index 295f492..9b1a1ce 100644 --- a/src/views/modules/part/external.vue +++ b/src/views/modules/part/external.vue @@ -1264,19 +1264,31 @@ export default { this.$message.error("请先上传文件!") return false } - this.isLoading = true - const formData = new FormData() - formData.append("file", this.fileList[0].raw) - formData.append("createBy", this.$store.state.user.name) - formData.append("site", this.$store.state.user.site.toString()) - savePartInfoByExcel(formData).then(({data}) => { - if (data.code === 0) { - // 关闭窗口并刷新页面 - this.provisionalDataDialogHandle() - } else { - this.isLoading = false - this.$message.warning(data.msg) - } + // 提示将删除之前的数据 + this.$confirm('Do you confirm the upload? If the Part Info already exists, we will delete it!', 'Warning', { + confirmButtonText: 'OK', + cancelButtonText: 'Cancel', + type: 'warning' + }).then(() => { + const formData = new FormData() + formData.append("file", this.fileList[0].raw) + formData.append("createBy", this.$store.state.user.name) + formData.append("site", this.$store.state.user.site.toString()) + this.isLoading = true + savePartInfoByExcel(formData).then(({data}) => { + if (data.code === 0) { + // 关闭窗口并刷新页面 + this.provisionalDataDialogHandle() + } else { + this.isLoading = false + this.$message.warning(data.msg) + } + }) + }).catch(() => { + this.$message({ + type: 'info', + message: 'Cancel upload' + }) }) }, @@ -1643,7 +1655,7 @@ export default { - + @@ -1662,7 +1674,7 @@ export default { - {{ isLoading ? 'Saving...' : 'Save' }} + {{ isLoading ? 'Saving...' : 'Save' }} Cancel