Format Timerecord related things

This commit is contained in:
Marcel Schwarz 2020-07-21 21:26:49 +02:00
parent e13d157dd6
commit 286d1c7fda
5 changed files with 317 additions and 345 deletions

View File

@ -47,9 +47,7 @@
v-on="on"
></v-text-field>
</template>
<v-date-picker v-model="newstartdate" @input="menu = false" no-title scrollable>
</v-date-picker>
<v-date-picker v-model="newstartdate" @input="menu = false" no-title scrollable></v-date-picker>
</v-menu>
</v-col>
<v-col cols="12" sm="6">
@ -71,9 +69,7 @@
v-on="on"
></v-text-field>
</template>
<v-date-picker v-model="newenddate" @input="menu2 = false" no-title scrollable>
</v-date-picker>
<v-date-picker v-model="newenddate" @input="menu2 = false" no-title scrollable></v-date-picker>
</v-menu>
</v-col>
</v-row>
@ -147,6 +143,7 @@
</template>
<script>
import {baseUri} from "../variables";
export default {
name: "CreateTimeTrackAccount",
data: () => ({
@ -186,11 +183,7 @@ export default {
false
);
accountxhttp.setRequestHeader("Content-Type", "application/json");
accountxhttp.setRequestHeader(
"Authorization",
sessionStorage.getItem("jwt")
);
accountxhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt"));
accountxhttp.send(null);
if (this.newstartdate != "" && this.newenddate != "" && this.newdate != "" && account != "") {
@ -231,7 +224,6 @@ export default {
if ((this.status == 200) & (this.readyState == 4)) {
accounts = JSON.parse(accountsxhttp.responseText);
accounts = accounts._embedded.accounts;
}
};
accountsxhttp.open(
@ -242,16 +234,11 @@ export default {
false
);
accountsxhttp.setRequestHeader("Content-Type", "application/json");
accountsxhttp.setRequestHeader(
"Authorization",
sessionStorage.getItem("jwt")
);
accountsxhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt"));
accountsxhttp.send(null);
var accountnames = [];
for (let index = 0; index < accounts.length; index++) {
accountnames[index] = accounts[index].name;
}
this.accounts = accountnames;
},
@ -261,7 +248,6 @@ export default {
listen.addEventListener("keyup", e => {
if (e.keyCode === 13) {
e.preventDefault();
this.addRecord();
}
});

View File

@ -58,9 +58,7 @@
v-on="on"
></v-text-field>
</template>
<v-date-picker v-model="newenddate" @input="menu2 = false" no-title scrollable>
</v-date-picker>
<v-date-picker v-model="newenddate" @input="menu2 = false" no-title scrollable></v-date-picker>
</v-menu>
</v-col>
</v-row>
@ -132,6 +130,7 @@
</v-card>
</v-container>
</template>
<script>
export default {
name: "EditTimeTrackAccount",
@ -194,12 +193,7 @@ export default {
record = JSON.parse(recordxhttp.responseText);
}
};
recordxhttp.open(
"GET",
sessionStorage.getItem("timeRecordEditSelfLink"),
false
);
recordxhttp.open("GET", sessionStorage.getItem("timeRecordEditSelfLink"), false);
recordxhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt"));
recordxhttp.send(null);
@ -225,7 +219,6 @@ export default {
listen.addEventListener("keyup", e => {
if (e.keyCode === 13) {
e.preventDefault();
this.editRecord();
}
});

View File

@ -2,16 +2,14 @@
<v-card outlined>
<v-list-item class="main_accent">
<v-list-item-content>
<!-- <v-col cols="2" >
<v-card color="background" elevation="0">
<pre><v-icon color="primary">mdi-calendar-range</v-icon>{{" " + timeRecord.date}}</pre>
</v-card>
</v-col> -->
<h3 justify-center>{{timeRecord.date}}</h3>
<v-row no-gutters align="center">
<v-col cols="2">
<v-card color="background" elevation="0">
<pre><v-icon color="green" v-bind:class="{'d-none':timeRecord.type == 'BREAK'}">mdi-currency-usd</v-icon><v-icon color="red" v-bind:class="{'d-none':timeRecord.type == 'PAID'}">mdi-currency-usd-off</v-icon>{{" " + timeRecord.type}}</pre>
<pre>
<v-icon color="green" v-bind:class="{'d-none':timeRecord.type == 'BREAK'}">mdi-currency-usd</v-icon>
<v-icon color="red" v-bind:class="{'d-none':timeRecord.type == 'PAID'}">mdi-currency-usd-off</v-icon>{{" " + timeRecord.type}}
</pre>
</v-card>
</v-col>
<v-col></v-col>
@ -54,7 +52,8 @@
<v-icon v-else>mdi-pencil</v-icon>
</v-btn>
</template>
<v-btn fab dark small color="green" @click="$emit('edit-timeRecord', timeRecord._links.self.href, timeRecord.enddate)">
<v-btn fab dark small color="green"
@click="$emit('edit-timeRecord', timeRecord._links.self.href, timeRecord.enddate)">
<v-icon>mdi-file-document-edit</v-icon>
</v-btn>
<v-btn fab dark small color="red" @click="$emit('del-timeRecord', timeRecord._links.self.href)">

View File

@ -28,7 +28,6 @@
<v-icon>mdi-plus</v-icon>
</v-btn>
</v-col>
<v-col cols="5"></v-col>
</v-row>
</v-container>
@ -106,7 +105,6 @@ export default {
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
var recordsDB = JSON.parse(xhttp.responseText);
records = recordsDB._embedded.records;
recordLinks = recordsDB._links;
}
@ -154,7 +152,6 @@ export default {
records[index].enddate = "pending";
}
}
this.timeRecords = records;
}
};

View File

@ -24,22 +24,19 @@
</v-row>
</v-list-item-content>
<v-list-item-action>
<v-speed-dial
v-model="fab"
transition="slide-x-reverse-transition"
direction="left"
open-on-hover
>
<v-speed-dial v-model="fab" transition="slide-x-reverse-transition" direction="left" open-on-hover>
<template v-slot:activator>
<v-btn v-model="fab" color="background" elevation="0" dark fab>
<v-icon v-if="fab">mdi-close</v-icon>
<v-icon v-else>mdi-pencil</v-icon>
</v-btn>
</template>
<v-btn fab dark small color="green" @click="$emit('edit-timeTrackAccount', timeTrackAccount._links.self.href)">
<v-btn fab dark small color="green"
@click="$emit('edit-timeTrackAccount', timeTrackAccount._links.self.href)">
<v-icon>mdi-file-document-edit</v-icon>
</v-btn>
<v-btn fab dark small color="red" @click="$emit('del-timeTrackAccount', timeTrackAccount._links.self.href)">
<v-btn fab dark small color="red"
@click="$emit('del-timeTrackAccount', timeTrackAccount._links.self.href)">
<v-icon>mdi-delete</v-icon>
</v-btn>
</v-speed-dial>