huangbin 4 vuotta sitten
vanhempi
commit
1337678bc5

+ 13 - 1
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/setup.ts

@@ -24,9 +24,21 @@ export function handleForm(data: WrHoldLB) {
             return Promise.reject('请选择商品')
         }
     };
+    const v_num = async (rule: RuleObject, value: number) => {
+        if (value) {
+            if (value > data.enableqty || value < 1) {
+                return Promise.reject('提示挂牌数量有误')
+            } else {
+                return Promise.resolve();
+            }
+        } else {
+            return Promise.reject('请输入挂牌数量')
+        }
+    };
+
     const rules = {
         FixedPrice: [{ required: true, message: '请输入挂牌价格', trigger: 'blur', type: 'number', min: 1, }],
-        OrderQty: [{ required: true, message: '请输入挂牌数量', trigger: 'blur', type: 'number', min: 1, ma: data.enableqty }],
+        OrderQty: [{ required: true, validator: v_num, trigger: 'blur', type: 'number' }],
         PriceMove: [{ required: true, message: '请输入升贴水', trigger: 'blur', type: 'number', }],
         goodsid: [{ required: true, validator: v_group }],
     }