This commit is contained in:
@@ -1,18 +1,25 @@
|
||||
<template>
|
||||
<div>
|
||||
<span class="text-caption">{{ $ay.t("WorkOrderStatus") }}</span>
|
||||
|
||||
<template v-if="hasState">
|
||||
<br />
|
||||
{{ currentState.color }}
|
||||
<v-icon large :color="currentState.color">$ayiFlag</v-icon
|
||||
><span class="text-h5">{{ currentState.name }}</span>
|
||||
<v-icon large v-if="currentState.locked">$ayiLock</v-icon>
|
||||
<v-icon large v-if="currentState.completed">$ayiCheckCircle</v-icon>
|
||||
<span class="text-h6">{{ currentState.name }}</span>
|
||||
<v-icon :color="currentState.color" class="ml-4">$ayiFlag</v-icon>
|
||||
<v-icon color="primary" v-if="currentState.locked" class="ml-4"
|
||||
>$ayiLock</v-icon
|
||||
>
|
||||
<v-icon color="primary" v-if="currentState.completed" class="ml-4"
|
||||
>$ayiCheckCircle</v-icon
|
||||
>
|
||||
</template>
|
||||
<div>
|
||||
{{ pvm.selectLists.wostatus }}
|
||||
<template v-if="canAdd">
|
||||
<h5>editable state here</h5>
|
||||
<v-autocomplete
|
||||
v-model="selectedStatus"
|
||||
:items="pvm.selectLists.allowedwostatus"
|
||||
label="select"
|
||||
></v-autocomplete>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -37,7 +44,9 @@
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
return {
|
||||
selectedStatus: null
|
||||
};
|
||||
},
|
||||
|
||||
props: {
|
||||
@@ -60,10 +69,10 @@ export default {
|
||||
},
|
||||
fieldValueChanged(ref) {
|
||||
if (
|
||||
!this.parentVM.formState.loading &&
|
||||
!this.parentVM.formState.readonly
|
||||
!this.pvm.formState.loading &&
|
||||
!this.pvm.formState.readonly
|
||||
) {
|
||||
window.$gz.form.fieldValueChanged(this.parentVM, ref);
|
||||
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -75,22 +84,28 @@ export default {
|
||||
//return actual status object from top level shell based on current state
|
||||
//if state is unknown then it should return a placeholder dummy state showing an error condition or empty I guess
|
||||
|
||||
if (this.value.states == null) {
|
||||
//Not set yet so return not set state
|
||||
return {
|
||||
id: 0,
|
||||
name: "NOT SET YET",
|
||||
active: true,
|
||||
color: "#000000",
|
||||
completed: false,
|
||||
locked: false
|
||||
};
|
||||
} else {
|
||||
//find it in the states collection
|
||||
//pvm.selectLists.wostates
|
||||
if (this.value.states != null) {
|
||||
//find it in the status collection
|
||||
//and return here
|
||||
//return this.value.states[this.value.states.length - 1];
|
||||
let laststate = this.value.states[this.value.states.length - 1];
|
||||
let found = this.pvm.selectLists.wostatus.find(
|
||||
z => z.id == laststate.workOrderStatusId
|
||||
);
|
||||
if (found) {
|
||||
found.locked = true;
|
||||
found.completed = true;
|
||||
return found;
|
||||
}
|
||||
}
|
||||
//default
|
||||
return {
|
||||
id: 0,
|
||||
name: "NOT SET YET",
|
||||
active: true,
|
||||
color: "#ffffff", //invisible
|
||||
completed: false,
|
||||
locked: false
|
||||
};
|
||||
},
|
||||
canAdd: function() {
|
||||
return (
|
||||
|
||||
@@ -188,7 +188,8 @@ export default {
|
||||
ayaType: window.$gz.type.WorkOrder,
|
||||
selectedItemIndex: null,
|
||||
selectLists: {
|
||||
wostatus: []
|
||||
wostatus: [],
|
||||
allowedwostatus: []
|
||||
},
|
||||
subRights: {
|
||||
items: {
|
||||
@@ -732,7 +733,8 @@ async function populateSelectionLists(vm) {
|
||||
window.$gz.form.setErrorBoxErrors(vm);
|
||||
//window.$gz.errorHandler.handleFormError(res.error, vm);
|
||||
} else {
|
||||
vm.selectLists.wostatus = res.data;
|
||||
vm.selectLists.wostatus = res.data.all;
|
||||
vm.selectLists.allowedwostatus = res.data.allowed;
|
||||
}
|
||||
|
||||
//---------
|
||||
|
||||
Reference in New Issue
Block a user