huangbin 4 năm trước cách đây
mục cha
commit
3469270094

+ 6 - 2
src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_transfer/setup.ts

@@ -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 { FormState } from "./interface";
 
@@ -8,10 +10,12 @@ export function handleForm() {
         num: 0,
         goodsid: 0,
     })
+    const v_num = async (rule: RuleObject, value: number) => {
+        return validateCommon(value, '请输入挂牌价');
+    };
     const rules = {
         price: [
-            { require, message: '请输入挂牌价', trigger: 'blur', type: 'number' },
-            { message: '挂牌价不能小于1', min: 1, type: 'number' }
+            { require, trigger: 'blur', type: 'number', validator: v_num },
         ],
         num: [
             { require, message: '请输入挂牌数量', trigger: 'blur', type: 'number' },