|
|
@@ -25,10 +25,22 @@ export function handlePasswordForm(data: WrPosition) {
|
|
|
return Promise.reject('请选择商品')
|
|
|
}
|
|
|
};
|
|
|
+ const v_num = async (rule: RuleObject, value: number) => {
|
|
|
+ if (value) {
|
|
|
+ if (value > data.creditenableqty || 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 }],
|
|
|
- PriceMove: [{ required: true, message: '请输入升贴水', trigger: 'blur', type: 'number', }],
|
|
|
+ OrderQty: [{ required: true, validator: v_num, trigger: 'blur', type: 'number' }],
|
|
|
+ PriceMove: [{ required: true, message: '请输入基差', trigger: 'blur', type: 'number', }],
|
|
|
+ DeliveryMonth: [{ required: true, message: '请选择交收月', }],
|
|
|
goodsid: [{ required: true, validator: v_group }],
|
|
|
|
|
|
}
|