Changes in Timetracking
Added Lieferscheine Button to EntityShow DataType Changes Fixed Loading Errors in createDocument Added Telephone to profile show
This commit is contained in:
@@ -17,22 +17,29 @@ const toast = useToast()
|
||||
|
||||
const timeTypes = dataStore.getTimeTypes
|
||||
const timeInfo = ref({
|
||||
user: "",
|
||||
start: "",
|
||||
end: null,
|
||||
profile: "",
|
||||
startDate: "",
|
||||
endDate: null,
|
||||
notes: null,
|
||||
projectId: null,
|
||||
project: null,
|
||||
type: null
|
||||
})
|
||||
|
||||
const filterUser = ref(user.value.id || "")
|
||||
const filterUser = ref(profileStore.activeProfile.id || "")
|
||||
|
||||
const times = ref([])
|
||||
|
||||
const setup = async () => {
|
||||
times.value = await useSupabaseSelect("times","*, profile(*)")
|
||||
}
|
||||
|
||||
setup()
|
||||
|
||||
const filteredRows = computed(() => {
|
||||
|
||||
let times = dataStore.times
|
||||
//let times = times.value
|
||||
|
||||
if(dataStore.hasRight('viewTimes')) {
|
||||
/*if(dataStore.hasRight('viewTimes')) {
|
||||
if(filterUser.value !== "") {
|
||||
times = times.filter(i => i.user === filterUser.value)
|
||||
}
|
||||
@@ -40,9 +47,9 @@ const filteredRows = computed(() => {
|
||||
times = times.filter(i => i.user === user.value.id)
|
||||
} else {
|
||||
times = []
|
||||
}
|
||||
}*/
|
||||
|
||||
return times
|
||||
return times.value
|
||||
|
||||
})
|
||||
|
||||
@@ -63,42 +70,34 @@ const columns = [
|
||||
{
|
||||
key:"state",
|
||||
label: "Status",
|
||||
sortable:true
|
||||
},
|
||||
{
|
||||
key: "user",
|
||||
label: "Benutzer",
|
||||
sortable:true
|
||||
},
|
||||
{
|
||||
key:"start",
|
||||
key:"startDate",
|
||||
label:"Start",
|
||||
sortable:true
|
||||
},
|
||||
{
|
||||
key: "endDate",
|
||||
label: "Ende",
|
||||
},
|
||||
{
|
||||
key:"type",
|
||||
label:"Typ",
|
||||
sortable:true
|
||||
},
|
||||
{
|
||||
key: "end",
|
||||
label: "Ende",
|
||||
sortable:true
|
||||
},
|
||||
{
|
||||
key: "duration",
|
||||
label: "Dauer",
|
||||
sortable:true
|
||||
},
|
||||
{
|
||||
key: "projectId",
|
||||
key: "project",
|
||||
label: "Projekt",
|
||||
sortable:true
|
||||
},
|
||||
{
|
||||
key: "notes",
|
||||
label: "Notizen",
|
||||
sortable:true
|
||||
}
|
||||
]
|
||||
|
||||
@@ -110,7 +109,7 @@ const configTimeMode = ref("create")
|
||||
|
||||
const startTime = async () => {
|
||||
console.log("started")
|
||||
timeInfo.value.user = user.value.id
|
||||
timeInfo.value.profile = profileStore.activeProfile.id
|
||||
timeInfo.value.start = new Date().toISOString()
|
||||
timeInfo.value.tenant = profileStore.currentTenant
|
||||
|
||||
@@ -124,7 +123,7 @@ const startTime = async () => {
|
||||
} else if(data) {
|
||||
//timeInfo.value = data[0]
|
||||
await dataStore.fetchTimes()
|
||||
runningTimeInfo.value = dataStore.times.find(time => time.user === user.value.id && !time.end)
|
||||
runningTimeInfo.value = dataStore.times.find(time => time.profile === profileStore.activeProfile.id && !time.end)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -155,8 +154,8 @@ const stopStartedTime = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
if(dataStore.times.find(time => time.user == user.value.id && !time.end)) {
|
||||
runningTimeInfo.value = dataStore.times.find(time => time.user == user.value.id && !time.end)
|
||||
if(times.value.find(time => time.profile == profileStore.activeProfile.id && !time.end)) {
|
||||
runningTimeInfo.value = times.value.find(time => time.profile == profileStore.activeProfile.id && !time.end)
|
||||
}
|
||||
|
||||
|
||||
@@ -241,7 +240,6 @@ const setState = async (newState) => {
|
||||
Erstellen
|
||||
</UButton>
|
||||
<USelectMenu
|
||||
v-if="dataStore.hasRight('viewTimes')"
|
||||
:options="profileStore.profiles"
|
||||
option-attribute="fullName"
|
||||
value-attribute="id"
|
||||
|
||||
Reference in New Issue
Block a user