huangbin 4 jaren geleden
bovenliggende
commit
ccf15bf567

+ 4 - 3
src/services/proto/warehousetrade/index.ts

@@ -5,6 +5,7 @@ import {
     WROutApplyReq
 } from "@/services/proto/warehousetrade/interface";
 import { protoMiddleware } from "@/services/socket/protobuf/buildReq";
+import { HeadEnum } from "@/services/socket/protobuf/protoHeader";
 
 
 /**
@@ -12,7 +13,7 @@ import { protoMiddleware } from "@/services/socket/protobuf/buildReq";
  * @param param
  */
 export const hdWROrder = (param: HdWROrderReq): Promise<any> => {
-    return protoMiddleware<HdWROrderReq>(param, 'HdWROrderReq', 'HdWROrderRsp', 5)
+    return protoMiddleware<HdWROrderReq>(param, 'HdWROrderReq', 'HdWROrderRsp', HeadEnum.tradeMode17)
 }
 
 /**
@@ -44,7 +45,7 @@ export const HdWRDealOrder = (param: HdWRDealOrderReq): Promise<any> => {
  * 出入库请求
  * @param param
  */
-export const wROutApply = (param: WROutApplyReq): Promise<any> =>{
+export const wROutApply = (param: WROutApplyReq): Promise<any> => {
     return protoMiddleware<WROutApplyReq>(param, 'WROutApplyReq', 'WROutApplyRsp', 2)
 }
 
@@ -52,7 +53,7 @@ export const wROutApply = (param: WROutApplyReq): Promise<any> =>{
  * 挂牌撤单请求
  * @param param
  */
-export const wRListingCancelOrder = (param: WRListingCancelOrderReq): Promise<any> =>{
+export const wRListingCancelOrder = (param: WRListingCancelOrderReq): Promise<any> => {
     return protoMiddleware<WRListingCancelOrderReq>(param, 'WRListingCancelOrderReq', 'WRListingCancelOrderRsp', 2)
 }
 

+ 4 - 4
src/services/socket/protobuf/protoHeader.ts

@@ -11,7 +11,7 @@ export enum HeadEnum {
     MarketID18_GoodsID0, // funcode uuid userID, MarketID:18, GoodsID: 0
     MarketID15101,
     MarketID69201,
-    MarketID17201,
+    tradeMode17,
 }
 
 /**
@@ -45,10 +45,10 @@ export function getProtoHeadParam(funCodeName: string, type: HeadEnum = 0): IMes
             result = Object.assign(result, { MarketID: 15101 })
             break;
         case HeadEnum.MarketID69201:
-            result = Object.assign(result, { MarketID: getMarketByTradeMode(TradeMode.Platinum), })
+            result = Object.assign(result, { MarketID: getMarketByTradeMode(TradeMode.Platinum)?.marketid, })
             break;
-        case HeadEnum.MarketID17201:
-            result = Object.assign(result, { MarketID: 17201, })
+        case HeadEnum.tradeMode17:
+            result = Object.assign(result, { MarketID: getMarketByTradeMode(TradeMode.WarehouseReceiptTrade)?.marketid, })
             break;
     }
     return result

+ 52 - 45
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/index.vue

@@ -139,6 +139,8 @@ import { _closeModal } from '@/common/setup/modal/modal';
 import { handlePasswordForm } from './setup';
 import { validateAction } from '@/common/setup/form';
 import { ListingForm } from './interface';
+import { getMarketRunByTradeMode } from '@/services/bus/market';
+import { message } from 'ant-design-vue';
 
 export default defineComponent({
     name: ModalEnum.spot_warrant_spot_details_listed,
@@ -157,52 +159,57 @@ export default defineComponent({
         const data = props.selectedRow;
         const loading = ref<boolean>(false);
         function submit() {
-            validateAction<ListingForm>(formRef, formState).then((res) => {
-                const param = {
-                    AccountID: data.accountid.toString(), // 默认内部资金账号第一个
-                    ClientSerialNo: uuidv4(), // 客户端流水号
-                    // OperateSrc: 2,
-                    ClientType: 4,
-                    // MarketID: 17201,
-                    LadingBillId: props.selectedRow.ladingbillid.toString(), // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
-                    // LadingBillId: 'uint642081626946446000001', // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
-                    TradeDate: moment('20210727').format('YYYYMMDD'), // 交易日 string
-                    // SubNum: '0', // 提单子单号
-                    SubNum: props.selectedRow.subnum,
-                    // WRFactorTypeId: '2121626946446000001', // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
-                    WRFactorTypeId: props.selectedRow.wrfactortypeid, // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
-                    IsSpecified: 0, // 是否指定对手 0:不指定 1:指定 uint32
-                    // MatchUserIDs: 0, // 仓单贸易对手资金账号ID集合(指定对手时填写) uint32
-                    OrderQty: res.OrderQty, // 委托数量(可挂部分数据量) ======
-                    DeliveryGoodsID: data.deliverygoodsid, // 交割商品商品ID
-                    WRPriceType: res.WRPriceType, // 价格方式 1:固定价 2:浮动价
-                    FixedPrice: res.FixedPrice, // 固定价格
-                    PriceFactor: 0, // 价格系数(浮动价时填写)
-                    PriceMove: res.PriceMove, // 升贴水(浮动价时填写)
-                    TimevalidType: 4, // 时间有效类型 1:当日有效 2:本周有效 3:指定时间有效 4:一直有效
-                    // ValidTime: moment('2021-08-25 00:00:00').format('YYYY-MM-DD HH:mm:ss'), // 有效期限
-                    ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'),
-                    FirstRatio: 0, // 首付比例
-                    PerformanceTemplateID: 0, // 履约计划模板ID
-                    UserID: getUserId(),
-                    OperatorID: getUserId(), // 操作员账号ID
-                    BuyOrSell: 1, // 买卖方向 0买1卖
-                    PriceDisplayMode: 1, // 浮动价显示方式 1:合并显示 2:分开显示
-                    CanBargain: 0, // 挂牌是否可议价0:不可1:可-摘牌是否议价
-                    Attachment1: '', // 附件1
-                    Attachment2: '', // 附件2
-                    Remark: '222', // 备注
-                    ApplyID: 0, // 申请ID
-                    CanPart: 1, // 是否允许部份摘牌0:不允许;1:允许
-                    WRTradeGoods: [],
-                    wrstandardid: props.selectedRow.wrstandardid,
-                    HasWr: 1,
-                };
-                console.log(param);
-                requestResultLoadingAndInfo(hdWROrder, param, loading, ['挂牌成功', '挂牌失败:']).then(() => {
-                    cancel();
+            const marketInfo = getMarketRunByTradeMode(17);
+            if (marketInfo) {
+                validateAction<ListingForm>(formRef, formState).then((res) => {
+                    const param = {
+                        AccountID: data.accountid.toString(), // 默认内部资金账号第一个
+                        ClientSerialNo: uuidv4(), // 客户端流水号
+                        // OperateSrc: 2,
+                        ClientType: 4,
+                        // MarketID: marketInfo.marketid,
+                        LadingBillId: props.selectedRow.ladingbillid.toString(), // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
+                        // LadingBillId: 'uint642081626946446000001', // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
+                        TradeDate: moment(marketInfo.tradedate).format('YYYYMMDD'), // 交易日 string
+                        // SubNum: '0', // 提单子单号
+                        SubNum: props.selectedRow.subnum,
+                        // WRFactorTypeId: '2121626946446000001', // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
+                        WRFactorTypeId: props.selectedRow.wrfactortypeid, // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
+                        IsSpecified: 0, // 是否指定对手 0:不指定 1:指定 uint32
+                        // MatchUserIDs: 0, // 仓单贸易对手资金账号ID集合(指定对手时填写) uint32
+                        OrderQty: res.OrderQty, // 委托数量(可挂部分数据量) ======
+                        DeliveryGoodsID: data.deliverygoodsid, // 交割商品商品ID
+                        WRPriceType: res.WRPriceType, // 价格方式 1:固定价 2:浮动价
+                        FixedPrice: res.FixedPrice, // 固定价格
+                        PriceFactor: 0, // 价格系数(浮动价时填写)
+                        PriceMove: res.PriceMove, // 升贴水(浮动价时填写)
+                        TimevalidType: 4, // 时间有效类型 1:当日有效 2:本周有效 3:指定时间有效 4:一直有效
+                        // ValidTime: moment('2021-08-25 00:00:00').format('YYYY-MM-DD HH:mm:ss'), // 有效期限
+                        ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'),
+                        FirstRatio: 0, // 首付比例
+                        PerformanceTemplateID: 0, // 履约计划模板ID
+                        UserID: getUserId(),
+                        OperatorID: getUserId(), // 操作员账号ID
+                        BuyOrSell: 1, // 买卖方向 0买1卖
+                        PriceDisplayMode: 1, // 浮动价显示方式 1:合并显示 2:分开显示
+                        CanBargain: 0, // 挂牌是否可议价0:不可1:可-摘牌是否议价
+                        Attachment1: '', // 附件1
+                        Attachment2: '', // 附件2
+                        Remark: '222', // 备注
+                        ApplyID: 0, // 申请ID
+                        CanPart: 1, // 是否允许部份摘牌0:不允许;1:允许
+                        WRTradeGoods: [],
+                        wrstandardid: props.selectedRow.wrstandardid,
+                        HasWr: 1,
+                    };
+                    console.log(param);
+                    requestResultLoadingAndInfo(hdWROrder, param, loading, ['挂牌成功', '挂牌失败:']).then(() => {
+                        cancel();
+                    });
                 });
-            });
+            } else {
+                message.error('市场信息未获取到,请联系管理员!');
+            }
         }
 
         return {