项目、合同fix
This commit is contained in:
@@ -283,43 +283,62 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="得分率(%)" required>
|
||||
<div class="range-input">
|
||||
<el-input-number
|
||||
<div class="range-input standard-range-input">
|
||||
<el-input
|
||||
v-model="standardForm.scoreRateLower"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:precision="0"
|
||||
inputmode="numeric"
|
||||
@input="value => handleStandardNumberInput('scoreRateLower', value, 0, 100)"
|
||||
/>
|
||||
<span>至</span>
|
||||
<el-input-number
|
||||
<el-input
|
||||
v-model="standardForm.scoreRateUpper"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:precision="0"
|
||||
inputmode="numeric"
|
||||
@input="value => handleStandardNumberInput('scoreRateUpper', value, 0, 100)"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="得分率每增加" required>
|
||||
<el-input-number v-model="standardForm.scoreRateIncrease" :min="0" :precision="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="最大资金使用额度(万元)" required>
|
||||
<div class="range-input">
|
||||
<el-input-number v-model="standardForm.creditLimitLower" :min="0" :precision="2" />
|
||||
<span>至</span>
|
||||
<el-input-number v-model="standardForm.creditLimitUpper" :min="0" :precision="2" />
|
||||
</div>
|
||||
<el-form-item label="得分率每增加" required>
|
||||
<el-input
|
||||
v-model="standardForm.scoreRateIncrease"
|
||||
inputmode="numeric"
|
||||
@input="value => handleStandardNumberInput('scoreRateIncrease', value)"
|
||||
>
|
||||
<template #suffix>%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="额度增加" required>
|
||||
<el-input-number v-model="standardForm.creditLimitIncrease" :min="0" :precision="2" />
|
||||
<span class="score-unit">万元</span>
|
||||
<el-input
|
||||
v-model="standardForm.creditLimitIncrease"
|
||||
inputmode="decimal"
|
||||
@input="value => handleStandardNumberInput('creditLimitIncrease', value, 2)"
|
||||
>
|
||||
<template #suffix>万元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最大资金使用额度(万元)" required>
|
||||
<div class="range-input standard-range-input">
|
||||
<el-input
|
||||
v-model="standardForm.creditLimitLower"
|
||||
inputmode="decimal"
|
||||
@input="value => handleStandardNumberInput('creditLimitLower', value, 2)"
|
||||
/>
|
||||
<span>至</span>
|
||||
<el-input
|
||||
v-model="standardForm.creditLimitUpper"
|
||||
inputmode="decimal"
|
||||
@input="value => handleStandardNumberInput('creditLimitUpper', value, 2)"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -657,6 +676,18 @@ export default {
|
||||
this.standardForm.creditLevel = '';
|
||||
}
|
||||
},
|
||||
handleStandardNumberInput(field, value, precision = 0, max) {
|
||||
let normalized = String(value || '').replace(precision > 0 ? /[^\d.]/g : /\D/g, '');
|
||||
if (precision > 0) {
|
||||
const [integer = '', ...decimalParts] = normalized.split('.');
|
||||
const decimal = decimalParts.join('').slice(0, precision);
|
||||
normalized = decimalParts.length ? `${integer}.${decimal}` : integer;
|
||||
}
|
||||
if (max !== undefined && normalized !== '' && Number(normalized) > max) {
|
||||
normalized = String(max);
|
||||
}
|
||||
this.standardForm[field] = normalized;
|
||||
},
|
||||
isValidCreditLevel(creditLevel) {
|
||||
return this.creditLevelOptions.some(item => item.value === String(creditLevel || '').trim());
|
||||
},
|
||||
@@ -698,6 +729,16 @@ export default {
|
||||
}
|
||||
const standard = JSON.parse(JSON.stringify(this.standardForm));
|
||||
standard.creditLevel = String(standard.creditLevel || '').trim();
|
||||
[
|
||||
'scoreRateLower',
|
||||
'scoreRateUpper',
|
||||
'scoreRateIncrease',
|
||||
'creditLimitLower',
|
||||
'creditLimitUpper',
|
||||
'creditLimitIncrease',
|
||||
].forEach(field => {
|
||||
standard[field] = Number(standard[field]);
|
||||
});
|
||||
const nextStandards = JSON.parse(JSON.stringify(this.configForm.standards));
|
||||
if (this.currentStandardIndex >= 0) {
|
||||
nextStandards.splice(this.currentStandardIndex, 1, standard);
|
||||
@@ -1128,6 +1169,17 @@ export default {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.standard-range-input {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
|
||||
:deep(.el-input) {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.score-unit {
|
||||
margin-left: 8px;
|
||||
color: #606266;
|
||||
|
||||
Reference in New Issue
Block a user