huangbin 4 лет назад
Родитель
Сommit
d1dbe3ee3e

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

@@ -39,6 +39,8 @@ import { getBuyMarketParam } from '../../setup';
 import { BuyOrSell } from '@/common/constants/enumCommon';
 import { expandIcon } from '@/common/setup/table/clolumn';
 import { ColumnType } from '@/common/methods/table/interface';
+import { Moment } from 'moment';
+import moment from 'moment';
 
 export default defineComponent({
     emits: ['cancel', 'openComponent'],
@@ -56,6 +58,10 @@ export default defineComponent({
             type: Object as PropType<WrOrderQuote>,
             default: {},
         },
+        time: {
+            type: Object as PropType<Moment>,
+            default: moment(),
+        },
     },
     components: {
         BtnList,
@@ -74,6 +80,10 @@ export default defineComponent({
                 wrfactortypeid: props.parantSelectedRow.wrfactortypeid,
                 goodsid: props.parantSelectedRow.goodsid,
             };
+            if (!haswr) {
+                // 无仓单 需要交收月过滤数据
+                param.deliverymonth = moment(props.time).format('YYYY-MM');
+            }
             queryTable(queryOrderQuoteDetail, param);
         };
         // 表格通用逻辑

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

@@ -39,6 +39,8 @@ import { getSellMarketParam } from '../../setup';
 import { BuyOrSell } from '@/common/constants/enumCommon';
 import { expandIcon } from '@/common/setup/table/clolumn';
 import { ColumnType } from '@/common/methods/table/interface';
+import { Moment } from 'moment';
+import moment from 'moment';
 
 export default defineComponent({
     emits: ['cancel', 'openComponent'],
@@ -56,6 +58,10 @@ export default defineComponent({
             type: Object as PropType<WrOrderQuote>,
             default: {},
         },
+        time: {
+            type: Object as PropType<Moment>,
+            default: moment(),
+        },
     },
     components: {
         BtnList,
@@ -76,6 +82,10 @@ export default defineComponent({
                 wrfactortypeid: props.parantSelectedRow.wrfactortypeid,
                 goodsid: props.parantSelectedRow.goodsid,
             };
+            if (!haswr) {
+                // 无仓单 需要交收月过滤数据
+                param.deliverymonth = moment(props.time).format('YYYY-MM');
+            }
             queryTable(queryOrderQuoteDetail, param);
         };
         // 表格通用逻辑

+ 25 - 1
src/views/market/spot_trade/components/buy-sell-market/index.vue

@@ -19,6 +19,13 @@
         <div class="arrowLeftIcon"></div>
         <div class="name">{{selectedRow.warehousename}}</div>
       </div>
+      <div class="titleBtn titleBtn3"
+           v-if="!getHasWR(enumName)">
+        <a-month-picker :allowClear="false"
+                        v-model:value="time"
+                        @change="timeChange"
+                        class="commonDatePicker" />
+      </div>
       <div class="green">
         <div class="numBlock"
              v-if="isFloatPrice()">
@@ -67,12 +74,14 @@
         <Sell :enumName="enumName"
               ref="sellRef"
               :parantSelectedRow="selectedRow"
+              :time="time"
               :btnList="handleBtnList(sellMarket.btnList)" />
       </a-col>
       <a-col :span="12"
              v-if="buyMarket.isMarket">
         <Buy :enumName="enumName"
              ref="buyRef"
+             :time="time"
              :parantSelectedRow="selectedRow"
              :btnList="handleBtnList(buyMarket.btnList)" />
       </a-col>
@@ -91,7 +100,7 @@ import { defineAsyncComponent, defineComponent, BtnList, ModalEnum } from '@/com
 import { _closeModal } from '@/common/setup/modal/modal';
 import { WrOrderQuote } from '@/services/go/wrtrade/interface';
 import { LeftOutlined } from '@ant-design/icons-vue';
-import { handleChildComponentMethod, handleFinacing } from './setup';
+import { handleChildComponentMethod, handleFinacing, getHasWR } from './setup';
 import Buy from './components/buy/index.vue';
 import Sell from './components/sell/index.vue';
 import { LineChartOutlined } from '@ant-design/icons-vue';
@@ -104,6 +113,7 @@ import Bus from '@/utils/eventBus/index';
 import { getQuoteDayInfoByCode } from '@/services/bus/goods';
 import TimerUtils from '@/utils/timer/timerUtil';
 import { BtnList as BtnListType } from '@/common/components/btnList/interface';
+import moment, { Moment } from 'moment';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
@@ -128,6 +138,7 @@ export default defineComponent({
         [ModalEnum.spot_trade_warehouse_post_buying]: defineAsyncComponent(() => import('../post_buying/index.vue')),
     },
     setup(props, context) {
+        const time = ref<Moment>(moment()); // string 交收月
         const loading = ref<boolean>(false);
         const { visible, cancel } = _closeModal(context);
         // 买卖大厅 配置数据
@@ -153,6 +164,7 @@ export default defineComponent({
         onMounted(() => {
             removeSubscribeQuotation(uuid);
             TimerUtils.clearInterval('buyAndSellMartet');
+            TimerUtils.clearTimeout('debounce');
         });
         const { childRef: buyRef, loadChildComponentData: loadBuyData } = handleChildComponentMethod();
         const { childRef: sellRef, loadChildComponentData: loadSellData } = handleChildComponentMethod();
@@ -169,6 +181,15 @@ export default defineComponent({
                 return list;
             }
         }
+        function timeChange() {
+            TimerUtils.setTimeout(
+                () => {
+                    queryFn();
+                },
+                200,
+                'debounce'
+            );
+        }
         TimerUtils.setInterval(
             () => {
                 loadBuyData();
@@ -181,6 +202,7 @@ export default defineComponent({
         Bus.$on('spotTrade', loadSellData);
 
         return {
+            time,
             buyRef,
             sellRef,
             cancel,
@@ -195,6 +217,8 @@ export default defineComponent({
             openComponent,
             enumName: props.enumName,
             handleBtnList,
+            getHasWR,
+            timeChange,
         };
     },
 });

+ 1 - 0
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_order_summary/components/listed/index.vue

@@ -248,6 +248,7 @@ export default defineComponent({
                     };
                     console.log(param);
                     requestResultLoadingAndInfo(hdWROrder, param, loading, ['挂牌成功', '挂牌失败:']).then(() => {
+                        Bus.$emit('spotTrade', true);
                         cancel(true);
                     });
                 });

+ 2 - 0
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_pending_order/components/cancle/index.vue

@@ -18,6 +18,7 @@ import { WRListingCancelOrderReq } from '@/services/proto/warehousetrade/interfa
 import * as Long from 'long';
 import { getLongTypeLoginID } from '@/services/bus/login';
 import { Modal } from 'ant-design-vue';
+import Bus from '@/utils/eventBus/index';
 
 export default defineComponent({
     name: ModalEnum.pre_sale_warehouse_receipt_pending_order_cancel_order,
@@ -47,6 +48,7 @@ export default defineComponent({
                 WRID: props.selectedRow.wrfactortypeid, // uint64 仓单ID,卖的时候填写
             };
             requestResultLoadingAndInfo(wRListingCancelOrder, param, loading, ['撤单成功', '撤单失败:']).then(() => {
+                Bus.$emit('spotTrade', true);
                 cancel(true);
             });
         }

+ 2 - 0
src/views/order/spot_warran/components/spot_warrant_pending_order/components/cancle/index.vue

@@ -18,6 +18,7 @@ import { WRListingCancelOrderReq } from '@/services/proto/warehousetrade/interfa
 import * as Long from 'long';
 import { getLongTypeLoginID } from '@/services/bus/login';
 import { Modal } from 'ant-design-vue';
+import Bus from '@/utils/eventBus/index';
 
 export default defineComponent({
     name: ModalEnum.spot_warrant_pending_order_cancel_order,
@@ -47,6 +48,7 @@ export default defineComponent({
                 WRID: props.selectedRow.wrfactortypeid, // uint64 仓单ID,卖的时候填写
             };
             requestResultLoadingAndInfo(wRListingCancelOrder, param, loading, ['撤单成功', '撤单失败:']).then(() => {
+                Bus.$emit('spotTrade', true);
                 cancel(true);
             });
         }