|
@@ -27,6 +27,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="年度运营目标" prop="targetAmount">
|
|
|
<el-input v-model="merchantDividendsForm.targetAmount" placeholder="请输入年度运营目标" />
|
|
|
+ <div class="tip">范围0-1,精确到小数点后2位, 多于两位默认会保留2位</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="分红平衡点" prop="balancePoint">
|
|
|
<el-input v-model="merchantDividendsForm.balancePoint" placeholder="请输入分红平衡点" />
|
|
@@ -43,7 +44,6 @@
|
|
|
import { postShopDividendSettingsApi, patchShopDividendSettingsByIdApi } from '@/api/rm-bank'
|
|
|
import { businessListGetAll } from '@/api/business'
|
|
|
|
|
|
-
|
|
|
const validateNumber = (label) => {
|
|
|
return (_, value, cb) => {
|
|
|
const num = value * 1
|
|
@@ -94,7 +94,17 @@ export default {
|
|
|
],
|
|
|
targetAmount: [
|
|
|
{ required: true, message: '请输入年度运营目标', trigger: 'blur' },
|
|
|
- { validator: validateNumber('年度运营目标'), trigger: 'blur' }
|
|
|
+ { validator: validateNumber('年度运营目标'), trigger: 'blur' },
|
|
|
+ {
|
|
|
+ validator: (_, value, cb) => {
|
|
|
+ if (value < 0 || value > 1) {
|
|
|
+ cb(new Error('年度运营目标必须在0-1之间'))
|
|
|
+ } else {
|
|
|
+ cb()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
],
|
|
|
balancePoint: [
|
|
|
{ required: true, message: '请输入分红平衡点', trigger: 'blur' },
|