|
|
@@ -64,27 +64,29 @@ export function handleNumAndPrice(enumName: EnumRouterName, selectedRow: WrOrder
|
|
|
function getMaxNum() {
|
|
|
// 可用资金
|
|
|
const canUseMoney = Number(getCanUseMoney(getSelectedAccount() as AccountListItem))
|
|
|
- // 挂牌最大数量=可用资金/(买方履约保证金比例*挂牌价格)
|
|
|
- let result = 0
|
|
|
- if (isFloat()) {
|
|
|
- const price = getPrice()
|
|
|
- if (price !== '--') {
|
|
|
- result = canUseMoney / (Number(price) * buymarginvalue)
|
|
|
- }
|
|
|
- } else {
|
|
|
- const margin = marginMethod() ? (buymarginvalue * formState.FixedPrice) : (buymarginvalue + formState.FixedPrice)
|
|
|
- if (margin) {
|
|
|
- result = Math.round(canUseMoney / margin)
|
|
|
+ if (canUseMoney > 0) {
|
|
|
+ // 挂牌最大数量=可用资金/(买方履约保证金比例*挂牌价格)
|
|
|
+ let result = 0
|
|
|
+ if (isFloat()) {
|
|
|
+ const price = getPrice()
|
|
|
+ if (price !== '--') {
|
|
|
+ result = canUseMoney / (Number(price) * buymarginvalue)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ const margin = marginMethod() ? (buymarginvalue * formState.FixedPrice) : (buymarginvalue + formState.FixedPrice)
|
|
|
+ if (margin) {
|
|
|
+ result = Math.round(canUseMoney / margin)
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- if (buymarginvalue !== 0) {
|
|
|
- return +result.toFixed(0)
|
|
|
- } else {
|
|
|
- // 当市场设置的买保证金为0时,不做数量限制
|
|
|
- return 10000
|
|
|
+ if (buymarginvalue !== 0) {
|
|
|
+ return +result.toFixed(0)
|
|
|
+ } else {
|
|
|
+ // 当市场设置的买保证金为0时,不做数量限制
|
|
|
+ return 10000
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+ return 0
|
|
|
}
|
|
|
// 摘牌金额
|
|
|
function getMoney() {
|