huangbin 4 years ago
parent
commit
527082aa08

+ 13 - 1
src/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_blocs/components/delisting/index.vue

@@ -128,7 +128,7 @@
           <a-row :gutter="24">
             <a-col :span="24">
               <a-form-item label="可用资金">
-                <span class="white ml8">{{getCanUseMoney(getSelectedAccount())}}</span>
+                <span class="white ml8">{{getMargin()}}</span>
               </a-form-item>
             </a-col>
           </a-row>
@@ -221,6 +221,17 @@ export default defineComponent({
                 return '--';
             }
         }
+        // 履约保证金
+        function getMargin() {
+            const price = isBargin() ? formState.price : props.selectedRow.fixedprice;
+            const num = formState.num;
+            let result = 0;
+            const { marginvalue } = props.selectedRow;
+            if (price && num && marginvalue) {
+                result = (price * num * marginvalue) / 100;
+            }
+            return result ? result.toFixed(2) : '--';
+        }
         function getMaxNum() {
             const qty = props.selectedRow.orderqty;
             let result = 0;
@@ -335,6 +346,7 @@ export default defineComponent({
             loading,
             getMaxNum,
             isCanpart,
+            getMargin,
         };
     },
 });

+ 13 - 1
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/delisting/index.vue

@@ -128,7 +128,7 @@
           <a-row :gutter="24">
             <a-col :span="24">
               <a-form-item label="可用资金">
-                <span class="white ml8">{{getCanUseMoney(getSelectedAccount())}}</span>
+                <span class="white ml8">{{getMargin()}}</span>
               </a-form-item>
             </a-col>
           </a-row>
@@ -221,6 +221,17 @@ export default defineComponent({
                 return '--';
             }
         }
+        // 履约保证金
+        function getMargin() {
+            const price = isBargin() ? formState.price : props.selectedRow.fixedprice;
+            const num = formState.num;
+            let result = 0;
+            const { marginvalue } = props.selectedRow;
+            if (price && num && marginvalue) {
+                result = (price * num * marginvalue) / 100;
+            }
+            return result ? result.toFixed(2) : '--';
+        }
         function getMaxNum() {
             const qty = props.selectedRow.orderqty;
             let result = 0;
@@ -335,6 +346,7 @@ export default defineComponent({
             loading,
             getMaxNum,
             isCanpart,
+            getMargin,
         };
     },
 });