Commit 5d92d4e3 by 李伟康

feat(financeManage): 优化二手车资金预警模块交互与校验逻辑

- 为验证码输入框添加 placeholder 提示文本
- 优化获取短信验证码逻辑,增加异常处理并修复发送失败后倒计时状态未重置问题
- 修复 verifySmsCode 接口调用时字段解构错误
- 删除 usageLimitDialog 中重复的提示文案注释
- 使用额度输入框新增 placeholder 并支持数字类型绑定及失焦校验
- 预警邮箱输入框增加 placeholder 及最大长度限制
- 资金预警首页金额范围查询占位符文案调整为“额度”相关表述
- 认证手机号搜索项明确 inputType 为 number 类型
1 parent 833a4a90
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
v-model="smsCode" v-model="smsCode"
class="input-width" class="input-width"
maxlength="6" maxlength="6"
placeholder="请输入验证码"
> >
</el-input> </el-input>
<el-button <el-button
...@@ -95,21 +96,25 @@ export default { ...@@ -95,21 +96,25 @@ export default {
}, },
methods: { methods: {
async getSmsCode (e) { async getSmsCode (e) {
let { phone } = this try {
if (!phone) return this.phoneError = '手机号不能为空' let { phone } = this
if (!/^1[3456789]\d{9}$/.test(phone)) return this.phoneError = '手机号格式错误' if (!phone) return this.phoneError = '手机号不能为空'
this.countDownStatus = true if (!/^1[3456789]\d{9}$/.test(phone)) return this.phoneError = '手机号格式错误'
let data = await sendSmsCode({ this.countDownStatus = true
phone let data = await sendSmsCode({
}) phone
if (data) { })
this.countDown() if (data) {
let target = e.target this.countDown()
if (target.nodeName == 'SPAN') target = e.target.parentNode let target = e.target
target.blur() if (target.nodeName == 'SPAN') target = e.target.parentNode
this.notice.okTips('发送短信成功') target.blur()
} else { this.notice.okTips('发送短信成功')
this.notice.errorTips('发送短信失败') } else {
this.countDownStatus = false
this.notice.errorTips('发送短信失败')
}
} catch (error) {
this.countDownStatus = false this.countDownStatus = false
} }
}, },
...@@ -135,7 +140,7 @@ export default { ...@@ -135,7 +140,7 @@ export default {
if (!/^1[3456789]\d{9}$/.test(phone)) return this.phoneError = '手机号格式错误' if (!/^1[3456789]\d{9}$/.test(phone)) return this.phoneError = '手机号格式错误'
if (!smsCode) return this.smsError = '验证码不能为空' if (!smsCode) return this.smsError = '验证码不能为空'
if (smsCode.length < 6) return this.smsError = '验证码错误,请重试!' if (smsCode.length < 6) return this.smsError = '验证码错误,请重试!'
let { code} = await verifySmsCode({ let { code } = await verifySmsCode({
phone, phone,
smsCode smsCode
}) })
......
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
每次“新增使用额度”都会重置上次限额,且上次未使用额度不会延续叠加使用(仅当期有效); 每次“新增使用额度”都会重置上次限额,且上次未使用额度不会延续叠加使用(仅当期有效);
预警通知触发条件:当额度使用率达到70%、80%、90%、95%时,各触发一次预警; 预警通知触发条件:当额度使用率达到70%、80%、90%、95%时,各触发一次预警;
“使用额度”仅控制二手车业务自动付款,超过当期额度后无法自动付款。 “使用额度”仅控制二手车业务自动付款,超过当期额度后无法自动付款。
<!-- 每次“新增使用额度”都会重置上次限额,且上次未使用额度不会延续叠加使用(仅当期有效);
预警通知触发条件:当额度使用率达到70%、80%、90%、95%时,各触发一次预警;
“使用额度”仅控制二手车业务自动付款,超过当期额度后无法自动付款。 -->
</div> </div>
<el-form <el-form
label-width="150px" label-width="150px"
...@@ -38,10 +35,12 @@ ...@@ -38,10 +35,12 @@
prop="usageLimit" prop="usageLimit"
> >
<el-input <el-input
v-model="infoForm.usageLimit" v-model.number="infoForm.usageLimit"
class="input-width" class="input-width"
:maxlength="15" :maxlength="15"
@input="handleUsageLimitNum" @input="handleUsageLimitNum"
@blur="handleBlur"
placeholder="请输入当前使用额度"
> >
</el-input> </el-input>
...@@ -54,6 +53,8 @@ ...@@ -54,6 +53,8 @@
<el-input <el-input
v-model="infoForm.warningEmail" v-model="infoForm.warningEmail"
class="input-width" class="input-width"
:maxlength="200"
placeholder="请输入预警通知邮箱(多邮箱用逗号隔开,最多五个)"
> >
</el-input> </el-input>
</el-form-item> </el-form-item>
...@@ -155,6 +156,10 @@ export default { ...@@ -155,6 +156,10 @@ export default {
} }
}, },
methods: { methods: {
handleBlur (event) {
let {usageLimit} = this.infoForm
this.infoForm.usageLimit = usageLimit <= 0 ? '' : usageLimit
},
handleUsageLimitNum (event) { handleUsageLimitNum (event) {
this.infoForm.usageLimit = limitPrice(event, this.oldVal, 15, 2) this.infoForm.usageLimit = limitPrice(event, this.oldVal, 15, 2)
this.oldVal = this.infoForm.usageLimit this.oldVal = this.infoForm.usageLimit
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
> >
<template #inputRangeHtml> <template #inputRangeHtml>
<input-range <input-range
start-placeholder="最小金额" start-placeholder="最小额度"
end-placeholder="最大金额" end-placeholder="最大额度"
:display-value="searchForm.amtList" :display-value="searchForm.amtList"
maxLength="15" maxLength="15"
inputMaxLength="15" inputMaxLength="15"
...@@ -175,6 +175,7 @@ export default { ...@@ -175,6 +175,7 @@ export default {
{ {
label: "认证手机号", label: "认证手机号",
name: "authPhone", name: "authPhone",
inputType: "number",
type: "input", type: "input",
isClear: true, isClear: true,
maxlength: 20 maxlength: 20
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!