This commit is contained in:
2021-04-06 19:27:02 +00:00
parent 91cebab9d4
commit 4afb02c8cd
2 changed files with 35 additions and 9 deletions

View File

@@ -55,6 +55,11 @@
<v-list-item-action> </v-list-item-action>
</template>
</v-autocomplete>
<div>
allstates:
{{ value.states }}
</div>
<div>currentstate:{{ pvm.currentState }}</div>
</div>
</template>
@@ -66,9 +71,8 @@
TODO: POC for now don't worry about rights to unset / set certain states, just hook it up for testing
todo: it must be clear to user why they can not change if they have too low a role to change, perhaps text under state instead of selector box that says "Only select roles can change this state"
todo: view state history
-->
{{ pvm.currentState }}
</div>
</template>
<script>
@@ -100,6 +104,17 @@ export default {
methods: {
addState() {
if (this.selectedStatus != null) {
//first remove any other non saved states in collection, no need to send them to the server if there was multiple state changes since last save
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,
workOrderStatusId: this.selectedStatus,
@@ -163,7 +178,7 @@ export default {
//ok, only thing left to check is if the current user can unlock this
//get remove roles required for current state
let cs = pvm.currentState;
let cs = this.pvm.currentState;
if (cs.removeRoles == null || cs.removeRoles == 0) {
//no state set yet
return true;