|
|
@@ -111,7 +111,9 @@ function strip(e) { |
|
|
|
} |
|
|
|
|
|
|
|
function stripLetters(e) { |
|
|
|
return (e.target.value.replace(/\W/g, '') || '') |
|
|
|
let value = (e.target.value.replace(/[^\w\s]/g, '').slice(0, 20) || '') |
|
|
|
e.target.value = value |
|
|
|
return value |
|
|
|
} |
|
|
|
|
|
|
|
function del() { |
|
|
@@ -131,6 +133,7 @@ function setLtv(e) { |
|
|
|
if (ltv < 0) ltv = 0 |
|
|
|
|
|
|
|
loan.ltv = ltv |
|
|
|
e.target.value = ltv |
|
|
|
loan.amount = Math.round(ltv / 100 * loan.price) |
|
|
|
} |
|
|
|
|
|
|
@@ -141,7 +144,9 @@ function setAmount(e) { |
|
|
|
|
|
|
|
if (amount > loan.price) amount = loan.price |
|
|
|
if (amount < 0) amount = 0 |
|
|
|
|
|
|
|
loan.amount = amount |
|
|
|
e.target.value = amount |
|
|
|
loan.ltv = Math.round(amount / loan.price * 100) |
|
|
|
} |
|
|
|
|
|
|
@@ -150,6 +155,7 @@ function setPrice(e) { |
|
|
|
let value = strip(e) |
|
|
|
|
|
|
|
loan.price = value |
|
|
|
e.target.value = value |
|
|
|
loan.amount = Math.round(loan.ltv / 100 * value) |
|
|
|
} |
|
|
|
|
|
|
@@ -160,6 +166,8 @@ function setDti(e) { |
|
|
|
|
|
|
|
if (dti > 100) dti = 100 |
|
|
|
if (dti < 0) dti = 0 |
|
|
|
|
|
|
|
e.target.value = dti |
|
|
|
loan.dti = dti |
|
|
|
} |
|
|
|
|
|
|
@@ -170,6 +178,8 @@ function setHousingDti(e) { |
|
|
|
|
|
|
|
if (housingDti > 100) housingDti = 100 |
|
|
|
if (housingDti < 0) housingDti = 0 |
|
|
|
|
|
|
|
e.target.value = housingDti |
|
|
|
loan.housingDti = housingDti |
|
|
|
} |
|
|
|
|
|
|
@@ -211,10 +221,6 @@ const loans = [ |
|
|
|
} |
|
|
|
] |
|
|
|
|
|
|
|
const propertyTypes = [ |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
export default { |
|
|
|
methods: { |
|
|
|
setPrice, setLtv, setAmount, setDti, setHousingDti, |
|
|
|