修正征信维护列表筛选与上传展示逻辑
This commit is contained in:
@@ -1,13 +1,18 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function uploadCreditHtml(data) {
|
||||
export function uploadCreditHtml(files) {
|
||||
const formData = new FormData()
|
||||
files.forEach((file) => {
|
||||
formData.append('files', file)
|
||||
})
|
||||
|
||||
return request({
|
||||
url: '/ccdi/creditInfo/upload',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -31,9 +31,8 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否已维护">
|
||||
<el-select v-model="queryParams.maintained" clearable placeholder="请选择是否已维护" style="width: 240px">
|
||||
<el-select v-model="queryParams.maintained" placeholder="仅展示已维护数据" style="width: 240px">
|
||||
<el-option label="已维护" value="1" />
|
||||
<el-option label="未维护" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -53,7 +52,11 @@
|
||||
<el-table-column label="姓名" prop="name" align="center" />
|
||||
<el-table-column label="柜员号" prop="staffId" align="center" />
|
||||
<el-table-column label="身份证号" prop="idCard" align="center" />
|
||||
<el-table-column label="最近征信查询日期" prop="queryDate" align="center" width="160" />
|
||||
<el-table-column label="最近征信查询日期" align="center" width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ formatQueryDate(scope.row.queryDate) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="负债笔数" prop="debtCount" align="center" width="100" />
|
||||
<el-table-column label="负债总额" prop="debtTotalAmount" align="center" width="140" />
|
||||
<el-table-column label="民事案件笔数" prop="civilCnt" align="center" width="120" />
|
||||
@@ -130,7 +133,7 @@
|
||||
<el-dialog title="征信详情" :visible.sync="detailDialogVisible" width="960px" append-to-body>
|
||||
<div class="section-title">征信摘要</div>
|
||||
<el-row :gutter="16" class="detail-summary">
|
||||
<el-col :span="8">征信查询日期:{{ detailForm.queryDate || "-" }}</el-col>
|
||||
<el-col :span="8">征信查询日期:{{ formatQueryDate(detailForm.queryDate) }}</el-col>
|
||||
<el-col :span="8">负债笔数:{{ detailForm.debtCount || 0 }}</el-col>
|
||||
<el-col :span="8">负债总额:{{ detailForm.debtTotalAmount || 0 }}</el-col>
|
||||
</el-row>
|
||||
@@ -207,7 +210,7 @@ export default {
|
||||
name: undefined,
|
||||
staffId: undefined,
|
||||
idCard: undefined,
|
||||
maintained: undefined,
|
||||
maintained: "1",
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -239,7 +242,7 @@ export default {
|
||||
name: undefined,
|
||||
staffId: undefined,
|
||||
idCard: undefined,
|
||||
maintained: undefined,
|
||||
maintained: "1",
|
||||
};
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
@@ -274,12 +277,9 @@ export default {
|
||||
this.$modal.msgError("请先选择征信 HTML 文件");
|
||||
return;
|
||||
}
|
||||
const formData = new FormData();
|
||||
this.uploadFileList.forEach((file) => {
|
||||
formData.append("files", file.raw || file);
|
||||
});
|
||||
const files = this.uploadFileList.map((file) => file.raw || file);
|
||||
this.uploadSubmitting = true;
|
||||
return uploadCreditHtml(formData)
|
||||
return uploadCreditHtml(files)
|
||||
.then((response) => {
|
||||
const data = response.data || {};
|
||||
this.uploadResult = {
|
||||
@@ -289,6 +289,10 @@ export default {
|
||||
};
|
||||
this.failureList = data.failures || [];
|
||||
this.$modal.msgSuccess(response.msg || "上传成功");
|
||||
this.uploadFileList = [];
|
||||
if (this.$refs.upload) {
|
||||
this.$refs.upload.clearFiles();
|
||||
}
|
||||
this.getList();
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -302,7 +306,7 @@ export default {
|
||||
this.detailForm = {
|
||||
personId: data.personId || row.idCard,
|
||||
personName: data.personName || row.name,
|
||||
queryDate: negativeInfo.queryDate || row.queryDate,
|
||||
queryDate: data.queryDate || negativeInfo.queryDate || row.queryDate,
|
||||
debtCount: row.debtCount || (data.debtList || []).length,
|
||||
debtTotalAmount: row.debtTotalAmount || 0,
|
||||
civilCnt: negativeInfo.civilCnt || row.civilCnt || 0,
|
||||
@@ -327,6 +331,18 @@ export default {
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
formatQueryDate(value) {
|
||||
if (!value) {
|
||||
return "-";
|
||||
}
|
||||
if (typeof value === "string") {
|
||||
const matched = value.match(/^(\d{4}-\d{2}-\d{2})/);
|
||||
if (matched) {
|
||||
return matched[1];
|
||||
}
|
||||
}
|
||||
return this.parseTime(value, "{y}-{m}-{d}") || "-";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user