HUGE REFACTOR / CLEANUP

if there is a issue it's probably something in here that was changed
This commit is contained in:
2021-09-28 20:19:44 +00:00
parent 51eddfede9
commit d0afdd9855
238 changed files with 3127 additions and 8614 deletions

View File

@@ -3,7 +3,6 @@
<div class="mb-n2 ml-10">
<span class="text-caption">{{ $ay.t("WorkOrderStatus") }}</span>
</div>
<template>
<div class="mb-6 mb-sm-0">
<v-btn icon class="ml-n1 mr-2" @click="openDialog = true">
@@ -22,7 +21,6 @@
>
</div>
</template>
<v-row justify="center">
<v-dialog v-model="openDialog" max-width="600px">
<v-card>
@@ -68,8 +66,6 @@
</div>
</div>
</template>
<!-- append-outer-icon="$ayiPlus"
@click:append-outer="addState()" -->
<template v-if="canAdd">
<div class="mt-8">
<v-autocomplete
@@ -136,10 +132,6 @@
</div>
</template>
<script>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* XXXeslint-disable */
////////////////////////////////////////////////////////////////////////////////////////////////////////////
export default {
data() {
return {
@@ -177,12 +169,10 @@ export default {
this.value.states = this.value.states.filter(
z => z.concurrency != null
);
//is it a different state?
if (this.selectedStatus == this.pvm.currentState.id) {
return;
}
//push in new state
this.value.states.push({
workOrderId: this.value.id,
@@ -197,7 +187,7 @@ export default {
}
},
getStateForDisplay(state) {
let ret = {
const ret = {
id: Date.now,
name: "??",
color: "#ffffff",
@@ -259,7 +249,7 @@ export default {
return this.value.states != null && this.value.states.length > 0;
},
stateDisplayList() {
let ret = [];
const ret = [];
this.value.states.forEach(z => {
ret.push(this.getStateForDisplay(z));
});
@@ -270,28 +260,23 @@ export default {
if (!this.pvm.rights.change) {
return false;
}
//not currently locked, user has rights to do it so allow it
if (!this.value.isLockedAtServer) {
return true;
}
//locked, confirm if user can change it
//if any role then no problem
//ok, only thing left to check is if the current user can unlock this
//only thing left to check is if the current user can unlock this
//get remove roles required for current state
let cs = this.pvm.currentState;
const cs = this.pvm.currentState;
if (cs.removeRoles == null || cs.removeRoles == 0) {
//no state set yet
return true;
}
//ok, need to check the role here against current user roles to see if this is valid
//need to check the role here against current user roles to see if this is valid
if (window.$gz.role.hasRole(cs.removeRoles)) {
return true;
}
return false;
}
}