diff --git a/src/components/baruser/CreditLists.vue b/src/components/baruser/CreditLists.vue index 5fcd257..733638e 100644 --- a/src/components/baruser/CreditLists.vue +++ b/src/components/baruser/CreditLists.vue @@ -362,7 +362,8 @@ export default { this.overLimitUser = null }, checkOverLimitIsValid(user) { - if (user.toSetAmount) { + console.log(user) + if (user.toSetAmount && user.autoLock) { if ( Math.abs(user.amount - Number.parseInt(user.toSetAmount)) > user.limit + 500 @@ -387,7 +388,7 @@ export default { clearTimeout(user.timeout) user.toSetAmount = user.toSetAmount ? user.toSetAmount + amount : amount if (this.checkOverLimitIsValid(user)) { - if (this.checkOverLimit(user)) { + if (this.checkOverLimit(user) && user.autoLock) { this.overLimitUser = user } else { user.timeout = setTimeout(() => { @@ -437,7 +438,7 @@ export default { ? user.toSetAmount + Math.round(Math.abs(user.value * 100)) : Math.round(Math.abs(user.value * 100)) if (this.checkOverLimitIsValid(user)) { - if (this.checkOverLimit(user)) { + if (this.checkOverLimit(user) && user.autoLock) { this.overLimitUser = user } else { this.addAmount({ diff --git a/src/components/user/AddAmount.vue b/src/components/user/AddAmount.vue index 422d6a9..55f5274 100644 --- a/src/components/user/AddAmount.vue +++ b/src/components/user/AddAmount.vue @@ -314,7 +314,7 @@ export default { this.overLimitUser = null }, checkOverLimitIsValid(user) { - if (this.toSetAmount) { + if (this.toSetAmount && user.autoLock) { if (Math.abs(this.getAllSum() - Number.parseInt(this.toSetAmount)) > user.limit + 500) { this.overOverLimit = user this.toSetAmount = null @@ -336,7 +336,7 @@ export default { clearTimeout(this.timeout) this.toSetAmount = this.toSetAmount ? this.toSetAmount + amount : amount if (this.checkOverLimitIsValid(this.user)) { - if (this.checkOverLimit(this.user)) { + if (this.checkOverLimit(this.user) && this.user.autoLock) { this.overLimitUser = this.user } else { this.timeout = setTimeout(() => { @@ -389,7 +389,7 @@ export default { ? this.toSetAmount + Math.round(Math.abs(this.value * 100)) : Math.round(Math.abs(this.value * 100)) if (this.checkOverLimitIsValid(this.user)) { - if (this.checkOverLimit(this.user)) { + if (this.checkOverLimit(this.user) && this.user.autoLock) { this.overLimitUser = this.user } else { diff --git a/src/store/modules/barUsers.js b/src/store/modules/barUsers.js index faceb0f..76f3be2 100644 --- a/src/store/modules/barUsers.js +++ b/src/store/modules/barUsers.js @@ -45,6 +45,7 @@ const mutations = { existuser.type = users[user].type existuser.limit = users[user].limit existuser.last_seen = users[user].last_seen + existuser.autoLock = users[user].autoLock ? users[user].autoLock : existuser.autoLock } else { state.users.push({ username: users[user].username, @@ -55,7 +56,8 @@ const mutations = { type: users[user].type, loading: false, limit: users[user].limit, - last_seen: users[user].last_seen + last_seen: users[user].last_seen, + autoLock: users[user].autoLock }) } }