ui调整
This commit is contained in:
@@ -28,6 +28,25 @@
|
||||
<el-descriptions-item label="测算利率">
|
||||
<span class="calculate-rate">{{ getCalculateRate() }}</span> %
|
||||
</el-descriptions-item>
|
||||
<!-- 执行利率输入区域 -->
|
||||
<el-descriptions-item label="执行利率" :class="'execute-rate-item'">
|
||||
<div class="execute-rate-input-wrapper">
|
||||
<el-input
|
||||
v-model="executeRateInput"
|
||||
class="execute-rate-input"
|
||||
placeholder="请输入执行利率"
|
||||
>
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleSetExecuteRate"
|
||||
>
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</div>
|
||||
@@ -115,7 +134,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getWorkflow } from "@/api/loanPricing/workflow"
|
||||
import { getWorkflow, setExecuteRate } from "@/api/loanPricing/workflow"
|
||||
import ModelOutputDisplay from "./components/ModelOutputDisplay.vue"
|
||||
import BargainingPoolDisplay from "./components/BargainingPoolDisplay.vue"
|
||||
|
||||
@@ -132,7 +151,16 @@ export default {
|
||||
retailOutput: null,
|
||||
corpOutput: null,
|
||||
bargainingPool: null,
|
||||
activeTab: 'basic'
|
||||
activeTab: 'basic',
|
||||
executeRateInput: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'workflowDetail.executeRate': {
|
||||
handler(newVal) {
|
||||
this.executeRateInput = newVal || ''
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -202,6 +230,35 @@ export default {
|
||||
return this.corpOutput.calculateRate || '-'
|
||||
}
|
||||
return '-'
|
||||
},
|
||||
/** 设定执行利率 */
|
||||
handleSetExecuteRate() {
|
||||
// 验证输入
|
||||
const value = this.executeRateInput
|
||||
if (value === null || value === undefined || value === '') {
|
||||
this.$modal.msgError("请输入执行利率")
|
||||
return
|
||||
}
|
||||
|
||||
// 验证是否为有效数字
|
||||
const numValue = parseFloat(value)
|
||||
if (isNaN(numValue)) {
|
||||
this.$modal.msgError("请输入有效的数字")
|
||||
return
|
||||
}
|
||||
if (numValue < 0 || numValue > 100) {
|
||||
this.$modal.msgError("执行利率必须在 0 到 100 之间")
|
||||
return
|
||||
}
|
||||
|
||||
// 调用 API
|
||||
setExecuteRate(this.workflowDetail.serialNum, value.toString()).then(() => {
|
||||
this.$modal.msgSuccess("执行利率设定成功")
|
||||
// 重新获取详情数据
|
||||
this.getDetail()
|
||||
}).catch(error => {
|
||||
this.$modal.msgError("设定失败:" + (error.msg || error.message || "未知错误"))
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,6 +314,18 @@ export default {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
// 执行利率输入区域
|
||||
.execute-rate-input-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
|
||||
.execute-rate-input {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
// 利率值样式
|
||||
.rate-value {
|
||||
color: #67c23a;
|
||||
|
||||
Reference in New Issue
Block a user