|
|
@ -71,7 +71,7 @@ const rules = reactive({ |
|
|
|
}, trigger: 'blur' |
|
|
|
}], |
|
|
|
permanentBean: [ |
|
|
|
{ required: true, message: '请输入永久金豆数', trigger: 'blur' }, |
|
|
|
{ required: true, message: '请输入付费金豆数', trigger: 'blur' }, |
|
|
|
{ |
|
|
|
validator: (rule, value, callback) => { |
|
|
|
// 检查是否为非负整数 |
|
|
@ -129,11 +129,17 @@ const deleteConsumeForm = function () { |
|
|
|
|
|
|
|
const handleConsumeForm = async () => { |
|
|
|
try { |
|
|
|
if(!consumeForm.value.permanentBean ){ |
|
|
|
consumeForm.value.permanentBean = 0 |
|
|
|
} |
|
|
|
if(!consumeForm.value.freeBean ){ |
|
|
|
consumeForm.value.freeBean = 0 |
|
|
|
} |
|
|
|
await new Promise((resolve, reject) => { |
|
|
|
formRef.value.validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (Number(consumeForm.value.permanentBean) === 0 && Number(consumeForm.value.freeBean) === 0) { |
|
|
|
reject(new Error('永久金豆和付费金豆不能同时为0')); |
|
|
|
reject(new Error('付费金豆和免费金豆不能同时为0')); |
|
|
|
} |
|
|
|
resolve(); // 验证通过,继续执行后续代码 |
|
|
|
} else { |
|
|
@ -205,10 +211,10 @@ const throttledHandleConsumeFormt = _.throttle(handleConsumeForm, 5000, { |
|
|
|
<el-button type="primary" @click="getUser(consumeForm.jwcode)" style="margin-left: 20px">查询</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="permanentBean" label="付费金豆" label-position="left"> |
|
|
|
<el-input v-model="consumeForm.permanentBean" style="width: 100px" /> |
|
|
|
<el-input v-model="consumeForm.permanentBean" placeholder="不填默认为0" style="width: 100px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="freeBean" label="免费金豆" label-position="left"> |
|
|
|
<el-input v-model="consumeForm.freeBean" style="width: 100px" /> |
|
|
|
<el-input v-model="consumeForm.freeBean" placeholder="不填默认为0" style="width: 100px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="remark" label="备注" label-position="left"> |
|
|
|
<el-input v-model="consumeForm.remark" style="width: 300px" :rows="5" maxlength="100" show-word-limit |
|
|
|