选择合约期限内容,对期限结果处理。
(选择合约期限数据 “7-14”、融券期限结果为“7”,可编辑结果只能在“7-14”之间。选择合约期限数据“6”、融券期限结果为“6”,不可编辑结果。)
changeServiceLifeInput(event) {
let newTerm = this.saveTerm.split('-')
let firstNum = parseInt(newTerm[0]) //字符串转化从数字
let lastNum = parseInt(newTerm[1])
let numVal = parseInt(event.target.value)
if (numVal < firstNum) {
this.orderForm.serviceLife = firstNum
} else if (numVal > lastNum) {
this.orderForm.serviceLife = lastNum
} else {
this.orderForm.serviceLife = numVal
}
},
// 约定融券借入-----可选期限
handleOptional(item) {
console.log(item.fee_rate, 'item.fee_rateitem.fee_rate')
this.borrowQuantity = item.volume
this.appointmentMode = item.businame
this.busicode = item.busicode
this.feeRate = item.fee_rate
let newTerm = item.term.split('-')
if (item.term.includes('-')) {
this.saveTerm = item.term
this.orderForm.serviceLife = newTerm[0]
this.serviceLifeDisabledState = false
} else {
this.orderForm.serviceLife = item.term
this.serviceLifeDisabledState = true
}
},