Explorar el Código

修改预售挂牌

huangbin hace 4 años
padre
commit
db68dc9671

+ 20 - 19
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_order_summary/components/listed/index.vue

@@ -42,9 +42,9 @@
                    v-if="formState.WRPriceType === 2">
               <a-form-item label="基差"
                            name="PriceMove">
-                <a-input class="commonInput"
-                         v-model:value="formState.PriceMove"
-                         style="width: 140px" />
+                <a-input-number class="commonInput"
+                                v-model:value="formState.PriceMove"
+                                style="width: 140px" />
               </a-form-item>
             </a-col>
           </a-row>
@@ -70,35 +70,36 @@
             </a-col>
           </a-row>
           <a-row :gutter="24">
-            <a-col :span="12">
-              <a-form-item label="交收月"
-                           name="time">
-                <a-month-picker style="width: 140px"
-                                v-model:value="formState.DeliveryMonth"
-                                :allowClear="false"
-                                class="commonDatePicker dialogDatePicker" />
-              </a-form-item>
-            </a-col>
-            <a-col :span="12">
-              <a-form-item>&nbsp;</a-form-item>
-            </a-col>
-          </a-row>
-          <a-row :gutter="24">
             <a-col :span="12"
                    class="mt-20">
               <a-form-item>
                 <a-slider v-model:value="formState.OrderQty"
                           ::min="0"
-                          :max="selectedRow.enableqty"
+                          :max="selectedRow.creditenableqty"
                           class="formSlider" />
                 <div class="unit">
                   <span>0</span>
-                  <span>{{selectedRow.enableqty}}{{selectedRow.enumdicname}}</span>
+                  <span>{{selectedRow.creditenableqty}}{{selectedRow.enumdicname}}</span>
                 </div>
               </a-form-item>
             </a-col>
             <a-col :span="12">&nbsp;</a-col>
           </a-row>
+          <a-row :gutter="24">
+            <a-col :span="12">
+              <a-form-item label="交收月"
+                           name="DeliveryMonth">
+                <a-month-picker style="width: 140px"
+                                v-model:value="formState.DeliveryMonth"
+                                :allowClear="false"
+                                class="commonDatePicker dialogDatePicker" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-item>&nbsp;</a-form-item>
+            </a-col>
+          </a-row>
+
           <a-row :gutter="24"
                  v-if="formState.WRPriceType === 2">
             <a-col :span="24">

+ 14 - 2
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_order_summary/components/listed/setup.ts

@@ -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 }],
 
     }