huangbin 4 年之前
父節點
當前提交
70a86120b0

+ 2 - 2
src/common/setup/trade/index.ts

@@ -46,7 +46,7 @@ export function useBuyFixedPricMaxNum<T extends CommomTradeForm>(formState: T, c
 
     // 处理 0 特殊情况
     if (marginValue) {
-        result = Math.floor(money / (marginValue * agreeunit))
+        result = Math.round(money / (marginValue * agreeunit))
     }
     return result
 }
@@ -60,7 +60,7 @@ export function useSellFixedPriceMaxNum<T extends CommomTradeForm>(formState: T,
     // 最大数量 = 可用资金/(履约保证金*挂牌价格)
     const marginValue = isRationInSellMarginType() ? (sellmarginvalue * formState.FixedPrice) : (sellmarginvalue + formState.FixedPrice)
     if (marginValue) { // 处理 0 特殊情况
-        result = Math.floor(money / (marginValue * agreeunit))
+        result = Math.round(money / (marginValue * agreeunit))
     }
     return result
 }

+ 1 - 1
src/views/market/spot_trade/components/buy-sell-market/components/delisting/setup.ts

@@ -117,7 +117,7 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
                 }
             }
         }
-        return Math.floor(result)
+        return Math.round(result)
     }
     //  摘牌金额
     function getMoney() {

+ 1 - 1
src/views/market/spot_trade/components/buy-sell-market/components/financing_delisting/setup.ts

@@ -139,7 +139,7 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
                 }
             }
         }
-        return Math.floor(result)
+        return Math.round(result)
     }
     //  摘牌金额
     function getMoney() {

+ 1 - 1
src/views/market/spot_trade/components/post_buying/setup.ts

@@ -53,7 +53,7 @@ export function handleNumAndPrice(enumName: EnumRouterName, selectedRow: WrOrder
         } else {
             const margin = marginMethod() ? (buymarginvalue * formState.FixedPrice) : (buymarginvalue + formState.FixedPrice)
             if (margin) {
-                result = Math.floor(canUseMoney / margin)
+                result = Math.round(canUseMoney / margin)
             }
         }
         return +result.toFixed(0)

+ 15 - 23
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/delisting/index.vue

@@ -152,34 +152,26 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref } from 'vue';
 import { Des } from '@/common/components/commonDes';
-import { _closeModal } from '@/common/setup/modal/modal';
-import { ModalEnum } from '@/common/constants/modalNameEnum';
 import Drawer from '@/common/components/drawer/index.vue';
-import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
-import { hdWROrder } from '@/services/proto/warehousetrade';
+import { BuyOrSell, TradeMode } from '@/common/constants/enumCommon';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { DGFactoryItems, HdWRDealOrderReq, WrBargainApplyReq, WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
-import { getAccountTypeList, getSelectedAccountId, getUserId } from '@/services/bus/account';
-import { v4 as uuidv4 } from 'uuid';
-import moment, { Moment } from 'moment';
-import { getMarketRunByTradeMode, marketIsRun } from '@/services/bus/market';
-import { QueryOrderQuoteMyqQsp, WrOrderQuote } from '@/services/go/wrtrade/interface';
-
 import { validateAction } from '@/common/setup/form';
-
-import { EnumRouterName } from '@/common/constants/enumRouterName';
-
-import { BuyOrSell, TradeMode } from '@/common/constants/enumCommon';
-import { getCanUseMoney } from '@/services/bus/account';
-import { TempWrOrderQuoteDetail } from '@/views/market/spot_trade/components/post_buying/interface';
-import { handleForm, handleSpotWarrant } from './setup';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { getAccountTypeList, getCanUseMoney, getSelectedAccountId, getUserId } from '@/services/bus/account';
+import { marketIsRun } from '@/services/bus/market';
 import { getRules } from '@/services/bus/rules';
-import { ListingForm } from './interface';
+import { QueryOrderQuoteMyqQsp } from '@/services/go/wrtrade/interface';
 import { HdWRDealOrder, wrBargainApply } from '@/services/proto/warehousetrade';
-import Long from 'long';
+import { WrBargainApplyReq } from '@/services/proto/warehousetrade/interface';
 import Bus from '@/utils/eventBus';
+import { MinusOutlined, PlusOutlined } from '@ant-design/icons-vue';
+import Long from 'long';
+import moment from 'moment';
+import { v4 as uuidv4 } from 'uuid';
+import { defineComponent, PropType, ref } from 'vue';
+import { ListingForm } from './interface';
+import { handleForm, handleSpotWarrant } from './setup';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
@@ -224,7 +216,7 @@ export default defineComponent({
             const price = getPrice();
             const num = getNum();
             if (price) {
-                return (price * num).toFixed(2);
+                return Math.round(price * num * 100) / 100;
             } else {
                 return '--';
             }
@@ -238,7 +230,7 @@ export default defineComponent({
             if (price && num && marginvalue) {
                 result = price * num * marginvalue;
             }
-            return result ? Math.floor(result * 100) / 100 : '--';
+            return result ? Math.round(result * 100) / 100 : '--';
         }
         function getMaxNum() {
             const qty = props.selectedRow.orderqty;