调整征信导入入口跳转到征信维护页面

This commit is contained in:
wkc
2026-03-24 13:59:36 +08:00
parent f4481792c8
commit 47eed3e63c
7 changed files with 374 additions and 130 deletions

View File

@@ -27,7 +27,7 @@
size="small"
icon="el-icon-upload2"
:disabled="isProjectTagging"
@click="handleOpenCreditUpload"
@click="handleGoCreditInfoPage"
>
征信导入
</el-button>
@@ -167,41 +167,6 @@
</div> -->
</div>
<el-dialog
v-if="showCreditUploadDialog"
title="征信导入"
:visible.sync="showCreditUploadDialog"
:close-on-click-modal="false"
width="500px"
>
<el-upload
class="upload-area"
drag
action="#"
:disabled="isProjectTagging"
:auto-upload="false"
:on-change="handleCreditFileChange"
:file-list="creditFileList"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">
支持 HTML 格式文件
</div>
</el-upload>
<span slot="footer">
<el-button @click="showCreditUploadDialog = false">取消</el-button>
<el-button
type="primary"
:disabled="isProjectTagging"
:loading="creditUploading"
@click="handleConfirmCreditUpload"
>
确定
</el-button>
</span>
</el-dialog>
<el-dialog
title="拉取本行信息"
:visible.sync="pullBankInfoDialogVisible"
@@ -354,11 +319,9 @@
<script>
import {
getImportStatus,
getUploadStatus,
pullBankInfo,
parseIdCardFile,
uploadFile,
batchUploadFiles,
getFileUploadList,
getFileUploadStatistics,
@@ -397,9 +360,6 @@ export default {
currentMenuTitle: "上传数据",
// 圆环周长
circumference: 2 * Math.PI * 14,
showCreditUploadDialog: false,
creditFileList: [],
creditUploading: false,
pullBankInfoDialogVisible: false,
pullBankInfoLoading: false,
parsingIdCardFile: false,
@@ -619,12 +579,11 @@ export default {
}
this.$emit("menu-change", { key: "overview", route: "overview" });
},
handleOpenCreditUpload() {
handleGoCreditInfoPage() {
if (this.isProjectTagging) {
return;
}
this.creditFileList = [];
this.showCreditUploadDialog = true;
this.$router.push("/maintain/creditInfo");
},
/** 上传卡片点击 */
handleUploadClick(key) {
@@ -636,90 +595,6 @@ export default {
this.selectedFiles = [];
}
},
handleCreditFileChange(file, fileList) {
this.creditFileList = fileList.slice(-1);
},
async handleConfirmCreditUpload() {
if (this.isProjectTagging) {
this.$message.warning("项目正在进行银行流水打标,暂不可上传或拉取数据");
return;
}
if (this.creditFileList.length === 0) {
this.$message.warning("请选择要上传的文件");
return;
}
this.creditUploading = true;
try {
const res = await uploadFile(
this.projectId,
"CREDIT",
this.creditFileList[0].raw
);
this.showCreditUploadDialog = false;
this.$message.success("征信文件上传成功,正在处理中...");
this.$emit("data-uploaded", { type: "credit" });
await this.loadUploadStatus();
this.pollCreditImportStatus(res && res.data);
} catch (error) {
this.$message.error("征信上传失败:" + (error.msg || "未知错误"));
} finally {
this.creditUploading = false;
this.creditFileList = [];
}
},
async pollCreditImportStatus(taskId) {
if (!taskId) {
return;
}
const maxAttempts = 20;
let attempts = 0;
const poll = async () => {
if (attempts >= maxAttempts) {
this.$message.warning("征信导入处理超时,请稍后查看");
return;
}
try {
const res = await getImportStatus(taskId);
const status = res.data;
if (!status) {
attempts += 1;
setTimeout(poll, 30000);
return;
}
if (status.uploadStatus === "SUCCESS") {
await this.loadUploadStatus();
this.$message.success("征信导入处理完成");
return;
}
if (status.uploadStatus === "FAILED") {
await this.loadUploadStatus();
this.$message.error(
"征信导入处理失败:" + (status.errorMessage || "未知错误")
);
return;
}
attempts += 1;
setTimeout(poll, 30000);
} catch (error) {
console.error("轮询征信导入状态失败:", error);
attempts += 1;
setTimeout(poll, 30000);
}
};
poll();
},
async loadUploadStatus() {
try {
const res = await getUploadStatus(this.projectId);