💊 fix: 修复【新增红包】随机红包,输入最大面额,大于了前端计算的最大面额值时,应该不允许提交

This commit is contained in:
wangsongsole 2023-06-29 11:28:10 +08:00
parent 38f27f606a
commit 0a9b637d8a
3 changed files with 17 additions and 3 deletions

View File

@ -484,7 +484,10 @@ export default class addKnockGold extends Component {
} else {
data = b
}
return data.toFixed(2)
this.setState({
computeMin: data.toFixed(2)
})
this.onHandleChange("", "max_denomination")
}
//tag
@ -501,7 +504,7 @@ export default class addKnockGold extends Component {
return "请输入"
}
if (this.state.computeMax) {
return `最大面额为${this.computeMin()} ~ ${this.state.computeMax}`
return `最大面额为${this.state.computeMin} ~ ${this.state.computeMax}`
}
return "请输入"
}

View File

@ -208,6 +208,16 @@ export function additionalRules(params) {
return false
}
if (params.computeMax < model.max_denomination) {
Notify.error("随机最大面额不得大于计算最大面额")
return false
}
if (params.computeMin < model.min_denomination) {
Notify.error("随机最小面额不得大于计算最小面额")
return false
}
if (model.day_budget < model.denomination || model.day_budget > model.all_budget) {
Notify.error("单日发放预算不得小于面额且不大于总预算")
return false

View File

@ -65,6 +65,7 @@ export function model({ data }) {
userSelectList: [] /* 预警人数据 */,
form_data: {},
isEdit: !!data?.id /* 是否为编辑 */,
computeMax: "" /* 随机最大面额 */
computeMax: "" /* 随机最大面额 */,
computeMin: "" /* 随机最小面额 */
}
}