|
@@ -497,9 +497,6 @@ export function useCancelOrder() {
|
|
|
return await cancelOrder({
|
|
return await cancelOrder({
|
|
|
data: {
|
|
data: {
|
|
|
...params,
|
|
...params,
|
|
|
- Header: {
|
|
|
|
|
- MarketID: marketid
|
|
|
|
|
- },
|
|
|
|
|
OldOrderId: orderid
|
|
OldOrderId: orderid
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -534,9 +531,6 @@ export function useHolderClose() {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
return await holderClose({
|
|
return await holderClose({
|
|
|
data: {
|
|
data: {
|
|
|
- Header: {
|
|
|
|
|
- MarketID: marketid
|
|
|
|
|
- },
|
|
|
|
|
TradeID: tradeid,
|
|
TradeID: tradeid,
|
|
|
GoodsID: goodsid,
|
|
GoodsID: goodsid,
|
|
|
BuyOrSell: buyOrSell,
|
|
BuyOrSell: buyOrSell,
|
|
@@ -555,88 +549,31 @@ export function useHolderClose() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 掉期商品摘牌请求
|
|
|
|
|
-export function useDelisting() {
|
|
|
|
|
- const loading = shallowRef(false)
|
|
|
|
|
-
|
|
|
|
|
- const onSubmit = async (goodsid: number, marketid: number, buyOrSell: EOrderDirection, orderid: string, priceMode: EPriceMode, orderPrice: number, maxSub: number, orderQty: number) => {
|
|
|
|
|
- try {
|
|
|
|
|
- loading.value = true
|
|
|
|
|
- return await order({
|
|
|
|
|
- data: {
|
|
|
|
|
- ClientSerialNo: v4(),
|
|
|
|
|
- ClientOrderTime: formatDate(new Date().toString(), 'YYYY-MM-DD HH:mm:ss'),
|
|
|
|
|
- ClientType: ClientType.Web,
|
|
|
|
|
- LoginID: loginStore.loginId,
|
|
|
|
|
- AccountID: accountStore.accountId,
|
|
|
|
|
- GoodsID: goodsid,
|
|
|
|
|
- MarketID: marketid,
|
|
|
|
|
- ValidType: EValidType.VALIDTYPE_DR,
|
|
|
|
|
- OperateType: EOrderOperateType.ORDEROPERATETYPE_NORMAL,
|
|
|
|
|
- OrderSrc: OrderSrc.ORDERSRC_CLIENT,
|
|
|
|
|
- OperatorID: loginStore.loginId,
|
|
|
|
|
- ListingSelectType: EListingSelectType.LISTINGSELECTTYPE_DELISTING,
|
|
|
|
|
- DelistingType: EDelistingType.DELISTINGTYPE_SELECTED,
|
|
|
|
|
- BuyOrSell: buyOrSell === EOrderDirection.BUY ? EOrderDirection.SELL : EOrderDirection.BUY,
|
|
|
|
|
- BuildType: EBuildType.BUILDTYPE_OPEN,
|
|
|
|
|
- TimevalidType: 1,
|
|
|
|
|
- MarketMaxSub: 0.0,
|
|
|
|
|
- ServiceTime: '',
|
|
|
|
|
- ValidTime: '',
|
|
|
|
|
- OrderFlag: 1,
|
|
|
|
|
- RelatedID: orderid,
|
|
|
|
|
- PriceMode: priceMode,
|
|
|
|
|
- CurtQuotePrice: 0.0,
|
|
|
|
|
- OrderPrice: priceMode === EPriceMode.PRICEMODE_LIMIT ? orderPrice : maxSub,
|
|
|
|
|
- OrderQty: orderQty,
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- } finally {
|
|
|
|
|
- loading.value = false
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return {
|
|
|
|
|
- loading,
|
|
|
|
|
- onSubmit
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 掉期商品挂牌请求
|
|
|
|
|
-export function useListing() {
|
|
|
|
|
|
|
+// 交易委托
|
|
|
|
|
+export function useOrder() {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
|
|
+ const formData = reactive<Partial<Proto.OrderReq>>({
|
|
|
|
|
+ ClientSerialNo: v4(),
|
|
|
|
|
+ ClientOrderTime: formatDate(new Date().toISOString(), 'YYYY-MM-DD HH:mm:ss'),
|
|
|
|
|
+ ClientType: ClientType.Web,
|
|
|
|
|
+ LoginID: loginStore.loginId,
|
|
|
|
|
+ AccountID: accountStore.accountId,
|
|
|
|
|
+ ValidType: EValidType.VALIDTYPE_DR,
|
|
|
|
|
+ OperateType: EOrderOperateType.ORDEROPERATETYPE_NORMAL,
|
|
|
|
|
+ OrderSrc: OrderSrc.ORDERSRC_CLIENT,
|
|
|
|
|
+ OperatorID: loginStore.loginId,
|
|
|
|
|
+ ListingSelectType: EListingSelectType.LISTINGSELECTTYPE_DELISTING,
|
|
|
|
|
+ DelistingType: EDelistingType.DELISTINGTYPE_SELECTED,
|
|
|
|
|
+ BuildType: EBuildType.BUILDTYPE_OPEN,
|
|
|
|
|
+ TimevalidType: 1,
|
|
|
|
|
+ OrderFlag: 1,
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- const onSubmit = async (goodsid: number, buyOrSell: number, orderid: string, priceMode: EPriceMode, orderPrice: number, maxSub: number, orderQty: number) => {
|
|
|
|
|
|
|
+ const formSubmit = async () => {
|
|
|
try {
|
|
try {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
return await order({
|
|
return await order({
|
|
|
- data: {
|
|
|
|
|
- ClientSerialNo: v4(),
|
|
|
|
|
- ClientOrderTime: formatDate(new Date().toString(), 'YYYY-MM-DD HH:mm:ss'),
|
|
|
|
|
- ClientType: ClientType.Web,
|
|
|
|
|
- LoginID: loginStore.loginId,
|
|
|
|
|
- AccountID: accountStore.accountId,
|
|
|
|
|
- GoodsID: goodsid,
|
|
|
|
|
- MarketID: userStore.getMarketId('TRADEMODE_TJMD'),
|
|
|
|
|
- ValidType: EValidType.VALIDTYPE_DR,
|
|
|
|
|
- OperateType: EOrderOperateType.ORDEROPERATETYPE_NORMAL,
|
|
|
|
|
- OrderSrc: OrderSrc.ORDERSRC_CLIENT,
|
|
|
|
|
- OperatorID: loginStore.loginId,
|
|
|
|
|
- ListingSelectType: EListingSelectType.LISTINGSELECTTYPE_LISTING,
|
|
|
|
|
- DelistingType: EDelistingType.DELISTINGTYPE_SELECTED,
|
|
|
|
|
- BuyOrSell: buyOrSell === 0 ? EOrderDirection.SELL : EOrderDirection.BUY,
|
|
|
|
|
- BuildType: EBuildType.BUILDTYPE_OPEN,
|
|
|
|
|
- TimevalidType: 1,
|
|
|
|
|
- MarketMaxSub: priceMode === EPriceMode.PRICEMODE_LIMIT ? 0.0 : maxSub,
|
|
|
|
|
- ServiceTime: '',
|
|
|
|
|
- ValidTime: '',
|
|
|
|
|
- OrderFlag: 1,
|
|
|
|
|
- RelatedID: orderid,
|
|
|
|
|
- PriceMode: priceMode,
|
|
|
|
|
- CurtQuotePrice: 0.0,
|
|
|
|
|
- OrderPrice: priceMode === EPriceMode.PRICEMODE_LIMIT ? orderPrice : 0.0,
|
|
|
|
|
- OrderQty: orderQty,
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ data: formData
|
|
|
})
|
|
})
|
|
|
} finally {
|
|
} finally {
|
|
|
loading.value = false
|
|
loading.value = false
|
|
@@ -645,6 +582,7 @@ export function useListing() {
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
loading,
|
|
loading,
|
|
|
- onSubmit
|
|
|
|
|
|
|
+ formData,
|
|
|
|
|
+ formSubmit
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|