|
@@ -147,12 +147,14 @@ import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo
|
|
|
import { useTaAccount } from '@/common/setup/account';
|
|
import { useTaAccount } from '@/common/setup/account';
|
|
|
import { validateAction } from '@/common/setup/form';
|
|
import { validateAction } from '@/common/setup/form';
|
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
|
|
+import { queryTableList } from '@/common/setup/table';
|
|
|
import { useListingTradeNumAndPrice } from '@/common/setup/trade';
|
|
import { useListingTradeNumAndPrice } from '@/common/setup/trade';
|
|
|
import { ListingTradeNumAndPrice } from '@/common/setup/trade/interface';
|
|
import { ListingTradeNumAndPrice } from '@/common/setup/trade/interface';
|
|
|
import { useTodayMargin } from '@/hooks/margin';
|
|
import { useTodayMargin } from '@/hooks/margin';
|
|
|
import { getGoodsAgreeunitByGoodsCode, getGoodsByCode, getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
|
|
import { getGoodsAgreeunitByGoodsCode, getGoodsByCode, getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
|
|
|
import { geLoginID_number } from '@/services/bus/login';
|
|
import { geLoginID_number } from '@/services/bus/login';
|
|
|
import { getMarketByTradeMode } from '@/services/bus/market';
|
|
import { getMarketByTradeMode } from '@/services/bus/market';
|
|
|
|
|
+import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
|
|
|
import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
|
|
import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
|
|
|
import { QueryQuoteGoodsListRsp } from '@/services/go/Tjmd/interface';
|
|
import { QueryQuoteGoodsListRsp } from '@/services/go/Tjmd/interface';
|
|
|
import { diaoQiOrder } from '@/services/socket/order';
|
|
import { diaoQiOrder } from '@/services/socket/order';
|
|
@@ -164,6 +166,9 @@ import { defineComponent, PropType, ref } from 'vue';
|
|
|
import { useUserType } from '../setup';
|
|
import { useUserType } from '../setup';
|
|
|
import { FormParam } from './interface';
|
|
import { FormParam } from './interface';
|
|
|
import { handleForm, isFloat, useBuySellDirection, usePrice, useNum } from './setup';
|
|
import { handleForm, isFloat, useBuySellDirection, usePrice, useNum } from './setup';
|
|
|
|
|
+import { queryTradePosition } from '@/services/go/ermcp/order';
|
|
|
|
|
+import { WrOrderQuote } from '@/services/go/wrtrade/interface';
|
|
|
|
|
+import { RefGoodsList } from '../../interface';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
emits: ['cancel', 'update'],
|
|
emits: ['cancel', 'update'],
|
|
@@ -171,15 +176,15 @@ export default defineComponent({
|
|
|
components: { Des, Drawer, PlusOutlined, MinusOutlined, SwapOutlined },
|
|
components: { Des, Drawer, PlusOutlined, MinusOutlined, SwapOutlined },
|
|
|
props: {
|
|
props: {
|
|
|
selectedRow: {
|
|
selectedRow: {
|
|
|
- type: Object as PropType<QueryQuoteDayRsp>,
|
|
|
|
|
|
|
+ type: Object as PropType<RefGoodsList>,
|
|
|
default: {},
|
|
default: {},
|
|
|
},
|
|
},
|
|
|
- refGoods: {
|
|
|
|
|
- type: Object as PropType<QueryQuoteGoodsListRsp[]>,
|
|
|
|
|
- default: [],
|
|
|
|
|
- },
|
|
|
|
|
},
|
|
},
|
|
|
setup(props, context) {
|
|
setup(props, context) {
|
|
|
|
|
+ // 查询 我的 持仓
|
|
|
|
|
+ const { tableList, queryTable } = queryTableList<QueryTradePositionRsp>();
|
|
|
|
|
+ queryTable(queryTradePosition);
|
|
|
|
|
+
|
|
|
// 获取保证金比例
|
|
// 获取保证金比例
|
|
|
const { getReckonMarginValueByTradeMode } = useTodayMargin();
|
|
const { getReckonMarginValueByTradeMode } = useTodayMargin();
|
|
|
// 控制弹窗
|
|
// 控制弹窗
|
|
@@ -207,13 +212,18 @@ export default defineComponent({
|
|
|
// 最大数量
|
|
// 最大数量
|
|
|
const getMaxNum = () => {
|
|
const getMaxNum = () => {
|
|
|
let result = 0;
|
|
let result = 0;
|
|
|
- // 可用资金
|
|
|
|
|
- const temp = +canUseMoney();
|
|
|
|
|
|
|
+ if (isBuy()) {
|
|
|
|
|
+ // 可用资金
|
|
|
|
|
+ const temp = +canUseMoney();
|
|
|
|
|
|
|
|
- const money = temp > 0 ? temp : 0;
|
|
|
|
|
- const agreeunit = getGoodsAgreeunitByGoodsCode(props.selectedRow.goodscode);
|
|
|
|
|
- if (money && formState.FixedPrice) {
|
|
|
|
|
- result = +(money / (formState.FixedPrice * agreeunit)).toFixed(0);
|
|
|
|
|
|
|
+ const money = temp > 0 ? temp : 0;
|
|
|
|
|
+ const agreeunit = getGoodsAgreeunitByGoodsCode(props.selectedRow.goodscode);
|
|
|
|
|
+ if (money && formState.FixedPrice) {
|
|
|
|
|
+ result = +(money / (formState.FixedPrice * agreeunit)).toFixed(0);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const temp = tableList.value.find((el) => el.goodscode === props.selectedRow.goodscode)?.enableqty;
|
|
|
|
|
+ result = temp ? temp : 0;
|
|
|
}
|
|
}
|
|
|
return result;
|
|
return result;
|
|
|
};
|
|
};
|