ソースを参照

修改撤单问题

li.shaoyi 3 年 前
コミット
05e8cc069b

+ 1 - 1
src/common/setup/table/button.ts

@@ -18,8 +18,8 @@ export function getClassName(val: string): BtnClassName {
     const operBtn = ['add', 'modify', 'reset', 'credit', 'payment', 'confirm_withdrawal', 'complete_stocking', 'upload_logistics', 'buy', 'listed', 'delisting',
         'receipt', 'confirm_pickup']
     const map = new Map<BtnClassName, string[]>([
-        ['btnDanger', btnDanger],
         ['operBtn', operBtn],
+        ['btnDanger', btnDanger],
     ])
     for (const [key, value] of map) {
         for (const item of value) {

+ 2 - 2
src/layout/components/bottom.vue

@@ -30,7 +30,7 @@ import { AccountListItem } from '@/services/dataCenter/interafce/account';
 import { OperationTabMenu } from '@/services/go/commonService/interface';
 import { getTaAccount } from '@/services/go/TaAccount';
 import Bus from '@/utils/eventBus/index';
-import { defineAsyncComponent, defineComponent, ref ,onBeforeUnmount} from 'vue';
+import { defineAsyncComponent, defineComponent, ref, onBeforeUnmount } from 'vue';
 
 export default defineComponent({
   name: 'layout-top',
@@ -72,7 +72,7 @@ export default defineComponent({
     function selectMenu(value: OperationTabMenu) {
       componentId.value = value.code as enumOrderComponents;
     }
-    
+
     onBeforeUnmount(() => {
       stopNotify();
     })

+ 13 - 16
src/services/proto/warehousetrade/index.ts

@@ -15,15 +15,11 @@ import { getInTaAccount } from '@/services/bus/account';
  * @param param
  */
 export const hdWROrder = (param: HdWROrderReq): Promise<any> => {
-    if (param.MarketID) {
-        const header: IMessageHead = {
-            MarketID: param.MarketID,
-            AccountID: getInTaAccount(),
-        }
-        return protoMiddleware<HdWROrderReq>(param, 'HdWROrderReq', 'HdWROrderRsp', header)
-    } else {
-        return protoMiddleware<HdWROrderReq>(param, 'HdWROrderReq', 'HdWROrderRsp', HeadEnum.tradeMode17)
+    const header: IMessageHead = {
+        MarketID: param.MarketID,
+        AccountID: getInTaAccount(),
     }
+    return protoMiddleware<HdWROrderReq>(param, 'HdWROrderReq', 'HdWROrderRsp', header)
 }
 
 /**
@@ -33,14 +29,11 @@ export const hdWROrder = (param: HdWROrderReq): Promise<any> => {
  * @constructor
  */
 export const HdWRDealOrder = (param: HdWRDealOrderReq): Promise<any> => {
-    if (param.MarketID) {
-        const header: IMessageHead = {
-            MarketID: param.MarketID,
-            AccountID: getInTaAccount(),
-        }
-        return protoMiddleware<HdWRDealOrderReq>(param, 'HdWRDealOrderReq', 'HdWRDealOrderRsp', header)
+    const header: IMessageHead = {
+        MarketID: param.MarketID,
+        AccountID: getInTaAccount(),
     }
-    return protoMiddleware<HdWRDealOrderReq>(param, 'HdWRDealOrderReq', 'HdWRDealOrderRsp', HeadEnum.tradeMode17)
+    return protoMiddleware<HdWRDealOrderReq>(param, 'HdWRDealOrderReq', 'HdWRDealOrderRsp', header)
 }
 /**
  * 议价摘牌请求
@@ -65,7 +58,11 @@ export const wROutApply = (param: WROutApplyReq): Promise<any> => {
  * @param param
  */
 export const wRListingCancelOrder = (param: WRListingCancelOrderReq): Promise<any> => {
-    return protoMiddleware<WRListingCancelOrderReq>(param, 'WRListingCancelOrderReq', 'WRListingCancelOrderRsp', HeadEnum.tradeMode17)
+    const header: IMessageHead = {
+        MarketID: param.MarketID,
+        AccountID: getInTaAccount(),
+    }
+    return protoMiddleware<WRListingCancelOrderReq>(param, 'WRListingCancelOrderReq', 'WRListingCancelOrderRsp', header)
 }
 
 

+ 1 - 0
src/services/proto/warehousetrade/interface.ts

@@ -167,6 +167,7 @@ export interface WRListingCancelOrderReq {
     OperatorID: number; // uint64 操作员账号ID
     BuyOrSell: number; // uint32 买卖方向
     WRID: number; // uint64 仓单ID,卖的时候填写
+    MarketID?: number; // 市场ID
 }
 
 // 挂牌撤单应答 0 22 5

+ 16 - 16
src/views/market/spot_trade/components/goods-chart/chart/index.vue

@@ -213,25 +213,25 @@ export default defineComponent({
     watch(
       () => props.selectedRow.last,
       () => {
-        if (tradedList.value.length) {
+        if (tradedList.value.length > 19) {
           // 移除列表最后一条记录
           tradedList.value.pop();
-          // 向列表开头添加新纪录
-          tradedList.value.unshift({
-            AV: 0,
-            Ask: 0,
-            BV: 0,
-            Bid: 0,
-            HI: 0,
-            HV: 0,
-            PE: props.selectedRow.last,
-            TDR: 0,
-            TK: 0,
-            TS: props.selectedRow.lasttime,
-            TT: 0,
-            Vol: props.selectedRow.lastvolume,
-          });
         }
+        // 向列表开头添加新纪录
+        tradedList.value.unshift({
+          AV: 0,
+          Ask: 0,
+          BV: 0,
+          Bid: 0,
+          HI: 0,
+          HV: 0,
+          PE: props.selectedRow.last,
+          TDR: 0,
+          TK: 0,
+          TS: props.selectedRow.lasttime,
+          TT: 0,
+          Vol: props.selectedRow.lastvolume,
+        });
       }
     );
 

+ 50 - 41
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_pending_order/components/cancle/index.vue

@@ -21,51 +21,60 @@ 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,
-    components: { Drawer },
-    emits: ['cancel', 'update'],
-    props: {
-        selectedRow: {
-            type: Object as PropType<WrOrderDetail>,
-            default: {},
-        },
+  name: ModalEnum.pre_sale_warehouse_receipt_pending_order_cancel_order,
+  components: { Drawer },
+  emits: ['cancel', 'update'],
+  props: {
+    selectedRow: {
+      type: Object as PropType<WrOrderDetail>,
+      default: {},
     },
-    setup(props, context) {
-        const { visible, cancel } = _closeModal(context);
-        const loading = ref<boolean>(false);
+  },
+  setup(props, context) {
+    const { visible, cancel } = _closeModal(context);
+    const loading = ref<boolean>(false);
 
-        function submit() {
-            const param: WRListingCancelOrderReq = {
-                UserID: getUserId(), // uint32 用户ID
-                AccountID: getInTaAccount(), // uint64 资金账号
-                OldWRTradeOrderID: Long.fromString(props.selectedRow.wrtradeorderid), // uint64 目标仓单贸易委托单ID
-                OrderSrc: 1, // uint32 委托来源
-                ClientSerialNo: uuidv4(), // string 客户端流水号
-                ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
-                ClientType: 4, // uint32 终端类型
-                OperatorID: Number(geLoginID_number()), // uint64 操作员账号ID
-                BuyOrSell: props.selectedRow.buyorsell, // uint32 买卖方向
-                WRID: Long.fromString(props.selectedRow.wrfactortypeid), // uint64 仓单ID,卖的时候填写
-            };
-            requestResultLoadingAndInfo(wRListingCancelOrder, param, loading, ['撤单成功', '撤单失败:']).then(() => {
-                Bus.$emit('spotTrade', true);
-                Bus.$emit('blocsTrade', true);
-                cancel(true);
-            });
-        }
+    function submit() {
+      const param: WRListingCancelOrderReq = {
+        UserID: getUserId(), // uint32 用户ID
+        AccountID: getInTaAccount(), // uint64 资金账号
+        OldWRTradeOrderID: Long.fromString(props.selectedRow.wrtradeorderid), // uint64 目标仓单贸易委托单ID
+        OrderSrc: 1, // uint32 委托来源
+        ClientSerialNo: uuidv4(), // string 客户端流水号
+        ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
+        ClientType: 4, // uint32 终端类型
+        OperatorID: Number(geLoginID_number()), // uint64 操作员账号ID
+        BuyOrSell: props.selectedRow.buyorsell, // uint32 买卖方向
+        WRID: Long.fromString(props.selectedRow.wrfactortypeid), // uint64 仓单ID,卖的时候填写
+        MarketID: props.selectedRow.marketid,
+      };
 
-        Modal.confirm({
-            title: '撤单',
-            content: '是否确认撤单!',
-            onOk: submit,
-            onCancel: cancel,
-        });
+      return requestResultLoadingAndInfo(wRListingCancelOrder, param, loading, ['撤单成功', '撤单失败:']).then(() => {
+        Bus.$emit('spotTrade', true);
+        Bus.$emit('blocsTrade', true);
+        cancel(true);
+      });
+    }
 
-        return {
-            visible,
-            cancel,
-        };
-    },
+    Modal.confirm({
+      title: '撤单',
+      content: '是否确认撤单!',
+      maskClosable: false,
+      onOk: async () => {
+        return submit();
+      },
+      onCancel: () => {
+        if (!loading.value) {
+          cancel()
+        }
+      },
+    });
+
+    return {
+      visible,
+      cancel,
+    };
+  },
 });
 </script>
 

+ 50 - 41
src/views/order/spot_warran/components/spot_warrant_pending_order/components/cancle/index.vue

@@ -21,51 +21,60 @@ import { Modal } from 'ant-design-vue';
 import Bus from '@/utils/eventBus/index';
 
 export default defineComponent({
-    name: ModalEnum.spot_warrant_pending_order_cancel_order,
-    components: { Drawer },
-    emits: ['cancel', 'update'],
-    props: {
-        selectedRow: {
-            type: Object as PropType<WrOrderDetail>,
-            default: {},
-        },
+  name: ModalEnum.spot_warrant_pending_order_cancel_order,
+  components: { Drawer },
+  emits: ['cancel', 'update'],
+  props: {
+    selectedRow: {
+      type: Object as PropType<WrOrderDetail>,
+      default: {},
     },
-    setup(props, context) {
-        const { visible, cancel } = _closeModal(context);
-        const loading = ref<boolean>(false);
+  },
+  setup(props, context) {
+    const { visible, cancel } = _closeModal(context);
+    const loading = ref<boolean>(false);
 
-        function submit() {
-            const param: WRListingCancelOrderReq = {
-                UserID: getUserId(), // uint32 用户ID
-                AccountID: getInTaAccount(), // uint64 资金账号
-                OldWRTradeOrderID: Long.fromString(props.selectedRow.wrtradeorderid), // uint64 目标仓单贸易委托单ID
-                OrderSrc: 1, // uint32 委托来源
-                ClientSerialNo: uuidv4(), // string 客户端流水号
-                ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
-                ClientType: 4, // uint32 终端类型
-                OperatorID: Number(geLoginID_number()), // uint64 操作员账号ID
-                BuyOrSell: props.selectedRow.buyorsell, // uint32 买卖方向
-                WRID: Long.fromString(props.selectedRow.wrfactortypeid), // uint64 仓单ID,卖的时候填写
-            };
-            requestResultLoadingAndInfo(wRListingCancelOrder, param, loading, ['撤单成功', '撤单失败:']).then(() => {
-                Bus.$emit('spotTrade', true);
-                Bus.$emit('blocsTrade', true);
-                cancel(true);
-            });
-        }
+    function submit() {
+      const param: WRListingCancelOrderReq = {
+        UserID: getUserId(), // uint32 用户ID
+        AccountID: getInTaAccount(), // uint64 资金账号
+        OldWRTradeOrderID: Long.fromString(props.selectedRow.wrtradeorderid), // uint64 目标仓单贸易委托单ID
+        OrderSrc: 1, // uint32 委托来源
+        ClientSerialNo: uuidv4(), // string 客户端流水号
+        ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
+        ClientType: 4, // uint32 终端类型
+        OperatorID: Number(geLoginID_number()), // uint64 操作员账号ID
+        BuyOrSell: props.selectedRow.buyorsell, // uint32 买卖方向
+        WRID: Long.fromString(props.selectedRow.wrfactortypeid), // uint64 仓单ID,卖的时候填写
+        MarketID: props.selectedRow.marketid,
+      };
 
-        Modal.confirm({
-            title: '撤单',
-            content: '是否确认撤单?',
-            onOk: submit,
-            onCancel: cancel,
-        });
+      return requestResultLoadingAndInfo(wRListingCancelOrder, param, loading, ['撤单成功', '撤单失败:']).then(() => {
+        Bus.$emit('spotTrade', true);
+        Bus.$emit('blocsTrade', true);
+        cancel(true);
+      });
+    }
 
-        return {
-            visible,
-            cancel,
-        };
-    },
+    Modal.confirm({
+      title: '撤单',
+      content: '是否确认撤单!',
+      maskClosable: false,
+      onOk: async () => {
+        return submit();
+      },
+      onCancel: () => {
+        if (!loading.value) {
+          cancel()
+        }
+      },
+    });
+
+    return {
+      visible,
+      cancel,
+    };
+  },
 });
 </script>
 

+ 2 - 2
src/views/order/swap_the_order/components/swap_commodity_contract_summary/index.vue

@@ -30,8 +30,8 @@
           <a>{{ getLastprice(record) }}</a>
         </template>
         <!-- 均价 -->
-        <template #averageprice="{ text }">
-          <a>{{ handleNoneValue(text) }}</a>
+        <template #averageprice="{ record }">
+          <a>{{ handleNoneValue(record.averageprice.toFixed(record.decimalplace)) }}</a>
         </template>
         <!-- 持仓盈亏 -->
         <template #profitloss="{ record }">