|
|
@@ -43,14 +43,21 @@ export function handleNumAndPrice(enumName: EnumRouterName, selectedRow: WrOrder
|
|
|
function getMaxNum() {
|
|
|
// 可用资金
|
|
|
const canUseMoney = Number(getCanUseMoney(getSelectedAccount() as AccountListItem))
|
|
|
+ const { buymarginvalue } = rules[0]
|
|
|
// 挂牌最大数量=可用资金/(买方履约保证金比例*挂牌价格)
|
|
|
- const margin = marginMethod() ? (buymarginvalue * formState.FixedPrice) : (buymarginvalue + formState.FixedPrice)
|
|
|
- if (margin) {
|
|
|
- return Math.floor(canUseMoney / margin)
|
|
|
-
|
|
|
+ let result = 0
|
|
|
+ if (isFloat()) {
|
|
|
+ const price = getPrice()
|
|
|
+ if (price !== '--') {
|
|
|
+ result = canUseMoney / (Number(price) * buymarginvalue)
|
|
|
+ }
|
|
|
} else {
|
|
|
- return 0
|
|
|
+ const margin = marginMethod() ? (buymarginvalue * formState.FixedPrice) : (buymarginvalue + formState.FixedPrice)
|
|
|
+ if (margin) {
|
|
|
+ result = Math.floor(canUseMoney / margin)
|
|
|
+ }
|
|
|
}
|
|
|
+ return +result.toFixed(0)
|
|
|
}
|
|
|
// 摘牌金额
|
|
|
function getMoney() {
|