From 90bc8df34f290907a3ee01d05a9df5ca62b2cacc Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期三, 05 七月 2023 17:47:39 +0800 Subject: [PATCH] 修改列表展示 --- Source/UBCS-WEB/src/components/BatchImport/index.vue | 29 ++++++++++++++++++++--------- 1 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Source/UBCS-WEB/src/components/BatchImport/index.vue b/Source/UBCS-WEB/src/components/BatchImport/index.vue index b517e50..b794d20 100644 --- a/Source/UBCS-WEB/src/components/BatchImport/index.vue +++ b/Source/UBCS-WEB/src/components/BatchImport/index.vue @@ -49,6 +49,7 @@ :on-exceed="handleExceed" :headers="uploadHeaders" :on-success="onSuccess" + :on-error="onError" :show-file-list="false" :on-change="uploadChange" :data="upParams" @@ -84,7 +85,7 @@ import { downloadHistoryImportTemplate, downloadErrorFile, - getHistoryLeftTree, + importDataShow, downloadBatchImportApplyTemplate, downloadBatchApplyCodeTemplate, } from "../../api/batchImport/index"; @@ -168,6 +169,7 @@ leftTree: [], redisOid: "", pageLoading: null, + showCodeApply: false, currentTypeObj: { historyImport: { title: "鍘嗗彶鏁版嵁瀵煎叆", @@ -214,11 +216,11 @@ this.$message.error("鍙厑璁镐笂浼爔lsx銆亁ls鏍煎紡鐨勬枃浠�"); return Promise.reject(false); } - if (this.type === "batchImportApply") { - const flag = await this.$refs.CodeApply.validate(); - if (!flag) { - return Promise.reject(false); - } + if (this.type === "batchImportApply" && this.showCodeApply) { + // const flag = await this.$refs.CodeApply.validate(); + // if (!flag) { + // return Promise.reject(false); + // } } this.pageLoading = this.$loading({ lock: true, @@ -243,8 +245,13 @@ }); }, onSuccess(res) { - let fileName = res.data.filePath.split("/").pop(); + if (Object.keys(res.data).length === 0) { + this.$message.success(this.title + '瀵煎叆鎴愬姛锛�') + this.dialogVisible = false + return + } if (res.data.fileOid) { + const fileName = res.data.filePath.split("/").pop(); this.$message.error("璇蜂笅杞介敊璇俊鎭枃浠惰繘琛屾煡鐪嬶紒"); downloadErrorFile({ uuid: res.data.fileOid }).then((res2) => { this.$utilFunc.downloadFileByBlob(res2.data, fileName); @@ -252,8 +259,8 @@ } if (res.data.redisUuid) { this.redisOid = res.data.redisUuid; - getHistoryLeftTree(res.data.redisUuid).then((res) => { - this.leftTree = res.obj.map((item) => { + importDataShow(res.data.redisUuid).then((res2) => { + this.leftTree = res2.data.data.map((item) => { return { ...item.codeClassifyTemplateVO, cloNamesList: item.cloNamesList, @@ -263,6 +270,10 @@ }); } }, + onError(err) { + console.log(err, 'err'); + this.pageLoading.close(); + }, uploadChange(file) { if (file.status === "success" || file.status === "error") { this.pageLoading.close(); -- Gitblit v1.9.3