huangbin 4 年之前
父節點
當前提交
30e6998d0a

+ 20 - 0
src/views/market/spot_trade/components/buy-sell-market/components/delisting/index.vue

@@ -102,6 +102,13 @@
             </a-col>
             <a-col :span="12">&nbsp;</a-col>
           </a-row>
+          <a-col :span="24"
+                 v-if="isFloat()">
+            <a-form-item label="估算价"
+                         name="PriceMove">
+              <span class="white">{{getPrice()}}</span>
+            </a-form-item>
+          </a-col>
           <a-row :gutter="24">
             <a-col :span="24"
                    class="mt-20">
@@ -168,6 +175,7 @@ import { ListingForm, TempWrOrderQuoteDetail } from './interface';
 import { BuyOrSell } from '@/common/constants/enumCommon';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { getCanUseMoney } from '@/services/bus/account';
+import { getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
 export default defineComponent({
     name: ModalEnum.spot_trade_warehouse_financing_delisting,
     components: { Drawer, PlusOutlined, MinusOutlined },
@@ -209,6 +217,17 @@ export default defineComponent({
         const { wrHoldList } = handleSpotWarrant(props.enumName, props.buyOrSell, props.parantSelectedRow, loading);
         getWrPosition(props.enumName, props.buyOrSell, loading);
         const { getMaxNum, getMoney, getMargin } = handleNumAndMoney(props.enumName, props.buyOrSell, props.selectedRow, props.parantSelectedRow, formState);
+        // 估算价
+        function getPrice() {
+            let result = '--';
+            const goodsPrice = getQuoteDayInfoByCodeFindPrice(props.parantSelectedRow.goodscode);
+            if (goodsPrice && goodsPrice !== '--') {
+                // 有实时行情价格
+                result = ((goodsPrice as number) + props.selectedRow.pricemove).toFixed(2);
+            }
+
+            return result;
+        }
         function submit() {
             validateAction<ListingForm>(formRef, formState).then((res) => {
                 // 首先确定  这是仓单贸易的有仓单挂摘牌 HasWr = 1
@@ -271,6 +290,7 @@ export default defineComponent({
             getMaxNum,
             getMoney,
             getMargin,
+            getPrice,
         };
     },
 });

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

@@ -2,12 +2,13 @@ import { BuyOrSell } from "@/common/constants/enumCommon";
 import { EnumRouterName } from "@/common/constants/enumRouterName";
 import { queryResultLoadingAndInfo } from "@/common/methods/request/resultInfo";
 import { getAccountTypeList, getCanUseMoney } from "@/services/bus/account";
+import { getGoodsAgreeunitByGoodsCode, getQuoteDayInfoByCodeFindPrice } from "@/services/bus/goods";
 import { getRules } from '@/services/bus/rules';
 import { AccountListItem } from "@/services/dataCenter/interafce/account";
 import { queryHoldLB, queryWrPosition } from '@/services/go/wrtrade';
 import { QueryWrPositionReq, WrHoldLB, WrOrderQuote, WrOrderQuoteDetail, WrPosition } from "@/services/go/wrtrade/interface";
 import { reactive, Ref, ref, UnwrapRef } from "vue";
-import { getGoodsPrice, handleIs } from "../../setup";
+import { handleIs } from "../../setup";
 import { ListingForm, Wrhold } from "./interface";
 
 export function handleForm(data: WrOrderQuoteDetail) {
@@ -82,11 +83,11 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
             const canUseMoney = Number(getCanUseMoney(getSelectedAccount() as AccountListItem))
             if (!isBuy()) {
                 if (isFloat()) {
-                    const goodsPrice = getGoodsPrice()
+                    const goodsPrice = getQuoteDayInfoByCodeFindPrice(parantSelectedRow.goodscode);
                     // 估算总价=挂牌基差+期货合约价;
-                    if (goodsPrice.value && goodsPrice.value !== '--') {   // 有实时行情价格
+                    if (goodsPrice && goodsPrice !== '--') {   // 有实时行情价格
                         // 估算总价
-                        const predictTotal = pricemove + (goodsPrice.value as number);
+                        const predictTotal = pricemove + (goodsPrice as number);
                         // 买方履约保证金比例*估算总价
                         const marginMoney = marginMethod() ? (buymarginvalue * predictTotal) : (buymarginvalue + predictTotal)
                         // 浮动价 摘买 最大数量=min{可用资金/(买方履约保证金比例*估算总价),挂牌数量}
@@ -123,12 +124,13 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
     function getMoney() {
         let result = 0
         if (isFloat()) {
-            const goodsPrice = getGoodsPrice()
-            if (goodsPrice.value && goodsPrice.value !== '--') {   // 有实时行情价格
+            const goodsPrice = getQuoteDayInfoByCodeFindPrice(parantSelectedRow.goodscode);
+            const agreeunit = getGoodsAgreeunitByGoodsCode(parantSelectedRow.goodscode);
+            if (goodsPrice && goodsPrice !== '--') {   // 有实时行情价格
                 // 估算总价=挂牌基差+期货合约价;
-                const predictTotal = pricemove + (goodsPrice.value as number);
+                const predictTotal = pricemove + (goodsPrice as number);
                 // 估算总额=估算总价*摘牌数量;
-                result = predictTotal * formState.num
+                result = predictTotal * formState.num * agreeunit
             }
         } else {
             // 摘牌金额=挂牌价格*摘牌数量

+ 21 - 0
src/views/market/spot_trade/components/buy-sell-market/components/financing_delisting/index.vue

@@ -120,6 +120,13 @@
             </a-col>
             <a-col :span="12">&nbsp;</a-col>
           </a-row>
+          <a-col :span="24"
+                 v-if="isFloat()">
+            <a-form-item label="估算价"
+                         name="PriceMove">
+              <span class="white">{{getPrice()}}</span>
+            </a-form-item>
+          </a-col>
           <a-row :gutter="24">
             <a-col :span="24"
                    class="mt-20">
@@ -203,6 +210,7 @@ import { v4 as uuidv4 } from 'uuid';
 import moment from 'moment';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { HdWRDealOrder } from '@/services/proto/warehousetrade';
+import { getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
 
 export default defineComponent({
     name: ModalEnum.spot_trade_warehouse_delisting,
@@ -248,6 +256,18 @@ export default defineComponent({
 
         const { componentId, closeComponent, openComponent } = handleModalComponent(() => {}, ref({}));
 
+        // 估算价
+        function getPrice() {
+            let result = '--';
+            const goodsPrice = getQuoteDayInfoByCodeFindPrice(props.parantSelectedRow.goodscode);
+            if (goodsPrice && goodsPrice !== '--') {
+                // 有实时行情价格
+                result = ((goodsPrice as number) + props.selectedRow.pricemove).toFixed(2);
+            }
+
+            return result;
+        }
+
         const show = ref<boolean>(false);
         function showAction() {
             show.value = !show.value;
@@ -324,6 +344,7 @@ export default defineComponent({
             openComponent,
             getCanUseMoney,
             getSelectedAccount,
+            getPrice,
         };
     },
 });

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

@@ -2,12 +2,13 @@ import { BuyOrSell } from "@/common/constants/enumCommon";
 import { EnumRouterName } from "@/common/constants/enumRouterName";
 import { queryResultLoadingAndInfo } from "@/common/methods/request/resultInfo";
 import { getAccountTypeList, getCanUseMoney } from "@/services/bus/account";
+import { getGoodsAgreeunitByGoodsCode, getQuoteDayInfoByCodeFindPrice } from "@/services/bus/goods";
 import { getRules } from '@/services/bus/rules';
 import { AccountListItem } from "@/services/dataCenter/interafce/account";
 import { queryHoldLB, queryWrPosition } from '@/services/go/wrtrade';
 import { QueryWrPositionReq, WrFAProductDetail, WrHoldLB, WrOrderQuote, WrOrderQuoteDetail, WrPosition } from "@/services/go/wrtrade/interface";
 import { reactive, Ref, ref, UnwrapRef } from "vue";
-import { getGoodsPrice, handleIs } from "../../setup";
+import { handleIs } from "../../setup";
 import { ListingForm, Wrhold } from "./interface";
 
 export const selecedFinance = ref<WrFAProductDetail>()
@@ -104,11 +105,11 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
             const canUseMoney = Number(getCanUseMoney(getSelectedAccount() as AccountListItem))
             if (!isBuy()) {
                 if (isFloat()) {
-                    const goodsPrice = getGoodsPrice()
+                    const goodsPrice = getQuoteDayInfoByCodeFindPrice(parantSelectedRow.goodscode);
                     // 估算总价=挂牌基差+期货合约价;
-                    if (goodsPrice.value && goodsPrice.value !== '--') {   // 有实时行情价格
+                    if (goodsPrice && goodsPrice !== '--') {   // 有实时行情价格
                         // 估算总价
-                        const predictTotal = pricemove + (goodsPrice.value as number);
+                        const predictTotal = pricemove + (goodsPrice as number);
                         // 买方履约保证金比例*估算总价
                         const marginMoney = marginMethod() ? (buymarginvalue * predictTotal) : (buymarginvalue + predictTotal)
                         // 浮动价 摘买 最大数量=min{可用资金/(买方履约保证金比例*估算总价),挂牌数量}
@@ -145,12 +146,13 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
     function getMoney() {
         let result = 0
         if (isFloat()) {
-            const goodsPrice = getGoodsPrice()
-            if (goodsPrice.value && goodsPrice.value !== '--') {   // 有实时行情价格
+            const goodsPrice = getQuoteDayInfoByCodeFindPrice(parantSelectedRow.goodscode);
+            const agreeunit = getGoodsAgreeunitByGoodsCode(parantSelectedRow.goodscode);
+            if (goodsPrice && goodsPrice !== '--') {   // 有实时行情价格
                 // 估算总价=挂牌基差+期货合约价;
-                const predictTotal = pricemove + (goodsPrice.value as number);
+                const predictTotal = pricemove + (goodsPrice as number);
                 // 估算总额=估算总价*摘牌数量;
-                result = predictTotal * formState.num
+                result = predictTotal * formState.num * agreeunit
             }
         } else {
             // 摘牌金额=挂牌价格*摘牌数量