|
@@ -1,3 +1,5 @@
|
|
|
|
|
+import { validateCommon } from "@/common/setup/validate";
|
|
|
|
|
+import { RuleObject } from "ant-design-vue/lib/form/interface";
|
|
|
import { reactive, ref, UnwrapRef } from "vue";
|
|
import { reactive, ref, UnwrapRef } from "vue";
|
|
|
import { FormState } from "./interface";
|
|
import { FormState } from "./interface";
|
|
|
|
|
|
|
@@ -8,10 +10,12 @@ export function handleForm() {
|
|
|
num: 0,
|
|
num: 0,
|
|
|
goodsid: 0,
|
|
goodsid: 0,
|
|
|
})
|
|
})
|
|
|
|
|
+ const v_num = async (rule: RuleObject, value: number) => {
|
|
|
|
|
+ return validateCommon(value, '请输入挂牌价');
|
|
|
|
|
+ };
|
|
|
const rules = {
|
|
const rules = {
|
|
|
price: [
|
|
price: [
|
|
|
- { require, message: '请输入挂牌价', trigger: 'blur', type: 'number' },
|
|
|
|
|
- { message: '挂牌价不能小于1', min: 1, type: 'number' }
|
|
|
|
|
|
|
+ { require, trigger: 'blur', type: 'number', validator: v_num },
|
|
|
],
|
|
],
|
|
|
num: [
|
|
num: [
|
|
|
{ require, message: '请输入挂牌数量', trigger: 'blur', type: 'number' },
|
|
{ require, message: '请输入挂牌数量', trigger: 'blur', type: 'number' },
|