Sfoglia il codice sorgente

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

li.shaoyi 4 anni fa
parent
commit
5eba243997

+ 15 - 4
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/post_buying/index.vue

@@ -72,7 +72,7 @@
                    v-if="isFloat()">
               <a-form-item label="估算价"
                            name="PriceMove">
-                <span class="white">{{getFloatPrice()}}</span>
+                <span class="white">{{getPrice()}}</span>
               </a-form-item>
             </a-col>
 
@@ -85,8 +85,8 @@
                                 :min="0"
                                 :max="getMaxNum()"
                                 v-model:value="formState.OrderQty" />
-                <MinusOutlined @click="increaseNum" />
-                <PlusOutlined @click="decreaseNum" />
+                <MinusOutlined @click="decreaseNum" />
+                <PlusOutlined @click="increaseNum" />
                 <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
               </a-form-item>
             </a-col>
@@ -169,6 +169,7 @@ import { handleForm, isFloat, useBuySellDirection, usePrice, useNum } from './se
 import { queryTradePosition } from '@/services/go/ermcp/order';
 import { WrOrderQuote } from '@/services/go/wrtrade/interface';
 import { RefGoodsList } from '../../interface';
+import { getGoodsPrice } from '@/views/market/spot_trade/components/buy-sell-market/setup';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
@@ -227,7 +228,16 @@ export default defineComponent({
             }
             return result;
         };
-
+        // 估算价
+        function getPrice() {
+            let result = '--';
+            const goodsPrice = getQuoteDayInfoByCodeFindPrice(props.selectedRow.goodscode);
+            if (goodsPrice && goodsPrice !== '--') {
+                // 有实时行情价格
+                result = ((goodsPrice as number) + formState.PriceMove).toFixed(2);
+            }
+            return result;
+        }
         function submit() {
             validateAction<FormParam>(formRef, formState).then((res) => {
                 const { goodscode, orderid } = props.selectedRow;
@@ -298,6 +308,7 @@ export default defineComponent({
             accountList,
             ...usePrice(),
             ...useNum(),
+            getPrice,
         };
     },
 });

+ 12 - 6
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_order_summary/components/listed/index.vue

@@ -306,6 +306,7 @@ import { validateAction } from '@/common/setup/form';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { useBlocksAccount, useBlocksFriends, useBlocksMoney, useBlocksNumber, useBlocksPermaceTemp, useBlocksPrice } from '@/common/setup/warehouse_receipt_trade/listing';
 import { getAccountTypeList, getCanUseMoney, getInTaAccount, getSelectedAccount, getUserId } from '@/services/bus/account';
+import { getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
 import { getMarketRunByTradeMode } from '@/services/bus/market';
 import { WrPosition } from '@/services/go/wrtrade/interface';
 import { hdWROrder } from '@/services/proto/warehousetrade';
@@ -351,23 +352,28 @@ export default defineComponent({
             formRef.value.validate();
         }
         const uuid = v4();
+                const goodsCode = ref<string>('');
         // 切换商品
         function handleGoodsChange(id: number) {
             //行情订阅
             removeSubscribeQuotation(uuid);
-            const goodsCode = goodsList.value.find((e) => e.goodsid === id)?.goodscode as string;
-            const arr = [{ exchangeCode: 250, goodsCode: goodsCode, subState: 0 }];
+            goodsCode.value = goodsList.value.find((e) => e.goodsid === id)?.goodscode as string;
+            const arr = [{ exchangeCode: 250, goodsCode: goodsCode.value, subState: 0 }];
             addSubscribeQuotation(uuid, arr);
             formRef.value.validate();
         }
         // 估算价
+        // 估算价
         function getPrice() {
             let result = '--';
-            const goodsPrice = getGoodsPrice();
-            if (goodsPrice.value && goodsPrice.value !== '--') {
-                // 有实时行情价格
-                result = ((goodsPrice.value as number) + formState.PriceMove).toFixed(2);
+            if (goodsCode.value) {
+                const goodsPrice = getQuoteDayInfoByCodeFindPrice(goodsCode.value);
+                if (goodsPrice && goodsPrice !== '--') {
+                    // 有实时行情价格
+                    result = ((goodsPrice as number) + formState.PriceMove).toFixed(2);
+                }
             }
+
             return result;
         }
         onMounted(() => {

+ 11 - 7
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/index.vue

@@ -293,13 +293,13 @@ import { validateAction } from '@/common/setup/form';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { useBlocksAccount, useBlocksFriends, useBlocksMoney, useBlocksNumber, useBlocksPermaceTemp, useBlocksPrice } from '@/common/setup/warehouse_receipt_trade/listing';
 import { getCanUseMoney, getInTaAccount, getUserId } from '@/services/bus/account';
+import { getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
 import { getMarketRunByTradeMode } from '@/services/bus/market';
 import { WrHoldLB } from '@/services/go/wrtrade/interface';
 import { hdWROrder } from '@/services/proto/warehousetrade';
 import { WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
 import { addSubscribeQuotation, removeSubscribeQuotation } from '@/services/socket/quota';
 import Bus from '@/utils/eventBus/index';
-import { getGoodsPrice } from '@/views/market/spot_trade/components/buy-sell-market/setup';
 import { message } from 'ant-design-vue';
 import moment from 'moment';
 import { v4 } from 'uuid';
@@ -338,23 +338,27 @@ export default defineComponent({
             formRef.value.validate();
         }
         const uuid = v4();
+        const goodsCode = ref<string>('');
         // 切换商品
         function handleGoodsChange(id: number) {
             //行情订阅
             removeSubscribeQuotation(uuid);
-            const goodsCode = goodsList.value.find((e) => e.goodsid === id)?.goodscode as string;
-            const arr = [{ exchangeCode: 250, goodsCode: goodsCode, subState: 0 }];
+            goodsCode.value = goodsList.value.find((e) => e.goodsid === id)?.goodscode as string;
+            const arr = [{ exchangeCode: 250, goodsCode: goodsCode.value, subState: 0 }];
             addSubscribeQuotation(uuid, arr);
             formRef.value.validate();
         }
         // 估算价
         function getPrice() {
             let result = '--';
-            const goodsPrice = getGoodsPrice();
-            if (goodsPrice.value && goodsPrice.value !== '--') {
-                // 有实时行情价格
-                result = ((goodsPrice.value as number) + formState.PriceMove).toFixed(2);
+            if (goodsCode.value) {
+                const goodsPrice = getQuoteDayInfoByCodeFindPrice(goodsCode.value);
+                if (goodsPrice && goodsPrice !== '--') {
+                    // 有实时行情价格
+                    result = ((goodsPrice as number) + formState.PriceMove).toFixed(2);
+                }
             }
+
             return result;
         }
         onMounted(() => {