|
@@ -36,12 +36,12 @@
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
|
<a-form-item label="挂牌价格">
|
|
<a-form-item label="挂牌价格">
|
|
|
- <span class="white ml8">{{selectedRow.username}}</span>
|
|
|
|
|
|
|
+ <span class="white ml8">{{selectedRow.orderprice.toFixed(2)}}</span>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
|
<a-form-item label="挂牌数量">
|
|
<a-form-item label="挂牌数量">
|
|
|
- <span class="white ml8">{{selectedRow.username}}</span>
|
|
|
|
|
|
|
+ <span class="white ml8">{{selectedRow.orderqty}}</span>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
</a-row>
|
|
</a-row>
|
|
@@ -115,8 +115,13 @@
|
|
|
import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
|
|
import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
|
|
|
import { defineComponent, PropType, ref } from 'vue';
|
|
import { defineComponent, PropType, ref } from 'vue';
|
|
|
import Drawer from '@/common/components/drawer/index.vue';
|
|
import Drawer from '@/common/components/drawer/index.vue';
|
|
|
-import { WrOrderQuote, WrOrderQuoteDetail } from '@/services/go/wrtrade/interface';
|
|
|
|
|
-import { getAccountTypeList, getSelectedAccountId, getUserId } from '@/services/bus/account';
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ WrOrderQuote,
|
|
|
|
|
+ WrOrderQuoteDetail,
|
|
|
|
|
+ WrTradeOrderDetailReq,
|
|
|
|
|
+ WrTradeOrderDetailRsp
|
|
|
|
|
+} from '@/services/go/wrtrade/interface';
|
|
|
|
|
+import {getAccount_longType, getAccountTypeList, getSelectedAccountId, getUserId} from '@/services/bus/account';
|
|
|
import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
import { HdWRDealOrder } from '@/services/proto/warehousetrade';
|
|
import { HdWRDealOrder } from '@/services/proto/warehousetrade';
|
|
|
import { v4 as uuidv4 } from 'uuid';
|
|
import { v4 as uuidv4 } from 'uuid';
|
|
@@ -127,17 +132,22 @@ import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
import { handleForm } from './setup';
|
|
import { handleForm } from './setup';
|
|
|
import { validateAction } from '@/common/setup/form';
|
|
import { validateAction } from '@/common/setup/form';
|
|
|
import { ListingForm, TempWrOrderQuoteDetail } from './interface';
|
|
import { ListingForm, TempWrOrderQuoteDetail } from './interface';
|
|
|
-import { BuyOrSell } from '@/common/constants/enumCommon';
|
|
|
|
|
|
|
+import {BuyOrSell, DelistingType, PriceType} from '@/common/constants/enumCommon';
|
|
|
import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
|
import { getCanUseMoney } from '@/services/bus/account';
|
|
import { getCanUseMoney } from '@/services/bus/account';
|
|
|
import { QueryDeliveryRelationRsp } from '@/services/go/delivery/interface';
|
|
import { QueryDeliveryRelationRsp } from '@/services/go/delivery/interface';
|
|
|
|
|
+import {Order} from "@/services/socket/order";
|
|
|
|
|
+import {OrderReq} from "@/services/socket/order/interface";
|
|
|
|
|
+import {getLongTypeLoginID} from "@/services/bus/login";
|
|
|
|
|
+import {LongType} from "@/services/socket/login/interface";
|
|
|
|
|
+import * as Long from "long";
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: ModalEnum.spot_trade_warehouse_financing_delisting,
|
|
name: ModalEnum.spot_trade_warehouse_financing_delisting,
|
|
|
components: { Drawer, PlusOutlined, MinusOutlined },
|
|
components: { Drawer, PlusOutlined, MinusOutlined },
|
|
|
emits: ['cancel', 'update'],
|
|
emits: ['cancel', 'update'],
|
|
|
props: {
|
|
props: {
|
|
|
selectedRow: {
|
|
selectedRow: {
|
|
|
- type: Object as PropType<WrOrderQuoteDetail>,
|
|
|
|
|
|
|
+ type: Object as PropType<WrTradeOrderDetailRsp>,
|
|
|
default: {},
|
|
default: {},
|
|
|
},
|
|
},
|
|
|
parantSelectedRow: {
|
|
parantSelectedRow: {
|
|
@@ -168,42 +178,51 @@ export default defineComponent({
|
|
|
function getMoney() {}
|
|
function getMoney() {}
|
|
|
// const { getMaxNum, getMoney, getMargin } = handleNumAndMoney(props.enumName, props.buyOrSell, props.selectedRow, props.parantSelectedRow, formState);
|
|
// const { getMaxNum, getMoney, getMargin } = handleNumAndMoney(props.enumName, props.buyOrSell, props.selectedRow, props.parantSelectedRow, formState);
|
|
|
function submit() {
|
|
function submit() {
|
|
|
- // validateAction<ListingForm>(formRef, formState).then((res) => {
|
|
|
|
|
- // // 首先确定 这是仓单贸易的有仓单挂摘牌 HasWr = 1
|
|
|
|
|
- // // 其次判断 摘牌 1。摘买 (需要通过自己的仓单进行摘买) 2。摘卖 (不需要通过仓单)
|
|
|
|
|
- // const param: HdWRDealOrderReq = {
|
|
|
|
|
- // UserID: getUserId(), // uint32 用户ID
|
|
|
|
|
- // AccountID: getSelectedAccountId(), // uint64 资金账号
|
|
|
|
|
- // RelatedWRTradeOrderID: props.selectedRow.wrtradeorderid, // uint64 关联委托单号(摘牌委托关联挂牌委托单ID)
|
|
|
|
|
- // WRTransferUserID: props.selectedRow.userid, // uint32 仓单受让用户
|
|
|
|
|
- // OrderQty: res.num as number, // uint64 委托数量
|
|
|
|
|
- // OrderSrc: 0, // uint32 委托来源
|
|
|
|
|
- // ClientSerialNo: uuidv4(), // string 客户端流水号
|
|
|
|
|
- // ClientOrderTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
|
|
|
|
|
- // ClientType: 4, // uint32 终端类型
|
|
|
|
|
- // OperatorID: getUserId(), // uint64 操作员账号ID
|
|
|
|
|
- // BuyOrSell: 0, // uint32 买卖方向
|
|
|
|
|
- // ApplyID: 0, // uint64 申请ID
|
|
|
|
|
- // // LadingBillId: 0, // uint64 提单id(wrholdlb的LadingBillId字段),卖的时候填写
|
|
|
|
|
- // SubNum: 0, // uint64 提单子单号(wrholdlb的SubNum字段),卖的时候填写
|
|
|
|
|
- // WRFactorTypeId: props.parantSelectedRow.wrfactortypeid, // uint64 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写
|
|
|
|
|
- // TradeDate: moment().format('YYYYMMDD'), // string 交易日
|
|
|
|
|
- // DeliveryMonth: '', // string 交收月
|
|
|
|
|
- // HasWr: isWR(), // uint32 是否有仓单-0:没有仓单 1:有仓单
|
|
|
|
|
- // IsFinancing: 0, // uint32 是否融资购买(买摘牌时有效)-0:否 1:是
|
|
|
|
|
- // ProductDetailID: 0, // uint64 金融机构产品组合ID(融资购买时有效)
|
|
|
|
|
- // };
|
|
|
|
|
- // // 摘买方向
|
|
|
|
|
- // if (isBuy()) {
|
|
|
|
|
- // param.BuyOrSell = 1;
|
|
|
|
|
- // param.LadingBillId = res.LadingBillId;
|
|
|
|
|
- // } else {
|
|
|
|
|
- // param.BuyOrSell = 0;
|
|
|
|
|
- // }
|
|
|
|
|
- // requestResultLoadingAndInfo(HdWRDealOrder, param, loading, ['摘牌成功', '摘牌失败:']).then(() => {
|
|
|
|
|
- // cancel(true);
|
|
|
|
|
- // });
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+ debugger
|
|
|
|
|
+ validateAction<ListingForm>(formRef, formState).then((res) => {
|
|
|
|
|
+ // 摘牌请求
|
|
|
|
|
+ const param: OrderReq = {
|
|
|
|
|
+ ClientSerialNo: uuidv4(), // 客户端流水号
|
|
|
|
|
+ ClientOrderTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), // 客户端委托时间
|
|
|
|
|
+ ClientType: 4, // 终端类型
|
|
|
|
|
+ LoginID: Number(getLongTypeLoginID() as LongType), // 登陆账号
|
|
|
|
|
+ AccountID: getSelectedAccountId(), // 交易账号
|
|
|
|
|
+ GoodsID: props.parantSelectedRow.goodsid, // 商品ID
|
|
|
|
|
+ MarketID: props.parantSelectedRow.marketid, // 市场ID
|
|
|
|
|
+ ValidType: 1, // 校验类型 当日有效
|
|
|
|
|
+ OperateType: 1, // 操作类型: 申请
|
|
|
|
|
+ OrderSrc: 1, // 单据来源: 客户端下单
|
|
|
|
|
+ RelatedID: Long.fromString(props.selectedRow.orderid), // 操作员账号ID
|
|
|
|
|
+ OrderPrice: props.selectedRow.orderprice, // 委托价格
|
|
|
|
|
+ OperatorID: Number(getLongTypeLoginID()),
|
|
|
|
|
+ // MarketMaxSub: number // 市价允许最大偏差(做市)
|
|
|
|
|
+ OrderQty: res.num, // 委托数量
|
|
|
|
|
+ BuyOrSell: props.selectedRow.buyorsell === 1 ? 0 : 1 , // 买卖方向 0 买 1 卖
|
|
|
|
|
+ BuildType: props.selectedRow.buyorsell === 1 ? 1 : 2 , // 下单类型 1 建 2 平
|
|
|
|
|
+ // CurtQuotePrice: 0, // 保留,计算冻结金额使用
|
|
|
|
|
+ // SpPrice: 0 ,// 止盈价格
|
|
|
|
|
+ // SlPrice: 0 , // 止损价格
|
|
|
|
|
+ PriceMode: PriceType.limit, // 取价方式
|
|
|
|
|
+ TimevalidType: 1, // 时间有效类型 单日有效
|
|
|
|
|
+ TriggerType: 1, // 预埋单触发类型
|
|
|
|
|
+ // TriggerPrice: number // 预埋单触发价格
|
|
|
|
|
+ ListingSelectType: 2, // 挂牌点选类型 1:挂牌 2:摘牌 3:先摘后挂
|
|
|
|
|
+ DelistingType: DelistingType.selected, // 摘牌类型 2:点选成交
|
|
|
|
|
+ // RelatedID: number // 关联单号
|
|
|
|
|
+ OptionType: 1, // 期权类型(1:认购(看涨)2:认沽(看跌))
|
|
|
|
|
+ // Premium: number // 权利金
|
|
|
|
|
+ // TriggerOperator: number // 触发条件(1:大于等于2:小于等于)
|
|
|
|
|
+ // ServiceTime: string // 服务端时间
|
|
|
|
|
+ // CouponTypeID: number // 优惠券类型ID(买方)
|
|
|
|
|
+ // UsedQty: number // 使用数量
|
|
|
|
|
+ // ValidTime: string // 指定有效日期
|
|
|
|
|
+ // ReceiveInfoID: number // 收货地址ID
|
|
|
|
|
+ }
|
|
|
|
|
+ debugger
|
|
|
|
|
+ requestResultLoadingAndInfo(Order, param, loading, ['摘牌成功', '摘牌失败:']).then(() => {
|
|
|
|
|
+ cancel(true);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
return {
|