[timesheet] fix employee ktory zadaval timesheet

This commit is contained in:
romankko2 committed 2023-07-17 19:12:10 +02:00
1 parent 249787eee3
commit 68942a8fc0
1 file changed
+12 -6
@@ -26,7 +26,8 @@
<div class="d-flex align-center flex-start width-100"> <div class="d-flex align-center flex-start width-100">
<p class="task-badge rounded-pill">{{ timesheet.time }}</p> <p class="task-badge rounded-pill">{{ timesheet.time }}</p>
<p class="ml-5">{{ timesheet.employee_name }} ({{ moment(timesheet.timestamp).format('D.M.YYYY') }})</p> <!-- <p class="ml-5">{{ timesheet.employee_name }} ({{ moment(timesheet.timestamp).format('D.M.YYYY') }})</p> -->
<p class="ml-5">{{ timesheet.employee_name }} ({{ timesheet.timestamp }})</p>
</div> </div>
</div> </div>
</template> </template>
@@ -50,11 +51,12 @@
</template> </template>
<script> <script>
import moment from 'moment' import moment from 'moment'
import errorUtils from '@/plugins/lib@auth/_utils/error.utils' import errorUtils from '@/plugins/lib@auth/_utils/error.utils'
import useVuelidate from '@vuelidate/core' import useVuelidate from '@vuelidate/core'
import { required, numeric, minValue } from '@vuelidate/validators' import { required, numeric, minValue } from '@vuelidate/validators'
import tmUtils from '@/plugins/tm@_utils/tm.utils' import tmUtils from '@/plugins/tm@_utils/tm.utils'
import { mapGetters } from 'vuex'
export default { export default {
props: { props: {
@@ -89,6 +91,10 @@ export default {
} }
}, },
computed: {
...mapGetters('auth', ['user'])
},
methods: { methods: {
async submit() { async submit() {
if (!await this.v$.$validate()) if (!await this.v$.$validate())
@@ -98,7 +104,7 @@ export default {
subtask.timesheets.push({ subtask.timesheets.push({
id: null, id: null,
employee_id: subtask.employee_id, employee_id: this.user.id,
time: typeof this.form.hours == 'string' ? parseFloat(this.form.hours) : this.form.hours time: typeof this.form.hours == 'string' ? parseFloat(this.form.hours) : this.form.hours
}) })