huangbin 4 éve
szülő
commit
ae39dd5f33

+ 11 - 8
src/views/market/spot_trade/spot_trade_order_transaction/components/buy-sell-market/index.vue

@@ -56,7 +56,7 @@
             </div>
           </div>
         </div>
-        <BtnList :btnList="btnListData"
+        <BtnList :btnList="handleBtnList()"
                  :record="selectedRow"
                  @click="openComponent" />
       </div>
@@ -111,13 +111,14 @@ import StockExchange from '../stock-exchange/index.vue';
 import Chart from '../../../components/goods-chart/chart/index.vue'; // 暂用组件,待优化
 import { ComponentType } from '../../setup';
 import { handleSubcriteOnDemandQuote, handleQuotePriceColor, quoteChange, quoteAmplitude, quoteAmplituOfVibration, handleNoneValue } from '@/common/setup/table/tableQuote';
+import { Tradesfer } from '../../spot_trade_order_transaction_listing_transfer/interface';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
     name: 'buy-sell-market',
     props: {
         selectedRow: {
-            type: Object as PropType<QueryQuoteDayRsp>,
+            type: Object as PropType<Tradesfer>,
             default: {},
         },
         deliverGoods: {
@@ -138,11 +139,13 @@ export default defineComponent({
     setup(props, context) {
         const loading = ref<boolean>(false);
         const { visible, cancel } = _closeModal(context);
-
-        const btnListData: BtnListType[] = [
-            { lable: '挂牌求购', code: 'Listing', className: 'operBtn' },
-            { lable: '详情', code: 'Detail', className: 'btnDeafault' },
-        ];
+        function handleBtnList() {
+            const result: BtnListType[] = [{ lable: '挂牌求购', code: 'Listing', className: 'operBtn' }];
+            if (props.selectedRow.deliverytype) {
+                result.push({ lable: '详情', code: 'Detail', className: 'btnDeafault' });
+            }
+            return result;
+        }
 
         onBeforeUnmount(() => {
             TimerUtils.clearInterval('buyAndSellMartet');
@@ -189,7 +192,6 @@ export default defineComponent({
             componentId,
             closeComponent,
             openComponent,
-            btnListData,
             changeComponent,
             ComponentType,
             showComponentsId,
@@ -200,6 +202,7 @@ export default defineComponent({
             quoteChange,
             quoteAmplitude,
             quoteAmplituOfVibration,
+            handleBtnList,
         };
     },
 });

+ 10 - 3
src/views/market/spot_trade/spot_trade_order_transaction/components/listing/index.vue

@@ -109,7 +109,7 @@
 
 <script lang="ts">
 import Drawer from '@/common/components/drawer/index.vue';
-import { DelistingType, PriceType } from '@/common/constants/enumCommon';
+import { DelistingType, PriceType, TradeMode } from '@/common/constants/enumCommon';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { validateAction } from '@/common/setup/form';
@@ -129,6 +129,8 @@ import { useBlocksAccount } from '../../spot_trade_order_transaction_swap/compon
 import { FormState } from './interface';
 import { handleForm } from './setup';
 import Bus from '@/utils/eventBus';
+import { Tradesfer } from '../../spot_trade_order_transaction_listing_transfer/interface';
+import { getMarketByTradeMode } from '@/services/bus/market';
 
 export default defineComponent({
     name: ModalEnum.spot_trade_warehouse_financing_delisting,
@@ -139,6 +141,10 @@ export default defineComponent({
             type: Object as PropType<QueryDeliveryRelationRsp>,
             default: {},
         },
+        selectedRow: {
+            type: Object as PropType<Tradesfer>,
+            default: {},
+        },
     },
 
     setup(props, context) {
@@ -162,6 +168,7 @@ export default defineComponent({
 
         function submit() {
             validateAction<FormState>(formRef, formState).then((res) => {
+                const marketid = getMarketByTradeMode(TradeMode.ListingAndSelection)!.marketid;
                 // 挂牌请求 通过挂牌求购进行挂牌
                 const param: OrderReq = {
                     ClientSerialNo: uuidv4(), // 客户端流水号
@@ -169,8 +176,8 @@ export default defineComponent({
                     ClientType: 4, // 终端类型
                     LoginID: geLoginID_number()!, // 登陆账号
                     AccountID: getSelectedAccountId(), // 交易账号
-                    GoodsID: props.deliverGoods.goodsid, // 商品ID
-                    MarketID: props.deliverGoods.marketid, // 市场ID
+                    GoodsID: props.selectedRow.goodsid, // 商品ID
+                    MarketID: props.deliverGoods.marketid ? props.deliverGoods.marketid : marketid, // 市场ID
                     ValidType: 1, // 校验类型 当日有效
                     OperateType: 1, // 操作类型: 申请
                     OrderSrc: 1, // 单据来源: 客户端下单

+ 30 - 11
src/views/market/spot_trade/spot_trade_order_transaction/setup.ts

@@ -1,6 +1,6 @@
 import { TradeMode } from "@/common/constants/enumCommon"
 import { initData } from "@/common/methods"
-import { getQuoteDayInfoByCode } from "@/services/bus/goods"
+import { getGoodsListByTrade, getQuoteDayInfoByCode } from "@/services/bus/goods"
 import { getMarketByTradeMode } from "@/services/bus/market"
 import { queryDeliveryRelation } from "@/services/go/delivery"
 import { QueryDeliveryRelationRsp } from "@/services/go/delivery/interface"
@@ -18,16 +18,22 @@ export function handleDeliveryRelation(param: deliverytype[]) {
     // 查询交割商品
     const deliverGoods = ref<any[]>([])
     function queryAction() {
+        // 根据 交易模式 获取 商品
+        // 没有交割商品也要显示
+        const allGoodsLsit = getGoodsListByTrade(TradeMode.ListingAndSelection).value.filter(e => e.goodsstatus === 3)
         const marketid = getMarketByTradeMode(TradeMode.ListingAndSelection)!.marketid
         queryDeliveryRelation({ marketid }).then(res => {
             goodsList.value.length = 0
             allDeliverGoods.value = res
             deliverGoods.value = getDeliverGoods()
-            res.forEach(el => {
+
+            allGoodsLsit.forEach(el => {
                 // 找到盘面数据
                 const quote = getQuoteDayInfoByCode(el.goodscode);
                 if (quote) {
-                    Object.assign(quote, { goodsname: el.goodsname, deliverytype: el.deliverytype })
+                    const item = res.find(item => item.goodsid === el.goodsid)
+                    const deliverytype = item ? item.deliverytype : undefined
+                    Object.assign(quote, { goodsname: el.goodsname, goodsid: el.goodsid, deliverytype })
                     goodsList.value.push(quote)
                 }
             })
@@ -38,13 +44,14 @@ export function handleDeliveryRelation(param: deliverytype[]) {
         return allDeliverGoods.value.filter(e => param.includes(e.deliverytype as deliverytype))
     }
     initData(() => {
-        if (allDeliverGoods.value.length === 0) {
-            // 从服务交割商品
-            queryAction()
-        } else {
-            // 从缓存中获取交割商品
-            deliverGoods.value = getDeliverGoods()
-        }
+        // if (allDeliverGoods.value.length === 0) {
+        //     // 从服务交割商品
+        //     queryAction()
+        // } else {
+        //     // 从缓存中获取交割商品
+        //     deliverGoods.value = getDeliverGoods()
+        // }
+        queryAction()
     })
     // 更新交割商品
     function updateGeliverGoods() {
@@ -52,7 +59,19 @@ export function handleDeliveryRelation(param: deliverytype[]) {
     }
     // 获取对应的行情
     function getQuoteList() {
-        return goodsList.value.filter(e => param.includes((e as unknown as any).deliverytype))
+        if (param.includes(1) || param.includes(3)) {
+            return goodsList.value.filter(e => {
+                const item = (e as unknown as any).deliverytype
+                if (item) {
+                    return param.includes((e as unknown as any).deliverytype)
+                } else {
+                    return true
+                }
+            })
+
+        } else {
+            return goodsList.value.filter(e => param.includes((e as unknown as any).deliverytype))
+        }
     }
     // 通过goodscode 查找交割商品
     function findDeilverGoodsByGoodsCode(goodscode: string) {

+ 16 - 10
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_listing_transfer/index.vue

@@ -70,7 +70,7 @@
     <!-- 右键 -->
     <contextMenu :contextMenu="contextMenu"
                  @cancel="closeContext"
-                 :list="btnList"></contextMenu>
+                 :list="handleBtnList(selectedRow)"></contextMenu>
     <component :is="componentId"
                v-if="componentId"
                :selectedRow="selectedRow"
@@ -86,7 +86,7 @@ import { contextMenu, defineAsyncComponent, defineComponent } from '@/common/exp
 import { handleDeliveryRelation } from '../setup';
 
 import { handleSubcriteOnDemandQuote, handleQuotePriceColor, quoteChange, quoteAmplitude, quoteAmplituOfVibration, handleNoneValue } from '@/common/setup/table/tableQuote';
-import { QueryDeliveryRelationRsp } from '@/services/go/delivery/interface';
+import { QueryDeliveryRelationReq, QueryDeliveryRelationRsp } from '@/services/go/delivery/interface';
 import { columnsList } from '../setup';
 
 import { handleTableEventAndData } from '@/common/setup/table/compose';
@@ -95,6 +95,7 @@ import { BtnListType } from '@/common/components/btnList/interface';
 import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
 import { getShowBottomValue } from '@/common/config/constrolBottom';
 import { ref } from 'vue';
+import { Tradesfer } from './interface';
 
 export default defineComponent({
     name: EnumRouterName.spot_trade_order_transaction_listing_transfer,
@@ -112,21 +113,26 @@ export default defineComponent({
             queryFn: () => {},
             clickName: 'BuyAndSell',
         };
-        const btnList: BtnListType[] = [
-            { lable: '挂牌求购', code: 'Listing', className: 'btnDeafault' },
-            { lable: '图表', code: 'BuyAndSell', className: 'btnDeafault' },
-            { lable: '详情', code: 'Detail', className: 'btnDeafault' },
-            // { lable: '买卖大厅', code: 'BuyAndSell', className: 'btnDeafault' },
-        ];
+        function handleBtnList(record: Tradesfer) {
+            const result: BtnListType[] = [
+                { lable: '挂牌求购', code: 'Listing', className: 'btnDeafault' },
+                { lable: '图表', code: 'BuyAndSell', className: 'btnDeafault' },
+            ];
+            if (record && record.deliverytype) {
+                result.push({ lable: '详情', code: 'Detail', className: 'btnDeafault' });
+            }
+            return result;
+        }
+
         const { deliverGoods, getQuoteList, goodsList, findDeilverGoodsByGoodsCode } = handleDeliveryRelation([1, 3]);
         // 行情按需订阅
         handleSubcriteOnDemandQuote<QueryDeliveryRelationRsp>(deliverGoods);
 
         return {
             isBottom,
-            ...handleTableEventAndData<QueryQuoteDayRsp>(param),
+            ...handleTableEventAndData<Tradesfer>(param),
             deliverGoods,
-            btnList,
+            handleBtnList,
             handleQuotePriceColor,
             quoteChange,
             quoteAmplitude,

+ 6 - 0
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_listing_transfer/interface.ts

@@ -0,0 +1,6 @@
+import { QueryQuoteDayRsp } from "@/services/go/quote/interface";
+
+export interface Tradesfer extends QueryQuoteDayRsp {
+    deliverytype: number | undefined,
+    goodsid: number
+}

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

@@ -309,7 +309,7 @@ export default defineComponent({
                     param.MarketMaxSub = res.PriceMove; // 基差
                 } else {
                     // 浮动价 不传价格,固定价才传价格
-                    param.OrderPrice = res.priceType;
+                    param.OrderPrice = res.FixedPrice;
                 }
                 requestResultLoadingAndInfo(diaoQiOrder, param, loading, ['挂牌求购成功', '挂牌求购失败:']).then(() => {
                     cancel(true);