✨ 结算汇率反算、开票合计填报、配载承运商交集与车辆组织悬停
外币结算按本位币/汇率反算;开票改填合计金额并反算不含税单价;配载展示承运商合同并按乙方交集限选;评分加减分封顶15分;车辆所有组织/使用部门悬停显示完整路径。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -102,15 +102,10 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="减分最高扣分">
|
||||
<el-input
|
||||
:model-value="configForm.maxMinusScore"
|
||||
placeholder="所有减分项合计不得超过该分值"
|
||||
clearable
|
||||
style="width: 500px"
|
||||
@input="handleMaxMinusScoreInput"
|
||||
>
|
||||
<el-input :model-value="HARDCODED_MAX_MINUS_SCORE" disabled style="width: 500px">
|
||||
<template #append>分</template>
|
||||
</el-input>
|
||||
<div class="score-config__hint">暂定最高扣 15 分,加分合计同样最高按 15 分计</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input
|
||||
@@ -500,9 +495,15 @@ const standardNumberFields = [
|
||||
'creditLimitIncrease',
|
||||
];
|
||||
|
||||
/** 暂定:加分/减分合计上限均为 15 分,超出按 15 分计 */
|
||||
const HARDCODED_MAX_PLUS_SCORE = 15;
|
||||
const HARDCODED_MAX_MINUS_SCORE = 15;
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
HARDCODED_MAX_PLUS_SCORE,
|
||||
HARDCODED_MAX_MINUS_SCORE,
|
||||
form: {},
|
||||
query: {},
|
||||
loading: true,
|
||||
@@ -639,7 +640,7 @@ export default {
|
||||
name: '',
|
||||
remark: '',
|
||||
standardDescription: '',
|
||||
maxMinusScore: '',
|
||||
maxMinusScore: HARDCODED_MAX_MINUS_SCORE,
|
||||
status: 3,
|
||||
categories: this.defaultCategories(),
|
||||
standards: [],
|
||||
@@ -696,7 +697,8 @@ export default {
|
||||
});
|
||||
return {
|
||||
...detail,
|
||||
maxMinusScore: this.normalizePlainDecimal(detail.maxMinusScore),
|
||||
// 暂定写死最高扣分,不读取历史配置值
|
||||
maxMinusScore: HARDCODED_MAX_MINUS_SCORE,
|
||||
categories: categories.map(category => ({
|
||||
...(map[category.categoryCode] || category),
|
||||
categoryName: category.categoryName,
|
||||
@@ -704,14 +706,6 @@ export default {
|
||||
standards: (detail.standards || []).map(standard => this.normalizeStandard(standard)),
|
||||
};
|
||||
},
|
||||
handleMaxMinusScoreInput(value) {
|
||||
const raw = String(value ?? '')
|
||||
.replace(/[^\d.]/g, '')
|
||||
.replace(/^\./, '')
|
||||
.replace(/(\..*)\./g, '$1')
|
||||
.replace(/^(\d+)(\.\d{0,2})?.*$/, '$1$2');
|
||||
this.configForm.maxMinusScore = raw;
|
||||
},
|
||||
openConfig(row, readonly = false) {
|
||||
this.readonly = readonly;
|
||||
if (row && row.id) {
|
||||
@@ -837,9 +831,7 @@ export default {
|
||||
},
|
||||
prepareSubmitConfig(config) {
|
||||
const payload = JSON.parse(JSON.stringify(config || {}));
|
||||
const maxMinus = this.normalizePlainDecimal(payload.maxMinusScore);
|
||||
payload.maxMinusScore =
|
||||
maxMinus === '' || maxMinus == null ? null : this.toScoreValue(maxMinus);
|
||||
payload.maxMinusScore = this.toScoreValue(HARDCODED_MAX_MINUS_SCORE);
|
||||
(payload.categories || []).forEach(category => {
|
||||
(category.items || []).forEach(item => {
|
||||
item.score = this.toScoreValue(item.score);
|
||||
@@ -1096,14 +1088,8 @@ export default {
|
||||
this.$message.warning('请输入评定表名称');
|
||||
return false;
|
||||
}
|
||||
if (
|
||||
this.configForm.maxMinusScore !== '' &&
|
||||
this.configForm.maxMinusScore != null &&
|
||||
!this.isNonNegativeDecimal(this.configForm.maxMinusScore)
|
||||
) {
|
||||
this.$message.warning('减分最高扣分须为不小于0的数字,最多两位小数');
|
||||
return false;
|
||||
}
|
||||
// 减分最高扣分暂定写死为 15,提交前强制回填,避免历史脏数据触发校验
|
||||
this.configForm.maxMinusScore = HARDCODED_MAX_MINUS_SCORE;
|
||||
const basic = this.configForm.categories.find(item => item.categoryCode === 'basic');
|
||||
if (!basic || basic.items.length === 0) {
|
||||
this.$message.warning('至少配置1个基础得分项目');
|
||||
@@ -1586,6 +1572,13 @@ export default {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.score-config__hint {
|
||||
margin-top: 6px;
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
:deep(.score-config__name-input) {
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
@@ -1588,6 +1588,9 @@ const customerArchiveFormRoute = '/vehicle/customer-archive/form';
|
||||
const customerArchiveListRefreshKey = 'customer-archive-list-refresh';
|
||||
/** 客商所属组织固定为顶层组织 */
|
||||
const FIXED_OWNER_DEPT_NAME = '广西现代物流集团有限公司';
|
||||
/** 暂定:加分/减分合计上限均为 15 分,超出按 15 分计 */
|
||||
const HARDCODED_MAX_PLUS_SCORE = 15;
|
||||
const HARDCODED_MAX_MINUS_SCORE = 15;
|
||||
|
||||
const createTimeRangeMap = {
|
||||
createTimeRange: ['createTimeStart', 'createTimeEnd'],
|
||||
@@ -2291,16 +2294,18 @@ export default {
|
||||
{ categoryCode: 'plus', categoryName: '加分项目' },
|
||||
{ categoryCode: 'minus', categoryName: '减分项目' },
|
||||
];
|
||||
const maxMinus = Number(this.currentScore?.maxMinusScore);
|
||||
const hasMaxMinus = Number.isFinite(maxMinus) && maxMinus >= 0;
|
||||
const rows = categoryMap.map((category, index) => {
|
||||
const details = this.getScoreCategoryDetails(category.categoryCode);
|
||||
let selfScore = details.reduce((sum, item) => sum + Number(item.selfScore || 0), 0);
|
||||
let reviewScore = details.reduce((sum, item) => sum + Number(item.reviewScore || 0), 0);
|
||||
// 减分项目合计受量化表「最高扣分」限制
|
||||
if (category.categoryCode === 'minus' && hasMaxMinus) {
|
||||
selfScore = Math.min(selfScore, maxMinus);
|
||||
reviewScore = Math.min(reviewScore, maxMinus);
|
||||
// 暂定:加分/减分合计最高按 15 分计
|
||||
if (category.categoryCode === 'plus') {
|
||||
selfScore = Math.min(selfScore, HARDCODED_MAX_PLUS_SCORE);
|
||||
reviewScore = Math.min(reviewScore, HARDCODED_MAX_PLUS_SCORE);
|
||||
}
|
||||
if (category.categoryCode === 'minus') {
|
||||
selfScore = Math.min(selfScore, HARDCODED_MAX_MINUS_SCORE);
|
||||
reviewScore = Math.min(reviewScore, HARDCODED_MAX_MINUS_SCORE);
|
||||
}
|
||||
return {
|
||||
...category,
|
||||
@@ -4216,7 +4221,8 @@ export default {
|
||||
scoreDate: this.$dayjs().format('YYYY-MM-DD'),
|
||||
applyCreditLimit: this.archiveForm.applyCreditLimit || '',
|
||||
maxCreditLimit: '',
|
||||
maxMinusScore: '',
|
||||
maxMinusScore: HARDCODED_MAX_MINUS_SCORE,
|
||||
maxPlusScore: HARDCODED_MAX_PLUS_SCORE,
|
||||
creditLevel: '',
|
||||
standards: [],
|
||||
tempApplyCreditLimit: '',
|
||||
@@ -4236,10 +4242,8 @@ export default {
|
||||
: score.applyCreditLimit
|
||||
),
|
||||
maxCreditLimit: this.normalizeOptionalAmount(score.maxCreditLimit),
|
||||
maxMinusScore:
|
||||
score.maxMinusScore === undefined || score.maxMinusScore === null
|
||||
? ''
|
||||
: score.maxMinusScore,
|
||||
maxMinusScore: HARDCODED_MAX_MINUS_SCORE,
|
||||
maxPlusScore: HARDCODED_MAX_PLUS_SCORE,
|
||||
tempApplyCreditLimit: this.normalizeOptionalAmount(score.tempApplyCreditLimit),
|
||||
attachments: score.attachments || this.parseAttachments(score.proofAttachments),
|
||||
details: (score.details || []).map(detail => ({
|
||||
@@ -4699,11 +4703,8 @@ export default {
|
||||
applyCreditLimit: this.currentScore.applyCreditLimit,
|
||||
maxCreditLimit: '',
|
||||
creditLevel: '',
|
||||
maxMinusScore:
|
||||
quantificationData.maxMinusScore ??
|
||||
scoreTemplate.maxMinusScore ??
|
||||
this.currentScore.maxMinusScore ??
|
||||
'',
|
||||
maxMinusScore: HARDCODED_MAX_MINUS_SCORE,
|
||||
maxPlusScore: HARDCODED_MAX_PLUS_SCORE,
|
||||
tempApplyCreditLimit: this.currentScore.tempApplyCreditLimit,
|
||||
tempCreditStartDate: this.currentScore.tempCreditStartDate,
|
||||
tempCreditEndDate: this.currentScore.tempCreditEndDate,
|
||||
@@ -4722,14 +4723,11 @@ export default {
|
||||
},
|
||||
applyMaxMinusScoreFromQuantification(quantificationId) {
|
||||
if (!quantificationId) return Promise.resolve();
|
||||
return getCreditScoreQuantificationDetail(quantificationId).then(res => {
|
||||
const data = res?.data?.data || {};
|
||||
this.currentScore.maxMinusScore =
|
||||
data.maxMinusScore === undefined || data.maxMinusScore === null
|
||||
? ''
|
||||
: data.maxMinusScore;
|
||||
this.calculateScore(this.currentScore);
|
||||
});
|
||||
// 暂定写死加分/减分上限,不再依赖量化表配置值
|
||||
this.currentScore.maxMinusScore = HARDCODED_MAX_MINUS_SCORE;
|
||||
this.currentScore.maxPlusScore = HARDCODED_MAX_PLUS_SCORE;
|
||||
this.calculateScore(this.currentScore);
|
||||
return Promise.resolve();
|
||||
},
|
||||
normalizeScoreTemplateDetails(template = {}) {
|
||||
const categoryDetails = (template.categories || []).flatMap(category =>
|
||||
@@ -5073,17 +5071,17 @@ export default {
|
||||
const plusDetails = this.getScoreCategoryDetailsByList(details, 'plus');
|
||||
const minusDetails = this.getScoreCategoryDetailsByList(details, 'minus');
|
||||
const sumScore = (list, prop) => list.reduce((sum, item) => sum + Number(item[prop] || 0), 0);
|
||||
const rawPlusSelf = sumScore(plusDetails, 'selfScore');
|
||||
const rawPlusReview = sumScore(plusDetails, 'reviewScore');
|
||||
const rawMinusSelf = sumScore(minusDetails, 'selfScore');
|
||||
const rawMinusReview = sumScore(minusDetails, 'reviewScore');
|
||||
// 量化表「减分最高扣分」:所有减分项合计不得超过该上限
|
||||
const maxMinus = Number(score.maxMinusScore);
|
||||
const hasMaxMinus = Number.isFinite(maxMinus) && maxMinus >= 0;
|
||||
const minusSelf = hasMaxMinus ? Math.min(rawMinusSelf, maxMinus) : rawMinusSelf;
|
||||
const minusReview = hasMaxMinus ? Math.min(rawMinusReview, maxMinus) : rawMinusReview;
|
||||
const selfScore =
|
||||
sumScore(basicDetails, 'selfScore') + sumScore(plusDetails, 'selfScore') - minusSelf;
|
||||
const reviewScore =
|
||||
sumScore(basicDetails, 'reviewScore') + sumScore(plusDetails, 'reviewScore') - minusReview;
|
||||
// 暂定:加分/减分合计最高按 15 分计
|
||||
const plusSelf = Math.min(rawPlusSelf, HARDCODED_MAX_PLUS_SCORE);
|
||||
const plusReview = Math.min(rawPlusReview, HARDCODED_MAX_PLUS_SCORE);
|
||||
const minusSelf = Math.min(rawMinusSelf, HARDCODED_MAX_MINUS_SCORE);
|
||||
const minusReview = Math.min(rawMinusReview, HARDCODED_MAX_MINUS_SCORE);
|
||||
const selfScore = sumScore(basicDetails, 'selfScore') + plusSelf - minusSelf;
|
||||
const reviewScore = sumScore(basicDetails, 'reviewScore') + plusReview - minusReview;
|
||||
const hasReviewScore = details.some(
|
||||
item => !this.isBlankScore(item.reviewScore)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user