+
+
-
-
-
+
- handleQualificationUploadSuccess(file, row)"
- />
+ {{ row.originalName || row.name || '-' }}
@@ -655,15 +645,59 @@
+
+
+
+ 支持pdf、bmp、jpeg、png、jpg、doc、docx、ppt、pptx、xlsx、xls、eml、msg、zip,单个文件不超过500M
+
+
-
-
+
+
-
+
+
+
+
+
@@ -1067,7 +1101,7 @@
- {{ formatScoreValue(detail.selfScore) }}分
+ {{ formatScoreValue(getSignedScore(detail, 'selfScore')) }}分
@@ -1075,9 +1109,13 @@
handleScoreDetailScoreInput(detail, 'reviewScore', value)"
>
+
+ -
+
分
@@ -1089,8 +1127,8 @@
{{ row.categoryName }}
- 自评:{{ row.selfScore }}分
- 复评:{{ row.reviewScore }}分
+ 自评:{{ getSignedScore(row, 'selfScore') }}分
+ 复评:{{ getSignedScore(row, 'reviewScore') }}分
@@ -1113,12 +1151,17 @@
button-text="上传附件"
button-icon="el-icon-upload"
:show-tip="false"
+ :show-uploading="true"
@success="handleScoreAttachmentUploadSuccess"
/>
-
+
+
+ {{ row.originalName || row.name || '-' }}
+
+
@@ -1137,7 +1180,7 @@
-
+
删除
@@ -1164,6 +1207,7 @@
import {
getList,
getDetail,
+ getChangeRecordList,
submit,
submitApproval,
withdrawApproval,
@@ -1294,6 +1338,13 @@ export default {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
+ changeRecordPage: {
+ currentPage: 1,
+ pageSize: 5,
+ pageSizes: [5],
+ total: 0,
+ records: [],
+ },
contactIndex: -1,
contactForm: this.emptyContact(),
contactMapBox: false,
@@ -1310,6 +1361,8 @@ export default {
invoiceIndex: -1,
invoiceForm: this.emptyInvoice(),
qualificationFiles: [],
+ qualificationUploadFiles: [],
+ selectedQualificationFiles: [],
deptTree: [],
deptOptions: [],
regionOptions: [],
@@ -1317,6 +1370,7 @@ export default {
customerTypeOptions: [],
businessScopeOptions: [],
bankListOptions: [],
+ qualificationTypeOptions: [],
creditLevelOptions: ['A', 'B', 'C', 'D', 'E', 'F'].map(item => ({
label: `${item}级`,
value: `${item}级`,
@@ -1643,14 +1697,14 @@ export default {
},
scoreTableData() {
const start = (this.scorePage.currentPage - 1) * this.scorePage.pageSize;
- return this.scoreList
+ return this.sortScoresByLatest(this.scoreList)
.slice(start, start + this.scorePage.pageSize)
- .map((item, index) => ({
- ...item,
- __raw: item,
- __rawIndex: start + index,
- __index: start + index + 1,
- maxCreditLimit: item.maxCreditLimit || '',
+ .map(({ score, index }, pageIndex) => ({
+ ...score,
+ __raw: score,
+ __rawIndex: index,
+ __index: start + pageIndex + 1,
+ maxCreditLimit: score.maxCreditLimit || '',
}));
},
contactPaginationPage() {
@@ -1770,6 +1824,43 @@ export default {
this.handleDetailCurrentChange('receipt', 1);
this.handleDetailCurrentChange('invoice', 1);
},
+ loadChangeRecords() {
+ if (!this.archiveForm.id) return;
+ const page = this.changeRecordPage;
+ getChangeRecordList(this.archiveForm.id, page.currentPage, page.pageSize).then(res => {
+ const data = res.data.data || {};
+ page.records = data.records || [];
+ page.total = Number(data.total || 0);
+ page.currentPage = Number(data.current || page.currentPage);
+ });
+ },
+ handleChangeRecordCurrentChange(currentPage) {
+ this.changeRecordPage.currentPage = Number(currentPage) || 1;
+ this.loadChangeRecords();
+ },
+ handleChangeRecordSizeChange(pageSize) {
+ this.changeRecordPage.pageSize = Number(pageSize) || 5;
+ this.changeRecordPage.currentPage = 1;
+ this.loadChangeRecords();
+ },
+ resetChangeRecordPage() {
+ this.changeRecordPage.currentPage = 1;
+ this.changeRecordPage.total = 0;
+ this.changeRecordPage.records = [];
+ },
+ changeRecordIndex(index) {
+ return (this.changeRecordPage.currentPage - 1) * this.changeRecordPage.pageSize + index + 1;
+ },
+ formatChangeData(row, column, value) {
+ if (!value) return '-';
+ try {
+ return Object.entries(JSON.parse(value))
+ .map(([field, fieldValue]) => `${field}:${fieldValue ?? '-'}`)
+ .join(';');
+ } catch (error) {
+ return value;
+ }
+ },
emptyContact() {
return {
contactName: '',
@@ -1958,6 +2049,7 @@ export default {
});
this.loadDictOptions('scope_of_business', 'businessScopeOptions');
this.loadDictOptions('bank_list', 'bankListOptions');
+ this.loadDictOptions('customer_attachment_types', 'qualificationTypeOptions');
},
initScoreQuantificationOptions() {
this.scoreQuantificationLoading = true;
@@ -2611,7 +2703,8 @@ export default {
.filter(item => item.url)
.map(item => ({
type: String(item.type || '').trim(),
- name: String(item.name || '').trim(),
+ originalName: String(item.originalName || item.name || '').trim(),
+ name: String(item.originalName || item.name || '').trim(),
description: String(item.description || '').trim(),
size: String(item.size || '').trim(),
uploadUserName: String(item.uploadUserName || '').trim(),
@@ -2641,22 +2734,51 @@ export default {
if (mb >= 1) return `${mb.toFixed(2)} MB`;
return `${(byteSize / 1024).toFixed(2)} KB`;
},
- handleQualificationUploadSuccess(file, row) {
- row.name = file.name || row.name || '客商材料';
- row.size = this.formatAttachmentSize(file.size || row.size);
- row.uploadUserName = this.userInfo.realName || this.userInfo.userName || '';
- row.uploadTime = this.$dayjs().format('YYYY-MM-DD HH:mm:ss');
- row.url = file.url || row.url || '';
- row.files = [file];
+ handleQualificationUploadSuccess(file) {
+ const originalName = file.originalName || file.name || '客商材料';
+ this.qualificationFiles.push({
+ type: this.resolveQualificationType(originalName),
+ originalName,
+ name: originalName,
+ description: '',
+ size: this.formatAttachmentSize(file.size),
+ uploadUserName: this.userInfo.realName || this.userInfo.userName || '',
+ uploadTime: this.$dayjs().format('YYYY-MM-DD HH:mm:ss'),
+ url: file.url || file.link || '',
+ files: [file],
+ });
+ },
+ resolveQualificationType(fileName) {
+ const name = String(fileName || '').toLocaleLowerCase();
+ return (
+ [...this.qualificationTypeOptions]
+ .filter(item => item?.label || item?.value)
+ .sort(
+ (a, b) =>
+ String(b.label || b.value || '').length - String(a.label || a.value || '').length
+ )
+ .find(item => {
+ const typeText = String(item.label || item.value || '').toLocaleLowerCase();
+ return typeText && name.includes(typeText);
+ })?.value || ''
+ );
},
downloadAttachments() {
- const files = this.qualificationFiles.filter(item => item.url);
+ const source = this.selectedQualificationFiles.length
+ ? this.selectedQualificationFiles
+ : this.qualificationFiles;
+ const files = source.filter(item => item.url);
if (!files.length) {
- this.$message.warning('暂无可下载附件');
+ this.$message.warning(
+ this.selectedQualificationFiles.length ? '所选附件暂无可下载地址' : '暂无可下载附件'
+ );
return;
}
files.forEach(item => window.open(item.url, '_blank'));
},
+ handleQualificationSelectionChange(rows) {
+ this.selectedQualificationFiles = rows || [];
+ },
normalizeDetail(detail) {
const businessScope = this.splitValue(detail.businessScope);
const registeredDetailAddress =
@@ -2723,10 +2845,9 @@ export default {
const time = this.$dayjs(value).valueOf();
return Number.isFinite(time) ? time : 0;
},
- getLatestCreditScore(scores = []) {
+ sortScoresByLatest(scores = []) {
return (scores || [])
.map((score, index) => ({ score, index }))
- .filter(item => String(item.score.creditLevel || '').trim())
.sort((a, b) => {
const scoreDateDiff =
this.getScoreTimeValue(b.score.scoreDate) - this.getScoreTimeValue(a.score.scoreDate);
@@ -2738,7 +2859,12 @@ export default {
this.getScoreTimeValue(b.score.createTime) - this.getScoreTimeValue(a.score.createTime);
if (createTimeDiff) return createTimeDiff;
return b.index - a.index;
- })[0]?.score;
+ });
+ },
+ getLatestCreditScore(scores = []) {
+ return this.sortScoresByLatest(scores)
+ .filter(item => String(item.score.creditLevel || '').trim())
+ [0]?.score;
},
applyArchiveCreditFromScores(archive) {
const latestScore = this.getLatestCreditScore(archive.scores || []);
@@ -2754,27 +2880,35 @@ export default {
this.readonly = readonly;
this.activeTab = 'scores';
this.resetDetailPagination();
+ this.resetChangeRecordPage();
if (row && row.id) {
getDetail(row.id).then(res => {
this.archiveForm = this.normalizeDetail(res.data.data);
this.qualificationFiles = this.parseAttachments(
this.archiveForm.qualificationAttachments
);
+ this.qualificationUploadFiles = [];
this.archiveBox = true;
+ this.loadChangeRecords();
});
return;
}
this.archiveForm = this.emptyArchive();
this.qualificationFiles = [];
+ this.qualificationUploadFiles = [];
+ this.selectedQualificationFiles = [];
this.archiveBox = true;
},
resetArchive() {
this.readonly = false;
this.archiveForm = this.emptyArchive();
this.qualificationFiles = [];
+ this.qualificationUploadFiles = [];
+ this.selectedQualificationFiles = [];
this.scoreBox = false;
this.resetScoreDialog();
this.resetDetailPagination();
+ this.resetChangeRecordPage();
this.contactBox = false;
this.contactIndex = -1;
this.contactForm = this.emptyContact();
@@ -3056,13 +3190,9 @@ export default {
this.calculateScore(this.currentScore);
},
handleScoreDetailScoreInput(detail, prop, value) {
- const normalized = String(value || '')
- .replace(/[^\d.]/g, '')
- .replace(/^\./, '')
- .replace(/(\..*)\./g, '$1')
- .replace(/^(\d+)(\.\d{0,2})?.*$/, '$1$2');
+ const normalized = String(value || '').replace(/\D/g, '');
if (prop === 'reviewScore' && normalized !== '') {
- const maxScore = this.getScoreItemFullScore(detail);
+ const maxScore = Math.floor(this.getScoreItemFullScore(detail));
if (Number(normalized) > maxScore) {
detail[prop] = String(maxScore);
this.$message.warning(
@@ -3112,7 +3242,7 @@ export default {
},
getSignedScore(detail, prop) {
const score = Number(detail[prop] || 0);
- return this.isMinusScoreDetail(detail) ? -score : score;
+ return this.isMinusScoreDetail(detail) && score > 0 ? -score : score;
},
getScoreItemFullScore(detail = {}) {
const itemScore = Number(detail.score);
@@ -3220,7 +3350,7 @@ export default {
this.archiveForm.scores.splice(this.scoreRecordIndex, 1, score);
} else {
this.archiveForm.scores.push(score);
- this.handleScoreCurrentChange(this.scorePageCount);
+ this.handleScoreCurrentChange(1);
}
this.syncArchiveCreditFromScores();
this.activeTab = 'scores';
@@ -3567,6 +3697,24 @@ export default {
margin-bottom: 12px;
}
+.qualification-upload-bar {
+ display: grid;
+ grid-template-columns: 1fr auto 1fr;
+ align-items: center;
+ margin-top: 12px;
+
+ :deep(.vehicle-attachment-upload) {
+ width: auto;
+ }
+
+ &__tip {
+ grid-column: 2;
+ color: #909399;
+ font-size: 13px;
+ text-align: center;
+ }
+}
+
.archive-tabs {
margin-top: 18px;
}