fixed bug, dass tage nicht mehr gesperrt oder entsperrt werden können

This commit is contained in:
Tim Gröger 2020-06-04 21:55:40 +02:00
parent a074ea0dd3
commit a25ec09b8f
6 changed files with 5 additions and 49 deletions

View File

@ -276,7 +276,6 @@ export default {
} }
}, },
addAmountMore(user) { addAmountMore(user) {
console.log(user.value * 100)
this.addAmount({ this.addAmount({
username: user.username, username: user.username,
amount: Math.round(Math.abs(user.value * 100)), amount: Math.round(Math.abs(user.value * 100)),

View File

@ -234,12 +234,6 @@ export default {
return list.length > 1 ? data.name + 'ist schon vorhanden' : false return list.length > 1 ? data.name + 'ist schon vorhanden' : false
} }
], ],
workerRules: [
(data, test) => {
console.log(data, test)
return false
}
],
backup: null backup: null
} }
}, },
@ -256,9 +250,7 @@ export default {
updateJobKindDate: 'sm/updateJobKindDate' updateJobKindDate: 'sm/updateJobKindDate'
}), }),
forceRenderer(jobkind) { forceRenderer(jobkind) {
console.log(jobkind)
this.update += 1 this.update += 1
console.log('before', jobkind.worker, jobkind.backupWorker)
if (jobkind.backupWorker !== jobkind.worker && this.focused) { if (jobkind.backupWorker !== jobkind.worker && this.focused) {
let addedUser = null let addedUser = null
for (let user in jobkind.worker) { for (let user in jobkind.worker) {
@ -385,40 +377,8 @@ export default {
}) })
this.dialog = false this.dialog = false
}, },
filterWorker() {},
// filterUser(jobkind) {
// console.log(jobkind, this.day.jobkinddate)
// var filtered = this.dbUsers.filter(user => {
// var test = this.day.jobkinddate.find(item => {
// if (item.job_kind === null) {
// return false
// }
// if (item.job_kind.id === jobkind.id) {
// return false
// }
// return item.worker.find(work => {
// return work.id === user.id
// })
// })
// console.log('test', test)
// if (test) {
// return false
// }
// if (jobkind.workgroup === null) {
// return true
// }
// return user.workgroups.find(workgroup => {
// if (jobkind.workgroup && workgroup) {
// return jobkind.workgroup.id === workgroup.id
// } else return true
// })
// })
// return filtered
// },
// eslint-disable-next-line no-unused-vars
filterUser(jobkind) { filterUser(jobkind) {
console.log(jobkind, this.day.jobkinddate)
// eslint-disable-next-line no-unused-vars
var filtered = this.dbUsers.filter(user => { var filtered = this.dbUsers.filter(user => {
var userInOther = this.day.jobkinddate.find(item => { var userInOther = this.day.jobkinddate.find(item => {
if (item.job_kind === null) { if (item.job_kind === null) {
@ -439,7 +399,6 @@ export default {
} else { } else {
if (user.workgroups ? user.workgroups.length > 0 : false) { if (user.workgroups ? user.workgroups.length > 0 : false) {
return user.workgroups.find(wg => { return user.workgroups.find(wg => {
console.log(wg, jobkind.workgroup)
return wg.id === jobkind.workgroup.id return wg.id === jobkind.workgroup.id
}) })
} else { } else {

View File

@ -83,7 +83,6 @@ const mutations = {
message = state.messages[0] message = state.messages[0]
if ((new Date() - state.messages[0].date) / 1000 < 2) { if ((new Date() - state.messages[0].date) / 1000 < 2) {
clearTimeout(message.timeout) clearTimeout(message.timeout)
console.log('done')
message.amount = message.amount + data.amount message.amount = message.amount + data.amount
message.visible = true message.visible = true
message.date = new Date() message.date = new Date()
@ -252,7 +251,6 @@ const actions = {
const response = await axios.get(url.barU.lock, { const response = await axios.get(url.barU.lock, {
headers: { Token: rootState.login.user.accessToken } headers: { Token: rootState.login.user.accessToken }
}) })
console.log(response.data.value)
commit('setLocked', response.data.value) commit('setLocked', response.data.value)
} catch (e) { } catch (e) {
if (e.response) if (e.response)

View File

@ -180,7 +180,6 @@ const mutations = {
return sum return sum
}, },
sortUsers: state => { sortUsers: state => {
console.log(state.users)
state.users = state.users.sort((a, b) => { state.users = state.users.sort((a, b) => {
if (a.locked && b.locked) { if (a.locked && b.locked) {
if (a.lastname > b.lastname) return 1 if (a.lastname > b.lastname) return 1

View File

@ -343,14 +343,16 @@ const actions = {
if (e.response.status === 401) dispatch('logout', null, { root: true }) if (e.response.status === 401) dispatch('logout', null, { root: true })
} }
}, },
async lockDay({ commit, rootState, dispatch }, data) { async lockDay({ commit, rootState, dispatch, getters }, data) {
try { try {
const response = await axios.post( const response = await axios.post(
url.vorstand.sm.lockDay, url.vorstand.sm.lockDay,
{ ...data }, { ...data },
{ headers: { Token: rootState.login.user.accessToken } } { headers: { Token: rootState.login.user.accessToken } }
) )
commit('updateMonth', { start: response.data.date, day: response.data }) console.log(response.data)
let date = new Date(response.data.date.year, response.data.date.month - 1, response.data.date.day)
commit('updateMonthLocked', { locked: response.data.locked, date, getters })
dispatch('getLifeTime', null, { root: true }) dispatch('getLifeTime', null, { root: true })
} catch (e) { } catch (e) {
if (e.response) if (e.response)

View File

@ -165,7 +165,6 @@ const mutations = {
message = state.messages[0] message = state.messages[0]
if ((new Date() - state.messages[0].date) / 1000 < 2) { if ((new Date() - state.messages[0].date) / 1000 < 2) {
clearTimeout(message.timeout) clearTimeout(message.timeout)
console.log('done')
message.amount = message.amount + data.amount message.amount = message.amount + data.amount
message.visible = true message.visible = true
message.date = new Date() message.date = new Date()